Commit b9980c60 by fudahua

绑定的时候需要判断是否门店下有或者以及在审核中

parent 71f5e8a5
......@@ -6,10 +6,12 @@ import com.gic.binlog.base.entity.GicRecord;
import com.gic.binlog.base.entity.enums.GicRecordType;
import com.gic.commons.util.EntityUtil;
import com.gic.dubbo.entity.ProviderLocalTag;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.contacts.manage.api.enums.StatusEnum;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.service.pojo.BinlogBasePojo;
import com.gic.haoban.manage.service.pojo.ClerkSyncPojo;
import com.gic.haoban.manage.service.service.StaffClerkBindLogService;
......@@ -43,6 +45,9 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
@Autowired
private StaffClerkBindLogService staffClerkBindLogService;
@Autowired
private StaffClerkRelationApiService staffClerkRelationApiService;
@Override
......@@ -114,14 +119,16 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
staffClerkRelationService.delBind(relationDTO.getClerkId(),"-1", ChannelCodeEnum.SYNC_UNBIND.getCode());
relationDTO.setClerkId(syncPojo.getClerkId());
relationDTO.setStoreId(syncPojo.getStoreId());
staffClerkRelationService.bind(relationDTO,"-1", ChannelCodeEnum.SYNC_BIND.getCode());
ServiceResponse response = staffClerkRelationApiService.bindStaffClerk(relationDTO, "-1", ChannelCodeEnum.SYNC_BIND.getCode());
logger.info("绑定结果正常:{}",JSONObject.toJSONString(response));
}else {//删除状态 需要判断是否近段时间有操作删除 2分组内有更新 判断是转移操作
Date timeDiff = DateUtils.addMinutes(new Date(), -2);
if(relationDTO.getUpdateTime().after(timeDiff)){
staffClerkRelationService.delBind(relationDTO.getClerkId(),"-1", ChannelCodeEnum.SYNC_UNBIND.getCode());
relationDTO.setClerkId(syncPojo.getClerkId());
relationDTO.setStoreId(syncPojo.getStoreId());
staffClerkRelationService.bind(relationDTO,"-1", ChannelCodeEnum.SYNC_BIND.getCode());
ServiceResponse response = staffClerkRelationApiService.bindStaffClerk(relationDTO, "-1", ChannelCodeEnum.SYNC_BIND.getCode());
logger.info("绑定结果:{}",JSONObject.toJSONString(response));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment