Commit fce368a6 by 徐高华

朋友圈-只处理主门店导购

parent d9f411c0
......@@ -22,10 +22,12 @@ import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanAttendMapper;
import com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanMapper;
import com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlan;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend;
import com.gic.haoban.manage.service.pojo.ClerkStaffBO;
import com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanService;
......@@ -69,6 +71,8 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
private PendingTaskService pendingTaskService ;
@Autowired
private HaobanCommonMQApiService haobanCommonMQApiService ;
@Autowired
private ClerkMainStoreRelatedService clerkMainStoreRelatedService ;
@Override
public ServiceResponse<Page<QwMomentPlanAttendDTO>> attendList(PlanClerkListQDTO qdto) {
......@@ -167,10 +171,15 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
String cid = dto.getClerkId() ;
String sid = dto.getStaffId() ;
if(map.get(cid) != null && map.get(cid).equals(sid)) {
successList.add(cid) ;
}else {
this.qwMomentPlanAttendMapper.updateSuccessStaff(plan.getPlanId(),cid,map.get(cid));
}
TabHaobanClerkMainStoreRelated tab =this.clerkMainStoreRelatedService.getMainStoreByStaffId(sid,plan.getWxEnterpriseId()) ;
if(null == tab || !tab.getStoreId().equals(dto.getStoreId())) {
this.qwMomentPlanAttendMapper.updateFail(plan.getPlanId(), clerkIdList,"任务下发时不是主门店");
continue;
}
successList.add(cid) ;
}
if(CollectionUtils.isNotEmpty(successList)) {
this.qwMomentPlanAttendMapper.updateSuccess(plan.getPlanId(), successList);
......
......@@ -32,12 +32,14 @@ import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanAttendMapper;
import com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanMapper;
import com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlan;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend;
import com.gic.haoban.manage.service.pojo.ClerkStaffBO;
import com.gic.haoban.manage.service.pojo.bo.PendingTaskBO;
import com.gic.haoban.manage.service.pojo.bo.moment.CountBO;
import com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService;
import com.gic.haoban.manage.service.service.QywxSendService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService;
......@@ -102,6 +104,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
private HaobanCommonMQApiService haobanCommonMQApiService ;
@Autowired
private PendingTaskService pendingTaskService ;
@Autowired
private ClerkMainStoreRelatedService clerkMainStoreRelatedService ;
private static GicMQClient mqClient = GICMQClientUtil.getClientInstance();
......@@ -317,7 +321,10 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
storeIdList = this.getStoreIdList(clerkDTO) ;
}
List<StaffClerkRelationDTO> list = this.staffClerkRelationApiService.listByStoreIds(plan.getWxEnterpriseId() , storeIdList) ;
List<ClerkStaffBO> clerkIdList = list.stream().map(o->{
List<ClerkStaffBO> clerkIdList = list.stream().filter(o->{
TabHaobanClerkMainStoreRelated tab = this.clerkMainStoreRelatedService.getMainStoreByStaffId(o.getStaffId(),plan.getWxEnterpriseId()) ;
return tab != null && tab.getStoreId().equals(o.getStoreId()) ;
}).map(o->{
ClerkStaffBO bo = new ClerkStaffBO() ;
bo.setClerkId(o.getClerkId());
bo.setStaffId(o.getStaffId());
......@@ -328,6 +335,7 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
logger.info("管理员列表={}",userIdList);
clerkIdList.stream().filter(o->!userIdList.contains(o)).collect(Collectors.toList()) ;
logger.info("导购数量={}",clerkIdList.size());
this.qwMomentPlanAttendService.saveClerk(plan.getWxEnterpriseId(),plan.getEnterpriseId(),planId, clerkIdList , 1);
this.qwMomentPlanMapper.updateClerkNum(planId,clerkIdList.size(),-1,-1);
}
......
......@@ -73,9 +73,11 @@ public class MomentTest {
dto.setSelectClerkIdList(clerkIds);
this.qwMomentApiService.save(dto) ;*/
Long planId = 772924621895778364L ;
/* Long planId = 772924621895778364L ;
TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(planId) ;
this.qwMomentPlanService.sendToQiwei(plan);
this.qwMomentPlanService.sendToQiwei(plan);*/
this.qwMomentPlanService.qwDataTimer("2");
}
......
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