| | |
| | | queryWrapper.eq(ShopTask::getTaskStatus,1); |
| | | queryWrapper.eq(ShopTask::getTaskDate,DateUtils.getDate()); |
| | | if(null != userIds && userIds.size() > 0){ |
| | | List<Shop> list = shopService.list(new QueryWrapper<Shop>().eq("del_flag", 0).in("belong_user_id", userIds)); |
| | | List<Shop> list = shopService.list(new QueryWrapper<Shop>().eq("del_flag", 0) |
| | | .in("belong_user_id", userIds)); |
| | | List<Long> collect = list.stream().map(Shop::getShopId).collect(Collectors.toList()); |
| | | queryWrapper.in(ShopTask::getShopId, collect); |
| | | } |
| | |
| | | Long userId; |
| | | SysStaff sysStaff; |
| | | HashSet<Long> userIdSet = new HashSet<>(); |
| | | HashSet<Long> createUserIdSet = new HashSet<>(); |
| | | for(StaffShopTaskPageVo staffShopTaskPageVo : shopTaskPageVoList){ |
| | | userIdSet.add(staffShopTaskPageVo.getUserId()); |
| | | if(null != staffShopTaskPageVo.getCreateUserId()){ |
| | | createUserIdSet.add(staffShopTaskPageVo.getCreateUserId()); |
| | | } |
| | | } |
| | | List<Long> useIdList = new ArrayList<>(userIdSet); |
| | | List<Long> createUserIdList = new ArrayList<>(createUserIdSet); |
| | | List<SysStaff> sysStaffList = remoteConfigService.listSysStaffByIds(useIdList).getData(); |
| | | Map<Long,SysStaff> sysStaffMap = sysStaffList.stream() |
| | | .collect(Collectors.toMap(SysStaff::getUserId, Function.identity())); |
| | | |
| | | createUserIdList.add(-1L); |
| | | List<SysStaff> sysStaffList1 = remoteConfigService.listSysStaffByIds(createUserIdList).getData(); |
| | | Map<Long,SysStaff> sysStaffMap1 = sysStaffList1.stream() |
| | | .collect(Collectors.toMap(SysStaff::getUserId, Function.identity())); |
| | | for(StaffShopTaskPageVo staffShopTaskPageVo : shopTaskPageVoList){ |
| | | //获取任务用户信息 |
| | | userId = staffShopTaskPageVo.getUserId(); |
| | | if(userId!=null){ |
| | | sysStaff = sysStaffMap.get(userId); |
| | | staffShopTaskPageVo.setUserName(sysStaff.getStaffName()); |
| | | staffShopTaskPageVo.setUserPicture(sysStaff.getStaffAvatar()); |
| | | staffShopTaskPageVo.setUserPosition(sysStaff.getStaffPost()); |
| | | if(null != sysStaff){ |
| | | staffShopTaskPageVo.setUserName(sysStaff.getStaffName()); |
| | | staffShopTaskPageVo.setUserPicture(sysStaff.getStaffAvatar()); |
| | | staffShopTaskPageVo.setUserPosition(sysStaff.getStaffPost()); |
| | | } |
| | | }else{ |
| | | if(null != staffShopTaskPageVo.getCreateUserId()){ |
| | | sysStaff = sysStaffMap1.get(staffShopTaskPageVo.getCreateUserId()); |
| | | staffShopTaskPageVo.setUserName(sysStaff.getStaffName()); |
| | | staffShopTaskPageVo.setUserPicture(sysStaff.getStaffAvatar()); |
| | | staffShopTaskPageVo.setUserPosition(sysStaff.getStaffPost()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | }else{ |
| | | shopTask.setTaskStatus(3); |
| | | } |
| | | shopTask.setCreateUserId(staffAddTaskDto.getUserId()); |
| | | this.saveOrUpdate(shopTask); |
| | | } |
| | | |