|
@@ -23,11 +23,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
+import java.util.concurrent.ExecutionException;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
+
|
|
|
+import static com.fasterxml.jackson.databind.type.LogicalType.Collection;
|
|
|
|
|
|
/**
|
|
|
* @Description: 推送列表
|
|
@@ -57,190 +59,317 @@ public class ProjectPushListServiceImpl extends ServiceImpl<ProjectPushListMappe
|
|
|
|
|
|
|
|
|
/**项目成本——查找并更新推送*/
|
|
|
- public Result<String> addAll(){
|
|
|
+ public Result<String> addAll() throws ExecutionException, InterruptedException {
|
|
|
this.truncateTable();//清空原来的数据
|
|
|
|
|
|
QueryWrapper<ProjectPushSet> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("cost_type","0");// 0材料费
|
|
|
- List<ProjectPushSet> list1 = projectPushSetService.list(queryWrapper);
|
|
|
- queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("cost_type","1");// 1外协费
|
|
|
List<ProjectPushSet> list2 = projectPushSetService.list(queryWrapper);
|
|
|
- queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("cost_type","2");// 2人工费
|
|
|
- List<ProjectPushSet> list3 = projectPushSetService.list(queryWrapper);
|
|
|
-
|
|
|
- List<ProjectPushList> pushList = new ArrayList<>();//所有的推送列表
|
|
|
-
|
|
|
- // 0材料费
|
|
|
- if(list1!=null && !list1.isEmpty()){
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
- for(ProjectPushSet set : list1){
|
|
|
- String stage = set.getStage();
|
|
|
- projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
- projectCostQueryWrapper.eq("clf",new BigDecimal(0));
|
|
|
- projectCostQueryWrapper.eq("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);
|
|
|
- pushList.add(push);
|
|
|
+
|
|
|
+
|
|
|
+ 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);
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- // 1外协费
|
|
|
- if(list2!=null && !list2.isEmpty()){
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
- for(ProjectPushSet set : list2){
|
|
|
- String stage = set.getStage();
|
|
|
- projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
- projectCostQueryWrapper.eq("wxf",new BigDecimal(0));
|
|
|
- projectCostQueryWrapper.eq("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);
|
|
|
- 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);
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- // 2人工费(工资及劳务费)
|
|
|
- if(list3!=null && !list3.isEmpty()){
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper;
|
|
|
- for(ProjectPushSet set : list3){
|
|
|
- String stage = set.getStage();
|
|
|
- projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
- projectCostQueryWrapper.eq("gzjlwf",new BigDecimal(0));
|
|
|
- projectCostQueryWrapper.eq("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);
|
|
|
- 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);
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- //3合同额
|
|
|
- String stage = "100";
|
|
|
- QueryWrapper<ProjectCost> projectCostQueryWrapper= new QueryWrapper<>();
|
|
|
- projectCostQueryWrapper.eq("contractfpe",new BigDecimal(0));
|
|
|
- projectCostQueryWrapper.eq("processPercent",stage);
|
|
|
- List<ProjectCost> projectCostList1 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
-
|
|
|
- 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();
|
|
|
+ return pushList;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ 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);
|
|
|
+ pushList.add(push);
|
|
|
+ }
|
|
|
}
|
|
|
- if(kyTaskInfo.getBusinessman()!=null){
|
|
|
- QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("realname",kyTaskInfo.getBusinessman());
|
|
|
- SysUser user = sysUserService.getOne(wrapper);
|
|
|
- if(user!=null) username=user.getUsername();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return pushList;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ CompletableFuture<List<ProjectPushList>> t5 = CompletableFuture.supplyAsync(() -> {
|
|
|
+ // 4材料预算超限
|
|
|
+ QueryWrapper<ProjectPushSet> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("cost_type", "3");// 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);
|
|
|
+ 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);
|
|
|
|
|
|
- //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
- 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);
|
|
|
- pushList.add(push);
|
|
|
- }
|
|
|
-
|
|
|
- //4收款额
|
|
|
- projectCostQueryWrapper = new QueryWrapper<>();
|
|
|
- projectCostQueryWrapper.eq("TaskMoney",new BigDecimal(0));
|
|
|
- projectCostQueryWrapper.eq("processPercent",stage);
|
|
|
- List<ProjectCost> projectCostList2 = costService.projectCostlist(projectCostQueryWrapper);
|
|
|
-
|
|
|
- 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();
|
|
|
+ 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();
|
|
|
+ }
|
|
|
}
|
|
|
- if(kyTaskInfo.getBusinessman()!=null){
|
|
|
- QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("realname",kyTaskInfo.getBusinessman());
|
|
|
- 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);
|
|
|
+ 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);
|
|
|
+ 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());
|
|
|
|
|
|
- //判断是否为组批任务、是组批前还是组批后的任务
|
|
|
- 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);
|
|
|
- pushList.add(push);
|
|
|
- }
|
|
|
- this.saveBatch(pushList);
|
|
|
+ this.saveBatch(mergedList);
|
|
|
return Result.OK("添加成功!");
|
|
|
}
|
|
|
|