Commit cec9170b by 徐高华

社群群发

parent 03943e1a
......@@ -15,7 +15,7 @@ public interface GroupChatPlanOwnerLogService {
public void batchAdd(String staffIdList, TabGroupChatPlan entity);
public void update(TabGroupChatPlanOwnerLog entity);
public boolean update(TabGroupChatPlanOwnerLog entity);
public void deleteByStaffIds(Long planId, String delStaffIds);
......
......@@ -135,28 +135,33 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
}
@Override
public void update(TabGroupChatPlanOwnerLog entity) {
public boolean update(TabGroupChatPlanOwnerLog entity) {
String staffId = entity.getStaffId();
TabHaobanClerkMainStoreRelated mainStore = this.clerkMainStoreRelatedService.getMainStoreByStaffId(staffId,
entity.getWxEnterpriseId());
boolean flag = true ;
if (null == mainStore) {
entity.setRemark("区经/未配置主门店");
flag = false ;
} else {
String storeId = mainStore.getStoreId();
StaffClerkRelationDTO clerk = this.staffClerkRelationService.getOneBindByStoreId(staffId, storeId);
if (null != clerk) {
if (!clerk.getEnterpriseId().equals(entity.getEnterpriseId())) {
entity.setRemark("主门店不在任务商户下");
flag = false ;
} else {
entity.setClerkId(clerk.getClerkId());
entity.setStoreId(mainStore.getStoreId());
}
} else {
entity.setRemark("无关联导购");
flag = false ;
logger.info("导购关联数据不存在,staffid={},storeid={}", staffId, mainStore.getStoreId());
}
}
this.groupChatPlanOwnerLogMapper.update(entity);
return flag ;
}
@Override
......
......@@ -393,7 +393,6 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
int pageNum = 0;
if(plan.getExecType() == 1) {
logger.info("好办小程序执行={}",planId);
// 发送消息
while (true) {
ownerList = this.groupChatPlanOwnerLogMapper.listForDoPlan(planId, pageNum * pageSize, pageSize);
if (CollectionUtils.isEmpty(ownerList)) {
......@@ -401,7 +400,11 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
}
pageNum++;
for (TabGroupChatPlanOwnerLog ownerLog : ownerList) {
boolean flag = this.groupChatPlanOwnerLogService.update(ownerLog);
if(flag) {
// 发送消息
}
}
}
return;
......
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