|
@@ -376,10 +376,16 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
Map<Long, String> nameMap = jdbcTemplate.query("select id,name from blade_user where is_deleted = 0", new BeanPropertyRowMapper<>(User.class)).stream().collect(Collectors.toMap(User::getId, User::getName, (key1, key2) -> key1));
|
|
|
- Map<Long, String> fileNameMaps = jdbcTemplate.query("select id,file_name from u_archive_file where file_name is not null and id in (" + archiveTaskBatchReportDTO.getDataIds() + ")", new BeanPropertyRowMapper<>(ArchiveFile.class)).stream().collect(Collectors.toMap(ArchiveFile::getId, ArchiveFile::getFileName, (obj1, obj2) -> obj1));
|
|
|
- String[] archiveIds = archiveTaskBatchReportDTO.getDataIds().split(",");
|
|
|
- if (archiveIds.length > 0) {
|
|
|
- for (String archiveId : archiveIds) {
|
|
|
+ List<ArchiveFile> archiveFiles = jdbcTemplate.query("select * from u_archive_file where id in (" + archiveTaskBatchReportDTO.getDataIds() + ")", new BeanPropertyRowMapper<>(ArchiveFile.class));
|
|
|
+ if (archiveFiles.size() > 0) {
|
|
|
+ for (ArchiveFile archive : archiveFiles) {
|
|
|
+ if (!archive.getStatus().equals(0)) {
|
|
|
+ throw new ServiceException("只有【未上报】状态的业务数据才能上报!");
|
|
|
+ }
|
|
|
+ if (!archive.getIsCertification().equals(0)) {
|
|
|
+ throw new ServiceException("只有【未认证】状态的业务数据才能上报!");
|
|
|
+ }
|
|
|
+
|
|
|
//创建task审批任务
|
|
|
Long processInstanceId = SnowFlakeUtil.getId();
|
|
|
Task task = new Task();
|
|
@@ -402,8 +408,8 @@ public class TaskController extends BladeController {
|
|
|
|
|
|
task.setTaskContent(ObjectUtil.isNotEmpty(archiveTaskBatchReportDTO.getTaskContent()) ? archiveTaskBatchReportDTO.getTaskContent() : null);
|
|
|
task.setTaskUser(null);
|
|
|
- task.setFormDataId(archiveId); //数据指向
|
|
|
- task.setTaskName(ObjectUtil.isNotEmpty(fileNameMaps.get(Long.parseLong(archiveId))) ? fileNameMaps.get(Long.parseLong(archiveId)) : "未获取到档案文件任务名");
|
|
|
+ task.setFormDataId(archive.getId().toString()); //数据指向
|
|
|
+ task.setTaskName(ObjectUtil.isNotEmpty(archive.getFileName()) ? archive.getFileName() : "未获取到档案文件任务名");
|
|
|
task.setContractId(archiveTaskBatchReportDTO.getContractId());
|
|
|
task.setProjectId(archiveTaskBatchReportDTO.getProjectId());
|
|
|
task.setBatch(archiveTaskBatchReportDTO.getBatch());
|
|
@@ -439,7 +445,7 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
//修改档案业务数据任务状态为待审批
|
|
|
- jdbcTemplate.execute("update u_archive_file set status = 1 where id = " + archiveId);
|
|
|
+ jdbcTemplate.execute("update u_archive_file set status = 1 where id = " + archive.getId());
|
|
|
}
|
|
|
|
|
|
//WebSocket推送
|