Merge remote-tracking branch 'origin/develop' into develop
Showing
5 changed files
with
45 additions
and
1 deletions
... | @@ -89,6 +89,14 @@ public class DemandController { | ... | @@ -89,6 +89,14 @@ public class DemandController { |
89 | return CommonRes.success(true); | 89 | return CommonRes.success(true); |
90 | } | 90 | } |
91 | 91 | ||
92 | @PostMapping("/cross-flow-call-back") | ||
93 | @SystemLog(value = "数据需求-流程结束后进行业务回调(跨服务审批)") | ||
94 | @Operation(summary = "数据需求-流程结束后进行业务回调(跨服务审批)", hidden = true) | ||
95 | public CommonRes<Boolean> crossFlowCallBack(@RequestBody @Valid BizCallbackDTO dto) { | ||
96 | demandService.crossFlowCallBack(dto); | ||
97 | return CommonRes.success(true); | ||
98 | } | ||
99 | |||
92 | @PostMapping("/last-approve") | 100 | @PostMapping("/last-approve") |
93 | @SystemLog(value = "数据需求审批") | 101 | @SystemLog(value = "数据需求审批") |
94 | @Operation(summary = "数据需求审批-最后一个节点时调用") | 102 | @Operation(summary = "数据需求审批-最后一个节点时调用") | ... | ... |
... | @@ -19,7 +19,7 @@ import java.util.Map; | ... | @@ -19,7 +19,7 @@ import java.util.Map; |
19 | @FeignClient(value = "ms-data-process-basic-service",url = "${dataProcessUrl}", configuration = FastCallFeignConfiguration.class) | 19 | @FeignClient(value = "ms-data-process-basic-service",url = "${dataProcessUrl}", configuration = FastCallFeignConfiguration.class) |
20 | public interface DataProcessBasicFeign { | 20 | public interface DataProcessBasicFeign { |
21 | 21 | ||
22 | @PostMapping(value = "/process-order/save", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | 22 | @PostMapping(value = "/process-order/saveOrUpdate", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) |
23 | CommonRes<Boolean> saveProcessOrder(@RequestBody @Valid ProcessOrderRQVO vo); | 23 | CommonRes<Boolean> saveProcessOrder(@RequestBody @Valid ProcessOrderRQVO vo); |
24 | 24 | ||
25 | @PostMapping(value = "/process-order-process-dtl/get-order-state", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | 25 | @PostMapping(value = "/process-order-process-dtl/get-order-state", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | ... | ... |
... | @@ -69,6 +69,12 @@ public interface DemandService { | ... | @@ -69,6 +69,12 @@ public interface DemandService { |
69 | */ | 69 | */ |
70 | void flowCallBack(BizCallbackDTO dto); | 70 | void flowCallBack(BizCallbackDTO dto); |
71 | 71 | ||
72 | /** | ||
73 | * 数据需求-流程结束后进行业务回调(跨服务审批) | ||
74 | * @param dto | ||
75 | */ | ||
76 | void crossFlowCallBack(BizCallbackDTO dto); | ||
77 | |||
72 | Boolean lastApprove(DemandApproveVO dto); | 78 | Boolean lastApprove(DemandApproveVO dto); |
73 | 79 | ||
74 | DemandRSVO getDemandDetailByProcess(String processOrderNo); | 80 | DemandRSVO getDemandDetailByProcess(String processOrderNo); | ... | ... |
... | @@ -34,6 +34,7 @@ import lombok.extern.slf4j.Slf4j; | ... | @@ -34,6 +34,7 @@ import lombok.extern.slf4j.Slf4j; |
34 | import org.apache.commons.collections.CollectionUtils; | 34 | import org.apache.commons.collections.CollectionUtils; |
35 | import org.apache.commons.lang3.ObjectUtils; | 35 | import org.apache.commons.lang3.ObjectUtils; |
36 | import org.apache.commons.lang3.StringUtils; | 36 | import org.apache.commons.lang3.StringUtils; |
37 | import org.springframework.beans.factory.annotation.Value; | ||
37 | import org.springframework.stereotype.Service; | 38 | import org.springframework.stereotype.Service; |
38 | import io.seata.spring.annotation.GlobalTransactional; | 39 | import io.seata.spring.annotation.GlobalTransactional; |
39 | import org.springframework.transaction.annotation.Transactional; | 40 | import org.springframework.transaction.annotation.Transactional; |
... | @@ -84,6 +85,9 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -84,6 +85,9 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
84 | @Resource | 85 | @Resource |
85 | private WorkflowFeign workflowFeign; | 86 | private WorkflowFeign workflowFeign; |
86 | 87 | ||
88 | @Value("${isCrossPlatform:}") | ||
89 | private Boolean isCrossPlatform; | ||
90 | |||
87 | /** | 91 | /** |
88 | * 数据需求分页查询 | 92 | * 数据需求分页查询 |
89 | * @author xcq | 93 | * @author xcq |
... | @@ -284,6 +288,29 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -284,6 +288,29 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
284 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); | 288 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); |
285 | } | 289 | } |
286 | String orderNo = null; | 290 | String orderNo = null; |
291 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState()) && !dto.getIsZqPlatformApprove() && !isCrossPlatform) { | ||
292 | //生成加工单 | ||
293 | orderNo = addOrder(mfDemandService.getById(dto.getBizGuid()),dto); | ||
294 | } | ||
295 | // 同步更新审批状态 | ||
296 | LambdaUpdateWrapper<MfDemand> updateWrapper = new LambdaUpdateWrapper<>(); | ||
297 | updateWrapper.set(MfDemand::getBizApproveState, dto.getApprovalState()); | ||
298 | updateWrapper.set(StringUtils.isNotBlank(orderNo),MfDemand::getProcessOrderNo, orderNo); | ||
299 | updateWrapper.set(StringUtils.isNotBlank(orderNo),MfDemand::getProcessingGenerateTime, new Date()); | ||
300 | updateWrapper.eq(MfDemand::getGuid, dto.getBizGuid()); | ||
301 | boolean flag = mfDemandService.update(updateWrapper); | ||
302 | if (!flag) { | ||
303 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(String.format("%s的业务审批状态", FUNCTION_NAME))); | ||
304 | } | ||
305 | } | ||
306 | |||
307 | @Override | ||
308 | public void crossFlowCallBack(BizCallbackDTO dto) { | ||
309 | MfDemand entity = mfDemandService.getById(dto.getBizGuid()); | ||
310 | if (entity == null) { | ||
311 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); | ||
312 | } | ||
313 | String orderNo = null; | ||
287 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { | 314 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { |
288 | //生成加工单 | 315 | //生成加工单 |
289 | orderNo = addOrder(mfDemandService.getById(dto.getBizGuid()),dto); | 316 | orderNo = addOrder(mfDemandService.getById(dto.getBizGuid()),dto); |
... | @@ -291,6 +318,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -291,6 +318,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
291 | // 同步更新审批状态 | 318 | // 同步更新审批状态 |
292 | LambdaUpdateWrapper<MfDemand> updateWrapper = new LambdaUpdateWrapper<>(); | 319 | LambdaUpdateWrapper<MfDemand> updateWrapper = new LambdaUpdateWrapper<>(); |
293 | updateWrapper.set(MfDemand::getBizApproveState, dto.getApprovalState()); | 320 | updateWrapper.set(MfDemand::getBizApproveState, dto.getApprovalState()); |
321 | updateWrapper.set(MfDemand::getCrossPlatformApproveState, dto.getApprovalState()); | ||
294 | updateWrapper.set(StringUtils.isNotBlank(orderNo),MfDemand::getProcessOrderNo, orderNo); | 322 | updateWrapper.set(StringUtils.isNotBlank(orderNo),MfDemand::getProcessOrderNo, orderNo); |
295 | updateWrapper.set(StringUtils.isNotBlank(orderNo),MfDemand::getProcessingGenerateTime, new Date()); | 323 | updateWrapper.set(StringUtils.isNotBlank(orderNo),MfDemand::getProcessingGenerateTime, new Date()); |
296 | updateWrapper.eq(MfDemand::getGuid, dto.getBizGuid()); | 324 | updateWrapper.eq(MfDemand::getGuid, dto.getBizGuid()); |
... | @@ -495,6 +523,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -495,6 +523,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
495 | checkProductGuid(rqVO.getDataProductGuid()); | 523 | checkProductGuid(rqVO.getDataProductGuid()); |
496 | } | 524 | } |
497 | //endregion 2.数据验证特殊处理 | 525 | //endregion 2.数据验证特殊处理 |
526 | rqVO.setBizApproveState(entity.getBizApproveState()); | ||
498 | 527 | ||
499 | //region 3.数据转换处理 | 528 | //region 3.数据转换处理 |
500 | 529 | ... | ... |
... | @@ -557,6 +557,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -557,6 +557,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
557 | //endregion 2.2.业务数据验证 | 557 | //endregion 2.2.业务数据验证 |
558 | 558 | ||
559 | //endregion 2.数据验证特殊处理 | 559 | //endregion 2.数据验证特殊处理 |
560 | rqVO.setBizApproveState(entity.getBizApproveState()); | ||
560 | 561 | ||
561 | //region 3.数据转换处理 | 562 | //region 3.数据转换处理 |
562 | 563 | ... | ... |
-
Please register or sign in to post a comment