|
@ -482,7 +482,7 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// *.发送初始化客户信息到mq,让监听者完成初始化操作
|
|
|
// *.发送初始化客户信息到mq,让监听者完成初始化操作
|
|
|
InitCustomerMQMsg msgContent = new InitCustomerMQMsg(); |
|
|
/*InitCustomerMQMsg msgContent = new InitCustomerMQMsg(); |
|
|
msgContent.setCustomerId(formDTO.getCustomerId()); |
|
|
msgContent.setCustomerId(formDTO.getCustomerId()); |
|
|
msgContent.setAgency(constructAgencyInfo4CustomerInit(paAgency)); |
|
|
msgContent.setAgency(constructAgencyInfo4CustomerInit(paAgency)); |
|
|
msgContent.setStaff(constructStaffInfo4CustomerInit(paAgency.getId(), paUser)); |
|
|
msgContent.setStaff(constructStaffInfo4CustomerInit(paAgency.getId(), paUser)); |
|
@ -493,50 +493,50 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn |
|
|
Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(systemMsgFormDTO); |
|
|
Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(systemMsgFormDTO); |
|
|
if (! sendMsgResult.success()) { |
|
|
if (! sendMsgResult.success()) { |
|
|
throw new RenException("发送(初始化客户信息)系统消息到message服务失败:{}", sendMsgResult.getInternalMsg()); |
|
|
throw new RenException("发送(初始化客户信息)系统消息到message服务失败:{}", sendMsgResult.getInternalMsg()); |
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
//3.调用epmet-user服务,初始化客户对应的角色;调用access服务给角色分配权限信息
|
|
|
|
|
|
Result initResult = epmetUserFeignClient.initGovStaffRolesForCustomer(formDTO.getCustomerId()); |
|
|
|
|
|
if (!initResult.success()) { |
|
|
|
|
|
throw new RenException("客户新增:调用user服务为客户初始化角色数据失败:".concat(initResult.toString())); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
////3.调用epmet-user服务,初始化客户对应的角色;调用access服务给角色分配权限信息
|
|
|
//4.调用oper-customize服务,初始化客户定制化首页模板数据
|
|
|
//Result initResult = epmetUserFeignClient.initGovStaffRolesForCustomer(formDTO.getCustomerId());
|
|
|
CustomerHomeDTO initHomeForm = new CustomerHomeDTO(); |
|
|
//if (!initResult.success()) {
|
|
|
initHomeForm.setCustomerId(formDTO.getCustomerId()); |
|
|
// throw new RenException("客户新增:调用user服务为客户初始化角色数据失败:".concat(initResult.toString()));
|
|
|
Result initHomeResult = operCustomizeFeignClient.init(initHomeForm); |
|
|
//}
|
|
|
if (!initHomeResult.success()) { |
|
|
//
|
|
|
throw new RenException("初始化客户首页数据失败:".concat(initHomeResult.getInternalMsg())); |
|
|
////4.调用oper-customize服务,初始化客户定制化首页模板数据
|
|
|
} |
|
|
//CustomerHomeDTO initHomeForm = new CustomerHomeDTO();
|
|
|
|
|
|
//initHomeForm.setCustomerId(formDTO.getCustomerId());
|
|
|
//5.调用gov-org服务,初始化客户根级组织信息、客户管理员信息
|
|
|
//Result initHomeResult = operCustomizeFeignClient.init(initHomeForm);
|
|
|
AddAgencyAndStaffFormDTO agencyAndStaff = new AddAgencyAndStaffFormDTO(); |
|
|
//if (!initHomeResult.success()) {
|
|
|
//客户组织信息
|
|
|
// throw new RenException("初始化客户首页数据失败:".concat(initHomeResult.getInternalMsg()));
|
|
|
CustomerAgencyDTO agencyDTO = new CustomerAgencyDTO(); |
|
|
//}
|
|
|
agencyDTO.setId(paAgency.getId()); |
|
|
//
|
|
|
agencyDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
////5.调用gov-org服务,初始化客户根级组织信息、客户管理员信息
|
|
|
agencyDTO.setOrganizationName(paAgency.getAgencyName()); |
|
|
//AddAgencyAndStaffFormDTO agencyAndStaff = new AddAgencyAndStaffFormDTO();
|
|
|
agencyDTO.setLevel(paAgency.getLevel()); |
|
|
////客户组织信息
|
|
|
agencyDTO.setAreaCode(paAgency.getAreaCode()); |
|
|
//CustomerAgencyDTO agencyDTO = new CustomerAgencyDTO();
|
|
|
agencyDTO.setProvince(paAgency.getProvince()); |
|
|
//agencyDTO.setId(paAgency.getId());
|
|
|
agencyDTO.setCity(paAgency.getCity()); |
|
|
//agencyDTO.setCustomerId(formDTO.getCustomerId());
|
|
|
agencyDTO.setDistrict(paAgency.getDistrict()); |
|
|
//agencyDTO.setOrganizationName(paAgency.getAgencyName());
|
|
|
agencyAndStaff.setAgencyDTO(agencyDTO); |
|
|
//agencyDTO.setLevel(paAgency.getLevel());
|
|
|
|
|
|
//agencyDTO.setAreaCode(paAgency.getAreaCode());
|
|
|
//客户管理员信息
|
|
|
//agencyDTO.setProvince(paAgency.getProvince());
|
|
|
AdminStaffFromDTO staffSubmitFrom = new AdminStaffFromDTO(); |
|
|
//agencyDTO.setCity(paAgency.getCity());
|
|
|
staffSubmitFrom.setCustomerId(formDTO.getCustomerId()); |
|
|
//agencyDTO.setDistrict(paAgency.getDistrict());
|
|
|
staffSubmitFrom.setAgencyId(paAgency.getId()); |
|
|
//agencyAndStaff.setAgencyDTO(agencyDTO);
|
|
|
staffSubmitFrom.setGender(Integer.parseInt(paUser.getGender())); |
|
|
//
|
|
|
staffSubmitFrom.setMobile(paUser.getPhone()); |
|
|
////客户管理员信息
|
|
|
staffSubmitFrom.setName(paUser.getRealName()); |
|
|
//AdminStaffFromDTO staffSubmitFrom = new AdminStaffFromDTO();
|
|
|
staffSubmitFrom.setWorkType(UserWorkType.FULL_TIME); |
|
|
//staffSubmitFrom.setCustomerId(formDTO.getCustomerId());
|
|
|
agencyAndStaff.setStaffDTO(staffSubmitFrom); |
|
|
//staffSubmitFrom.setAgencyId(paAgency.getId());
|
|
|
|
|
|
//staffSubmitFrom.setGender(Integer.parseInt(paUser.getGender()));
|
|
|
Result agencyResult = govOrgOpenFeignClient.saveRootAgency(agencyAndStaff); |
|
|
//staffSubmitFrom.setMobile(paUser.getPhone());
|
|
|
if (!agencyResult.success()) { |
|
|
//staffSubmitFrom.setName(paUser.getRealName());
|
|
|
throw new RenException(agencyResult.getCode(), agencyResult.getInternalMsg()); |
|
|
//staffSubmitFrom.setWorkType(UserWorkType.FULL_TIME);
|
|
|
} |
|
|
//agencyAndStaff.setStaffDTO(staffSubmitFrom);
|
|
|
|
|
|
//
|
|
|
|
|
|
//Result agencyResult = govOrgOpenFeignClient.saveRootAgency(agencyAndStaff);
|
|
|
|
|
|
//if (!agencyResult.success()) {
|
|
|
|
|
|
// throw new RenException(agencyResult.getCode(), agencyResult.getInternalMsg());
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//6.更新第三方数据库中客户数据状态为已初始化
|
|
|
//6.更新第三方数据库中客户数据状态为已初始化
|
|
|
String customerUrl = "https://epmet-cloud.elinkservice.cn/api/third/pacustomer/updatecustomer/" + formDTO.getCustomerId(); |
|
|
String customerUrl = "https://epmet-cloud.elinkservice.cn/api/third/pacustomer/updatecustomer/" + formDTO.getCustomerId(); |
|
|