Showing
4 changed files
with
82 additions
and
5 deletions
xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/customer/develop/GetCustomerDevelopPlanBo.java
| @@ -145,7 +145,7 @@ public class GetCustomerDevelopPlanBo extends BaseBo<CustomerDevelopPlan> implem | @@ -145,7 +145,7 @@ public class GetCustomerDevelopPlanBo extends BaseBo<CustomerDevelopPlan> implem | ||
| 145 | * 流程任务ID | 145 | * 流程任务ID | 
| 146 | */ | 146 | */ | 
| 147 | @ApiModelProperty("流程任务ID") | 147 | @ApiModelProperty("流程任务ID") | 
| 148 | - private Long flowTaskId; | 148 | + private String flowTaskId; | 
| 149 | 149 | ||
| 150 | /** | 150 | /** | 
| 151 | * 创建人 | 151 | * 创建人 | 
| @@ -91,7 +91,6 @@ public class CustomerDevelopPlanController extends DefaultBaseController { | @@ -91,7 +91,6 @@ public class CustomerDevelopPlanController extends DefaultBaseController { | ||
| 91 | if (!CollectionUtil.isEmpty(dataList)) { | 91 | if (!CollectionUtil.isEmpty(dataList)) { | 
| 92 | results = this.packCustomerDevelopData(dataList); | 92 | results = this.packCustomerDevelopData(dataList); | 
| 93 | } | 93 | } | 
| 94 | - log.info("====================== CustomerDevelopPlanController.query results:{}", JsonUtil.toJsonString(results)); | ||
| 95 | return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); | 94 | return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); | 
| 96 | } | 95 | } | 
| 97 | 96 | ||
| @@ -229,7 +228,6 @@ public class CustomerDevelopPlanController extends DefaultBaseController { | @@ -229,7 +228,6 @@ public class CustomerDevelopPlanController extends DefaultBaseController { | ||
| 229 | // 获取流程任务数据 | 228 | // 获取流程任务数据 | 
| 230 | List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo() | 229 | List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo() | 
| 231 | , SecurityUtil.getCurrentUser().getId()); | 230 | , SecurityUtil.getCurrentUser().getId()); | 
| 232 | - log.info("=================== packCustomerDevelopData flowTaskList =================={}", JsonUtil.toJsonString(flowTaskList)); | ||
| 233 | Map<String, FlowTaskDto> flowTaskMap = new HashMap<>(); | 231 | Map<String, FlowTaskDto> flowTaskMap = new HashMap<>(); | 
| 234 | if (CollectionUtils.isNotEmpty(flowTaskList)) { | 232 | if (CollectionUtils.isNotEmpty(flowTaskList)) { | 
| 235 | flowTaskMap = flowTaskList.stream().collect(Collectors.toMap(FlowTaskDto::getBusinessId, Function.identity())); | 233 | flowTaskMap = flowTaskList.stream().collect(Collectors.toMap(FlowTaskDto::getBusinessId, Function.identity())); | 
| @@ -260,7 +258,7 @@ public class CustomerDevelopPlanController extends DefaultBaseController { | @@ -260,7 +258,7 @@ public class CustomerDevelopPlanController extends DefaultBaseController { | ||
| 260 | data.setOffice(office); | 258 | data.setOffice(office); | 
| 261 | // 流程任务 | 259 | // 流程任务 | 
| 262 | FlowTaskDto task = flowTaskMap.get(plan.getId()); | 260 | FlowTaskDto task = flowTaskMap.get(plan.getId()); | 
| 263 | - data.setFlowTaskId(task == null ? null : task.getTaskId()); | 261 | + data.setFlowTaskId(task == null ? null : String.valueOf(task.getTaskId())); | 
| 264 | // 产品品种 | 262 | // 产品品种 | 
| 265 | ProductVariety productVariety = productVarietyMap.get(plan.getProductVarietyId()); | 263 | ProductVariety productVariety = productVarietyMap.get(plan.getProductVarietyId()); | 
| 266 | data.setProductVariety(productVariety); | 264 | data.setProductVariety(productVariety); | 
xingyun-sc/src/main/java/com/lframework/xingyun/sc/handlers/BusinessDataHandlerServiceImpl.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.handlers; | ||
| 2 | + | ||
| 3 | +import com.lframework.starter.bpm.dto.FlowInstanceExtDto; | ||
| 4 | +import com.lframework.starter.bpm.enums.FlowInstanceStatus; | ||
| 5 | +import com.lframework.starter.bpm.service.BusinessDataHandlerService; | ||
| 6 | +import com.lframework.starter.web.core.utils.JsonUtil; | ||
| 7 | +import com.lframework.xingyun.sc.enums.CustomerDevelopStatus; | ||
| 8 | +import com.lframework.xingyun.sc.service.customer.CustomerDevelopPlanService; | ||
| 9 | +import lombok.extern.slf4j.Slf4j; | ||
| 10 | +import org.apache.commons.collections4.MapUtils; | ||
| 11 | +import org.apache.commons.lang3.StringUtils; | ||
| 12 | +import org.dromara.warm.flow.core.entity.Instance; | ||
| 13 | +import org.dromara.warm.flow.core.listener.ListenerVariable; | ||
| 14 | +import org.springframework.stereotype.Component; | ||
| 15 | + | ||
| 16 | +import javax.annotation.Resource; | ||
| 17 | +import java.util.Map; | ||
| 18 | + | ||
| 19 | +@Component | ||
| 20 | +@Slf4j | ||
| 21 | +public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerService { | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + @Resource | ||
| 25 | + private CustomerDevelopPlanService customerDevelopPlanService; | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 业务状态数据处理器 | ||
| 30 | + * | ||
| 31 | + * @param listenerVariable 流程变量 | ||
| 32 | + */ | ||
| 33 | + @Override | ||
| 34 | + public void businessStatusHandler(ListenerVariable listenerVariable) { | ||
| 35 | + log.info("==================== 业务状态数据处理开始......"); | ||
| 36 | + Instance instance = listenerVariable.getInstance(); | ||
| 37 | + Map<String, Object> variable = listenerVariable.getVariable(); | ||
| 38 | + if (MapUtils.isEmpty(variable)) { | ||
| 39 | + return; | ||
| 40 | + } | ||
| 41 | + String businessId = instance.getBusinessId(); | ||
| 42 | + // 获取业务数据标识 | ||
| 43 | + String ext = instance.getExt(); | ||
| 44 | + String businessType = null; | ||
| 45 | + if (StringUtils.isNotBlank(ext)) { | ||
| 46 | + FlowInstanceExtDto flowInstanceExtDto = JsonUtil.parseObject(ext, FlowInstanceExtDto.class); | ||
| 47 | + businessType = flowInstanceExtDto.getBizFlag(); | ||
| 48 | + } | ||
| 49 | + if (StringUtils.isBlank(businessType)) { | ||
| 50 | + return; | ||
| 51 | + } | ||
| 52 | + // 获取审核结果 | ||
| 53 | + String flowStatus = instance.getFlowStatus(); | ||
| 54 | + // 更新业务数据 | ||
| 55 | + switch (businessType) { | ||
| 56 | + case "CUSTOMER_DEVELOP": | ||
| 57 | + handleCustomerDevelopData(flowStatus, businessId); | ||
| 58 | + break; | ||
| 59 | + default: | ||
| 60 | + break; | ||
| 61 | + } | ||
| 62 | + log.info("==================== 业务状态数据处理结束......"); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 客户开发业务数据处理 | ||
| 68 | + * | ||
| 69 | + * @param businessId 业务ID | ||
| 70 | + */ | ||
| 71 | + private void handleCustomerDevelopData(String flowStatus, String businessId) { | ||
| 72 | + if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus) | ||
| 73 | + || FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) { | ||
| 74 | + customerDevelopPlanService.updateStatus(businessId, CustomerDevelopStatus.PASS); | ||
| 75 | + } else if (FlowInstanceStatus.REVOKE.getCode().equals(flowStatus) | ||
| 76 | + || FlowInstanceStatus.REFUSE.getCode().equals(flowStatus)) { | ||
| 77 | + customerDevelopPlanService.updateStatus(businessId, CustomerDevelopStatus.REFUSE); | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | +} | 
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/customer/CustomerDevelopPlanServiceImpl.java
| @@ -91,7 +91,6 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe | @@ -91,7 +91,6 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe | ||
| 91 | , JsonUtil.toJsonString(SecurityUtil.getCurrentUser().getId())); | 91 | , JsonUtil.toJsonString(SecurityUtil.getCurrentUser().getId())); | 
| 92 | // 获取当前人员的待办任务数据 | 92 | // 获取当前人员的待办任务数据 | 
| 93 | List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId()); | 93 | List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId()); | 
| 94 | - log.info("=================== CustomerDevelopPlanService.query flowTaskList =================={}", JsonUtil.toJsonString(flowTaskList)); | ||
| 95 | if (CollectionUtils.isEmpty(flowTaskList)) { | 94 | if (CollectionUtils.isEmpty(flowTaskList)) { | 
| 96 | return new PageResult<>(); | 95 | return new PageResult<>(); | 
| 97 | } | 96 | } |