|
...
|
...
|
@@ -7,6 +7,7 @@ import com.github.pagehelper.PageInfo; |
|
7
|
7
|
import com.lframework.starter.bpm.dto.FlowTaskDto;
|
|
8
|
8
|
import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
|
|
9
|
9
|
import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
|
|
|
10
|
+import com.lframework.starter.bpm.service.FlowTaskWrapperService;
|
|
10
|
11
|
import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
|
|
11
|
12
|
import com.lframework.starter.web.core.components.security.SecurityUtil;
|
|
12
|
13
|
import com.lframework.starter.web.core.utils.*;
|
|
...
|
...
|
@@ -51,6 +52,8 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe |
|
51
|
52
|
private FlowTaskWrapperMapper flowTaskWrapperMapper;
|
|
52
|
53
|
@Resource
|
|
53
|
54
|
private FlowInstanceWrapperService flowInstanceWrapperService;
|
|
|
55
|
+ @Resource
|
|
|
56
|
+ private FlowTaskWrapperService flowTaskWrapperService;
|
|
54
|
57
|
|
|
55
|
58
|
|
|
56
|
59
|
|
|
...
|
...
|
@@ -81,20 +84,27 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe |
|
81
|
84
|
// 待办类型
|
|
82
|
85
|
String todoType = vo.getTodoType();
|
|
83
|
86
|
if ("COMPLETED".equals(todoType)) {
|
|
84
|
|
- vo.setStatus(CustomerDevelopStatus.PASS.getCode());
|
|
|
87
|
+ // 获取当前人已办理业务数据ID
|
|
|
88
|
+ List<String> businessIds = flowTaskWrapperService.listBusinessId("CUSTOMER_DEVELOP", SecurityUtil.getCurrentUser().getId(), true);
|
|
|
89
|
+ if (CollectionUtils.isEmpty(businessIds)) {
|
|
|
90
|
+ return new PageResult<>();
|
|
|
91
|
+ }
|
|
|
92
|
+ vo.setIds(businessIds);
|
|
85
|
93
|
} else if ("WAIT".equals(todoType)) {
|
|
86
|
|
- log.info("=================== CustomerDevelopPlanService.query SecurityUtil.getCurrentUser.getId =================={}"
|
|
87
|
|
- , JsonUtil.toJsonString(SecurityUtil.getCurrentUser().getId()));
|
|
88
|
|
- // 获取当前人员的待办任务数据
|
|
89
|
|
- List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
|
|
90
|
|
- if (CollectionUtils.isEmpty(flowTaskList)) {
|
|
|
94
|
+ // 获取当前人待办理业务数据ID
|
|
|
95
|
+ List<String> businessIds = flowTaskWrapperService.listBusinessId("CUSTOMER_DEVELOP", SecurityUtil.getCurrentUser().getId(), false);
|
|
|
96
|
+ if (CollectionUtils.isEmpty(businessIds)) {
|
|
91
|
97
|
return new PageResult<>();
|
|
92
|
98
|
}
|
|
93
|
|
- List<String> ids = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());
|
|
94
|
|
- vo.setIds(ids);
|
|
|
99
|
+ vo.setIds(businessIds);
|
|
95
|
100
|
}
|
|
|
101
|
+ List<CustomerDevelopPlan> dataList = new ArrayList<>();
|
|
96
|
102
|
PageHelperUtil.startPage(pageIndex, pageSize);
|
|
97
|
|
- List<CustomerDevelopPlan> dataList = this.query(vo);
|
|
|
103
|
+ if ("COMPLETED".equals(todoType) || "WAIT".equals(todoType)) {
|
|
|
104
|
+ dataList = this.getBaseMapper().noDataPermissionQuery(vo);
|
|
|
105
|
+ } else {
|
|
|
106
|
+ dataList = this.query(vo);
|
|
|
107
|
+ }
|
|
98
|
108
|
|
|
99
|
109
|
return PageResultUtil.convert(new PageInfo<>(dataList));
|
|
100
|
110
|
}
|
|
...
|
...
|
@@ -270,33 +280,19 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe |
|
270
|
280
|
* @return CustomerDevelopPlanStatisticsBo
|
|
271
|
281
|
*/
|
|
272
|
282
|
@Override
|
|
273
|
|
- public CustomerDevelopPlanStatisticsBo todoTypeStatistics() {
|
|
|
283
|
+ public CustomerDevelopPlanStatisticsBo todoTypeStatistics(QueryCustomerDevelopPlanVo vo) {
|
|
274
|
284
|
// 获取所有客户开发数据
|
|
275
|
|
- LambdaQueryWrapper<CustomerDevelopPlan> queryWrapper = Wrappers.lambdaQuery(CustomerDevelopPlan.class);
|
|
276
|
|
- List<CustomerDevelopPlan> customerDevelopPlans = this.getBaseMapper().selectList(queryWrapper);
|
|
277
|
|
- if (CollectionUtils.isEmpty(customerDevelopPlans)) {
|
|
278
|
|
- return null;
|
|
279
|
|
- }
|
|
|
285
|
+ List<CustomerDevelopPlan> customerDevelopPlans = query(vo);
|
|
280
|
286
|
// 获取当前人员流程任务数据
|
|
281
|
|
- List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo()
|
|
282
|
|
- , SecurityUtil.getCurrentUser().getId());
|
|
283
|
|
- List<String> businessIds = new ArrayList<>();
|
|
284
|
|
- if (CollectionUtils.isNotEmpty(flowTaskList)) {
|
|
285
|
|
- businessIds = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());
|
|
286
|
|
- }
|
|
287
|
|
- int completedCount = 0;
|
|
288
|
|
- int todoCount = 0;
|
|
289
|
|
- for (CustomerDevelopPlan plan : customerDevelopPlans) {
|
|
290
|
|
- CustomerDevelopStatus status = plan.getStatus();
|
|
291
|
|
- if (CustomerDevelopStatus.PASS.equals(status)) {
|
|
292
|
|
- completedCount++;
|
|
293
|
|
- }
|
|
294
|
|
- if (businessIds.contains(plan.getId())) {
|
|
295
|
|
- todoCount++;
|
|
296
|
|
- }
|
|
297
|
|
- }
|
|
|
287
|
+ List<String> completedBusinessIds = flowTaskWrapperService.listBusinessId("CUSTOMER_DEVELOP"
|
|
|
288
|
+ , SecurityUtil.getCurrentUser().getId(), true);
|
|
|
289
|
+ List<String> todoBusinessIds = flowTaskWrapperService.listBusinessId("CUSTOMER_DEVELOP"
|
|
|
290
|
+ , SecurityUtil.getCurrentUser().getId(), false);
|
|
|
291
|
+ int completedCount = CollectionUtils.isEmpty(completedBusinessIds) ? 0 : completedBusinessIds.size();
|
|
|
292
|
+ int todoCount = CollectionUtils.isEmpty(todoBusinessIds) ? 0 : todoBusinessIds.size();
|
|
|
293
|
+
|
|
298
|
294
|
CustomerDevelopPlanStatisticsBo statisticsBo = new CustomerDevelopPlanStatisticsBo();
|
|
299
|
|
- statisticsBo.setAllCount(customerDevelopPlans.size());
|
|
|
295
|
+ statisticsBo.setAllCount(CollectionUtils.isEmpty(customerDevelopPlans) ? 0 : customerDevelopPlans.size());
|
|
300
|
296
|
statisticsBo.setCompletedCount(completedCount);
|
|
301
|
297
|
statisticsBo.setTodoCount(todoCount);
|
|
302
|
298
|
|
...
|
...
|
|