tianwu.sun 4 mesiacov pred
rodič
commit
f2b00ec662

+ 26 - 6
src/main/java/com/bootdo/datas/controller/DataController.java

@@ -198,6 +198,7 @@ public class DataController {
     public R batchVerify(@RequestParam("ids[]") Long[] ids) {
         log.info("批量审核通过 ids:" + ids.toString());
         List<String> failedDataNames = new ArrayList<>();
+        List<GyDataImportDTO> dataImportDTOList = new ArrayList<>();
         for (Long id : ids) {
             log.info("审核通过 id:" + id);
             GyDataImportDTO data = new GyDataImportDTO();
@@ -209,14 +210,20 @@ public class DataController {
                 // 0:待审核 1:删除 2:已上报 3:通过审核 4:驳回 5:联合审批 6:终审
                 data.setId(id);
                 data.setDataStatus("3");
-                gyDataService.updateStatus(data);
+                dataImportDTOList.add(data);
             } else {
-            failedDataNames.add(data.getDataName());
+                failedDataNames.add(data.getDataName());
+            }
         }
-    }
         if (failedDataNames.size() > 0) {
-        return R.error(String.join(",", failedDataNames) + ",审核失败");
-    }
+            return R.error(String.join(",", failedDataNames) + ",审核失败");
+        } else {
+            if(dataImportDTOList.size() > 0){
+                for(GyDataImportDTO importDTO : dataImportDTOList){
+                    gyDataService.updateStatus(importDTO);
+                }
+            }
+        }
         return R.ok();
     }
 
@@ -252,6 +259,8 @@ public class DataController {
     @RequiresPermissions("datas:data:rebut")
     public R batchRebut(@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();
@@ -263,7 +272,18 @@ public class DataController {
                 // 0:待审核 1:删除 2:已上报 3:通过审核 4:驳回 5:联合审批 6:终审
                 data.setId(id);
                 data.setDataStatus("4");
-                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();

+ 24 - 3
src/main/java/com/bootdo/datas/controller/DataExpertController.java

@@ -149,6 +149,8 @@ public class DataExpertController {
     @RequiresPermissions("datas:expertVerify:verify")
     public R batchVerify(@RequestParam("ids[]") Long[] ids) {
         log.info("批量审核通过 ids:" + ids.toString());
+        List<String> failedDataNames = new ArrayList<>();
+        List<GyDataImportDTO> dataImportDTOList = new ArrayList<>();
         for (Long id : ids) {
             log.info("审核通过 id:" + id);
             GyDataImportDTO data = new GyDataImportDTO();
@@ -159,7 +161,18 @@ public class DataExpertController {
                 // 0:正常 1:删除 2:已上报 3:通过审核 4:驳回 5:联合审批 6:终审
                 data.setId(id);
                 data.setDataStatus("3");
-                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();
@@ -198,6 +211,7 @@ public class DataExpertController {
     public R batchRebut(@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();
@@ -208,13 +222,20 @@ public class DataExpertController {
                 // 0:正常 1:删除 2:已上报 3:通过审核 4:驳回 5:联合审批 6:终审
                 data.setId(id);
                 data.setDataStatus("4");
-                gyDataService.updateStatus(data);
+                dataImportDTOList.add(data);
             } else {
                 failedDataNames.add(data.getDataName());
             }
         }
+
         if (failedDataNames.size() > 0) {
-            return R.error(String.join(",", failedDataNames) + ",专家审核失败");
+            return R.error(String.join(",", failedDataNames) + ",驳回失败");
+        } else {
+            if(dataImportDTOList.size() > 0){
+                for(GyDataImportDTO importDTO : dataImportDTOList){
+                    gyDataService.updateStatus(importDTO);
+                }
+            }
         }
         return R.ok();
     }

+ 24 - 3
src/main/java/com/bootdo/datas/controller/DataUnionController.java

@@ -137,6 +137,7 @@ public class DataUnionController {
     public R batchVerify(@RequestParam("ids[]") Long[] ids) {
         log.info("批量审核通过 ids:" + ids.toString());
         List<String> failedDataNames = new ArrayList<>();
+        List<GyDataImportDTO> dataImportDTOList = new ArrayList<>();
         for (Long id : ids) {
             log.info("审核通过 id:" + id);
             GyDataImportDTO data = new GyDataImportDTO();
@@ -147,13 +148,20 @@ public class DataUnionController {
                 // 0:正常 1:删除 2:已上报 3:通过审核 4:驳回
                 data.setId(id);
                 data.setDataStatus("3");
-                gyDataService.updateStatus(data);
+                dataImportDTOList.add(data);
             } else {
                 failedDataNames.add(data.getDataName());
             }
         }
+
         if (failedDataNames.size() > 0) {
-            return R.error(String.join(",", failedDataNames) + ",联合审核失败");
+            return R.error(String.join(",", failedDataNames) + ",审核失败");
+        } else {
+            if(dataImportDTOList.size() > 0){
+                for(GyDataImportDTO importDTO : dataImportDTOList){
+                    gyDataService.updateStatus(importDTO);
+                }
+            }
         }
         return R.ok();
     }
@@ -191,6 +199,8 @@ public class DataUnionController {
     @RequiresPermissions("datas:unionVerify:rebut")
     public R batchRebut(@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();
@@ -201,7 +211,18 @@ public class DataUnionController {
                 // 0:正常 1:删除 2:已上报 3:通过审核 4:驳回
                 data.setId(id);
                 data.setDataStatus("4");
-                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();

+ 23 - 3
src/main/java/com/bootdo/datas/controller/DataVerifyController.java

@@ -138,6 +138,8 @@ public class DataVerifyController {
     @RequiresPermissions("datas:dataVerify:verify")
     public R batchVerify(@RequestParam("ids[]") Long[] ids) {
         log.info("批量审核通过 ids:" + ids.toString());
+        List<String> failedDataNames = new ArrayList<>();
+        List<GyDataImportDTO> dataImportDTOList = new ArrayList<>();
         for (Long id : ids) {
             log.info("审核通过 id:" + id);
             GyDataImportDTO data = new GyDataImportDTO();
@@ -148,7 +150,18 @@ public class DataVerifyController {
                 // 0:正常 1:删除 2:已上报 3:通过审核 4:驳回 5:联合审批 6:终审
                 data.setId(id);
                 data.setDataStatus("3");
-                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();
@@ -188,6 +201,7 @@ public class DataVerifyController {
     public R batchRebut(@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();
@@ -198,13 +212,19 @@ public class DataVerifyController {
                 // 0:正常 1:删除 2:已上报 3:通过审核 4:驳回 5:联合审批 6:终审
                 data.setId(id);
                 data.setDataStatus("4");
-                gyDataService.updateStatus(data);
-            }else {
+                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();