|
@@ -60,317 +60,323 @@ public class ProjectPushListServiceImpl extends ServiceImpl<ProjectPushListMappe
|
|
|
|
|
|
/**项目成本——查找并更新推送*/
|
|
|
public Result<String> addAll() throws ExecutionException, InterruptedException {
|
|
|
- this.truncateTable();//清空原来的数据
|
|
|
-
|
|
|
- QueryWrapper<ProjectPushSet> queryWrapper = new QueryWrapper<>();
|
|
|
- List<ProjectPushSet> list2 = projectPushSetService.list(queryWrapper);
|
|
|
-
|
|
|
-
|
|
|
- CompletableFuture<List<ProjectPushList>> t1 = CompletableFuture.supplyAsync(() -> {
|
|
|
- // 0材料费
|
|
|
- QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
- queryWrapper1.eq("cost_type", "0");// 0材料费
|
|
|
- List<ProjectPushSet> list = projectPushSetService.list(queryWrapper1);
|
|
|
- List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
- if (list != null && !list.isEmpty()) {
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
- for (ProjectPushSet set : list) {
|
|
|
- String stage = set.getStage();
|
|
|
- projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
- projectCostQueryWrapper.eq("clf", new BigDecimal(0));
|
|
|
- projectCostQueryWrapper.ge("processPercent", stage);//
|
|
|
- List<ProjectCost> projectCostList1 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
-
|
|
|
- List<String> roleIds = Arrays.asList(set.getPushTo().split(","));
|
|
|
- List<UserNameIDVO> userNameIdList = this.userNamesByRoleIds(roleIds);
|
|
|
-
|
|
|
- for (ProjectCost cost : projectCostList1) {
|
|
|
- for (UserNameIDVO vo : userNameIdList) {
|
|
|
- //根据用户id查其所属部门的部门编码
|
|
|
- List<String> sysOrgCodeList = this.selectDeptCodeByUserId(vo.getUserId());
|
|
|
- String sysOrgCodes = sysOrgCodeList.stream().collect(Collectors.joining(","));
|
|
|
-
|
|
|
- //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
- String remark = null;
|
|
|
- if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1"))
|
|
|
- remark = "(组批之后)";//组批之后
|
|
|
- else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
- remark = "(组批之前)";//组批之前
|
|
|
- if (remark == null) remark = "";
|
|
|
- //组推送对象
|
|
|
- ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
- cost.getTaskno(), cost.getTaskname(), set.getId(), vo.getUsername(), set.getContent() + remark, sysOrgCodes, 0,"0");
|
|
|
- pushList.add(push);
|
|
|
+ try {
|
|
|
+ this.truncateTable();//清空原来的数据
|
|
|
+ QueryWrapper<ProjectPushSet> queryWrapper = new QueryWrapper<>();
|
|
|
+ List<ProjectPushSet> list2 = projectPushSetService.list(queryWrapper);
|
|
|
+
|
|
|
+
|
|
|
+ CompletableFuture<List<ProjectPushList>> t1 = CompletableFuture.supplyAsync(() -> {
|
|
|
+ // 0材料费
|
|
|
+ QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("cost_type", "0");// 0材料费
|
|
|
+ List<ProjectPushSet> list = projectPushSetService.list(queryWrapper1);
|
|
|
+ List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
+ QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
+ for (ProjectPushSet set : list) {
|
|
|
+ String stage = set.getStage();
|
|
|
+ projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
+ projectCostQueryWrapper.eq("clf", new BigDecimal(0));
|
|
|
+ projectCostQueryWrapper.ge("processPercent", stage);//
|
|
|
+ List<ProjectCost> projectCostList1 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
+
|
|
|
+ List<String> roleIds = Arrays.asList(set.getPushTo().split(","));
|
|
|
+ List<UserNameIDVO> userNameIdList = this.userNamesByRoleIds(roleIds);
|
|
|
+
|
|
|
+ for (ProjectCost cost : projectCostList1) {
|
|
|
+ for (UserNameIDVO vo : userNameIdList) {
|
|
|
+ //根据用户id查其所属部门的部门编码
|
|
|
+ List<String> sysOrgCodeList = this.selectDeptCodeByUserId(vo.getUserId());
|
|
|
+ String sysOrgCodes = sysOrgCodeList.stream().collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
+ String remark = null;
|
|
|
+ if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1"))
|
|
|
+ remark = "(组批之后)";//组批之后
|
|
|
+ else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
+ remark = "(组批之前)";//组批之前
|
|
|
+ if (remark == null) remark = "";
|
|
|
+ //组推送对象
|
|
|
+ ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
+ cost.getTaskno(), cost.getTaskname(), set.getId(), vo.getUsername(), set.getContent() + remark, sysOrgCodes, 0, "0");
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- return pushList;
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- CompletableFuture<List<ProjectPushList>> t2 = CompletableFuture.supplyAsync(() -> {
|
|
|
- // 1外协费
|
|
|
- QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
- queryWrapper1.eq("cost_type", "1");// 1外协费
|
|
|
- List<ProjectPushSet> list = projectPushSetService.list(queryWrapper1);
|
|
|
- List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
- if (list != null && !list.isEmpty()) {
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
- for (ProjectPushSet set : list) {
|
|
|
- String stage = set.getStage();
|
|
|
- projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
- projectCostQueryWrapper.eq("wxf", new BigDecimal(0));
|
|
|
- projectCostQueryWrapper.ge("processPercent", stage);
|
|
|
- List<ProjectCost> projectCostList1 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
-
|
|
|
- List<String> roleIds = Arrays.asList(set.getPushTo().split(","));
|
|
|
- List<UserNameIDVO> userNameIdList = this.userNamesByRoleIds(roleIds);
|
|
|
-
|
|
|
- for (ProjectCost cost : projectCostList1) {
|
|
|
- for (UserNameIDVO vo : userNameIdList) {
|
|
|
- //根据用户id查其所属部门的部门编码
|
|
|
- List<String> sysOrgCodeList = this.selectDeptCodeByUserId(vo.getUserId());
|
|
|
- String sysOrgCodes = sysOrgCodeList.stream().collect(Collectors.joining(","));
|
|
|
-
|
|
|
- //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
- String remark = null;
|
|
|
- if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1"))
|
|
|
- remark = "(组批之后)";//组批之后
|
|
|
- else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
- remark = "(组批之前)";//组批之前
|
|
|
- if (remark == null) remark = "";
|
|
|
- //组推送对象
|
|
|
- ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
- cost.getTaskno(), cost.getTaskname(), set.getId(), vo.getUsername(), set.getContent() + remark, sysOrgCodes, 0,"1");
|
|
|
- pushList.add(push);
|
|
|
+ return pushList;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ CompletableFuture<List<ProjectPushList>> t2 = CompletableFuture.supplyAsync(() -> {
|
|
|
+ // 1外协费
|
|
|
+ QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("cost_type", "1");// 1外协费
|
|
|
+ List<ProjectPushSet> list = projectPushSetService.list(queryWrapper1);
|
|
|
+ List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
+ QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
+ for (ProjectPushSet set : list) {
|
|
|
+ String stage = set.getStage();
|
|
|
+ projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
+ projectCostQueryWrapper.eq("wxf", new BigDecimal(0));
|
|
|
+ projectCostQueryWrapper.ge("processPercent", stage);
|
|
|
+ List<ProjectCost> projectCostList1 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
+
|
|
|
+ List<String> roleIds = Arrays.asList(set.getPushTo().split(","));
|
|
|
+ List<UserNameIDVO> userNameIdList = this.userNamesByRoleIds(roleIds);
|
|
|
+
|
|
|
+ for (ProjectCost cost : projectCostList1) {
|
|
|
+ for (UserNameIDVO vo : userNameIdList) {
|
|
|
+ //根据用户id查其所属部门的部门编码
|
|
|
+ List<String> sysOrgCodeList = this.selectDeptCodeByUserId(vo.getUserId());
|
|
|
+ String sysOrgCodes = sysOrgCodeList.stream().collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
+ String remark = null;
|
|
|
+ if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1"))
|
|
|
+ remark = "(组批之后)";//组批之后
|
|
|
+ else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
+ remark = "(组批之前)";//组批之前
|
|
|
+ if (remark == null) remark = "";
|
|
|
+ //组推送对象
|
|
|
+ ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
+ cost.getTaskno(), cost.getTaskname(), set.getId(), vo.getUsername(), set.getContent() + remark, sysOrgCodes, 0, "1");
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- return pushList;
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- CompletableFuture<List<ProjectPushList>> t3 = CompletableFuture.supplyAsync(() -> {
|
|
|
- // 2人工费(工资及劳务费)
|
|
|
- QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
- queryWrapper1.eq("cost_type", "2");// 2人工费
|
|
|
- List<ProjectPushSet> list = projectPushSetService.list(queryWrapper1);
|
|
|
- List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
- if (list != null && !list.isEmpty()) {
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
- for (ProjectPushSet set : list) {
|
|
|
- String stage = set.getStage();
|
|
|
- projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
- projectCostQueryWrapper.eq("gzjlwf", new BigDecimal(0));
|
|
|
- projectCostQueryWrapper.ge("processPercent", stage);
|
|
|
- List<ProjectCost> projectCostList1 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
-
|
|
|
- List<String> roleIds = Arrays.asList(set.getPushTo().split(","));
|
|
|
- List<UserNameIDVO> userNameIdList = this.userNamesByRoleIds(roleIds);
|
|
|
-
|
|
|
- for (ProjectCost cost : projectCostList1) {
|
|
|
- for (UserNameIDVO vo : userNameIdList) {
|
|
|
- //根据用户id查其所属部门的部门编码
|
|
|
- List<String> sysOrgCodeList = this.selectDeptCodeByUserId(vo.getUserId());
|
|
|
- String sysOrgCodes = sysOrgCodeList.stream().collect(Collectors.joining(","));
|
|
|
-
|
|
|
- //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
- String remark = null;
|
|
|
- if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1"))
|
|
|
- remark = "(组批之后)";//组批之后
|
|
|
- else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
- remark = "(组批之前)";//组批之前
|
|
|
- if (remark == null) remark = "";
|
|
|
- //组推送对象
|
|
|
- ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
- cost.getTaskno(), cost.getTaskname(), set.getId(), vo.getUsername(), set.getContent() + remark, sysOrgCodes, 0,"2");
|
|
|
- pushList.add(push);
|
|
|
+ return pushList;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ CompletableFuture<List<ProjectPushList>> t3 = CompletableFuture.supplyAsync(() -> {
|
|
|
+ // 2人工费(工资及劳务费)
|
|
|
+ QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("cost_type", "2");// 2人工费
|
|
|
+ List<ProjectPushSet> list = projectPushSetService.list(queryWrapper1);
|
|
|
+ List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
+ QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
+ for (ProjectPushSet set : list) {
|
|
|
+ String stage = set.getStage();
|
|
|
+ projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
+ projectCostQueryWrapper.eq("gzjlwf", new BigDecimal(0));
|
|
|
+ projectCostQueryWrapper.ge("processPercent", stage);
|
|
|
+ List<ProjectCost> projectCostList1 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
+
|
|
|
+ List<String> roleIds = Arrays.asList(set.getPushTo().split(","));
|
|
|
+ List<UserNameIDVO> userNameIdList = this.userNamesByRoleIds(roleIds);
|
|
|
+
|
|
|
+ for (ProjectCost cost : projectCostList1) {
|
|
|
+ for (UserNameIDVO vo : userNameIdList) {
|
|
|
+ //根据用户id查其所属部门的部门编码
|
|
|
+ List<String> sysOrgCodeList = this.selectDeptCodeByUserId(vo.getUserId());
|
|
|
+ String sysOrgCodes = sysOrgCodeList.stream().collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
+ String remark = null;
|
|
|
+ if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1"))
|
|
|
+ remark = "(组批之后)";//组批之后
|
|
|
+ else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
+ remark = "(组批之前)";//组批之前
|
|
|
+ if (remark == null) remark = "";
|
|
|
+ //组推送对象
|
|
|
+ ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
+ cost.getTaskno(), cost.getTaskname(), set.getId(), vo.getUsername(), set.getContent() + remark, sysOrgCodes, 0, "2");
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- return pushList;
|
|
|
- });
|
|
|
+ return pushList;
|
|
|
+ });
|
|
|
|
|
|
|
|
|
- CompletableFuture<List<ProjectPushList>> t4 = CompletableFuture.supplyAsync(() -> {
|
|
|
- // 3外协预算超限
|
|
|
- QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
- queryWrapper1 = new QueryWrapper<>();
|
|
|
+ CompletableFuture<List<ProjectPushList>> t4 = CompletableFuture.supplyAsync(() -> {
|
|
|
+ // 3外协预算超限
|
|
|
+ QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1 = new QueryWrapper<>();
|
|
|
queryWrapper1.eq("cost_type", "3");// 3外协预算超限
|
|
|
- List<ProjectPushSet> list = projectPushSetService.list(queryWrapper1);
|
|
|
- List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
- if (list != null && !list.isEmpty()) {
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
- for (ProjectPushSet set : list) {
|
|
|
- List<ProjectCost> projectCostList1 = costService.selectProjectCostListWhereWxysGtWxf();
|
|
|
-
|
|
|
- List<String> roleIds = Arrays.asList(set.getPushTo().split(","));
|
|
|
- List<UserNameIDVO> userNameIdList = this.userNamesByRoleIds(roleIds);
|
|
|
-
|
|
|
- for (ProjectCost cost : projectCostList1) {
|
|
|
- for (UserNameIDVO vo : userNameIdList) {
|
|
|
- //根据用户id查其所属部门的部门编码
|
|
|
- List<String> sysOrgCodeList = this.selectDeptCodeByUserId(vo.getUserId());
|
|
|
- String sysOrgCodes = String.join(",", sysOrgCodeList);
|
|
|
-
|
|
|
- //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
- String remark = null;
|
|
|
- if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1"))
|
|
|
- remark = "(组批之后)";//组批之后
|
|
|
- else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
- remark = "(组批之前)";//组批之前
|
|
|
- if (remark == null) remark = "";
|
|
|
- //组推送对象
|
|
|
- ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
- cost.getTaskno(), cost.getTaskname(), set.getId(), vo.getUsername(), set.getContent() + remark, sysOrgCodes, 0,"3");
|
|
|
- pushList.add(push);
|
|
|
+ List<ProjectPushSet> list = projectPushSetService.list(queryWrapper1);
|
|
|
+ List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
+ QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
+ for (ProjectPushSet set : list) {
|
|
|
+ List<ProjectCost> projectCostList1 = costService.selectProjectCostListWhereWxysGtWxf();
|
|
|
+
|
|
|
+ List<String> roleIds = Arrays.asList(set.getPushTo().split(","));
|
|
|
+ List<UserNameIDVO> userNameIdList = this.userNamesByRoleIds(roleIds);
|
|
|
+
|
|
|
+ for (ProjectCost cost : projectCostList1) {
|
|
|
+ for (UserNameIDVO vo : userNameIdList) {
|
|
|
+ //根据用户id查其所属部门的部门编码
|
|
|
+ List<String> sysOrgCodeList = this.selectDeptCodeByUserId(vo.getUserId());
|
|
|
+ String sysOrgCodes = String.join(",", sysOrgCodeList);
|
|
|
+
|
|
|
+ //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
+ String remark = null;
|
|
|
+ if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1"))
|
|
|
+ remark = "(组批之后)";//组批之后
|
|
|
+ else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
+ remark = "(组批之前)";//组批之前
|
|
|
+ if (remark == null) remark = "";
|
|
|
+ //组推送对象
|
|
|
+ ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
+ cost.getTaskno(), cost.getTaskname(), set.getId(), vo.getUsername(), set.getContent() + remark, sysOrgCodes, 0, "3");
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- return pushList;
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- CompletableFuture<List<ProjectPushList>> t5 = CompletableFuture.supplyAsync(() -> {
|
|
|
- // 4材料预算超限
|
|
|
- QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
- queryWrapper1 = new QueryWrapper<>();
|
|
|
- queryWrapper1.eq("cost_type", "4");// 4材料预算超限
|
|
|
- List<ProjectPushSet> list = projectPushSetService.list(queryWrapper1);
|
|
|
- List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
- if (list != null && !list.isEmpty()) {
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
- for (ProjectPushSet set : list) {
|
|
|
- List<ProjectCost> projectCostList1 = costService.selectProjectCostListWhereClysGtCLf();
|
|
|
-
|
|
|
- List<String> roleIds = Arrays.asList(set.getPushTo().split(","));
|
|
|
- List<UserNameIDVO> userNameIdList = this.userNamesByRoleIds(roleIds);
|
|
|
-
|
|
|
- for (ProjectCost cost : projectCostList1) {
|
|
|
- for (UserNameIDVO vo : userNameIdList) {
|
|
|
- //根据用户id查其所属部门的部门编码
|
|
|
- List<String> sysOrgCodeList = this.selectDeptCodeByUserId(vo.getUserId());
|
|
|
- String sysOrgCodes = sysOrgCodeList.stream().collect(Collectors.joining(","));
|
|
|
-
|
|
|
- //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
- String remark = null;
|
|
|
- if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1"))
|
|
|
- remark = "(组批之后)";//组批之后
|
|
|
- else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
- remark = "(组批之前)";//组批之前
|
|
|
- if (remark == null) remark = "";
|
|
|
- //组推送对象
|
|
|
- ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
- cost.getTaskno(), cost.getTaskname(), set.getId(), vo.getUsername(), set.getContent() + remark, sysOrgCodes, 1,"4");
|
|
|
- pushList.add(push);
|
|
|
+ return pushList;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ CompletableFuture<List<ProjectPushList>> t5 = CompletableFuture.supplyAsync(() -> {
|
|
|
+ // 4材料预算超限
|
|
|
+ QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("cost_type", "4");// 4材料预算超限
|
|
|
+ List<ProjectPushSet> list = projectPushSetService.list(queryWrapper1);
|
|
|
+ List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
+ QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
+ for (ProjectPushSet set : list) {
|
|
|
+ List<ProjectCost> projectCostList1 = costService.selectProjectCostListWhereClysGtCLf();
|
|
|
+
|
|
|
+ List<String> roleIds = Arrays.asList(set.getPushTo().split(","));
|
|
|
+ List<UserNameIDVO> userNameIdList = this.userNamesByRoleIds(roleIds);
|
|
|
+
|
|
|
+ for (ProjectCost cost : projectCostList1) {
|
|
|
+ for (UserNameIDVO vo : userNameIdList) {
|
|
|
+ //根据用户id查其所属部门的部门编码
|
|
|
+ List<String> sysOrgCodeList = this.selectDeptCodeByUserId(vo.getUserId());
|
|
|
+ String sysOrgCodes = sysOrgCodeList.stream().collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
+ String remark = null;
|
|
|
+ if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1"))
|
|
|
+ remark = "(组批之后)";//组批之后
|
|
|
+ else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
+ remark = "(组批之前)";//组批之前
|
|
|
+ if (remark == null) remark = "";
|
|
|
+ //组推送对象
|
|
|
+ ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
+ cost.getTaskno(), cost.getTaskname(), set.getId(), vo.getUsername(), set.getContent() + remark, sysOrgCodes, 1, "4");
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- return pushList;
|
|
|
- });
|
|
|
-
|
|
|
- CompletableFuture<List<ProjectPushList>> t6 = CompletableFuture.supplyAsync(() -> {
|
|
|
- //5合同额
|
|
|
- String stage = "100";
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
- projectCostQueryWrapper.eq("contractfpe", new BigDecimal(0));
|
|
|
- projectCostQueryWrapper.eq("processPercent", stage);
|
|
|
-
|
|
|
- List<ProjectCost> projectCostList1 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
- List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
- for (ProjectCost cost : projectCostList1) {
|
|
|
- String taskno = cost.getTaskno();
|
|
|
- String orgcode = null;
|
|
|
- String username = null;
|
|
|
- if (taskno != null) {
|
|
|
- KyTaskInfo kyTaskInfo = kyTaskInfoService.getKyTaskInfoByTaskno(taskno);
|
|
|
- if (kyTaskInfo != null) {
|
|
|
- if (kyTaskInfo.getJycsid() != null) {//下达部门id
|
|
|
- SysDepart sysDepart = departService.getById(kyTaskInfo.getJycsid());
|
|
|
- if (sysDepart != null) orgcode = sysDepart.getOrgCode();
|
|
|
- }
|
|
|
- if (kyTaskInfo.getBusinessmanname() != null) {
|
|
|
- QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("realname", kyTaskInfo.getBusinessmanname());
|
|
|
- SysUser user = sysUserService.getOne(wrapper);
|
|
|
- if (user != null) username = user.getUsername();
|
|
|
+ return pushList;
|
|
|
+ });
|
|
|
+
|
|
|
+ CompletableFuture<List<ProjectPushList>> t6 = CompletableFuture.supplyAsync(() -> {
|
|
|
+ //5合同额
|
|
|
+ String stage = "100";
|
|
|
+ QueryWrapper<ProjectCost> projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
+ projectCostQueryWrapper.eq("contractfpe", new BigDecimal(0));
|
|
|
+ projectCostQueryWrapper.eq("processPercent", stage);
|
|
|
+
|
|
|
+ List<ProjectCost> projectCostList1 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
+ List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
+ for (ProjectCost cost : projectCostList1) {
|
|
|
+ String taskno = cost.getTaskno();
|
|
|
+ String orgcode = null;
|
|
|
+ String username = null;
|
|
|
+ if (taskno != null) {
|
|
|
+ KyTaskInfo kyTaskInfo = kyTaskInfoService.getKyTaskInfoByTaskno(taskno);
|
|
|
+ if (kyTaskInfo != null) {
|
|
|
+ if (kyTaskInfo.getJycsid() != null) {//下达部门id
|
|
|
+ SysDepart sysDepart = departService.getById(kyTaskInfo.getJycsid());
|
|
|
+ if (sysDepart != null) orgcode = sysDepart.getOrgCode();
|
|
|
+ }
|
|
|
+ if (kyTaskInfo.getBusinessmanname() != null) {
|
|
|
+ QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.eq("realname", kyTaskInfo.getBusinessmanname());
|
|
|
+ SysUser user = sysUserService.getOne(wrapper);
|
|
|
+ if (user != null) username = user.getUsername();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
- String remark = null;
|
|
|
- if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1")) remark = "(组批之后)";//组批之后
|
|
|
- else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0")) remark = "(组批之前)";//组批之前
|
|
|
- if (remark == null) remark = "";
|
|
|
- ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
- cost.getTaskno(), cost.getTaskname(), "", username, "请及时处理合同额" + remark, orgcode, 0,"5");
|
|
|
- pushList.add(push);
|
|
|
- }
|
|
|
- return pushList;
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- CompletableFuture<List<ProjectPushList>> t7 = CompletableFuture.supplyAsync(() -> {
|
|
|
- //6收款额
|
|
|
- String stage = "100";
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
- projectCostQueryWrapper.eq("TaskMoney", new BigDecimal(0));
|
|
|
- projectCostQueryWrapper.eq("processPercent", stage);
|
|
|
- List<ProjectCost> projectCostList2 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
- List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
- for (ProjectCost cost : projectCostList2) {
|
|
|
- String taskno = cost.getTaskno();
|
|
|
- String orgcode = null;
|
|
|
- String username = null;
|
|
|
- if (taskno != null) {
|
|
|
- KyTaskInfo kyTaskInfo = kyTaskInfoService.getKyTaskInfoByTaskno(taskno);
|
|
|
- if (kyTaskInfo != null) {
|
|
|
- if (kyTaskInfo.getJycsid() != null) {//下达部门id
|
|
|
- SysDepart sysDepart = departService.getById(kyTaskInfo.getJycsid());
|
|
|
- if (sysDepart != null) orgcode = sysDepart.getOrgCode();
|
|
|
- }
|
|
|
- if (kyTaskInfo.getBusinessmanname()!= null) {
|
|
|
- QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("realname", kyTaskInfo.getBusinessmanname());
|
|
|
- SysUser user = sysUserService.getOne(wrapper);
|
|
|
- if (user != null) username = user.getUsername();
|
|
|
+ //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
+ String remark = null;
|
|
|
+ if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1")) remark = "(组批之后)";//组批之后
|
|
|
+ else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
+ remark = "(组批之前)";//组批之前
|
|
|
+ if (remark == null) remark = "";
|
|
|
+ ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
+ cost.getTaskno(), cost.getTaskname(), "", username, "请及时处理合同额" + remark, orgcode, 0, "5");
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
+ return pushList;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ CompletableFuture<List<ProjectPushList>> t7 = CompletableFuture.supplyAsync(() -> {
|
|
|
+ //6收款额
|
|
|
+ String stage = "100";
|
|
|
+ QueryWrapper<ProjectCost> projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
+ projectCostQueryWrapper.eq("TaskMoney", new BigDecimal(0));
|
|
|
+ projectCostQueryWrapper.eq("processPercent", stage);
|
|
|
+ List<ProjectCost> projectCostList2 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
+ List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
+ for (ProjectCost cost : projectCostList2) {
|
|
|
+ String taskno = cost.getTaskno();
|
|
|
+ String orgcode = null;
|
|
|
+ String username = null;
|
|
|
+ if (taskno != null) {
|
|
|
+ KyTaskInfo kyTaskInfo = kyTaskInfoService.getKyTaskInfoByTaskno(taskno);
|
|
|
+ if (kyTaskInfo != null) {
|
|
|
+ if (kyTaskInfo.getJycsid() != null) {//下达部门id
|
|
|
+ SysDepart sysDepart = departService.getById(kyTaskInfo.getJycsid());
|
|
|
+ if (sysDepart != null) orgcode = sysDepart.getOrgCode();
|
|
|
+ }
|
|
|
+ if (kyTaskInfo.getBusinessmanname() != null) {
|
|
|
+ QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.eq("realname", kyTaskInfo.getBusinessmanname());
|
|
|
+ SysUser user = sysUserService.getOne(wrapper);
|
|
|
+ if (user != null) username = user.getUsername();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
- String remark = null;
|
|
|
- if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1")) remark = "(组批之后)";//组批之后
|
|
|
- else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0")) remark = "(组批之前)";//组批之前
|
|
|
- if (remark == null) remark = "";
|
|
|
- ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
- cost.getTaskno(), cost.getTaskname(), "", username, "请及时处理已收款" + remark, orgcode, 0,"6");
|
|
|
- pushList.add(push);
|
|
|
- }
|
|
|
- return pushList;
|
|
|
- });
|
|
|
-
|
|
|
- CompletableFuture<Void> future = CompletableFuture.allOf(t1, t2, t3, t4, t5, t6, t7);
|
|
|
- future.get();
|
|
|
- List<ProjectPushList> projectPushLists = t1.get();
|
|
|
- List<ProjectPushList> projectPushLists1 = t2.get();
|
|
|
- List<ProjectPushList> projectPushLists2 = t3.get();
|
|
|
- List<ProjectPushList> projectPushLists3 = t4.get();
|
|
|
- List<ProjectPushList> projectPushLists4 = t5.get();
|
|
|
- List<ProjectPushList> projectPushLists5 = t6.get();
|
|
|
- List<ProjectPushList> projectPushLists6 = t7.get();
|
|
|
- List<ProjectPushList> mergedList = Stream.of(projectPushLists, projectPushLists1, projectPushLists2, projectPushLists3, projectPushLists4, projectPushLists5, projectPushLists6)
|
|
|
- .flatMap(java.util.Collection::stream)
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- this.saveBatch(mergedList);
|
|
|
- return Result.OK("添加成功!");
|
|
|
+ //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
+ String remark = null;
|
|
|
+ if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "1")) remark = "(组批之后)";//组批之后
|
|
|
+ else if (cost.getPccode() != null && Objects.equals(cost.getStatus(), "0"))
|
|
|
+ remark = "(组批之前)";//组批之前
|
|
|
+ if (remark == null) remark = "";
|
|
|
+ ProjectPushList push = ProjectPushListConvert.INSTANCE.toProjectPushList(
|
|
|
+ cost.getTaskno(), cost.getTaskname(), "", username, "请及时处理已收款" + remark, orgcode, 0, "6");
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
+ return pushList;
|
|
|
+ });
|
|
|
+
|
|
|
+ CompletableFuture<Void> future = CompletableFuture.allOf(t1, t2, t3, t4, t5, t6, t7);
|
|
|
+ future.get();
|
|
|
+ List<ProjectPushList> projectPushLists = t1.get();
|
|
|
+ List<ProjectPushList> projectPushLists1 = t2.get();
|
|
|
+ List<ProjectPushList> projectPushLists2 = t3.get();
|
|
|
+ List<ProjectPushList> projectPushLists3 = t4.get();
|
|
|
+ List<ProjectPushList> projectPushLists4 = t5.get();
|
|
|
+ List<ProjectPushList> projectPushLists5 = t6.get();
|
|
|
+ List<ProjectPushList> projectPushLists6 = t7.get();
|
|
|
+ List<ProjectPushList> mergedList = Stream.of(projectPushLists, projectPushLists1, projectPushLists2, projectPushLists3, projectPushLists4, projectPushLists5, projectPushLists6)
|
|
|
+ .flatMap(java.util.Collection::stream)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ this.saveBatch(mergedList);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return Result.ok("推送失败");
|
|
|
+ }
|
|
|
+ return Result.ok("推送成功");
|
|
|
}
|
|
|
|
|
|
|