Commit 1c59a0389a2b8df5fc4902928af44e275a1d1b1e
1 parent
82b2daaf
归还钥匙、领取钥匙使用车辆自编号
Showing
8 changed files
with
111 additions
and
65 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
| ... | ... | @@ -8,6 +8,7 @@ import com.ruoyi.common.core.controller.BaseController; |
| 8 | 8 | import com.ruoyi.common.core.domain.AjaxResult; |
| 9 | 9 | import com.ruoyi.common.core.domain.ResponseResult; |
| 10 | 10 | import com.ruoyi.common.core.domain.entity.SysDictData; |
| 11 | +import com.ruoyi.common.core.redis.RedisCache; | |
| 11 | 12 | import com.ruoyi.common.exception.file.FileUploadException; |
| 12 | 13 | import com.ruoyi.domain.OrderEntity; |
| 13 | 14 | import com.ruoyi.domain.caiinfo.CarInfo; |
| ... | ... | @@ -44,6 +45,7 @@ import com.ruoyi.service.dss.FaceService; |
| 44 | 45 | import com.ruoyi.service.scheduling.LinggangSchedulingService; |
| 45 | 46 | import com.ruoyi.service.sign.in.resource.LinggangSignInResourceService; |
| 46 | 47 | import com.ruoyi.system.service.ISysDictDataService; |
| 48 | +import com.ruoyi.utils.ConstDateUtil; | |
| 47 | 49 | import com.ruoyi.utils.DateUtil; |
| 48 | 50 | import io.swagger.annotations.Api; |
| 49 | 51 | import io.swagger.annotations.ApiOperation; |
| ... | ... | @@ -64,6 +66,8 @@ import java.util.*; |
| 64 | 66 | import java.util.stream.Collectors; |
| 65 | 67 | |
| 66 | 68 | import static com.ruoyi.common.ConstDriverProperties.BC_TYPE_OUT; |
| 69 | +import static com.ruoyi.common.ConstSignInConstSignInProperties.SIGN_IN_ERROR_COUNT; | |
| 70 | +import static com.ruoyi.common.redispre.GlobalRedisPreName.REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW; | |
| 67 | 71 | |
| 68 | 72 | /** |
| 69 | 73 | * @author liujun |
| ... | ... | @@ -90,6 +94,8 @@ public class DssDriverController extends BaseController { |
| 90 | 94 | private IEquipmentService equipmentService; |
| 91 | 95 | @Autowired |
| 92 | 96 | private LinggangSignInResourceService signInResourceService; |
| 97 | + @Autowired | |
| 98 | + private RedisCache redisCache; | |
| 93 | 99 | |
| 94 | 100 | @PostMapping(value = "/Driver/Login") |
| 95 | 101 | @ApiOperation("人员登录设备") |
| ... | ... | @@ -201,6 +207,7 @@ public class DssDriverController extends BaseController { |
| 201 | 207 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 202 | 208 | } |
| 203 | 209 | |
| 210 | + | |
| 204 | 211 | String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); |
| 205 | 212 | if (StringUtils.isNotEmpty(msg)) { |
| 206 | 213 | log.info(msg); |
| ... | ... | @@ -582,13 +589,16 @@ public class DssDriverController extends BaseController { |
| 582 | 589 | private GetWineRecordVo convertGetWineRecordVo(SignIn signIn) { |
| 583 | 590 | GetWineRecordVo vo = new GetWineRecordVo(); |
| 584 | 591 | vo.setCheckTime(signIn.getCreateTime()); |
| 585 | - if (DateUtils.isSameDay(signIn.getCreateTime(), new Date())) { | |
| 592 | + | |
| 593 | + String key = REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW + ConstDateUtil.formatDate("yyyyMMdd") + ":" + signIn.getJobCode(); | |
| 594 | + | |
| 595 | + Integer count = redisCache.getCacheObject(key); | |
| 596 | + if (Objects.nonNull(count) && SIGN_IN_ERROR_COUNT.compareTo(count) <= 0) { | |
| 586 | 597 | vo.setCheck(Objects.equals(signIn.getType(), 0)); |
| 587 | - } else { | |
| 588 | - vo.setCheck(Boolean.TRUE); | |
| 598 | + return vo; | |
| 589 | 599 | } |
| 590 | 600 | |
| 591 | - | |
| 601 | + vo.setCheck(Boolean.TRUE); | |
| 592 | 602 | return vo; |
| 593 | 603 | } |
| 594 | 604 | |
| ... | ... | @@ -631,7 +641,7 @@ public class DssDriverController extends BaseController { |
| 631 | 641 | if (CollectionUtils.isNotEmpty(carInfos)) { |
| 632 | 642 | Optional<CarInfo> optional = carInfos.stream().filter(c -> Objects.equals(c.getNbbm(), scheduling.getNbbm())).findFirst(); |
| 633 | 643 | if (optional.isPresent()) { |
| 634 | - vo.setCarNo(optional.get().getPlateNum()); | |
| 644 | + vo.setCarNo(optional.get().getNbbm()); | |
| 635 | 645 | } |
| 636 | 646 | } |
| 637 | 647 | vo.setRouteName(scheduling.getLineName()); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssFaceController.java
| ... | ... | @@ -77,6 +77,8 @@ public class DssFaceController extends BaseController { |
| 77 | 77 | |
| 78 | 78 | NewDriver driver = new NewDriver(); |
| 79 | 79 | driver.setPosts("驾驶员"); |
| 80 | + driver.setFaceSignIn(1); | |
| 81 | + | |
| 80 | 82 | List<NewDriver> drivers = newDriverService.list(driver); |
| 81 | 83 | List<ReqDataVo> vos = convertReqDataVo(drivers); |
| 82 | 84 | return ResponseResult.success(vos); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
| ... | ... | @@ -92,9 +92,9 @@ public class KeyBoxController extends BaseController { |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | String msg = JwtAuthenticationTokenFilter.validateDevice(request.getDevice()); |
| 95 | - if(StringUtils.isNotEmpty(msg)){ | |
| 95 | + if (StringUtils.isNotEmpty(msg)) { | |
| 96 | 96 | log.info(msg); |
| 97 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | |
| 97 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | LingangEquipmentLinkeLog linkeLog = saveLog(request); |
| ... | ... | @@ -110,9 +110,9 @@ public class KeyBoxController extends BaseController { |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); |
| 113 | - if(StringUtils.isNotEmpty(msg)){ | |
| 113 | + if (StringUtils.isNotEmpty(msg)) { | |
| 114 | 114 | log.info(msg); |
| 115 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | |
| 115 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
| ... | ... | @@ -159,9 +159,9 @@ public class KeyBoxController extends BaseController { |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); |
| 162 | - if(StringUtils.isNotEmpty(msg)){ | |
| 162 | + if (StringUtils.isNotEmpty(msg)) { | |
| 163 | 163 | log.info(msg); |
| 164 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | |
| 164 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | try { |
| ... | ... | @@ -195,7 +195,7 @@ public class KeyBoxController extends BaseController { |
| 195 | 195 | scheduling.setCzCode(venueInfo.getParkCode()); |
| 196 | 196 | scheduling.setStartScheduleDate(DateUtil.shortDate(dto.getTime())); |
| 197 | 197 | scheduling.setType(1); |
| 198 | - scheduling.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(scheduling.getStartScheduleDate(),1)); | |
| 198 | + scheduling.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(scheduling.getStartScheduleDate(), 1)); | |
| 199 | 199 | |
| 200 | 200 | List<LinggangScheduling> schedulings = schedulingService.listByCZ(scheduling); |
| 201 | 201 | Set<String> jobCodes = null; |
| ... | ... | @@ -216,7 +216,6 @@ public class KeyBoxController extends BaseController { |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | |
| 219 | - | |
| 220 | 219 | BasicSyncVo vo = convertBasicSyncVo(workLocations, schedulings, keyInfos, drivers, carInfos, equipment, venueInfo, equipmentList); |
| 221 | 220 | return ResponseResult.success(vo); |
| 222 | 221 | } catch (ParseException e) { |
| ... | ... | @@ -233,9 +232,9 @@ public class KeyBoxController extends BaseController { |
| 233 | 232 | } |
| 234 | 233 | |
| 235 | 234 | String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); |
| 236 | - if(StringUtils.isNotEmpty(msg)){ | |
| 235 | + if (StringUtils.isNotEmpty(msg)) { | |
| 237 | 236 | log.info(msg); |
| 238 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | |
| 237 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); | |
| 239 | 238 | } |
| 240 | 239 | |
| 241 | 240 | Equipment equipment = queryEquipment(dto.getDevice()); |
| ... | ... | @@ -256,20 +255,19 @@ public class KeyBoxController extends BaseController { |
| 256 | 255 | } |
| 257 | 256 | |
| 258 | 257 | String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); |
| 259 | - if(StringUtils.isNotEmpty(msg)){ | |
| 258 | + if (StringUtils.isNotEmpty(msg)) { | |
| 260 | 259 | log.info(msg); |
| 261 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | |
| 260 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); | |
| 262 | 261 | } |
| 263 | 262 | |
| 264 | 263 | |
| 265 | - | |
| 266 | 264 | LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation(); |
| 267 | 265 | entity.setDevice(dto.getDevice()); |
| 268 | 266 | List<LinggangKeyWorkLocation> schedulings = linggangKeyWorkLocationService.list(entity); |
| 269 | 267 | |
| 270 | 268 | List<KeyInfo> keyInfos = null; |
| 271 | - if(CollectionUtils.isNotEmpty(dto.getKeyItem())){ | |
| 272 | - Set<String> codes = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getKeyCode).filter(obj->Objects.nonNull(obj)).collect(Collectors.toSet()); | |
| 269 | + if (CollectionUtils.isNotEmpty(dto.getKeyItem())) { | |
| 270 | + Set<String> codes = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getKeyCode).filter(obj -> Objects.nonNull(obj)).collect(Collectors.toSet()); | |
| 273 | 271 | keyInfos = keyInfoService.list(codes); |
| 274 | 272 | } |
| 275 | 273 | |
| ... | ... | @@ -279,7 +277,7 @@ public class KeyBoxController extends BaseController { |
| 279 | 277 | // return ResponseResult.error404(); |
| 280 | 278 | // } |
| 281 | 279 | |
| 282 | - List<LinggangKeyWorkLocation> locations = convert(dto, schedulings, driver,keyInfos); | |
| 280 | + List<LinggangKeyWorkLocation> locations = convert(dto, schedulings, driver, keyInfos); | |
| 283 | 281 | ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.TAKE_OUT); |
| 284 | 282 | if (Objects.isNull(responseResult)) { |
| 285 | 283 | return ResponseResult.error(); |
| ... | ... | @@ -299,9 +297,9 @@ public class KeyBoxController extends BaseController { |
| 299 | 297 | } |
| 300 | 298 | |
| 301 | 299 | String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); |
| 302 | - if(StringUtils.isNotEmpty(msg)){ | |
| 300 | + if (StringUtils.isNotEmpty(msg)) { | |
| 303 | 301 | log.info(msg); |
| 304 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | |
| 302 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); | |
| 305 | 303 | } |
| 306 | 304 | |
| 307 | 305 | |
| ... | ... | @@ -318,19 +316,18 @@ public class KeyBoxController extends BaseController { |
| 318 | 316 | } |
| 319 | 317 | |
| 320 | 318 | List<KeyInfo> keyInfos = null; |
| 321 | - if(CollectionUtils.isNotEmpty(dto.getKeyItem())){ | |
| 322 | - Set<String> codes = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getKeyCode).filter(obj->Objects.nonNull(obj)).collect(Collectors.toSet()); | |
| 319 | + if (CollectionUtils.isNotEmpty(dto.getKeyItem())) { | |
| 320 | + Set<String> codes = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getKeyCode).filter(obj -> Objects.nonNull(obj)).collect(Collectors.toSet()); | |
| 323 | 321 | keyInfos = keyInfoService.list(codes); |
| 324 | 322 | |
| 325 | - if(CollectionUtils.isEmpty(keyInfos)){ | |
| 326 | - codes = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getPlate).filter(obj->Objects.nonNull(obj)).collect(Collectors.toSet()); | |
| 327 | - keyInfos = keyInfoService.list(null,codes); | |
| 323 | + if (CollectionUtils.isEmpty(keyInfos)) { | |
| 324 | + codes = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getPlate).filter(obj -> Objects.nonNull(obj)).collect(Collectors.toSet()); | |
| 325 | + keyInfos = keyInfoService.list(null, codes); | |
| 328 | 326 | } |
| 329 | 327 | } |
| 330 | 328 | |
| 331 | 329 | |
| 332 | - | |
| 333 | - List<LinggangKeyWorkLocation> locations = convert(dto, schedulings, driver,keyInfos); | |
| 330 | + List<LinggangKeyWorkLocation> locations = convert(dto, schedulings, driver, keyInfos); | |
| 334 | 331 | // List<LinggangKeyWorkLocation> errorLocations = locations.stream().filter(l -> Objects.isNull(l.getKeyInfoId())).collect(Collectors.toList()); |
| 335 | 332 | // locations = locations.stream().filter(l -> Objects.nonNull(l.getKeyInfoId())).collect(Collectors.toList()); |
| 336 | 333 | ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.REPAY); |
| ... | ... | @@ -357,45 +354,44 @@ public class KeyBoxController extends BaseController { |
| 357 | 354 | |
| 358 | 355 | @PostMapping(value = "Driver/TurnKey/plan") |
| 359 | 356 | @ApiOperation(value = "钥匙归还计划") |
| 360 | - public ResponseResult<List<TakeKeyPlanVo>> getKeyWorkLocaltionPlan(@Valid @RequestBody TakeKeyPlanDTO dto,BindingResult bindingResult){ | |
| 357 | + public ResponseResult<List<TakeKeyPlanVo>> getKeyWorkLocaltionPlan(@Valid @RequestBody TakeKeyPlanDTO dto, BindingResult bindingResult) { | |
| 361 | 358 | if (bindingResult.hasErrors()) { |
| 362 | 359 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 363 | 360 | } |
| 364 | 361 | |
| 365 | 362 | String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); |
| 366 | - if(StringUtils.isNotEmpty(msg)){ | |
| 363 | + if (StringUtils.isNotEmpty(msg)) { | |
| 367 | 364 | log.info(msg); |
| 368 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | |
| 365 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); | |
| 369 | 366 | } |
| 370 | 367 | |
| 371 | 368 | |
| 372 | - | |
| 373 | 369 | LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation(); |
| 374 | 370 | entity.setDevice(dto.getDevice()); |
| 375 | 371 | entity.setType(2); |
| 376 | 372 | entity.setDelFlag(Boolean.FALSE); |
| 377 | 373 | entity.setStartScheduleDate(dto.getTime()); |
| 378 | - entity.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(dto.getTime(),1)); | |
| 374 | + entity.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(dto.getTime(), 1)); | |
| 379 | 375 | |
| 380 | 376 | List<LinggangKeyWorkLocation> schedulings = linggangKeyWorkLocationService.list(entity); |
| 381 | - if(CollectionUtils.isEmpty(schedulings)){ | |
| 377 | + if (CollectionUtils.isEmpty(schedulings)) { | |
| 382 | 378 | return ResponseResult.success(); |
| 383 | 379 | } |
| 384 | 380 | |
| 385 | 381 | Set<Integer> keyIds = schedulings.stream().map(LinggangKeyWorkLocation::getKeyInfoId).collect(Collectors.toSet()); |
| 386 | 382 | |
| 387 | 383 | List<KeyInfo> tempKeyInfos = null; |
| 388 | - if(CollectionUtils.isNotEmpty(keyIds)){ | |
| 384 | + if (CollectionUtils.isNotEmpty(keyIds)) { | |
| 389 | 385 | tempKeyInfos = keyInfoService.listByIds(keyIds); |
| 390 | 386 | } |
| 391 | 387 | List<KeyInfo> keyInfos = tempKeyInfos; |
| 392 | 388 | int keyInfoSize = CollectionUtils.size(keyInfos); |
| 393 | 389 | |
| 394 | - List<TakeKeyPlanVo> vos = schedulings.stream().map(s->{ | |
| 390 | + List<TakeKeyPlanVo> vos = schedulings.stream().map(s -> { | |
| 395 | 391 | TakeKeyPlanVo vo = convert(s); |
| 396 | - if(keyInfoSize > 0){ | |
| 397 | - Optional<KeyInfo> optional = keyInfos.stream().filter(k->Objects.equals(k.getId(),s.getKeyInfoId())).findFirst(); | |
| 398 | - if(optional.isPresent()){ | |
| 392 | + if (keyInfoSize > 0) { | |
| 393 | + Optional<KeyInfo> optional = keyInfos.stream().filter(k -> Objects.equals(k.getId(), s.getKeyInfoId())).findFirst(); | |
| 394 | + if (optional.isPresent()) { | |
| 399 | 395 | vo.setKeyCode(optional.get().getKeyCode()); |
| 400 | 396 | } |
| 401 | 397 | } |
| ... | ... | @@ -413,9 +409,9 @@ public class KeyBoxController extends BaseController { |
| 413 | 409 | } |
| 414 | 410 | |
| 415 | 411 | String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); |
| 416 | - if(StringUtils.isNotEmpty(msg)){ | |
| 412 | + if (StringUtils.isNotEmpty(msg)) { | |
| 417 | 413 | log.info(msg); |
| 418 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | |
| 414 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); | |
| 419 | 415 | } |
| 420 | 416 | |
| 421 | 417 | |
| ... | ... | @@ -427,15 +423,33 @@ public class KeyBoxController extends BaseController { |
| 427 | 423 | } |
| 428 | 424 | |
| 429 | 425 | if (StringUtils.isNotEmpty(dto.getPlate())) { |
| 426 | +// CarInfo carInfo = new CarInfo(); | |
| 427 | +// carInfo.setNbbm(dto.getPlate()); | |
| 428 | +// List<CarInfo> carInfos = carInfoService.listLikeNbbs(carInfo); | |
| 429 | +// if (CollectionUtils.isEmpty(carInfos)) { | |
| 430 | +// keyInfoIds = new HashSet<>(); | |
| 431 | +// keyInfoIds.add(-10000); | |
| 432 | +// } else { | |
| 433 | +// Set<String> plateNums = carInfos.stream().map(CarInfo::getPlateNum).collect(Collectors.toSet()); | |
| 434 | +// keyInfos = keyInfoService.listPlateNums(plateNums); | |
| 435 | +// if (CollectionUtils.isNotEmpty(keyInfos)) { | |
| 436 | +// keyInfoIds = keyInfos.stream().map(KeyInfo::getId).collect(Collectors.toSet()); | |
| 437 | +// } else { | |
| 438 | +// keyInfoIds = new HashSet<>(); | |
| 439 | +// keyInfoIds.add(-10000); | |
| 440 | +// } | |
| 441 | +// } | |
| 442 | + | |
| 430 | 443 | KeyInfo keyInfo = new KeyInfo(); |
| 431 | 444 | keyInfo.setPlateNum(dto.getPlate()); |
| 432 | 445 | keyInfos = keyInfoService.listLikePlate(keyInfo); |
| 433 | 446 | if (CollectionUtils.isNotEmpty(keyInfos)) { |
| 434 | - keyInfoIds = keyInfos.stream().map(KeyInfo::getId).collect(Collectors.toSet()); | |
| 435 | - }else{ | |
| 436 | - keyInfoIds = new HashSet<>(); | |
| 437 | - keyInfoIds.add(-10000); | |
| 438 | - } | |
| 447 | + keyInfoIds = keyInfos.stream().map(KeyInfo::getId).collect(Collectors.toSet()); | |
| 448 | + } else { | |
| 449 | + keyInfoIds = new HashSet<>(); | |
| 450 | + keyInfoIds.add(-10000); | |
| 451 | + } | |
| 452 | + | |
| 439 | 453 | } |
| 440 | 454 | |
| 441 | 455 | LinggangKeyWorkLocation location = new LinggangKeyWorkLocation(); |
| ... | ... | @@ -468,7 +482,7 @@ public class KeyBoxController extends BaseController { |
| 468 | 482 | locationEq.setYardId(sourceEq.getYardId()); |
| 469 | 483 | locationEq.setStartScheduleDate(date); |
| 470 | 484 | locationEq.setKeyInfoIds(keyInfoIds); |
| 471 | - locationEq.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(locationEq.getStartScheduleDate(),1)); | |
| 485 | + locationEq.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(locationEq.getStartScheduleDate(), 1)); | |
| 472 | 486 | |
| 473 | 487 | // Set<Integer> types = new HashSet<>(); |
| 474 | 488 | // types.add(1); |
| ... | ... | @@ -514,7 +528,7 @@ public class KeyBoxController extends BaseController { |
| 514 | 528 | scheduling.setJobCode(dto.getStaffCode()); |
| 515 | 529 | |
| 516 | 530 | scheduling.setStartScheduleDate(DateUtil.shortDate(dto.getTime())); |
| 517 | - scheduling.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(scheduling.getStartScheduleDate(),1)); | |
| 531 | + scheduling.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(scheduling.getStartScheduleDate(), 1)); | |
| 518 | 532 | // String bcType = Objects.equals(0, dto.getEventType()) ? ConstDriverProperties.BC_TYPE_OUT : Objects.equals(1, dto.getEventType()) ? ConstDriverProperties.BC_TYPE_IN : "other"; |
| 519 | 533 | String bcType = ConstDriverProperties.BC_TYPE_OUT; |
| 520 | 534 | scheduling.setBcType(bcType); |
| ... | ... | @@ -637,7 +651,7 @@ public class KeyBoxController extends BaseController { |
| 637 | 651 | // vo.setYardName(keyInfo.getY) |
| 638 | 652 | vo.setDevice(workLocation.getDevice()); |
| 639 | 653 | vo.setCabinetNo(workLocation.getCabinetNo()); |
| 640 | - vo.setPlateNum(carInfo.getPlateNum()); | |
| 654 | + vo.setPlateNum(carInfo.getNbbm()); | |
| 641 | 655 | |
| 642 | 656 | return vo; |
| 643 | 657 | } |
| ... | ... | @@ -701,7 +715,7 @@ public class KeyBoxController extends BaseController { |
| 701 | 715 | BasicSyncDriverWorkDriverPlanTimePlateVo planTimePlateVo = new BasicSyncDriverWorkDriverPlanTimePlateVo(); |
| 702 | 716 | planTimePlateVo.setKey(new Date(sc.getFcsjT())); |
| 703 | 717 | |
| 704 | - planTimePlateVo.setValue(carInfoOptional.get().getPlateNum()); | |
| 718 | + planTimePlateVo.setValue(carInfoOptional.get().getNbbm()); | |
| 705 | 719 | planVo.setTimePlate(planTimePlateVo); |
| 706 | 720 | |
| 707 | 721 | return planVo; |
| ... | ... | @@ -716,7 +730,7 @@ public class KeyBoxController extends BaseController { |
| 716 | 730 | if (CollectionUtils.isNotEmpty(schedulings) && CollectionUtils.isNotEmpty(carInfos)) { |
| 717 | 731 | Set<String> nbbms = schedulings.stream().filter(s -> Objects.equals(s.getQdzcode(), venueInfo.getParkCode()) || |
| 718 | 732 | Objects.equals(s.getZdzcode(), venueInfo.getParkCode())).map(LinggangScheduling::getNbbm).collect(Collectors.toSet()); |
| 719 | - List<String> plateNums = carInfos.stream().filter(c -> nbbms.contains(c.getNbbm())).map(CarInfo::getPlateNum).collect(Collectors.toList()); | |
| 733 | + List<String> plateNums = carInfos.stream().filter(c -> nbbms.contains(c.getNbbm())).map(CarInfo::getNbbm).collect(Collectors.toList()); | |
| 720 | 734 | vo.setYardVehicles(plateNums); |
| 721 | 735 | |
| 722 | 736 | } |
| ... | ... | @@ -734,7 +748,7 @@ public class KeyBoxController extends BaseController { |
| 734 | 748 | return vo; |
| 735 | 749 | } |
| 736 | 750 | |
| 737 | - private List<LinggangKeyWorkLocation> convert(TakeKeyDTO dto, List<LinggangKeyWorkLocation> schedulings, NewDriver driver,List<KeyInfo> keyInfos) { | |
| 751 | + private List<LinggangKeyWorkLocation> convert(TakeKeyDTO dto, List<LinggangKeyWorkLocation> schedulings, NewDriver driver, List<KeyInfo> keyInfos) { | |
| 738 | 752 | if (CollectionUtils.isEmpty(dto.getKeyItem())) { |
| 739 | 753 | return Collections.emptyList(); |
| 740 | 754 | } |
| ... | ... | @@ -754,12 +768,12 @@ public class KeyBoxController extends BaseController { |
| 754 | 768 | location.setKeyInfoId(opt.get().getKeyInfoId()); |
| 755 | 769 | } |
| 756 | 770 | } |
| 757 | - if(Objects.nonNull(keyInfos)){ | |
| 758 | - Optional<KeyInfo> optional = keyInfos.stream().filter(k->Objects.equals(k.getKeyCode(),item.getKeyCode())).findFirst(); | |
| 771 | + if (Objects.nonNull(keyInfos)) { | |
| 772 | + Optional<KeyInfo> optional = keyInfos.stream().filter(k -> Objects.equals(k.getKeyCode(), item.getKeyCode())).findFirst(); | |
| 759 | 773 | if (optional.isPresent()) { |
| 760 | 774 | location.setKeyInfoId(optional.get().getId()); |
| 761 | - }else{ | |
| 762 | - optional = keyInfos.stream().filter(k->Objects.equals(k.getPlateNum(),item.getPlate())).findFirst(); | |
| 775 | + } else { | |
| 776 | + optional = keyInfos.stream().filter(k -> Objects.equals(k.getPlateNum(), item.getPlate())).findFirst(); | |
| 763 | 777 | if (optional.isPresent()) { |
| 764 | 778 | location.setKeyInfoId(optional.get().getId()); |
| 765 | 779 | } |
| ... | ... | @@ -869,7 +883,7 @@ public class KeyBoxController extends BaseController { |
| 869 | 883 | } |
| 870 | 884 | |
| 871 | 885 | if (CollectionUtils.isNotEmpty(drivers)) { |
| 872 | - Optional<NewDriver> opt = drivers.stream().filter(d -> Objects.equals(d.getJobCode(),optional.get().getJobCode())).findFirst(); | |
| 886 | + Optional<NewDriver> opt = drivers.stream().filter(d -> Objects.equals(d.getJobCode(), optional.get().getJobCode())).findFirst(); | |
| 873 | 887 | if (opt.isPresent()) { |
| 874 | 888 | recordsVo.setStaffName(opt.get().getPersonnelName()); |
| 875 | 889 | } |
| ... | ... | @@ -877,9 +891,9 @@ public class KeyBoxController extends BaseController { |
| 877 | 891 | } |
| 878 | 892 | } |
| 879 | 893 | |
| 880 | - if(Objects.nonNull(l.getUpdateTime())){ | |
| 894 | + if (Objects.nonNull(l.getUpdateTime())) { | |
| 881 | 895 | recordsVo.setTime(l.getUpdateTime()); |
| 882 | - }else if(Objects.nonNull(l.getCreateTime())){ | |
| 896 | + } else if (Objects.nonNull(l.getCreateTime())) { | |
| 883 | 897 | recordsVo.setTime(l.getCreateTime()); |
| 884 | 898 | } |
| 885 | 899 | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/in/service/ISignInService.java
| ... | ... | @@ -75,6 +75,8 @@ public interface ISignInService extends IService<SignIn> { |
| 75 | 75 | */ |
| 76 | 76 | AjaxResult addSignIn(SignIn signIn) throws FileUploadException, IOException; |
| 77 | 77 | |
| 78 | + AjaxResult getAjaxResultByDriverSignInfo(SignIn signIn, SignInResponseVo vo); | |
| 79 | + | |
| 78 | 80 | AjaxResult addSign(SignIn signIn, Driver driver, LinggangScheduling scheduling) throws IOException; |
| 79 | 81 | |
| 80 | 82 | String repairSignRecord(HttpServletRequest request); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
| ... | ... | @@ -530,7 +530,8 @@ public class SignInServiceImpl extends ServiceImpl<SignInMapper, SignIn> impleme |
| 530 | 530 | return vo; |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | - private AjaxResult getAjaxResultByDriverSignInfo(SignIn signIn, SignInResponseVo vo) { | |
| 533 | + @Override | |
| 534 | + public AjaxResult getAjaxResultByDriverSignInfo(SignIn signIn, SignInResponseVo vo) { | |
| 534 | 535 | String key = REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW + ConstDateUtil.formatDate("yyyyMMdd") + ":" + signIn.getJobCode(); |
| 535 | 536 | // 驾驶员酒精测试连续超标两次则提示换人 |
| 536 | 537 | Integer count = redisCache.getCacheObject(key); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/carinfo/CarInfoService.java
| ... | ... | @@ -20,6 +20,8 @@ public interface CarInfoService extends IService<CarInfo> { |
| 20 | 20 | */ |
| 21 | 21 | List<CarInfo> list(CarInfo entity); |
| 22 | 22 | |
| 23 | + List<CarInfo> listLikeNbbs(CarInfo carInfo); | |
| 24 | + | |
| 23 | 25 | List<CarInfo> likePlateNumPlateNumTop30(CarInfo entity); |
| 24 | 26 | /**根据车辆自编号查询车辆信息*/ |
| 25 | 27 | List<CarInfo> list(Collection<String> nbbms); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/impl/carinfo/CarInfoServiceImpl.java
| ... | ... | @@ -10,6 +10,7 @@ import com.ruoyi.domain.caiinfo.CarInfo; |
| 10 | 10 | import com.ruoyi.mapper.carinfo.CarInfoMapper; |
| 11 | 11 | import com.ruoyi.service.carinfo.CarInfoService; |
| 12 | 12 | import org.apache.commons.collections4.CollectionUtils; |
| 13 | +import org.apache.commons.lang3.StringUtils; | |
| 13 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | 15 | import org.springframework.stereotype.Service; |
| 15 | 16 | |
| ... | ... | @@ -56,6 +57,17 @@ public class CarInfoServiceImpl extends ServiceImpl<CarInfoMapper, CarInfo> impl |
| 56 | 57 | } |
| 57 | 58 | |
| 58 | 59 | @Override |
| 60 | + public List<CarInfo> listLikeNbbs(CarInfo carInfo) { | |
| 61 | + String nbbs = carInfo.getNbbm(); | |
| 62 | + carInfo.setNbbm(null); | |
| 63 | + LambdaQueryWrapper<CarInfo> wrapper = new LambdaQueryWrapper<>(carInfo); | |
| 64 | + if (StringUtils.isNotEmpty(nbbs)) { | |
| 65 | + wrapper.like(CarInfo::getNbbm, nbbs); | |
| 66 | + } | |
| 67 | + return list(wrapper); | |
| 68 | + } | |
| 69 | + | |
| 70 | + @Override | |
| 59 | 71 | public List<CarInfo> likePlateNumPlateNumTop30(CarInfo entity) { |
| 60 | 72 | String plateNum = entity.getPlateNum(); |
| 61 | 73 | entity.setPlateNum(null); |
| ... | ... | @@ -82,9 +94,9 @@ public class CarInfoServiceImpl extends ServiceImpl<CarInfoMapper, CarInfo> impl |
| 82 | 94 | @Override |
| 83 | 95 | public List<CarInfo> list(CarInfo carInfo, Collection<String> nbbms) { |
| 84 | 96 | LambdaQueryWrapper<CarInfo> wrapper = null; |
| 85 | - if(Objects.isNull(carInfo)) { | |
| 97 | + if (Objects.isNull(carInfo)) { | |
| 86 | 98 | wrapper = new LambdaQueryWrapper<>(); |
| 87 | - }else{ | |
| 99 | + } else { | |
| 88 | 100 | wrapper = new LambdaQueryWrapper<>(carInfo); |
| 89 | 101 | } |
| 90 | 102 | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/impl/dss/FaceServiceImpl.java
| ... | ... | @@ -45,7 +45,10 @@ public class FaceServiceImpl implements FaceService { |
| 45 | 45 | |
| 46 | 46 | @Override |
| 47 | 47 | public NewDriver checkFace(NewDriver driver) { |
| 48 | - List<NewDriver> drivers = newDriverService.list(new NewDriver()); | |
| 48 | + NewDriver driver1 = new NewDriver(); | |
| 49 | + driver1.setFaceSignIn(1); | |
| 50 | + | |
| 51 | + List<NewDriver> drivers = newDriverService.list(driver1); | |
| 49 | 52 | return checkFace(drivers, driver); |
| 50 | 53 | } |
| 51 | 54 | ... | ... |