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,6 +54,25 @@ public class EquipmentExceptionReportController extends BaseController { | ||
| 54 | @ApiOperation("分页查询-用于对外") | 54 | @ApiOperation("分页查询-用于对外") |
| 55 | @PostMapping(value = "/list/limit/contact/{page}/{pageLimit}") | 55 | @PostMapping(value = "/list/limit/contact/{page}/{pageLimit}") |
| 56 | public IPage<EquipmentExceptionReportVO> listLimitOfContact(@RequestBody EquipmentExceptionReportQueryDTO request, @ModelAttribute OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) { | 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 | IPage<EquipmentExceptionReportVO> voiPage = listLimit(request, orderEntity, page, pageLimit, model); | 76 | IPage<EquipmentExceptionReportVO> voiPage = listLimit(request, orderEntity, page, pageLimit, model); |
| 58 | if (Objects.nonNull(voiPage) && CollectionUtils.isNotEmpty(voiPage.getRecords())) { | 77 | if (Objects.nonNull(voiPage) && CollectionUtils.isNotEmpty(voiPage.getRecords())) { |
| 59 | Set<String> jobs = voiPage.getRecords().stream().map(EquipmentExceptionReportVO::getJobCode).collect(Collectors.toSet()); | 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 | package com.ruoyi.domain.sign.in.exception.report; | 1 | package com.ruoyi.domain.sign.in.exception.report; |
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.annotation.IdType; | 3 | import com.baomidou.mybatisplus.annotation.IdType; |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 4 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
| 5 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 6 | import com.ruoyi.common.annotation.Excel; | 7 | import com.ruoyi.common.annotation.Excel; |
| @@ -11,6 +12,7 @@ import lombok.NoArgsConstructor; | @@ -11,6 +12,7 @@ import lombok.NoArgsConstructor; | ||
| 11 | import lombok.experimental.Accessors; | 12 | import lombok.experimental.Accessors; |
| 12 | import lombok.extern.slf4j.Slf4j; | 13 | import lombok.extern.slf4j.Slf4j; |
| 13 | 14 | ||
| 15 | +import java.util.Collection; | ||
| 14 | import java.util.Date; | 16 | import java.util.Date; |
| 15 | 17 | ||
| 16 | 18 | ||
| @@ -132,6 +134,9 @@ public class EquipmentExceptionReport { | @@ -132,6 +134,9 @@ public class EquipmentExceptionReport { | ||
| 132 | @Excel(name = "签到ID") | 134 | @Excel(name = "签到ID") |
| 133 | private java.lang.Long signId; | 135 | private java.lang.Long signId; |
| 134 | 136 | ||
| 137 | + @TableField(exist = false) | ||
| 138 | + private Collection<String> driverJobs; | ||
| 139 | + | ||
| 135 | 140 | ||
| 136 | @Override | 141 | @Override |
| 137 | public String toString() { | 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 +6,8 @@ import lombok.Data; | ||
| 6 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | +import java.util.Collection; | ||
| 10 | + | ||
| 9 | @Data | 11 | @Data |
| 10 | @ApiModel(value = "打卡异常上报表的查询DTO") | 12 | @ApiModel(value = "打卡异常上报表的查询DTO") |
| 11 | @Accessors(chain = true) | 13 | @Accessors(chain = true) |
| @@ -82,6 +84,12 @@ public class EquipmentExceptionReportQueryDTO implements java.io.Serializable { | @@ -82,6 +84,12 @@ public class EquipmentExceptionReportQueryDTO implements java.io.Serializable { | ||
| 82 | /***签到ID*/ | 84 | /***签到ID*/ |
| 83 | @ApiModelProperty(value="签到ID",example ="1") | 85 | @ApiModelProperty(value="签到ID",example ="1") |
| 84 | private java.lang.Long signId; | 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 | public void clearStrEmpty() { | 95 | public void clearStrEmpty() { |
Bsth-admin/src/main/java/com/ruoyi/service/driver/NewDriverService.java
| @@ -51,6 +51,7 @@ public interface NewDriverService extends IService<NewDriver> { | @@ -51,6 +51,7 @@ public interface NewDriverService extends IService<NewDriver> { | ||
| 51 | NewDriver getOne(NewDriver entity); | 51 | NewDriver getOne(NewDriver entity); |
| 52 | 52 | ||
| 53 | NewDriver getOne(String jobCode); | 53 | NewDriver getOne(String jobCode); |
| 54 | + NewDriver getOneByPhone(String phone); | ||
| 54 | 55 | ||
| 55 | Integer countId(NewDriver entity); | 56 | Integer countId(NewDriver entity); |
| 56 | 57 |
Bsth-admin/src/main/java/com/ruoyi/service/impl/driver/NewDriverServiceImpl.java
| @@ -170,6 +170,13 @@ public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver | @@ -170,6 +170,13 @@ public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver | ||
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | @Override | 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 | public Integer countId(NewDriver entity) { | 180 | public Integer countId(NewDriver entity) { |
| 174 | LambdaQueryWrapper<NewDriver> wrapper = new LambdaQueryWrapper<>(entity); | 181 | LambdaQueryWrapper<NewDriver> wrapper = new LambdaQueryWrapper<>(entity); |
| 175 | wrapper.select(NewDriver::getJobCode); | 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,6 +10,7 @@ import com.ruoyi.domain.sign.in.exception.report.EquipmentExceptionReport; | ||
| 10 | import com.ruoyi.mapper.sign.in.exception.report.EquipmentExceptionReportMapper; | 10 | import com.ruoyi.mapper.sign.in.exception.report.EquipmentExceptionReportMapper; |
| 11 | import com.ruoyi.service.sign.in.exception.report.EquipmentExceptionReportService; | 11 | import com.ruoyi.service.sign.in.exception.report.EquipmentExceptionReportService; |
| 12 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 13 | +import org.apache.commons.collections4.CollectionUtils; | ||
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.stereotype.Service; | 15 | import org.springframework.stereotype.Service; |
| 15 | 16 | ||
| @@ -30,12 +31,19 @@ public class EquipmentExceptionReportServiceImpl extends ServiceImpl<EquipmentEx | @@ -30,12 +31,19 @@ public class EquipmentExceptionReportServiceImpl extends ServiceImpl<EquipmentEx | ||
| 30 | public IPage<EquipmentExceptionReport> pageList(Page<EquipmentExceptionReport> page, EquipmentExceptionReport entity, OrderEntity orderEntity) { | 31 | public IPage<EquipmentExceptionReport> pageList(Page<EquipmentExceptionReport> page, EquipmentExceptionReport entity, OrderEntity orderEntity) { |
| 31 | LambdaQueryWrapper<EquipmentExceptionReport> countWrapper = new LambdaQueryWrapper<>(entity); | 32 | LambdaQueryWrapper<EquipmentExceptionReport> countWrapper = new LambdaQueryWrapper<>(entity); |
| 32 | countWrapper.select(EquipmentExceptionReport::getId); | 33 | countWrapper.select(EquipmentExceptionReport::getId); |
| 34 | + if(CollectionUtils.isNotEmpty(entity.getDriverJobs())){ | ||
| 35 | + countWrapper.in(EquipmentExceptionReport::getJobCode,entity.getDriverJobs()); | ||
| 36 | + } | ||
| 33 | int count = count(countWrapper); | 37 | int count = count(countWrapper); |
| 34 | 38 | ||
| 35 | List<EquipmentExceptionReport> lists = Collections.emptyList(); | 39 | List<EquipmentExceptionReport> lists = Collections.emptyList(); |
| 36 | if (count > 0) { | 40 | if (count > 0) { |
| 37 | PageHelper.startPage((int) page.getCurrent(), (int) page.getSize(), false); | 41 | PageHelper.startPage((int) page.getCurrent(), (int) page.getSize(), false); |
| 38 | LambdaQueryWrapper<EquipmentExceptionReport> selectWrapper = new LambdaQueryWrapper<>(entity); | 42 | LambdaQueryWrapper<EquipmentExceptionReport> selectWrapper = new LambdaQueryWrapper<>(entity); |
| 43 | + if(CollectionUtils.isNotEmpty(entity.getDriverJobs())){ | ||
| 44 | + selectWrapper.in(EquipmentExceptionReport::getJobCode,entity.getDriverJobs()); | ||
| 45 | + } | ||
| 46 | + | ||
| 39 | orderColumn(selectWrapper, orderEntity); | 47 | orderColumn(selectWrapper, orderEntity); |
| 40 | lists = list(selectWrapper); | 48 | lists = list(selectWrapper); |
| 41 | } | 49 | } |