【DAOP-1.0】数据需求
【功能点】联调问题处理
Showing
9 changed files
with
144 additions
and
13 deletions
... | @@ -68,16 +68,22 @@ public class DemandController { | ... | @@ -68,16 +68,22 @@ public class DemandController { |
68 | 68 | ||
69 | @GetMapping("/detail") | 69 | @GetMapping("/detail") |
70 | @SystemLog(value = "数据需求-详情") | 70 | @SystemLog(value = "数据需求-详情") |
71 | @Operation( | 71 | @Operation(summary = "数据需求-详情",parameters = { |
72 | summary = "数据需求-详情", | 72 | @Parameter(name = "guid", description = "数据需求唯一标识", required = true)}) |
73 | parameters = { | ||
74 | @Parameter(name = "guid", description = "数据需求唯一标识", required = true)} | ||
75 | ) | ||
76 | public CommonRes<DemandRSVO> getDemandDetail(@RequestParam String guid) { | 73 | public CommonRes<DemandRSVO> getDemandDetail(@RequestParam String guid) { |
77 | DemandRSVO vo = demandService.getDemandDetail(guid); | 74 | DemandRSVO vo = demandService.getDemandDetail(guid); |
78 | return CommonRes.success(vo); | 75 | return CommonRes.success(vo); |
79 | } | 76 | } |
80 | 77 | ||
78 | @GetMapping("/detail-by-process") | ||
79 | @SystemLog(value = "按加工单查数据需求详情") | ||
80 | @Operation(summary = "按加工单查数据需求详情",parameters = { | ||
81 | @Parameter(name = "guid", description = "加工单单号", required = true)}) | ||
82 | public CommonRes<DemandRSVO> getDemandDetailByProcess(@RequestParam String processOrderNo) { | ||
83 | DemandRSVO vo = demandService.getDemandDetailByProcess(processOrderNo); | ||
84 | return CommonRes.success(vo); | ||
85 | } | ||
86 | |||
81 | @PostMapping("/flow-call-back") | 87 | @PostMapping("/flow-call-back") |
82 | @SystemLog(value = "数据需求-流程结束后进行业务回调") | 88 | @SystemLog(value = "数据需求-流程结束后进行业务回调") |
83 | @Operation(summary = "数据需求-流程结束后进行业务回调", hidden = true) | 89 | @Operation(summary = "数据需求-流程结束后进行业务回调", hidden = true) | ... | ... |
... | @@ -225,6 +225,12 @@ public class DemandRSVO { | ... | @@ -225,6 +225,12 @@ public class DemandRSVO { |
225 | 225 | ||
226 | @Schema(description = "提交时间") | 226 | @Schema(description = "提交时间") |
227 | private Date createTime; | 227 | private Date createTime; |
228 | |||
229 | @Schema(description = "需求单编号") | ||
230 | private String requirementOrderNo; | ||
231 | |||
232 | @Schema(description = "加工单编号") | ||
233 | private String processOrderNo; | ||
228 | 234 | ||
229 | /******** 库表存储属性 需处理 *****/ | 235 | /******** 库表存储属性 需处理 *****/ |
230 | 236 | ... | ... |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import lombok.Data; | ||
4 | import lombok.experimental.Accessors; | ||
5 | |||
6 | /** | ||
7 | * @program: common-admin-platform-auth-service | ||
8 | * @description: 订单编号DTO | ||
9 | * @author: Huanglh | ||
10 | * @create: 2020-08-14 09:41 | ||
11 | **/ | ||
12 | @Data | ||
13 | @Accessors(chain = true) | ||
14 | public class RuleDTO { | ||
15 | /** 规则名称 */ | ||
16 | private String ruleName; | ||
17 | |||
18 | /** 规则类型 */ | ||
19 | private String ruleType; | ||
20 | } |
... | @@ -77,6 +77,9 @@ public class ServicerMaintainRSVO { | ... | @@ -77,6 +77,9 @@ public class ServicerMaintainRSVO { |
77 | @Schema(description = "维护信息") | 77 | @Schema(description = "维护信息") |
78 | private String maintainJson; | 78 | private String maintainJson; |
79 | 79 | ||
80 | @Schema(description = "创建人") | ||
81 | private String createUserName; | ||
82 | |||
80 | @Schema(description = "创建时间") | 83 | @Schema(description = "创建时间") |
81 | private Date createTime; | 84 | private Date createTime; |
82 | 85 | ... | ... |
1 | package com.csbr.qingcloud.portal.feign; | ||
2 | |||
3 | import com.csbr.cloud.common.config.FastCallFeignConfiguration; | ||
4 | import com.csbr.cloud.common.entity.DictModel; | ||
5 | import com.csbr.cloud.common.entity.DictionaryVO; | ||
6 | import com.csbr.cloud.common.response.CommonRes; | ||
7 | import com.csbr.qingcloud.portal.domain.vo.RuleDTO; | ||
8 | import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; | ||
9 | import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty; | ||
10 | import jakarta.validation.Valid; | ||
11 | import org.springframework.cloud.openfeign.FeignClient; | ||
12 | import org.springframework.http.MediaType; | ||
13 | import org.springframework.web.bind.annotation.*; | ||
14 | import java.util.List; | ||
15 | |||
16 | /** | ||
17 | * @author Xiaocq | ||
18 | */ | ||
19 | @FeignClient(value = "ms-daop-configure-service", configuration = FastCallFeignConfiguration.class) | ||
20 | public interface ConfigureFeign { | ||
21 | |||
22 | /** | ||
23 | * 通过字典类型获取字典数据 | ||
24 | */ | ||
25 | @HystrixCommand(fallbackMethod = "CommonUtil.sleepFallback", commandProperties = | ||
26 | { | ||
27 | @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "1500") | ||
28 | }) | ||
29 | @RequestMapping(value = "/dict/data/get-by-dictType", method = RequestMethod.GET) | ||
30 | CommonRes<List<DictModel>> getDictListByType(@RequestParam String dictType); | ||
31 | |||
32 | |||
33 | /** | ||
34 | * 获取全部字典 | ||
35 | */ | ||
36 | @GetMapping(value = "/dict/data/get-all",produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | ||
37 | CommonRes<List<DictionaryVO>> getAll(); | ||
38 | |||
39 | /** | ||
40 | * 编码生成 | ||
41 | */ | ||
42 | @PostMapping(value = "/rule/new-code",produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | ||
43 | CommonRes<String> newCode(@RequestBody RuleDTO dto); | ||
44 | |||
45 | |||
46 | } |
... | @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestBody; | ... | @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestBody; |
15 | @FeignClient(value = "ms-data-process-basic-service", configuration = FastCallFeignConfiguration.class) | 15 | @FeignClient(value = "ms-data-process-basic-service", configuration = FastCallFeignConfiguration.class) |
16 | public interface DataProcessBasicFeign { | 16 | public interface DataProcessBasicFeign { |
17 | 17 | ||
18 | @PostMapping(value = "/tenant/auth", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | 18 | @PostMapping(value = "/process-order/save", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) |
19 | CommonRes<Boolean> saveProcessOrder(@RequestBody @Valid ProcessOrderRQVO vo); | 19 | CommonRes<Boolean> saveProcessOrder(@RequestBody @Valid ProcessOrderRQVO vo); |
20 | 20 | ||
21 | } | 21 | } | ... | ... |
... | @@ -215,4 +215,10 @@ public class MfDemand extends BaseShardingDO { | ... | @@ -215,4 +215,10 @@ public class MfDemand extends BaseShardingDO { |
215 | @Name("加工单位名称") | 215 | @Name("加工单位名称") |
216 | private String processCompanyName; | 216 | private String processCompanyName; |
217 | 217 | ||
218 | @Name("需求单编号") | ||
219 | private String requirementOrderNo; | ||
220 | |||
221 | @Name("加工单编号") | ||
222 | private String processOrderNo; | ||
223 | |||
218 | } | 224 | } | ... | ... |
... | @@ -72,4 +72,6 @@ public interface DemandService { | ... | @@ -72,4 +72,6 @@ public interface DemandService { |
72 | void flowCallBack(BizCallbackDTO dto); | 72 | void flowCallBack(BizCallbackDTO dto); |
73 | 73 | ||
74 | Boolean lastApprove(DemandApproveVO dto); | 74 | Boolean lastApprove(DemandApproveVO dto); |
75 | |||
76 | DemandRSVO getDemandDetailByProcess(String processOrderNo); | ||
75 | } | 77 | } | ... | ... |
... | @@ -6,7 +6,10 @@ import com.csbr.cloud.common.enums.SystemError; | ... | @@ -6,7 +6,10 @@ import com.csbr.cloud.common.enums.SystemError; |
6 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | 6 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; |
7 | import com.csbr.cloud.workflow.domain.dto.appove.FlowUpdateStateDTO; | 7 | import com.csbr.cloud.workflow.domain.dto.appove.FlowUpdateStateDTO; |
8 | import com.csbr.cloud.workflow.feign.WorkflowFeign; | 8 | import com.csbr.cloud.workflow.feign.WorkflowFeign; |
9 | import com.csbr.qingcloud.portal.domain.vo.DemandApproveVO; | 9 | import com.csbr.qingcloud.portal.domain.vo.*; |
10 | import com.csbr.qingcloud.portal.feign.ConfigureFeign; | ||
11 | import com.csbr.qingcloud.portal.feign.DataProcessBasicFeign; | ||
12 | import com.csbr.qingcloud.portal.feign.PersonelFeign; | ||
10 | import csbr.cloud.entity.enums.ApprovalStateEnum; | 13 | import csbr.cloud.entity.enums.ApprovalStateEnum; |
11 | import com.csbr.cloud.common.exception.CsbrSystemException; | 14 | import com.csbr.cloud.common.exception.CsbrSystemException; |
12 | import com.csbr.cloud.common.util.CommonUtil; | 15 | import com.csbr.cloud.common.util.CommonUtil; |
... | @@ -18,9 +21,6 @@ import csbr.cloud.entity.domain.base.vo.PageListVO; | ... | @@ -18,9 +21,6 @@ import csbr.cloud.entity.domain.base.vo.PageListVO; |
18 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | 21 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; |
19 | import com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO; | 22 | import com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO; |
20 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | 23 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; |
21 | import com.csbr.qingcloud.portal.domain.vo.DemandQueryVO; | ||
22 | import com.csbr.qingcloud.portal.domain.vo.DemandRQVO; | ||
23 | import com.csbr.qingcloud.portal.domain.vo.DemandRSVO; | ||
24 | import com.csbr.qingcloud.portal.mybatis.entity.MfDemand; | 24 | import com.csbr.qingcloud.portal.mybatis.entity.MfDemand; |
25 | import com.csbr.qingcloud.portal.mybatis.service.MfDemandService; | 25 | import com.csbr.qingcloud.portal.mybatis.service.MfDemandService; |
26 | import com.csbr.qingcloud.portal.service.DemandService; | 26 | import com.csbr.qingcloud.portal.service.DemandService; |
... | @@ -34,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional; | ... | @@ -34,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional; |
34 | 34 | ||
35 | import java.util.ArrayList; | 35 | import java.util.ArrayList; |
36 | import java.util.Collections; | 36 | import java.util.Collections; |
37 | import java.util.Date; | ||
37 | import java.util.List; | 38 | import java.util.List; |
38 | 39 | ||
39 | /** | 40 | /** |
... | @@ -60,6 +61,15 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -60,6 +61,15 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
60 | private MfDemandService mfDemandService; | 61 | private MfDemandService mfDemandService; |
61 | 62 | ||
62 | @Resource | 63 | @Resource |
64 | private ConfigureFeign configureFeign; | ||
65 | |||
66 | @Resource | ||
67 | private PersonelFeign personelFeign; | ||
68 | |||
69 | @Resource | ||
70 | private DataProcessBasicFeign dataProcessBasicFeign; | ||
71 | |||
72 | @Resource | ||
63 | private CsbrBeanUtil csbrBeanUtil; | 73 | private CsbrBeanUtil csbrBeanUtil; |
64 | 74 | ||
65 | @Resource | 75 | @Resource |
... | @@ -127,6 +137,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -127,6 +137,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
127 | DemandRQVO rqVO = (DemandRQVO) flowBaseVO; | 137 | DemandRQVO rqVO = (DemandRQVO) flowBaseVO; |
128 | beforeSave(rqVO); | 138 | beforeSave(rqVO); |
129 | MfDemand entity = convertToEntity(rqVO); | 139 | MfDemand entity = convertToEntity(rqVO); |
140 | entity.setRequirementOrderNo(configureFeign.newCode(new RuleDTO().setRuleName("demand-code").setRuleType("generate")).getData()); | ||
130 | // 发起审批流程或保存草稿 | 141 | // 发起审批流程或保存草稿 |
131 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | 142 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); |
132 | super.startWorkFlow(rqVO, approvalDTO, entity::setBizApproveState); | 143 | super.startWorkFlow(rqVO, approvalDTO, entity::setBizApproveState); |
... | @@ -228,22 +239,25 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -228,22 +239,25 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
228 | * 流程结束后进行业务回调 | 239 | * 流程结束后进行业务回调 |
229 | * @author xcq | 240 | * @author xcq |
230 | * @date 2024-12-31 18:46 | 241 | * @date 2024-12-31 18:46 |
231 | * @param dto | ||
232 | * @return void | 242 | * @return void |
233 | */ | 243 | */ |
234 | @Transactional(rollbackFor = Exception.class) | 244 | @GlobalTransactional(rollbackFor = Exception.class) |
235 | @Override | 245 | @Override |
236 | public void flowCallBack(BizCallbackDTO dto) { | 246 | public void flowCallBack(BizCallbackDTO dto) { |
237 | MfDemand entity = mfDemandService.getById(dto.getBizGuid()); | 247 | MfDemand entity = mfDemandService.getById(dto.getBizGuid()); |
238 | if (entity == null) { | 248 | if (entity == null) { |
239 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); | 249 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); |
240 | } | 250 | } |
251 | String orderNo = null; | ||
241 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { | 252 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { |
242 | // todo | 253 | //生成加工单 |
254 | orderNo = addOrder(mfDemandService.getById(dto.getBizGuid())); | ||
243 | } | 255 | } |
244 | // 同步更新审批状态 | 256 | // 同步更新审批状态 |
245 | LambdaUpdateWrapper<MfDemand> updateWrapper = mfDemandService.csbrUpdateWrapper(MfDemand.class); | 257 | LambdaUpdateWrapper<MfDemand> updateWrapper = mfDemandService.csbrUpdateWrapper(MfDemand.class); |
246 | updateWrapper.set(MfDemand::getBizApproveState, dto.getApprovalState()); | 258 | updateWrapper.set(MfDemand::getBizApproveState, dto.getApprovalState()); |
259 | updateWrapper.set(StringUtils.isNotBlank(orderNo),MfDemand::getProcessOrderNo, orderNo); | ||
260 | updateWrapper.set(StringUtils.isNotBlank(orderNo),MfDemand::getProcessingGenerateTime, new Date()); | ||
247 | updateWrapper.eq(MfDemand::getGuid, dto.getBizGuid()); | 261 | updateWrapper.eq(MfDemand::getGuid, dto.getBizGuid()); |
248 | boolean flag = mfDemandService.update(updateWrapper); | 262 | boolean flag = mfDemandService.update(updateWrapper); |
249 | if (!flag) { | 263 | if (!flag) { |
... | @@ -251,6 +265,23 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -251,6 +265,23 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
251 | } | 265 | } |
252 | } | 266 | } |
253 | 267 | ||
268 | private String addOrder(MfDemand bean){ | ||
269 | ProcessOrderRQVO vo = csbrBeanUtil.convert(bean,ProcessOrderRQVO.class); | ||
270 | vo.setGuid(null); | ||
271 | vo.setTenantName(personelFeign.getAllTenantGuidNameMap().getData().get(bean.getTenantGuid())); | ||
272 | vo.setRequirementOrderNo(bean.getRequirementOrderNo()); | ||
273 | vo.setProcessOrderNo(configureFeign.newCode(new RuleDTO().setRuleName("process-order-code").setRuleType("generate")).getData()); | ||
274 | vo.setRequirementOrderName(bean.getDataDemandName()); | ||
275 | vo.setApplicationSceneDesc(bean.getSceneDescription()); | ||
276 | vo.setProcessState("N"); | ||
277 | vo.setContactTel(bean.getContactInformation()); | ||
278 | vo.setLinkContractInfoJson(bean.getContractAttachJson()); | ||
279 | vo.setFileUrl(bean.getDataDemandFieldAttachJson()); | ||
280 | |||
281 | dataProcessBasicFeign.saveProcessOrder(vo); | ||
282 | return vo.getProcessOrderNo(); | ||
283 | } | ||
284 | |||
254 | @GlobalTransactional | 285 | @GlobalTransactional |
255 | @Override | 286 | @Override |
256 | public Boolean lastApprove(DemandApproveVO dto) { | 287 | public Boolean lastApprove(DemandApproveVO dto) { |
... | @@ -266,6 +297,17 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -266,6 +297,17 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
266 | return true; | 297 | return true; |
267 | } | 298 | } |
268 | 299 | ||
300 | @Override | ||
301 | public DemandRSVO getDemandDetailByProcess(String processOrderNo) { | ||
302 | LambdaQueryWrapper<MfDemand> queryWrapper = new LambdaQueryWrapper<>(); | ||
303 | queryWrapper.eq(MfDemand::getProcessOrderNo,processOrderNo); | ||
304 | List<MfDemand> list = mfDemandService.list(queryWrapper); | ||
305 | if(CollectionUtils.isEmpty(list)){ | ||
306 | return null; | ||
307 | } | ||
308 | return convertToVO(list.get(0)); | ||
309 | } | ||
310 | |||
269 | /** | 311 | /** |
270 | * 获取发起流程参数 | 312 | * 获取发起流程参数 |
271 | * @author xcq | 313 | * @author xcq | ... | ... |
-
Please register or sign in to post a comment