Browse Source

优化u_information_query没有关联u_task时任可以撤回、废除

lvy 3 tháng trước cách đây
mục cha
commit
e54ee1815a

+ 22 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1377,6 +1377,28 @@ public R<String> batchDownloadFileToZip(String ids, HttpServletResponse response
                 e.printStackTrace();
                 return R.data(300, false, "废除失败");
             }
+        } else {
+            List<String> list = Arrays.asList(ids.split(","));
+            if (!list.isEmpty()) {
+                List<InformationQuery> queryList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery()
+                        .select(InformationQuery::getId, InformationQuery::getStatus).in(InformationQuery::getId, list));
+                if (queryList != null && !queryList.isEmpty()) {
+                    List<Long> ids1 = queryList.stream().map(InformationQuery::getId).collect(Collectors.toList());
+                    this.informationQueryService.update(Wrappers.<InformationQuery>lambdaUpdate().set(InformationQuery::getStatus, 0).in(InformationQuery::getId, ids1));
+                    return R.success("操作成功");
+                } else {
+                    // 试验
+                    List<InformationQuery> dataList = this.informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery()
+                            .select(InformationQuery::getId)
+                            .eq(InformationQuery::getType, 2)
+                            .in(InformationQuery::getWbsId, Func.toStrList(ids)));
+                    if (!dataList.isEmpty()) {
+                        List<Long> dataIds = dataList.stream().map(InformationQuery::getId).collect(Collectors.toList());
+                        this.informationQueryService.update(Wrappers.<InformationQuery>lambdaUpdate().set(InformationQuery::getStatus, 0).in(InformationQuery::getId, dataIds));
+                        return R.success("操作成功");
+                    }
+                }
+            }
         }
         return R.data(300, false, "未获取到任务信息,废除失败");
     }