ce50f5a6 by xu

可信空间连接器入住接口

1 parent ba7be8c8
......@@ -56,6 +56,14 @@ public class TdsConnectorIdentityController {
tdsConnectorIdentityService.updateTdsConnectorIdentity(vo);
return CommonRes.success(true);
}
@PostMapping("/cross-flow-call-back")
@SystemLog(value = "连接器身份信息-流程结束后进行业务回调(跨服务审批)")
@Operation(summary = "连接器身份信息-流程结束后进行业务回调(跨服务审批)", hidden = true)
public CommonRes<Boolean> crossFlowCallBack(@RequestBody @Valid BizCallbackDTO dto) {
tdsConnectorIdentityService.crossFlowCallBack(dto);
return CommonRes.success(true);
}
@DeleteMapping("/delete")
@SystemLog(value = "连接器身份信息-批量删除")
......
......@@ -106,4 +106,10 @@ public interface TdsConnectorIdentityService {
* @return
*/
TdsConnectorIdentityRSVO checkConnector();
/**
* 跨平台业务调用
* @param dto
*/
void crossFlowCallBack(BizCallbackDTO dto);
}
......
......@@ -25,7 +25,9 @@ import csbr.cloud.entity.domain.base.vo.PageListVO;
import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity;
import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityService;
import com.csbr.qingcloud.portal.service.TdsConnectorIdentityService;
import csbr.cloud.entity.domain.user.UserInfo;
import csbr.cloud.entity.enums.ApprovalStateEnum;
import csbr.cloud.entity.utils.UserContextHolder;
import io.seata.spring.annotation.GlobalTransactional;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
......@@ -153,6 +155,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements
beforeSave(rqVO);
MfTdsConnectorIdentity entity = convertToEntity(rqVO);
rqVO.setGuid(entity.getGuid());
if("N".equals(entity.getIsChangeData()) && flowBaseVO.getImmediateApprove()) {
entity.setConnectorIdentity(IdentificationCodeUtil.genConnectorCode(entity.getLegalSocialCreditCode(), IdentificationCodeUtil.medIndustry));
}
mfTdsConnectorIdentityService.csbrAddEntity(entity);
// 发起审批流程或保存草稿
AddApprovalDTO approvalDTO = getAddApprovalDTO(entity,rqVO);
......@@ -209,6 +214,10 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements
beforeUpdate(rqVO);
MfTdsConnectorIdentity oldEntity = mfTdsConnectorIdentityService.getById(rqVO.getGuid());
MfTdsConnectorIdentity entity = convertToEntity(rqVO);
if("N".equals(entity.getIsChangeData()) && StringUtils.isBlank(entity.getConnectorIdentity())
&& flowBaseVO.getImmediateApprove()) {
entity.setConnectorIdentity(IdentificationCodeUtil.genConnectorCode(entity.getLegalSocialCreditCode(), IdentificationCodeUtil.medIndustry));
}
mfTdsConnectorIdentityService.csbrUpdateEntity(entity);
// 发起审批流程或保存草稿
AddApprovalDTO approvalDTO = getAddApprovalDTO(entity, rqVO);
......@@ -279,18 +288,6 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements
if (entity == null) {
throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME));
}
// 同步更新审批状态
entity.setBizApproveState(bizApproveVO.getApprovalState());
if(ApprovalStateEnum.PASSED.getValue().equals(bizApproveVO.getApprovalState())) {
if("N".equals(entity.getIsChangeData())) {
entity.setConnectorIdentity(IdentificationCodeUtil.genConnectorCode(entity.getLegalSocialCreditCode(), IdentificationCodeUtil.medIndustry));
}
//如果是变更数据需要更新原来数据信息
if("Y".equals(entity.getIsChangeData())) {
changSourceConnectorInentity(entity);
}
}
//驳回和撤销是,修改原来数据状态
if(ApprovalStateEnum.REJECT.getValue().equals(bizApproveVO.getApprovalState())
|| ApprovalStateEnum.CANCEL.getValue().equals(bizApproveVO.getApprovalState())) {
if("Y".equals(entity.getIsChangeData())) {
......@@ -299,6 +296,8 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements
mfTdsConnectorIdentityService.updateById(sourceEntity);
}
}
// 同步更新审批状态
entity.setBizApproveState(bizApproveVO.getApprovalState());
mfTdsConnectorIdentityService.updateById(entity);
}
......@@ -460,6 +459,29 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements
return convertToVO(list.get(0));
}
@Override
public void crossFlowCallBack(BizCallbackDTO dto) {
MfTdsConnectorIdentity entity = mfTdsConnectorIdentityService.getById(dto.getBizGuid());
entity.setCrossPlatformApproveState(dto.getApprovalState());
mfTdsConnectorIdentityService.updateById(entity);
UserInfo userInfo = UserContextHolder.get();
userInfo.setCurrentTenantGuid(entity.getTenantGuid());
UserContextHolder.set(userInfo);
//如果是变更数据需要更新原来数据信息
if("Y".equals(entity.getIsChangeData())) {
changSourceConnectorInentity(entity);
}
//驳回和撤销是,修改原来数据状态
if(ApprovalStateEnum.REJECT.getValue().equals(dto.getApprovalState())
|| ApprovalStateEnum.CANCEL.getValue().equals(dto.getApprovalState())) {
if("Y".equals(entity.getIsChangeData())) {
MfTdsConnectorIdentity sourceEntity = mfTdsConnectorIdentityService.getById(entity.getSourceBizGuid());
sourceEntity.setBizApproveState(ApprovalStateEnum.PASSED.getValue());
mfTdsConnectorIdentityService.updateById(sourceEntity);
}
}
}
@Transactional
public void afterChangeSaveTdsConnectorIdentity(TdsConnectorIdentityRQVO rqVO,MfTdsConnectorIdentity oldTdsConnectorIdentity) {
//修改变更前数据状态为已废弃
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!