fdeba13e by xu

Merge branch 'feature-tds-v1.0.0' into 'develop'

可信空间连接器入住接口

See merge request !17
2 parents cab0aaa5 ce50f5a6
...@@ -56,6 +56,14 @@ public class TdsConnectorIdentityController { ...@@ -56,6 +56,14 @@ public class TdsConnectorIdentityController {
56 tdsConnectorIdentityService.updateTdsConnectorIdentity(vo); 56 tdsConnectorIdentityService.updateTdsConnectorIdentity(vo);
57 return CommonRes.success(true); 57 return CommonRes.success(true);
58 } 58 }
59
60 @PostMapping("/cross-flow-call-back")
61 @SystemLog(value = "连接器身份信息-流程结束后进行业务回调(跨服务审批)")
62 @Operation(summary = "连接器身份信息-流程结束后进行业务回调(跨服务审批)", hidden = true)
63 public CommonRes<Boolean> crossFlowCallBack(@RequestBody @Valid BizCallbackDTO dto) {
64 tdsConnectorIdentityService.crossFlowCallBack(dto);
65 return CommonRes.success(true);
66 }
59 67
60 @DeleteMapping("/delete") 68 @DeleteMapping("/delete")
61 @SystemLog(value = "连接器身份信息-批量删除") 69 @SystemLog(value = "连接器身份信息-批量删除")
......
...@@ -106,4 +106,10 @@ public interface TdsConnectorIdentityService { ...@@ -106,4 +106,10 @@ public interface TdsConnectorIdentityService {
106 * @return 106 * @return
107 */ 107 */
108 TdsConnectorIdentityRSVO checkConnector(); 108 TdsConnectorIdentityRSVO checkConnector();
109
110 /**
111 * 跨平台业务调用
112 * @param dto
113 */
114 void crossFlowCallBack(BizCallbackDTO dto);
109 } 115 }
......
...@@ -25,7 +25,9 @@ import csbr.cloud.entity.domain.base.vo.PageListVO; ...@@ -25,7 +25,9 @@ import csbr.cloud.entity.domain.base.vo.PageListVO;
25 import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity; 25 import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity;
26 import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityService; 26 import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityService;
27 import com.csbr.qingcloud.portal.service.TdsConnectorIdentityService; 27 import com.csbr.qingcloud.portal.service.TdsConnectorIdentityService;
28 import csbr.cloud.entity.domain.user.UserInfo;
28 import csbr.cloud.entity.enums.ApprovalStateEnum; 29 import csbr.cloud.entity.enums.ApprovalStateEnum;
30 import csbr.cloud.entity.utils.UserContextHolder;
29 import io.seata.spring.annotation.GlobalTransactional; 31 import io.seata.spring.annotation.GlobalTransactional;
30 import jakarta.annotation.Resource; 32 import jakarta.annotation.Resource;
31 import lombok.extern.slf4j.Slf4j; 33 import lombok.extern.slf4j.Slf4j;
...@@ -153,6 +155,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements ...@@ -153,6 +155,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements
153 beforeSave(rqVO); 155 beforeSave(rqVO);
154 MfTdsConnectorIdentity entity = convertToEntity(rqVO); 156 MfTdsConnectorIdentity entity = convertToEntity(rqVO);
155 rqVO.setGuid(entity.getGuid()); 157 rqVO.setGuid(entity.getGuid());
158 if("N".equals(entity.getIsChangeData()) && flowBaseVO.getImmediateApprove()) {
159 entity.setConnectorIdentity(IdentificationCodeUtil.genConnectorCode(entity.getLegalSocialCreditCode(), IdentificationCodeUtil.medIndustry));
160 }
156 mfTdsConnectorIdentityService.csbrAddEntity(entity); 161 mfTdsConnectorIdentityService.csbrAddEntity(entity);
157 // 发起审批流程或保存草稿 162 // 发起审批流程或保存草稿
158 AddApprovalDTO approvalDTO = getAddApprovalDTO(entity,rqVO); 163 AddApprovalDTO approvalDTO = getAddApprovalDTO(entity,rqVO);
...@@ -209,6 +214,10 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements ...@@ -209,6 +214,10 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements
209 beforeUpdate(rqVO); 214 beforeUpdate(rqVO);
210 MfTdsConnectorIdentity oldEntity = mfTdsConnectorIdentityService.getById(rqVO.getGuid()); 215 MfTdsConnectorIdentity oldEntity = mfTdsConnectorIdentityService.getById(rqVO.getGuid());
211 MfTdsConnectorIdentity entity = convertToEntity(rqVO); 216 MfTdsConnectorIdentity entity = convertToEntity(rqVO);
217 if("N".equals(entity.getIsChangeData()) && StringUtils.isBlank(entity.getConnectorIdentity())
218 && flowBaseVO.getImmediateApprove()) {
219 entity.setConnectorIdentity(IdentificationCodeUtil.genConnectorCode(entity.getLegalSocialCreditCode(), IdentificationCodeUtil.medIndustry));
220 }
212 mfTdsConnectorIdentityService.csbrUpdateEntity(entity); 221 mfTdsConnectorIdentityService.csbrUpdateEntity(entity);
213 // 发起审批流程或保存草稿 222 // 发起审批流程或保存草稿
214 AddApprovalDTO approvalDTO = getAddApprovalDTO(entity, rqVO); 223 AddApprovalDTO approvalDTO = getAddApprovalDTO(entity, rqVO);
...@@ -279,18 +288,6 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements ...@@ -279,18 +288,6 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements
279 if (entity == null) { 288 if (entity == null) {
280 throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); 289 throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME));
281 } 290 }
282 // 同步更新审批状态
283 entity.setBizApproveState(bizApproveVO.getApprovalState());
284 if(ApprovalStateEnum.PASSED.getValue().equals(bizApproveVO.getApprovalState())) {
285 if("N".equals(entity.getIsChangeData())) {
286 entity.setConnectorIdentity(IdentificationCodeUtil.genConnectorCode(entity.getLegalSocialCreditCode(), IdentificationCodeUtil.medIndustry));
287 }
288 //如果是变更数据需要更新原来数据信息
289 if("Y".equals(entity.getIsChangeData())) {
290 changSourceConnectorInentity(entity);
291 }
292 }
293 //驳回和撤销是,修改原来数据状态
294 if(ApprovalStateEnum.REJECT.getValue().equals(bizApproveVO.getApprovalState()) 291 if(ApprovalStateEnum.REJECT.getValue().equals(bizApproveVO.getApprovalState())
295 || ApprovalStateEnum.CANCEL.getValue().equals(bizApproveVO.getApprovalState())) { 292 || ApprovalStateEnum.CANCEL.getValue().equals(bizApproveVO.getApprovalState())) {
296 if("Y".equals(entity.getIsChangeData())) { 293 if("Y".equals(entity.getIsChangeData())) {
...@@ -299,6 +296,8 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements ...@@ -299,6 +296,8 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements
299 mfTdsConnectorIdentityService.updateById(sourceEntity); 296 mfTdsConnectorIdentityService.updateById(sourceEntity);
300 } 297 }
301 } 298 }
299 // 同步更新审批状态
300 entity.setBizApproveState(bizApproveVO.getApprovalState());
302 mfTdsConnectorIdentityService.updateById(entity); 301 mfTdsConnectorIdentityService.updateById(entity);
303 } 302 }
304 303
...@@ -460,6 +459,29 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements ...@@ -460,6 +459,29 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements
460 return convertToVO(list.get(0)); 459 return convertToVO(list.get(0));
461 } 460 }
462 461
462 @Override
463 public void crossFlowCallBack(BizCallbackDTO dto) {
464 MfTdsConnectorIdentity entity = mfTdsConnectorIdentityService.getById(dto.getBizGuid());
465 entity.setCrossPlatformApproveState(dto.getApprovalState());
466 mfTdsConnectorIdentityService.updateById(entity);
467 UserInfo userInfo = UserContextHolder.get();
468 userInfo.setCurrentTenantGuid(entity.getTenantGuid());
469 UserContextHolder.set(userInfo);
470 //如果是变更数据需要更新原来数据信息
471 if("Y".equals(entity.getIsChangeData())) {
472 changSourceConnectorInentity(entity);
473 }
474 //驳回和撤销是,修改原来数据状态
475 if(ApprovalStateEnum.REJECT.getValue().equals(dto.getApprovalState())
476 || ApprovalStateEnum.CANCEL.getValue().equals(dto.getApprovalState())) {
477 if("Y".equals(entity.getIsChangeData())) {
478 MfTdsConnectorIdentity sourceEntity = mfTdsConnectorIdentityService.getById(entity.getSourceBizGuid());
479 sourceEntity.setBizApproveState(ApprovalStateEnum.PASSED.getValue());
480 mfTdsConnectorIdentityService.updateById(sourceEntity);
481 }
482 }
483 }
484
463 @Transactional 485 @Transactional
464 public void afterChangeSaveTdsConnectorIdentity(TdsConnectorIdentityRQVO rqVO,MfTdsConnectorIdentity oldTdsConnectorIdentity) { 486 public void afterChangeSaveTdsConnectorIdentity(TdsConnectorIdentityRQVO rqVO,MfTdsConnectorIdentity oldTdsConnectorIdentity) {
465 //修改变更前数据状态为已废弃 487 //修改变更前数据状态为已废弃
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!