|
|
|
@ -6,6 +6,7 @@ import com.kiisoo.ic.store.entity.PrivilageCpUserStoreDO;
|
|
|
|
|
import com.kiisoo.ic.store.mapper.PoiStoreStaffDOMapper;
|
|
|
|
|
import com.kiisoo.ic.synchronous.entity.TurnBackDTO;
|
|
|
|
|
import com.kiisoo.ic.synchronous.entity.WxDataDTO;
|
|
|
|
|
import com.kiisoo.ic.wx.service.QWMailListManageService;
|
|
|
|
|
import com.lmax.disruptor.EventHandler;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import me.chanjar.weixin.cp.bean.WxCpUserExternalContactInfo;
|
|
|
|
@ -29,6 +30,9 @@ public class DTOMessageHandler implements EventHandler<DTOMessage> {
|
|
|
|
|
@Autowired
|
|
|
|
|
private CustomerService customerService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private QWMailListManageService qwMailListManageService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 处理事件, 如入库操作
|
|
|
|
|
* @param dtoMessage
|
|
|
|
@ -42,7 +46,15 @@ public class DTOMessageHandler implements EventHandler<DTOMessage> {
|
|
|
|
|
dtoMessage.setId(UUID.randomUUID().toString());
|
|
|
|
|
String cpUserId = dtoMessage.getCpUserId();
|
|
|
|
|
PrivilageCpUserStoreDO cpUserStoreDO = dtoMessage.getPrivilageCpUserStoreDO();
|
|
|
|
|
List<WxCpUserExternalContactInfo> customers = dtoMessage.getCustomers();
|
|
|
|
|
List<WxCpUserExternalContactInfo> customers = null;
|
|
|
|
|
try {
|
|
|
|
|
customers = qwMailListManageService.getCustomer(cpUserId);
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
log.error("查询联系人失败:"+cpUserId,e);
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtils.isNotEmpty(customers)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
for (WxCpUserExternalContactInfo customer:customers){
|
|
|
|
|
TurnBackDTO turnBackDTO = new TurnBackDTO();
|
|
|
|
|
|
|
|
|
|