tianwu.sun 4 달 전
부모
커밋
9a8b147de4
1개의 변경된 파일28개의 추가작업 그리고 2개의 파일을 삭제
  1. 28 2
      src/main/java/com/bootdo/datas/controller/DataVerifyController.java

+ 28 - 2
src/main/java/com/bootdo/datas/controller/DataVerifyController.java

@@ -288,6 +288,8 @@ public class DataVerifyController {
     public R nextVerify(@RequestParam("ids[]") Long[] ids, @PathVariable("deptId") Long deptId) {
         log.info("联合审批通过 ids:" + ids.toString());
         log.info("联合审批通过 deptId:" + deptId);
+        List<String> failedDataNames = new ArrayList<>();
+        List<GyDataImportDTO> dataImportDTOList = new ArrayList<>();
         for (Long id : ids) {
             log.info("联合审批通过 id:" + id);
             GyDataImportDTO data = new GyDataImportDTO();
@@ -300,7 +302,18 @@ public class DataVerifyController {
                 data.setDataStatus("2");
                 data.setSendVerify("3");
                 data.setNextVerifyDept(deptId);
-                gyDataService.updateStatus(data);
+                dataImportDTOList.add(data);
+            } else {
+                failedDataNames.add(data.getDataName());
+            }
+        }
+        if (failedDataNames.size() > 0) {
+            return R.error(String.join(",", failedDataNames) + ",审核失败");
+        } else {
+            if(dataImportDTOList.size() > 0){
+                for(GyDataImportDTO importDTO : dataImportDTOList){
+                    gyDataService.updateStatus(importDTO);
+                }
             }
         }
         return R.ok();
@@ -319,6 +332,8 @@ public class DataVerifyController {
     @RequiresPermissions("datas:dataVerify:expert")
     public R expert(@RequestParam("ids[]") Long[] ids) {
         log.info("专家审核 备案主键 ids:" + ids);
+        List<String> failedDataNames = new ArrayList<>();
+        List<GyDataImportDTO> dataImportDTOList = new ArrayList<>();
         for (Long id : ids) {
             log.info("专家审核 id:" + id);
             GyDataImportDTO data = new GyDataImportDTO();
@@ -332,7 +347,18 @@ public class DataVerifyController {
                 data.setSendVerify("2");// 0 未送审 1 送审 2 专家审核
                 // 0:待审核 1:删除 2:审核中  3:通过审核 4:驳回 5:联合审批 6:终审
 //                data.setDataStatus("6");
-                gyDataService.updateStatus(data);
+                dataImportDTOList.add(data);
+            } else {
+                failedDataNames.add(data.getDataName());
+            }
+        }
+        if (failedDataNames.size() > 0) {
+            return R.error(String.join(",", failedDataNames) + ",审核失败");
+        } else {
+            if(dataImportDTOList.size() > 0){
+                for(GyDataImportDTO importDTO : dataImportDTOList){
+                    gyDataService.updateStatus(importDTO);
+                }
             }
         }
         return R.ok();