Commit 6141b055ad59573a91afa01a85ed9d10bee7ce41
1 parent
1854df32
酒测未通过审核
Showing
7 changed files
with
61 additions
and
22 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
| ... | ... | @@ -548,7 +548,7 @@ public class DssDriverController extends BaseController { |
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | 550 | vo.setRouteName(scheduling.getLineName()); |
| 551 | - vo.setFache(new Date(scheduling.getFcsjT())); | |
| 551 | + vo.setFache(new Date(scheduling.getFcsjT()*100)); | |
| 552 | 552 | |
| 553 | 553 | return vo; |
| 554 | 554 | }).collect(Collectors.toList()); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
| ... | ... | @@ -203,7 +203,7 @@ public class KeyBoxController extends BaseController { |
| 203 | 203 | logger.info("根据DTO的数据无法查询车辆信息(carInfos1):[{}]", dto); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - BasicSyncVo vo = convertBasicSyncVo(workLocations, schedulings, keyInfos, drivers, carInfos, equipment, venueInfo, equipmentList,schedulings1,carInfos1); | |
| 206 | + BasicSyncVo vo = convertBasicSyncVo(workLocations, schedulings, keyInfos, drivers, carInfos, equipment, venueInfo, equipmentList, schedulings1, carInfos1); | |
| 207 | 207 | return ResponseResult.success(vo); |
| 208 | 208 | } catch (ParseException e) { |
| 209 | 209 | logger.error("钥匙柜基础信息同步异常:[{}]", dto, e); |
| ... | ... | @@ -247,7 +247,7 @@ public class KeyBoxController extends BaseController { |
| 247 | 247 | } |
| 248 | 248 | Equipment equipment = equipmentService.getOneByDeviceId(dto.getDevice()); |
| 249 | 249 | |
| 250 | - TakeKeyVo vo = convertTakeKeyVo(dto, responseResult,equipment); | |
| 250 | + TakeKeyVo vo = convertTakeKeyVo(dto, responseResult, equipment); | |
| 251 | 251 | |
| 252 | 252 | return new ResponseResult<>(responseResult.getCode(), responseResult.getMsg(), vo); |
| 253 | 253 | } |
| ... | ... | @@ -266,11 +266,17 @@ public class KeyBoxController extends BaseController { |
| 266 | 266 | |
| 267 | 267 | List<LinggangKeyWorkLocation> locations = convert(dto, schedulings, driver); |
| 268 | 268 | ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.REPAY); |
| 269 | - if (Objects.isNull(responseResult) || !responseResult.isSuccess()) { | |
| 269 | + if (Objects.isNull(responseResult)) { | |
| 270 | 270 | return ResponseResult.error(); |
| 271 | 271 | } |
| 272 | + | |
| 273 | + if (responseResult.isSuccess()) { | |
| 274 | + return ResponseResult.error(responseResult.getCode(), responseResult.getMsg()); | |
| 275 | + } | |
| 276 | + | |
| 277 | + | |
| 272 | 278 | Equipment equipment = equipmentService.getOneByDeviceId(dto.getDevice()); |
| 273 | - TakeKeyVo vo = convertTakeKeyVo(dto, responseResult,equipment); | |
| 279 | + TakeKeyVo vo = convertTakeKeyVo(dto, responseResult, equipment); | |
| 274 | 280 | |
| 275 | 281 | return new ResponseResult<>(responseResult.getCode(), responseResult.getMsg(), vo); |
| 276 | 282 | } |
| ... | ... | @@ -370,7 +376,18 @@ public class KeyBoxController extends BaseController { |
| 370 | 376 | String bcType = ConstDriverProperties.BC_TYPE_IN; |
| 371 | 377 | scheduling.setBcType(bcType); |
| 372 | 378 | |
| 373 | - return schedulingService.getOne(scheduling); | |
| 379 | + List<LinggangScheduling> linggangSchedulings = schedulingService.list(scheduling); | |
| 380 | + if (CollectionUtils.isEmpty(linggangSchedulings)) { | |
| 381 | + return null; | |
| 382 | + } | |
| 383 | + | |
| 384 | + | |
| 385 | + Optional<LinggangScheduling> optional = linggangSchedulings.stream().filter(lin -> lin.getZdsjT() >= dto.getTime().getTime()).findFirst(); | |
| 386 | + if (optional.isPresent()) { | |
| 387 | + return optional.get(); | |
| 388 | + } | |
| 389 | + int size = linggangSchedulings.size(); | |
| 390 | + return linggangSchedulings.get(size - 1); | |
| 374 | 391 | } |
| 375 | 392 | |
| 376 | 393 | private List<LinggangScheduling> queryScheduling(Collection<Long> ids) { |
| ... | ... | @@ -483,7 +500,7 @@ public class KeyBoxController extends BaseController { |
| 483 | 500 | |
| 484 | 501 | private BasicSyncVo convertBasicSyncVo(List<LinggangKeyWorkLocation> workLocations, List<LinggangScheduling> schedulings, |
| 485 | 502 | List<KeyInfo> keyInfos, List<NewDriver> drivers, List<CarInfo> carInfos, Equipment equipment, |
| 486 | - LinggangVenueInfo venueInfo, List<Equipment> equipmentList, List<LinggangScheduling> schedulings1,List<CarInfo> carInfos1) { | |
| 503 | + LinggangVenueInfo venueInfo, List<Equipment> equipmentList, List<LinggangScheduling> schedulings1, List<CarInfo> carInfos1) { | |
| 487 | 504 | BasicSyncVo vo = new BasicSyncVo(); |
| 488 | 505 | |
| 489 | 506 | vo.setDevice(equipment.getDeviceId()); |
| ... | ... | @@ -538,7 +555,7 @@ public class KeyBoxController extends BaseController { |
| 538 | 555 | planVo.setStaffCode(sc.getJobCode()); |
| 539 | 556 | |
| 540 | 557 | BasicSyncDriverWorkDriverPlanTimePlateVo planTimePlateVo = new BasicSyncDriverWorkDriverPlanTimePlateVo(); |
| 541 | - planTimePlateVo.setKey(sc.getScheduleDate()); | |
| 558 | + planTimePlateVo.setKey(new Date(sc.getFcsjT())); | |
| 542 | 559 | |
| 543 | 560 | planTimePlateVo.setValue(carInfoOptional.get().getPlateNum()); |
| 544 | 561 | planVo.setTimePlate(planTimePlateVo); |
| ... | ... | @@ -555,8 +572,8 @@ public class KeyBoxController extends BaseController { |
| 555 | 572 | if (CollectionUtils.isNotEmpty(schedulings1) && CollectionUtils.isNotEmpty(carInfos1)) { |
| 556 | 573 | Set<String> nbbms = schedulings1.stream().filter(s -> Objects.equals(s.getQdzcode(), venueInfo.getParkCode()) || |
| 557 | 574 | Objects.equals(s.getZdzcode(), venueInfo.getParkCode())).map(LinggangScheduling::getNbbm).collect(Collectors.toSet()); |
| 558 | - List<String> plateNums = carInfos1.stream().filter(c->nbbms.contains(c.getNbbm())).map(CarInfo::getPlateNum).collect(Collectors.toList()); | |
| 559 | - vo.setYardVehicles(plateNums); | |
| 575 | + List<String> plateNums = carInfos1.stream().filter(c -> nbbms.contains(c.getNbbm())).map(CarInfo::getPlateNum).collect(Collectors.toList()); | |
| 576 | + vo.setYardVehicles(plateNums); | |
| 560 | 577 | |
| 561 | 578 | } |
| 562 | 579 | |
| ... | ... | @@ -592,7 +609,7 @@ public class KeyBoxController extends BaseController { |
| 592 | 609 | } |
| 593 | 610 | } |
| 594 | 611 | |
| 595 | - if(Objects.nonNull(driver)) { | |
| 612 | + if (Objects.nonNull(driver)) { | |
| 596 | 613 | location.setCreateBy(Convert.toLong(driver.getId())); |
| 597 | 614 | } |
| 598 | 615 | location.setCreateTime(new Date()); |
| ... | ... | @@ -601,12 +618,12 @@ public class KeyBoxController extends BaseController { |
| 601 | 618 | }).filter(obj -> Objects.nonNull(obj.getKeyInfoId())).collect(Collectors.toList()); |
| 602 | 619 | } |
| 603 | 620 | |
| 604 | - private TakeKeyVo convertTakeKeyVo(TakeKeyDTO dto, ResponseResult<Boolean> result,Equipment equipment) { | |
| 621 | + private TakeKeyVo convertTakeKeyVo(TakeKeyDTO dto, ResponseResult<Boolean> result, Equipment equipment) { | |
| 605 | 622 | TakeKeyVo vo = new TakeKeyVo(); |
| 606 | 623 | vo.setDevice(dto.getDevice()); |
| 607 | 624 | vo.setTime(new Date()); |
| 608 | 625 | vo.setResult(result.isSuccess() ? 0 : 1); |
| 609 | - if(Objects.nonNull(equipment)){ | |
| 626 | + if (Objects.nonNull(equipment)) { | |
| 610 | 627 | vo.setDeviceType(equipment.getPromise()); |
| 611 | 628 | vo.setDriverCode(equipment.getDeviceId()); |
| 612 | 629 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/sign/in/exception/report/EquipmentExceptionReportController.java
| ... | ... | @@ -109,8 +109,20 @@ public class EquipmentExceptionReportController extends BaseController { |
| 109 | 109 | @GetMapping(value = "/view/{id}") |
| 110 | 110 | public com.ruoyi.common.core.domain.ResponseResult<EquipmentExceptionReportVO> view(@PathVariable("id") Long id, org.springframework.ui.Model model) { |
| 111 | 111 | EquipmentExceptionReport source = equipmentExceptionReportService.getById(id); |
| 112 | + NewDriver driver = driverService.getOne(source.getJobCode()); | |
| 113 | + SignIn signIn = signInService.getById(source.getSignId()); | |
| 114 | + EquipmentExceptionReportVO vo = convert(source); | |
| 112 | 115 | |
| 113 | - return com.ruoyi.common.core.domain.ResponseResult.success(convert(source)); | |
| 116 | + if(Objects.nonNull(driver)){ | |
| 117 | + vo.setJobCodeName(driver.getPersonnelName()); | |
| 118 | + } | |
| 119 | + | |
| 120 | + if(Objects.nonNull(signIn)){ | |
| 121 | + vo.setAlcoholIntake(signIn.getAlcoholIntake()); | |
| 122 | + vo.setCreateTime(signIn.getCreateTime()); | |
| 123 | + } | |
| 124 | + | |
| 125 | + return com.ruoyi.common.core.domain.ResponseResult.success(vo); | |
| 114 | 126 | } |
| 115 | 127 | |
| 116 | 128 | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/exception/report/EquipmentExceptionReport.java
Bsth-admin/src/main/java/com/ruoyi/service/impl/dss/FaceServiceImpl.java
| ... | ... | @@ -79,12 +79,21 @@ public class FaceServiceImpl implements FaceService { |
| 79 | 79 | return dr; |
| 80 | 80 | }).max(Comparator.comparing(NewDriver::getImageScore)); |
| 81 | 81 | |
| 82 | - bufferedImage.flush(); | |
| 83 | - return optional.isPresent() ? optional.get() : null; | |
| 82 | + if (Objects.nonNull(bufferedImage)) { | |
| 83 | + bufferedImage.flush(); | |
| 84 | + } | |
| 85 | + | |
| 86 | + if (optional.isPresent() && Objects.nonNull(optional.get().getImageScore()) && optional.get().getImageScore() > 0.95) { | |
| 87 | + return optional.get(); | |
| 88 | + } | |
| 89 | + | |
| 90 | + | |
| 91 | + return null; | |
| 84 | 92 | } catch (IOException e) { |
| 85 | 93 | sourceDriver.setImage(null); |
| 86 | 94 | log.error("图片校验异常:[{}]", sourceDriver, e); |
| 87 | 95 | } finally { |
| 96 | + | |
| 88 | 97 | IOUtils.closeQuietly(byteArrayInputStream); |
| 89 | 98 | } |
| 90 | 99 | return null; |
| ... | ... | @@ -127,14 +136,14 @@ public class FaceServiceImpl implements FaceService { |
| 127 | 136 | List<FaceInfo> faceInfoList = new ArrayList<>(); |
| 128 | 137 | int errorCode = faceEngine.detectFaces(image.getImageData(), image.getWidth(), image.getHeight(), image.getImageFormat(), faceInfoList); |
| 129 | 138 | if (errorCode != ErrorInfo.MOK.getValue()) { |
| 130 | - log.error("人脸对比失败,请检查数据:[{}];错误代码:[{}]", driver,errorCode); | |
| 139 | + log.error("人脸对比失败,请检查数据:[{}];错误代码:[{}]", driver, errorCode); | |
| 131 | 140 | return null; |
| 132 | 141 | } |
| 133 | 142 | |
| 134 | 143 | FaceFeature faceFeature = new FaceFeature(); |
| 135 | 144 | errorCode = faceEngine.extractFaceFeature(image.getImageData(), image.getWidth(), image.getHeight(), image.getImageFormat(), faceInfoList.get(0), faceFeature); |
| 136 | 145 | if (errorCode != ErrorInfo.MOK.getValue()) { |
| 137 | - log.error("提取对比特征失败,请检查数据:[{}];错误代码:[{}]", driver,errorCode); | |
| 146 | + log.error("提取对比特征失败,请检查数据:[{}];错误代码:[{}]", driver, errorCode); | |
| 138 | 147 | return null; |
| 139 | 148 | } |
| 140 | 149 | return faceFeature; | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/impl/key/location/LinggangKeyWorkLocationServiceImpl.java
| ... | ... | @@ -602,7 +602,7 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl<LinggangKeyW |
| 602 | 602 | continue; |
| 603 | 603 | } |
| 604 | 604 | break; |
| 605 | - } while (i < 10000); | |
| 605 | + } while (i < 100); | |
| 606 | 606 | |
| 607 | 607 | if (Objects.isNull(equipment) || Objects.isNull(number)) { |
| 608 | 608 | log.info("没有找到存放的格子:[{}]", equipment); | ... | ... |
Bsth-admin/src/main/resources/logback.xml
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | |
| 17 | 17 | <!-- 系统日志输出 --> |
| 18 | 18 | <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 19 | - <file>${log.path}/sys-info.log</file> | |
| 19 | + <file>${log.path}/lingang-bsth.log</file> | |
| 20 | 20 | <!-- 循环政策:基于时间创建日志文件 --> |
| 21 | 21 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 22 | 22 | <!-- 日志文件名格式 --> |
| ... | ... | @@ -38,7 +38,7 @@ |
| 38 | 38 | </appender> |
| 39 | 39 | |
| 40 | 40 | <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 41 | - <file>${log.path}/sys-error.log</file> | |
| 41 | + <file>${log.path}/lingang-bsth-error.log</file> | |
| 42 | 42 | <!-- 循环政策:基于时间创建日志文件 --> |
| 43 | 43 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 44 | 44 | <!-- 日志文件名格式 --> |
| ... | ... | @@ -61,7 +61,7 @@ |
| 61 | 61 | |
| 62 | 62 | <!-- 用户访问日志输出 --> |
| 63 | 63 | <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 64 | - <file>${log.path}/sys-user.log</file> | |
| 64 | + <file>${log.path}/lingang-bsth-user.log</file> | |
| 65 | 65 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 66 | 66 | <!-- 按天回滚 daily --> |
| 67 | 67 | <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern> | ... | ... |