|
|
|
@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.kiisoo.ic.config.WxCpConfiguration;
|
|
|
|
|
import com.kiisoo.ic.employee.entity.PrivilageCpUserDO;
|
|
|
|
|
import com.kiisoo.ic.employee.mapper.PrivilageCpUserDOMapper;
|
|
|
|
|
import com.kiisoo.ic.generalize.entity.PoiCustomerContactDataStat;
|
|
|
|
|
import com.kiisoo.ic.generalize.mapper.PoiCustomerContactDataStatMapper;
|
|
|
|
|
import com.kiisoo.ic.store.constant.Constants;
|
|
|
|
@ -42,6 +44,7 @@ public class BehaviorDTOMessageGroupConsumer implements WorkHandler<BehaviorDTOM
|
|
|
|
|
PrivilageCpUserStoreDOMapper privilageCpUserStoreDOMapper = behaviorDtoMessage.getPrivilageCpUserStoreDOMapper();
|
|
|
|
|
PoiCustomerContactDataStatMapper poiCustomerContactDataStatMapper = behaviorDtoMessage.getPoiCustomerContactDataStatMapper();
|
|
|
|
|
StorePromotionDataDOMapper storePromotionDataDOMapper = behaviorDtoMessage.getStorePromotionDataDOMapper();
|
|
|
|
|
PrivilageCpUserDOMapper privilageCpUserDOMapper = behaviorDtoMessage.getPrivilageCpUserDOMapper();
|
|
|
|
|
|
|
|
|
|
wxCpService = WxCpConfiguration.getCpService(APPLICATIONID);
|
|
|
|
|
WxCpExternalContactService externalContactService = wxCpService.getExternalContactService();
|
|
|
|
@ -50,6 +53,12 @@ public class BehaviorDTOMessageGroupConsumer implements WorkHandler<BehaviorDTOM
|
|
|
|
|
Long storeId = privilageCpUserStoreDOMapper.selectOneByCpUserId(cpUserId);
|
|
|
|
|
Long regionId = null;
|
|
|
|
|
|
|
|
|
|
if (storeId == null){
|
|
|
|
|
QueryWrapper<PrivilageCpUserDO> qw = new QueryWrapper<>();
|
|
|
|
|
qw.eq("cp_user_id",cpUserId).last("limit 1");
|
|
|
|
|
regionId = privilageCpUserDOMapper.selectOne(qw).getId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WxCusInfoReqDO wxCusInfoReqDO = new WxCusInfoReqDO();
|
|
|
|
|
wxCusInfoReqDO.setAccess_token(wxCpService.getAccessToken());
|
|
|
|
|
wxCusInfoReqDO.setUserid(cpUserId);
|
|
|
|
@ -66,7 +75,11 @@ public class BehaviorDTOMessageGroupConsumer implements WorkHandler<BehaviorDTOM
|
|
|
|
|
wxCusInfoRespDO.setStatTime(statDate);
|
|
|
|
|
|
|
|
|
|
QueryWrapper<PoiCustomerContactDataStat> qw = new QueryWrapper();
|
|
|
|
|
qw.eq("store_id", storeId).eq("region_id", regionId).eq("stat_time", statDate).last("limit 1");
|
|
|
|
|
if (storeId == null && regionId !=null){
|
|
|
|
|
qw.isNull("store_id").eq("region_id", regionId).eq("stat_time", statDate).last("limit 1");
|
|
|
|
|
}else if (regionId == null && storeId !=null){
|
|
|
|
|
qw.eq("store_id",storeId).isNull("region_id").eq("stat_time", statDate).last("limit 1");
|
|
|
|
|
}
|
|
|
|
|
PoiCustomerContactDataStat poiCustomerContactDataStat = poiCustomerContactDataStatMapper.selectOne(qw);
|
|
|
|
|
int syncRes = 0;
|
|
|
|
|
if (poiCustomerContactDataStat == null) {
|
|
|
|
|