|
@@ -5,9 +5,12 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
@@ -5,9 +5,12 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
5
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
5
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
6
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
6
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
7
|
import com.github.pagehelper.PageInfo;
|
7
|
import com.github.pagehelper.PageInfo;
|
|
|
|
8
|
+import com.lframework.starter.bpm.dto.FlowTaskDto;
|
|
8
|
import com.lframework.starter.bpm.entity.FlowInstanceWrapper;
|
9
|
import com.lframework.starter.bpm.entity.FlowInstanceWrapper;
|
|
|
|
10
|
+import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
|
|
9
|
import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
|
11
|
import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
|
|
10
|
import com.lframework.starter.bpm.service.FlowTaskWrapperService;
|
12
|
import com.lframework.starter.bpm.service.FlowTaskWrapperService;
|
|
|
|
13
|
+import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
|
|
11
|
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
14
|
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
|
12
|
import com.lframework.starter.common.exceptions.impl.InputErrorException;
|
15
|
import com.lframework.starter.common.exceptions.impl.InputErrorException;
|
|
13
|
import com.lframework.starter.common.utils.Assert;
|
16
|
import com.lframework.starter.common.utils.Assert;
|
|
@@ -15,6 +18,7 @@ import com.lframework.starter.common.utils.CollectionUtil; |
|
@@ -15,6 +18,7 @@ import com.lframework.starter.common.utils.CollectionUtil; |
|
15
|
import com.lframework.starter.common.utils.NumberUtil;
|
18
|
import com.lframework.starter.common.utils.NumberUtil;
|
|
16
|
import com.lframework.starter.common.utils.StringUtil;
|
19
|
import com.lframework.starter.common.utils.StringUtil;
|
|
17
|
import com.lframework.starter.web.core.annotations.oplog.OpLog;
|
20
|
import com.lframework.starter.web.core.annotations.oplog.OpLog;
|
|
|
|
21
|
+import com.lframework.starter.web.core.components.security.SecurityUtil;
|
|
18
|
import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
|
22
|
import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
|
|
19
|
import com.lframework.starter.web.core.utils.IdUtil;
|
23
|
import com.lframework.starter.web.core.utils.IdUtil;
|
|
20
|
import com.lframework.starter.web.core.utils.OpLogUtil;
|
24
|
import com.lframework.starter.web.core.utils.OpLogUtil;
|
|
@@ -25,6 +29,7 @@ import com.lframework.starter.web.core.utils.PageResultUtil; |
|
@@ -25,6 +29,7 @@ import com.lframework.starter.web.core.utils.PageResultUtil; |
|
25
|
import com.lframework.xingyun.basedata.entity.Workshop;
|
29
|
import com.lframework.xingyun.basedata.entity.Workshop;
|
|
26
|
import com.lframework.xingyun.basedata.service.workshop.WorkshopService;
|
30
|
import com.lframework.xingyun.basedata.service.workshop.WorkshopService;
|
|
27
|
import com.lframework.xingyun.sc.bo.procurement.GetProcurementPlanBo;
|
31
|
import com.lframework.xingyun.sc.bo.procurement.GetProcurementPlanBo;
|
|
|
|
32
|
+import com.lframework.xingyun.sc.enums.CustomerDevelopStatus;
|
|
28
|
import com.lframework.xingyun.sc.procurement.entity.ProcurementPlan;
|
33
|
import com.lframework.xingyun.sc.procurement.entity.ProcurementPlan;
|
|
29
|
import com.lframework.xingyun.sc.procurement.entity.ProcurementPlanLine;
|
34
|
import com.lframework.xingyun.sc.procurement.entity.ProcurementPlanLine;
|
|
30
|
import com.lframework.xingyun.sc.procurement.mappers.plan.ProcurementPlanMapper;
|
35
|
import com.lframework.xingyun.sc.procurement.mappers.plan.ProcurementPlanMapper;
|
|
@@ -40,13 +45,7 @@ import com.lframework.xingyun.sc.procurement.vo.plan.UpdateProcurementPlanVo; |
|
@@ -40,13 +45,7 @@ import com.lframework.xingyun.sc.procurement.vo.plan.UpdateProcurementPlanVo; |
|
40
|
import java.math.BigDecimal;
|
45
|
import java.math.BigDecimal;
|
|
41
|
import java.time.LocalDate;
|
46
|
import java.time.LocalDate;
|
|
42
|
import java.time.format.DateTimeFormatter;
|
47
|
import java.time.format.DateTimeFormatter;
|
|
43
|
-import java.util.ArrayList;
|
|
|
|
44
|
-import java.util.Collections;
|
|
|
|
45
|
-import java.util.Comparator;
|
|
|
|
46
|
-import java.util.HashMap;
|
|
|
|
47
|
-import java.util.LinkedHashMap;
|
|
|
|
48
|
-import java.util.List;
|
|
|
|
49
|
-import java.util.Map;
|
48
|
+import java.util.*;
|
|
50
|
import java.util.stream.Collectors;
|
49
|
import java.util.stream.Collectors;
|
|
51
|
import org.apache.commons.lang3.StringUtils;
|
50
|
import org.apache.commons.lang3.StringUtils;
|
|
52
|
import org.springframework.beans.factory.annotation.Autowired;
|
51
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -71,16 +70,19 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla |
|
@@ -71,16 +70,19 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla |
|
71
|
private FlowTaskWrapperService flowTaskWrapperService;
|
70
|
private FlowTaskWrapperService flowTaskWrapperService;
|
|
72
|
@Resource
|
71
|
@Resource
|
|
73
|
private ProcurementBuyoutApplyService procurementBuyoutApplyService;
|
72
|
private ProcurementBuyoutApplyService procurementBuyoutApplyService;
|
|
|
|
73
|
+ @Resource
|
|
|
|
74
|
+ private FlowTaskWrapperMapper flowTaskWrapperMapper;
|
|
74
|
|
75
|
|
|
75
|
@Override
|
76
|
@Override
|
|
76
|
public PageResult<ProcurementPlan> query(Integer pageIndex, Integer pageSize,
|
77
|
public PageResult<ProcurementPlan> query(Integer pageIndex, Integer pageSize,
|
|
77
|
- QueryProcurementPlanVo vo) {
|
78
|
+ QueryProcurementPlanVo vo) {
|
|
78
|
|
79
|
|
|
79
|
Assert.greaterThanZero(pageIndex);
|
80
|
Assert.greaterThanZero(pageIndex);
|
|
80
|
Assert.greaterThanZero(pageSize);
|
81
|
Assert.greaterThanZero(pageSize);
|
|
81
|
|
82
|
|
|
82
|
PageHelperUtil.startPage(pageIndex, pageSize);
|
83
|
PageHelperUtil.startPage(pageIndex, pageSize);
|
|
83
|
List<ProcurementPlan> datas = this.query(vo);
|
84
|
List<ProcurementPlan> datas = this.query(vo);
|
|
|
|
85
|
+ fillShowExamineInfo(datas);
|
|
84
|
|
86
|
|
|
85
|
return PageResultUtil.convert(new PageInfo<>(datas));
|
87
|
return PageResultUtil.convert(new PageInfo<>(datas));
|
|
86
|
}
|
88
|
}
|
|
@@ -104,6 +106,8 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla |
|
@@ -104,6 +106,8 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla |
|
104
|
|
106
|
|
|
105
|
List<ProcurementPlanLine> lines = procurementPlanLineService.getByProcurementPlanId(id);
|
107
|
List<ProcurementPlanLine> lines = procurementPlanLineService.getByProcurementPlanId(id);
|
|
106
|
|
108
|
|
|
|
|
109
|
+ fillShowExamineInfo(Collections.singletonList(plan));
|
|
|
|
110
|
+
|
|
107
|
return new GetProcurementPlanBo(plan, lines);
|
111
|
return new GetProcurementPlanBo(plan, lines);
|
|
108
|
}
|
112
|
}
|
|
109
|
|
113
|
|
|
@@ -620,4 +624,41 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla |
|
@@ -620,4 +624,41 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla |
|
620
|
|
624
|
|
|
621
|
return candidate;
|
625
|
return candidate;
|
|
622
|
}
|
626
|
}
|
|
|
|
627
|
+
|
|
|
|
628
|
+ /**
|
|
|
|
629
|
+ * 回填审核按钮展示信息
|
|
|
|
630
|
+ *
|
|
|
|
631
|
+ * @param datas 数据列表
|
|
|
|
632
|
+ */
|
|
|
|
633
|
+ private void fillShowExamineInfo(List<ProcurementPlan> datas) {
|
|
|
|
634
|
+ if (CollectionUtil.isEmpty(datas)) {
|
|
|
|
635
|
+ return;
|
|
|
|
636
|
+ }
|
|
|
|
637
|
+
|
|
|
|
638
|
+ List<ProcurementPlan> validDatas = datas.stream()
|
|
|
|
639
|
+ .filter(Objects::nonNull)
|
|
|
|
640
|
+ .collect(Collectors.toList());
|
|
|
|
641
|
+ if (CollectionUtil.isEmpty(validDatas)) {
|
|
|
|
642
|
+ return;
|
|
|
|
643
|
+ }
|
|
|
|
644
|
+
|
|
|
|
645
|
+ List<String> businessIds = validDatas.stream().map(ProcurementPlan::getId).collect(Collectors.toList());
|
|
|
|
646
|
+ List<FlowInstanceWrapper> flowList = flowInstanceWrapperService.getFlowByBusinessIdList(businessIds);
|
|
|
|
647
|
+ Set<String> flowBusinessIdSet = CollectionUtil.isNotEmpty(flowList)
|
|
|
|
648
|
+ ? flowList.stream().map(FlowInstanceWrapper::getBusinessId).collect(Collectors.toSet())
|
|
|
|
649
|
+ : new HashSet<>();
|
|
|
|
650
|
+
|
|
|
|
651
|
+ List<FlowTaskDto> todoFlowTaskList = flowTaskWrapperMapper.queryTodoList(
|
|
|
|
652
|
+ new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
|
|
|
|
653
|
+ Set<String> todoBusinessIdSet = CollectionUtil.isNotEmpty(todoFlowTaskList)
|
|
|
|
654
|
+ ? todoFlowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toSet())
|
|
|
|
655
|
+ : new HashSet<>();
|
|
|
|
656
|
+
|
|
|
|
657
|
+ for (ProcurementPlan data : validDatas) {
|
|
|
|
658
|
+ boolean hasFlow = flowBusinessIdSet.contains(data.getId());
|
|
|
|
659
|
+ boolean hasTodo = todoBusinessIdSet.contains(data.getId());
|
|
|
|
660
|
+ data.setShowExamineDetail(hasFlow && StringUtils.isNotBlank(data.getApprovalStatus()));
|
|
|
|
661
|
+ data.setShowExamine(hasTodo && CustomerDevelopStatus.AUDIT.name().equals(data.getApprovalStatus()));
|
|
|
|
662
|
+ }
|
|
|
|
663
|
+ }
|
|
623
|
} |
664
|
} |