| | |
| | | @Override |
| | | public AppXpCruiseCheckInRuleVo getMyXpCruiseCheckInRule(Long uid) { |
| | | List<XpCruiseCheckInRule> list = this.list(new LambdaQueryWrapper<XpCruiseCheckInRule>().eq(XpCruiseCheckInRule::getDeleted, 0) |
| | | .apply("find_in_set({0}, operations_user_id)", uid).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; |
| | | } |
| | |
| | | public Long saveCruiseCheckInRecord(XpCruiseCheckInRecord dto) { |
| | | Long checkLocationId = dto.getCheckLocationId(); |
| | | List<XpCruiseCheckInRule> list = this.list(new LambdaQueryWrapper<XpCruiseCheckInRule>().eq(XpCruiseCheckInRule::getDeleted, 0) |
| | | .apply("find_in_set({0}, operations_user_id)", dto.getOperationsUserId()).last(" and (now() BETWEEN start_time and end_time or cyclic_mode = 1)")); |
| | | .eq(XpCruiseCheckInRule::getOperationsUserId, dto.getOperationsUserId()).last(" and (now() BETWEEN start_time and end_time or cyclic_mode = 1)")); |
| | | if(list.isEmpty()){ |
| | | return null; |
| | | } |
| | |
| | | long count = xpCruiseCheckInRuleLocationService.count(new LambdaQueryWrapper<XpCruiseCheckInRuleLocation>() |
| | | .eq(XpCruiseCheckInRuleLocation::getCruiseCheckInRuleId, cruiseCheckInRuleListPage.getId())); |
| | | cruiseCheckInRuleListPage.setPointNum(count); |
| | | List<XpOperationsUser> xpOperationsUser = xpOperationsUserClient.queryByIds(cruiseCheckInRuleListPage.getOperationsUserId()).getData(); |
| | | cruiseCheckInRuleListPage.setUserName(xpOperationsUser.stream().map(XpOperationsUser::getNickName).collect(Collectors.toList())); |
| | | cruiseCheckInRuleListPage.setPhone(xpOperationsUser.stream().map(XpOperationsUser::getPhoneNumber).collect(Collectors.toList())); |
| | | cruiseCheckInRuleListPage.setRoleName(xpOperationsUser.stream().map(XpOperationsUser::getRoleName).collect(Collectors.toList())); |
| | | XpOperationsUser xpOperationsUser = xpOperationsUserClient.queryById(cruiseCheckInRuleListPage.getOperationsUserId()).getData(); |
| | | cruiseCheckInRuleListPage.setUserName(xpOperationsUser.getNickName()); |
| | | cruiseCheckInRuleListPage.setPhone(xpOperationsUser.getPhoneNumber()); |
| | | cruiseCheckInRuleListPage.setRoleName(xpOperationsUser.getRoleName()); |
| | | } |
| | | return xpCruiseCheckInRuleListPage; |
| | | } |