deb40ef6 by xiaojie

【数据资产】

1、企业信息-流程结束后进行业务回调(跨服务审批)
1 parent 5f39ff09
......@@ -96,6 +96,14 @@ public class EnterpriseController {
return CommonRes.success(true);
}
@PostMapping("/cross-flow-call-back")
@SystemLog(value = "企业信息-流程结束后进行业务回调(跨服务审批)")
@Operation(summary = "企业信息-流程结束后进行业务回调(跨服务审批)", hidden = true)
public CommonRes<Boolean> crossFlowCallBack(@RequestBody @Valid BizCallbackDTO dto) {
enterpriseService.crossFlowCallBack(dto);
return CommonRes.success(true);
}
@PostMapping("/move-old-data")
@SystemLog(value = "将此账号提交的数据需求迁移到新的企业")
@Operation(summary = "将此账号提交的数据需求迁移到新的企业", hidden = true)
......
......@@ -71,6 +71,12 @@ public interface EnterpriseService {
*/
void flowCallBack(BizCallbackDTO dto);
/**
* 流程结束后进行业务回调(跨服务审批)
* @param dto
*/
void crossFlowCallBack(BizCallbackDTO dto);
Boolean check(EnterpriseRQVO vo);
List<ChangeInfoVO> getChange(String tenantName);
......
......@@ -321,7 +321,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
if (!flag) {
throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(String.format("%s的业务审批状态", FUNCTION_NAME)));
}
if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) {
if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState()) && !dto.getIsZqPlatformApprove() && StringUtils.isEmpty(entity.getZqName())) {
String tenantName = personelFeign.getAllTenantGuidNameMap().getData().get(entity.getTenantGuid());
if("非认证会员".equals(tenantName)){
//删除原帐号并新增正式会员
......@@ -348,6 +348,47 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
}
@Override
public void crossFlowCallBack(BizCallbackDTO dto) {
MfEnterprise entity = mfEnterpriseService.getById(dto.getBizGuid());
if (entity == null) {
throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME));
}
// 同步更新审批状态
LambdaUpdateWrapper<MfEnterprise> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(MfEnterprise::getBizApproveState, dto.getApprovalState());
updateWrapper.set(MfEnterprise::getCrossPlatformApproveState, dto.getApprovalState());
updateWrapper.eq(MfEnterprise::getGuid, dto.getBizGuid());
boolean flag = mfEnterpriseService.update(updateWrapper);
if (!flag) {
throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(String.format("%s的业务审批状态", FUNCTION_NAME)));
}
if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) {
String tenantName = personelFeign.getAllTenantGuidNameMap().getData().get(entity.getTenantGuid());
if("非认证会员".equals(tenantName)){
//删除原帐号并新增正式会员
TenantRQVO vo = csbrBeanUtil.convert(entity,TenantRQVO.class);
//新增会员时guid必须保证为空
vo.setGuid(null);
vo.setTenantType(null);
vo.setContactTel(entity.getContactTel());
vo.setBizGuid(dto.getBizGuid());
vo.setPersonIncharge(entity.getJuridicalPerson());
vo.setBizState("Y");
vo.setRegistrationDate(DateUtil.getDateToLocal(entity.getRegistrationDate()));
vo.setTenantLicList(getTenantLicList(entity.getBusinessLicenseJson()));
vo.setCompanyAddress(String.format("%s/%s/%s",entity.getProvince(),entity.getCity(),entity.getDistrict()));
vo.setProvince(null);
vo.setCity(null);
vo.setDistrict(null);
personelFeign.authTenant(vo).getData();
}
else{
updateTenant(entity);
}
}
}
private List<TenantLicRQVO> getTenantLicList(String json) {
if(StringUtils.isBlank(json)){
return null;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!