| | |
| | | @Resource |
| | | private XpOperationUserClient xpOperationsUserClient; |
| | | |
| | | @Resource |
| | | private XpCruiseCheckInRuleOperationsUserMapper xpCruiseCheckInRuleOperationsUserMapper; |
| | | |
| | | |
| | | |
| | |
| | | @Override |
| | | public AppXpCruiseCheckInRuleVo getMyXpCruiseCheckInRule(Long uid) { |
| | | List<XpCruiseCheckInRule> list = this.list(new LambdaQueryWrapper<XpCruiseCheckInRule>().eq(XpCruiseCheckInRule::getDeleted, 0) |
| | | .last(" and (now() BETWEEN start_time and end_time or cyclic_mode = 1)")); |
| | | .eq(XpCruiseCheckInRule::getOperationsUserId, uid).last(" and (now() BETWEEN start_time and end_time or cyclic_mode = 1)")); |
| | | if(list.isEmpty()){ |
| | | return null; |
| | | } |
| | |
| | | List<XpOperationsUser> data = xpOperationsUserClient.getByPhoneNumber(dto.getPhoneNumber()).getData(); |
| | | ids.addAll(data.stream().map(XpOperationsUser::getId).collect(Collectors.toList())); |
| | | } |
| | | if(!ids.isEmpty()){ |
| | | List<XpCruiseCheckInRuleOperationsUser> operationsUserId = xpCruiseCheckInRuleOperationsUserMapper.selectList(new QueryWrapper<XpCruiseCheckInRuleOperationsUser>().in("operations_user_id", ids)); |
| | | List<Integer> ruleIds = operationsUserId.stream().map(XpCruiseCheckInRuleOperationsUser::getCruiseCheckInRuleId).collect(Collectors.toList()); |
| | | dto.setIds(ruleIds); |
| | | } |
| | | dto.setOperationsUserIds(ids); |
| | | List<XpCruiseCheckInRuleListPage> xpCruiseCheckInRuleListPage = this.baseMapper.getXpCruiseCheckInRuleListPage(pageInfo, dto); |
| | | for (XpCruiseCheckInRuleListPage cruiseCheckInRuleListPage : xpCruiseCheckInRuleListPage) { |
| | | long count = xpCruiseCheckInRuleLocationService.count(new LambdaQueryWrapper<XpCruiseCheckInRuleLocation>() |
| | | .eq(XpCruiseCheckInRuleLocation::getCruiseCheckInRuleId, cruiseCheckInRuleListPage.getId())); |
| | | cruiseCheckInRuleListPage.setPointNum(count); |
| | | XpOperationsUser xpOperationsUser = xpOperationsUserClient.queryById(cruiseCheckInRuleListPage.getOperationsUserId()).getData(); |
| | | cruiseCheckInRuleListPage.setUserName(xpOperationsUser.getNickName()); |
| | | cruiseCheckInRuleListPage.setPhone(xpOperationsUser.getPhoneNumber()); |
| | | cruiseCheckInRuleListPage.setRoleName(xpOperationsUser.getRoleName()); |
| | | } |
| | | return xpCruiseCheckInRuleListPage; |
| | | } |
| | | |
| | |
| | | XpCruiseCheckInRule xpCruiseCheckInRule = new XpCruiseCheckInRule(); |
| | | BeanUtils.copyProperties(dto, xpCruiseCheckInRule); |
| | | xpCruiseCheckInRule.setDeleted(false); |
| | | xpCruiseCheckInRule.setOperationsUserId(dto.getRelationId()); |
| | | this.save(xpCruiseCheckInRule); |
| | | dto.getPoints().forEach(s->{ |
| | | s.setCruiseCheckInRuleId(xpCruiseCheckInRule.getId()); |
| | | }); |
| | | xpCruiseCheckInRuleLocationService.saveBatch(dto.getPoints()); |
| | | Long relationId = dto.getRelationId(); |
| | | |
| | | XpCruiseCheckInRuleOperationsUser xpCruiseCheckInRuleOperationsUser = new XpCruiseCheckInRuleOperationsUser(); |
| | | xpCruiseCheckInRuleOperationsUser.setCruiseCheckInRuleId(xpCruiseCheckInRule.getId()); |
| | | xpCruiseCheckInRuleOperationsUser.setOperationsUserId(relationId); |
| | | xpCruiseCheckInRuleOperationsUserMapper.insert(xpCruiseCheckInRuleOperationsUser); |
| | | } |
| | | |
| | | |