Browse Source

客户初始化暂时放开MQ

dev_shibei_match
sunyuchao 5 years ago
parent
commit
82c516d8b6
  1. 2
      epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml
  2. 2
      epmet-module/oper-crm/oper-crm-server/pom.xml
  3. 86
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

2
epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-crm-server:
container_name: oper-crm-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.76
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.77
ports:
- "8090:8090"
network_mode: host # 使用现有网络

2
epmet-module/oper-crm/oper-crm-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.76</version>
<version>0.3.77</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>oper-crm</artifactId>

86
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

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

Loading…
Cancel
Save