|
|
@ -18,6 +18,7 @@ |
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
@ -35,8 +36,10 @@ import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.entity.CustomerAgencyEntity; |
|
|
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.redis.CustomerAgencyRedis; |
|
|
|
import com.epmet.send.SendMqMsgUtil; |
|
|
|
import com.epmet.service.AgencyService; |
|
|
|
import com.epmet.service.CustomerAgencyService; |
|
|
|
import com.epmet.service.CustomerOrgParameterService; |
|
|
@ -80,6 +83,8 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
private CustomerOrgParameterService customerOrgParameterService; |
|
|
|
@Autowired |
|
|
|
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@ -176,6 +181,16 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
|
|
|
|
//5.redis缓存
|
|
|
|
customerAgencyRedis.delete(formDTO.getAgencyId()); |
|
|
|
|
|
|
|
//2021-10-18 推送mq,数据同步到中介库 start【中介库只放了组织的名称、级别,所以涉及批量修改pname的操作不涉及同步中间库】
|
|
|
|
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); |
|
|
|
mq.setCustomerId(originalEntity.getCustomerId()); |
|
|
|
mq.setOrgId(formDTO.getAgencyId()); |
|
|
|
mq.setOrgType("agency"); |
|
|
|
mq.setType("agency_change"); |
|
|
|
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); |
|
|
|
//2021-10-18 end
|
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
@ -215,6 +230,16 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
log.error(CustomerAgencyConstant.DEL_EXCEPTION); |
|
|
|
throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); |
|
|
|
} |
|
|
|
|
|
|
|
//2021-10-18 推送mq,数据同步到中介库 start
|
|
|
|
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); |
|
|
|
mq.setCustomerId(formDTO.getCustomerId()); |
|
|
|
mq.setOrgId(formDTO.getAgencyId()); |
|
|
|
mq.setOrgType("agency"); |
|
|
|
mq.setType("agency_change"); |
|
|
|
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); |
|
|
|
//2021-10-18 end
|
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
@ -370,6 +395,16 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
entity.setTotalUser(0); |
|
|
|
entity.setCustomerId(form.getCustomerId()); |
|
|
|
customerAgencyDao.insert(entity); |
|
|
|
|
|
|
|
//2021-10-18 推送mq,数据同步到中介库 start
|
|
|
|
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); |
|
|
|
mq.setCustomerId(form.getCustomerId()); |
|
|
|
mq.setOrgId(entity.getId()); |
|
|
|
mq.setOrgType("agency"); |
|
|
|
mq.setType("agency_create"); |
|
|
|
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); |
|
|
|
//2021-10-18 end
|
|
|
|
|
|
|
|
return entity.getId(); |
|
|
|
} |
|
|
|
|
|
|
@ -430,6 +465,15 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_MANAGER_ERROR.getCode(), staffResult.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
//2021-10-18 推送mq,数据同步到中介库 start
|
|
|
|
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); |
|
|
|
mq.setCustomerId(agencyDTO.getCustomerId()); |
|
|
|
mq.setOrgId(entity.getId()); |
|
|
|
mq.setOrgType("agency"); |
|
|
|
mq.setType("agency_create"); |
|
|
|
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); |
|
|
|
//2021-10-18 end
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -474,6 +518,15 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
//3:返回新组织Id
|
|
|
|
resultDTO.setAgencyId(insertEntity.getId()); |
|
|
|
resultDTO.setAreaCode(insertEntity.getAreaCode()); |
|
|
|
|
|
|
|
//2021-10-18 推送mq,数据同步到中介库 start
|
|
|
|
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); |
|
|
|
mq.setCustomerId(parent.getCustomerId()); |
|
|
|
mq.setOrgId(insertEntity.getId()); |
|
|
|
mq.setOrgType("agency"); |
|
|
|
mq.setType("agency_create"); |
|
|
|
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); |
|
|
|
//2021-10-18 end
|
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|