Commit cec9170b by 徐高华

社群群发

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