Explorar o código

批量归档调整

sangwenwei hai 11 meses
pai
achega
1c64b5cd4f

+ 18 - 12
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/service/CwFillingbatchService.java

@@ -87,6 +87,11 @@ public class CwFillingbatchService {
                 //设置层级
                 record.setLevel("1");
             }
+            for (CwFillingbatchInfoDTO cwFillingbatchInfoDTO : projectList) {
+                if (StringUtils.isBlank(cwFillingbatchInfoDTO.getStatus())){
+                    cwFillingbatchInfoDTO.setStatus("2");
+                }
+            }
             records.addAll(projectList);
         }
 
@@ -183,13 +188,14 @@ public class CwFillingbatchService {
                 }
                 List<CwFillingbatchProjectDTO> record = new ArrayList<>(uniqueProjectMap.values());
                 List<CwFillingbatchProjectDTO> records = projectList.getRecords();
+                for (CwFillingbatchProjectDTO dto : projectList.getRecords()) {
+                    dto.setLevel("1");
+                }
                 records.addAll(record);
                 projectList.setRecords(records);
-            } else {
-                for (CwFillingbatchProjectDTO record : projectList.getRecords()) {
-                    record.setLevel("1");
-                }
             }
+
+
         }
 
 
@@ -231,16 +237,16 @@ public class CwFillingbatchService {
         }
         //新增项目信息
         if (CollectionUtil.isNotEmpty(info.getCwFillingbatchProjects())) {
+            Integer count = 0;
             for (CwFillingbatchProject cwFillingbatchProject : info.getCwFillingbatchProjects()) {
-                Integer count = 0;
                 if ("1".equals(cwFillingbatchProject.getLevel())) {
                     //往归档项目表中添加信息
                     CwFillingbatchProject project = new CwFillingbatchProject();
                     project.setId(UUID.randomUUID().toString().replace("-", ""));
                     project.setFillingbatchId(info.getId());
                     project.setReportId(cwFillingbatchProject.getReportId());
-                    project.setStatus("2");
-                    project.setSort(count++);
+                    count = count+1;
+                    project.setSort(count);
                     cwFillingbatchProjectMapper.insert(project);
                     //遍历子级数据
                     if (CollectionUtil.isNotEmpty(cwFillingbatchProject.getChildren())) {
@@ -286,16 +292,16 @@ public class CwFillingbatchService {
         cwFillingBatchInfoMapper.insert(cwFillingbatchInfo);
         //遍历归档项目信息
         if (CollectionUtil.isNotEmpty(info.getCwFillingbatchProjects())) {
+            Integer count = 0;
             for (CwFillingbatchProject cwFillingbatchProject : info.getCwFillingbatchProjects()) {
-                Integer count = 0;
                 if ("1".equals(cwFillingbatchProject.getLevel())) {
                     //往归档项目表中添加信息
                     CwFillingbatchProject project = new CwFillingbatchProject();
                     project.setId(UUID.randomUUID().toString().replace("-", ""));
                     project.setFillingbatchId(cwFillingbatchInfo.getId());
                     project.setReportId(cwFillingbatchProject.getReportId());
-                    project.setStatus("2");
-                    project.setSort(count++);
+                    count = count+1;
+                    project.setSort(count);
                     cwFillingbatchProjectMapper.insert(project);
                     //遍历子级数据
                     if (CollectionUtil.isNotEmpty(cwFillingbatchProject.getChildren())) {
@@ -334,11 +340,11 @@ public class CwFillingbatchService {
             //修改归档项目表中的案卷号和项目状态
             if (CollectionUtil.isNotEmpty(dto.getCwFillingbatchProjects())) {
                 for (CwFillingbatchProject cwFillingbatchProject : dto.getCwFillingbatchProjects()) {
-                    if (cwFillingbatchProject.getLevel().equals("1")){
+                    if (StringUtils.isNotBlank(cwFillingbatchProject.getLevel()) && cwFillingbatchProject.getLevel().equals("1")){
                         CwFillingbatchProject project1 = new CwFillingbatchProject();
                         project1.setId(cwFillingbatchProject.getId());
                         project1.setAchiveNo(cwFillingbatchProject.getAchiveNo());
-                        project1.setStatus(cwFillingbatchProject.getStatus());
+                        project1.setStatus(cwFillingbatchProject.getProjectStatus());
                         cwFillingbatchProjectMapper.updateById(project1);
                     }
                 }