Commit 57ec403a by 墨竹

fix:kafka导购删除去除

parent 59a9bd31
...@@ -4,10 +4,8 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,10 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.gic.binlog.base.entity.GicField; import com.gic.binlog.base.entity.GicField;
import com.gic.binlog.base.entity.GicRecord; import com.gic.binlog.base.entity.GicRecord;
import com.gic.binlog.base.entity.enums.GicRecordType; import com.gic.binlog.base.entity.enums.GicRecordType;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.dubbo.entity.ProviderLocalTag; import com.gic.dubbo.entity.ProviderLocalTag;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.FlushStoreMqDTO; import com.gic.haoban.manage.api.dto.FlushStoreMqDTO;
...@@ -22,7 +20,6 @@ import com.gic.haoban.manage.service.pojo.GroupSyncPojo; ...@@ -22,7 +20,6 @@ import com.gic.haoban.manage.service.pojo.GroupSyncPojo;
import com.gic.haoban.manage.service.pojo.StoreSyncPojo; import com.gic.haoban.manage.service.pojo.StoreSyncPojo;
import com.gic.haoban.manage.service.service.StaffClerkRelationService; import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StoreRangeService; import com.gic.haoban.manage.service.service.StoreRangeService;
import com.gic.haoban.task.api.dto.MqMessageQo;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -79,39 +76,7 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor ...@@ -79,39 +76,7 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
logger.error("binlog数据为空"); logger.error("binlog数据为空");
return; return;
} }
if (record.value().getTableName().equals(CLERK)) { if (record.value().getTableName().equals(GROUP)) {
ClerkSyncPojo syncPojo = (ClerkSyncPojo) pojo;
dealClerk(syncPojo);
//发消息处理新增店长,任务重新分配问题
GicRecordType gicRecordType = GicRecordType.valueOf(syncPojo.getRecordType());
if (gicRecordType.equals(GicRecordType.INSERT)
|| gicRecordType.equals(GicRecordType.UPDATE)) {
//新增,更新某个人为店长
String clerkId = syncPojo.getClerkId();
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO == null) {
logger.error("导购为空,clerkId:{}", clerkId);
return;
}
Integer clerkType = clerkDTO.getClerkType();
if (clerkType != null && clerkType == 1) {
//发消息处理新增店长,任务重新分配问题
try {
logger.info("待分配任务重分配======>{}", clerkId);
MqMessageQo mqMessageQo = new MqMessageQo();
//任务分配给店长
mqMessageQo.setType(MqMessageQo.DISTRIBUTE_TASK);
mqMessageQo.setData(clerkId);
String s = JSONObject.toJSONString(mqMessageQo);
GICMQClientUtil.getClientInstance().sendCommonMessage(RouterConstant.ROUTERTYPE, s,
"com.gic.haoban.task.api.service.MqAsynApiService", "run");
} catch (Exception e) {
logger.error("任务重新分配问题发送消息队列出错",e);
}
}
}
}
else if (record.value().getTableName().equals(GROUP)) {
//分组 //分组
dealStoreGroup((GroupSyncPojo) pojo); dealStoreGroup((GroupSyncPojo) pojo);
} }
......
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