Commit 88c7675ef44dd34cfac6d08107006874d2e89016
1 parent
09e06927
酒测未通过审核
Showing
6 changed files
with
48 additions
and
0 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/sign/in/exception/report/EquipmentExceptionReportController.java
| ... | ... | @@ -54,6 +54,25 @@ public class EquipmentExceptionReportController extends BaseController { |
| 54 | 54 | @ApiOperation("分页查询-用于对外") |
| 55 | 55 | @PostMapping(value = "/list/limit/contact/{page}/{pageLimit}") |
| 56 | 56 | public IPage<EquipmentExceptionReportVO> listLimitOfContact(@RequestBody EquipmentExceptionReportQueryDTO request, @ModelAttribute OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) { |
| 57 | + if (!Objects.equals("1", request.getSupperAuh())) { | |
| 58 | + Set<String> driverJobs = new HashSet<>(); | |
| 59 | + NewDriver driver = driverService.getOneByPhone(request.getTelPhone()); | |
| 60 | + if (Objects.isNull(driver)) { | |
| 61 | + logger.error("没有查到用户信息:[{}]", request); | |
| 62 | + return null; | |
| 63 | + } | |
| 64 | + NewDriver d1 = new NewDriver(); | |
| 65 | + d1.setFleetName(driver.getFleetName()); | |
| 66 | + List<NewDriver> drivers1 = driverService.list(d1); | |
| 67 | + if (CollectionUtils.isEmpty(drivers1)) { | |
| 68 | + logger.error("该车队没有人员:[{}],[{}]", request, d1); | |
| 69 | + } | |
| 70 | + | |
| 71 | + driverJobs = drivers1.stream().map(NewDriver::getJobCode).collect(Collectors.toSet()); | |
| 72 | + request.setDriverJobs(driverJobs); | |
| 73 | + } | |
| 74 | + | |
| 75 | + | |
| 57 | 76 | IPage<EquipmentExceptionReportVO> voiPage = listLimit(request, orderEntity, page, pageLimit, model); |
| 58 | 77 | if (Objects.nonNull(voiPage) && CollectionUtils.isNotEmpty(voiPage.getRecords())) { |
| 59 | 78 | Set<String> jobs = voiPage.getRecords().stream().map(EquipmentExceptionReportVO::getJobCode).collect(Collectors.toSet()); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/exception/report/EquipmentExceptionReport.java
| 1 | 1 | package com.ruoyi.domain.sign.in.exception.report; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.annotation.IdType; |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 4 | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
| 5 | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 6 | 7 | import com.ruoyi.common.annotation.Excel; |
| ... | ... | @@ -11,6 +12,7 @@ import lombok.NoArgsConstructor; |
| 11 | 12 | import lombok.experimental.Accessors; |
| 12 | 13 | import lombok.extern.slf4j.Slf4j; |
| 13 | 14 | |
| 15 | +import java.util.Collection; | |
| 14 | 16 | import java.util.Date; |
| 15 | 17 | |
| 16 | 18 | |
| ... | ... | @@ -132,6 +134,9 @@ public class EquipmentExceptionReport { |
| 132 | 134 | @Excel(name = "签到ID") |
| 133 | 135 | private java.lang.Long signId; |
| 134 | 136 | |
| 137 | + @TableField(exist = false) | |
| 138 | + private Collection<String> driverJobs; | |
| 139 | + | |
| 135 | 140 | |
| 136 | 141 | @Override |
| 137 | 142 | public String toString() { | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/exception/report/dto/EquipmentExceptionReportQueryDTO.java
| ... | ... | @@ -6,6 +6,8 @@ import lombok.Data; |
| 6 | 6 | import lombok.EqualsAndHashCode; |
| 7 | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | |
| 9 | +import java.util.Collection; | |
| 10 | + | |
| 9 | 11 | @Data |
| 10 | 12 | @ApiModel(value = "打卡异常上报表的查询DTO") |
| 11 | 13 | @Accessors(chain = true) |
| ... | ... | @@ -82,6 +84,12 @@ public class EquipmentExceptionReportQueryDTO implements java.io.Serializable { |
| 82 | 84 | /***签到ID*/ |
| 83 | 85 | @ApiModelProperty(value="签到ID",example ="1") |
| 84 | 86 | private java.lang.Long signId; |
| 87 | + @ApiModelProperty(value = "登陆人员的手机号码") | |
| 88 | + private String telPhone; | |
| 89 | + @ApiModelProperty(value = "超级权限用户") | |
| 90 | + private String supperAuh; | |
| 91 | + @ApiModelProperty(value = "需要查询的工号集合") | |
| 92 | + private Collection<String> driverJobs; | |
| 85 | 93 | |
| 86 | 94 | |
| 87 | 95 | public void clearStrEmpty() { | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/driver/NewDriverService.java
Bsth-admin/src/main/java/com/ruoyi/service/impl/driver/NewDriverServiceImpl.java
| ... | ... | @@ -170,6 +170,13 @@ public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | @Override |
| 173 | + public NewDriver getOneByPhone(String phone) { | |
| 174 | + LambdaQueryWrapper<NewDriver> wrapper = new LambdaQueryWrapper<>(); | |
| 175 | + wrapper.eq(NewDriver::getTelphone, phone); | |
| 176 | + return getOne(wrapper); | |
| 177 | + } | |
| 178 | + | |
| 179 | + @Override | |
| 173 | 180 | public Integer countId(NewDriver entity) { |
| 174 | 181 | LambdaQueryWrapper<NewDriver> wrapper = new LambdaQueryWrapper<>(entity); |
| 175 | 182 | wrapper.select(NewDriver::getJobCode); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/impl/sign/in/exception/report/EquipmentExceptionReportServiceImpl.java
| ... | ... | @@ -10,6 +10,7 @@ import com.ruoyi.domain.sign.in.exception.report.EquipmentExceptionReport; |
| 10 | 10 | import com.ruoyi.mapper.sign.in.exception.report.EquipmentExceptionReportMapper; |
| 11 | 11 | import com.ruoyi.service.sign.in.exception.report.EquipmentExceptionReportService; |
| 12 | 12 | import lombok.extern.slf4j.Slf4j; |
| 13 | +import org.apache.commons.collections4.CollectionUtils; | |
| 13 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | 15 | import org.springframework.stereotype.Service; |
| 15 | 16 | |
| ... | ... | @@ -30,12 +31,19 @@ public class EquipmentExceptionReportServiceImpl extends ServiceImpl<EquipmentEx |
| 30 | 31 | public IPage<EquipmentExceptionReport> pageList(Page<EquipmentExceptionReport> page, EquipmentExceptionReport entity, OrderEntity orderEntity) { |
| 31 | 32 | LambdaQueryWrapper<EquipmentExceptionReport> countWrapper = new LambdaQueryWrapper<>(entity); |
| 32 | 33 | countWrapper.select(EquipmentExceptionReport::getId); |
| 34 | + if(CollectionUtils.isNotEmpty(entity.getDriverJobs())){ | |
| 35 | + countWrapper.in(EquipmentExceptionReport::getJobCode,entity.getDriverJobs()); | |
| 36 | + } | |
| 33 | 37 | int count = count(countWrapper); |
| 34 | 38 | |
| 35 | 39 | List<EquipmentExceptionReport> lists = Collections.emptyList(); |
| 36 | 40 | if (count > 0) { |
| 37 | 41 | PageHelper.startPage((int) page.getCurrent(), (int) page.getSize(), false); |
| 38 | 42 | LambdaQueryWrapper<EquipmentExceptionReport> selectWrapper = new LambdaQueryWrapper<>(entity); |
| 43 | + if(CollectionUtils.isNotEmpty(entity.getDriverJobs())){ | |
| 44 | + selectWrapper.in(EquipmentExceptionReport::getJobCode,entity.getDriverJobs()); | |
| 45 | + } | |
| 46 | + | |
| 39 | 47 | orderColumn(selectWrapper, orderEntity); |
| 40 | 48 | lists = list(selectWrapper); |
| 41 | 49 | } | ... | ... |