Commit 1c59a0389a2b8df5fc4902928af44e275a1d1b1e

Authored by liujun001
1 parent 82b2daaf

归还钥匙、领取钥匙使用车辆自编号

Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
@@ -8,6 +8,7 @@ import com.ruoyi.common.core.controller.BaseController; @@ -8,6 +8,7 @@ import com.ruoyi.common.core.controller.BaseController;
8 import com.ruoyi.common.core.domain.AjaxResult; 8 import com.ruoyi.common.core.domain.AjaxResult;
9 import com.ruoyi.common.core.domain.ResponseResult; 9 import com.ruoyi.common.core.domain.ResponseResult;
10 import com.ruoyi.common.core.domain.entity.SysDictData; 10 import com.ruoyi.common.core.domain.entity.SysDictData;
  11 +import com.ruoyi.common.core.redis.RedisCache;
11 import com.ruoyi.common.exception.file.FileUploadException; 12 import com.ruoyi.common.exception.file.FileUploadException;
12 import com.ruoyi.domain.OrderEntity; 13 import com.ruoyi.domain.OrderEntity;
13 import com.ruoyi.domain.caiinfo.CarInfo; 14 import com.ruoyi.domain.caiinfo.CarInfo;
@@ -44,6 +45,7 @@ import com.ruoyi.service.dss.FaceService; @@ -44,6 +45,7 @@ import com.ruoyi.service.dss.FaceService;
44 import com.ruoyi.service.scheduling.LinggangSchedulingService; 45 import com.ruoyi.service.scheduling.LinggangSchedulingService;
45 import com.ruoyi.service.sign.in.resource.LinggangSignInResourceService; 46 import com.ruoyi.service.sign.in.resource.LinggangSignInResourceService;
46 import com.ruoyi.system.service.ISysDictDataService; 47 import com.ruoyi.system.service.ISysDictDataService;
  48 +import com.ruoyi.utils.ConstDateUtil;
47 import com.ruoyi.utils.DateUtil; 49 import com.ruoyi.utils.DateUtil;
48 import io.swagger.annotations.Api; 50 import io.swagger.annotations.Api;
49 import io.swagger.annotations.ApiOperation; 51 import io.swagger.annotations.ApiOperation;
@@ -64,6 +66,8 @@ import java.util.*; @@ -64,6 +66,8 @@ import java.util.*;
64 import java.util.stream.Collectors; 66 import java.util.stream.Collectors;
65 67
66 import static com.ruoyi.common.ConstDriverProperties.BC_TYPE_OUT; 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 * @author liujun 73 * @author liujun
@@ -90,6 +94,8 @@ public class DssDriverController extends BaseController { @@ -90,6 +94,8 @@ public class DssDriverController extends BaseController {
90 private IEquipmentService equipmentService; 94 private IEquipmentService equipmentService;
91 @Autowired 95 @Autowired
92 private LinggangSignInResourceService signInResourceService; 96 private LinggangSignInResourceService signInResourceService;
  97 + @Autowired
  98 + private RedisCache redisCache;
93 99
94 @PostMapping(value = "/Driver/Login") 100 @PostMapping(value = "/Driver/Login")
95 @ApiOperation("人员登录设备") 101 @ApiOperation("人员登录设备")
@@ -201,6 +207,7 @@ public class DssDriverController extends BaseController { @@ -201,6 +207,7 @@ public class DssDriverController extends BaseController {
201 return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); 207 return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage());
202 } 208 }
203 209
  210 +
204 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); 211 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice());
205 if (StringUtils.isNotEmpty(msg)) { 212 if (StringUtils.isNotEmpty(msg)) {
206 log.info(msg); 213 log.info(msg);
@@ -582,13 +589,16 @@ public class DssDriverController extends BaseController { @@ -582,13 +589,16 @@ public class DssDriverController extends BaseController {
582 private GetWineRecordVo convertGetWineRecordVo(SignIn signIn) { 589 private GetWineRecordVo convertGetWineRecordVo(SignIn signIn) {
583 GetWineRecordVo vo = new GetWineRecordVo(); 590 GetWineRecordVo vo = new GetWineRecordVo();
584 vo.setCheckTime(signIn.getCreateTime()); 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 vo.setCheck(Objects.equals(signIn.getType(), 0)); 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 return vo; 602 return vo;
593 } 603 }
594 604
@@ -631,7 +641,7 @@ public class DssDriverController extends BaseController { @@ -631,7 +641,7 @@ public class DssDriverController extends BaseController {
631 if (CollectionUtils.isNotEmpty(carInfos)) { 641 if (CollectionUtils.isNotEmpty(carInfos)) {
632 Optional<CarInfo> optional = carInfos.stream().filter(c -> Objects.equals(c.getNbbm(), scheduling.getNbbm())).findFirst(); 642 Optional<CarInfo> optional = carInfos.stream().filter(c -> Objects.equals(c.getNbbm(), scheduling.getNbbm())).findFirst();
633 if (optional.isPresent()) { 643 if (optional.isPresent()) {
634 - vo.setCarNo(optional.get().getPlateNum()); 644 + vo.setCarNo(optional.get().getNbbm());
635 } 645 }
636 } 646 }
637 vo.setRouteName(scheduling.getLineName()); 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,6 +77,8 @@ public class DssFaceController extends BaseController {
77 77
78 NewDriver driver = new NewDriver(); 78 NewDriver driver = new NewDriver();
79 driver.setPosts("驾驶员"); 79 driver.setPosts("驾驶员");
  80 + driver.setFaceSignIn(1);
  81 +
80 List<NewDriver> drivers = newDriverService.list(driver); 82 List<NewDriver> drivers = newDriverService.list(driver);
81 List<ReqDataVo> vos = convertReqDataVo(drivers); 83 List<ReqDataVo> vos = convertReqDataVo(drivers);
82 return ResponseResult.success(vos); 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,9 +92,9 @@ public class KeyBoxController extends BaseController {
92 } 92 }
93 93
94 String msg = JwtAuthenticationTokenFilter.validateDevice(request.getDevice()); 94 String msg = JwtAuthenticationTokenFilter.validateDevice(request.getDevice());
95 - if(StringUtils.isNotEmpty(msg)){ 95 + if (StringUtils.isNotEmpty(msg)) {
96 log.info(msg); 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 LingangEquipmentLinkeLog linkeLog = saveLog(request); 100 LingangEquipmentLinkeLog linkeLog = saveLog(request);
@@ -110,9 +110,9 @@ public class KeyBoxController extends BaseController { @@ -110,9 +110,9 @@ public class KeyBoxController extends BaseController {
110 } 110 }
111 111
112 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); 112 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice());
113 - if(StringUtils.isNotEmpty(msg)){ 113 + if (StringUtils.isNotEmpty(msg)) {
114 log.info(msg); 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,9 +159,9 @@ public class KeyBoxController extends BaseController {
159 } 159 }
160 160
161 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); 161 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice());
162 - if(StringUtils.isNotEmpty(msg)){ 162 + if (StringUtils.isNotEmpty(msg)) {
163 log.info(msg); 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 try { 167 try {
@@ -195,7 +195,7 @@ public class KeyBoxController extends BaseController { @@ -195,7 +195,7 @@ public class KeyBoxController extends BaseController {
195 scheduling.setCzCode(venueInfo.getParkCode()); 195 scheduling.setCzCode(venueInfo.getParkCode());
196 scheduling.setStartScheduleDate(DateUtil.shortDate(dto.getTime())); 196 scheduling.setStartScheduleDate(DateUtil.shortDate(dto.getTime()));
197 scheduling.setType(1); 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 List<LinggangScheduling> schedulings = schedulingService.listByCZ(scheduling); 200 List<LinggangScheduling> schedulings = schedulingService.listByCZ(scheduling);
201 Set<String> jobCodes = null; 201 Set<String> jobCodes = null;
@@ -216,7 +216,6 @@ public class KeyBoxController extends BaseController { @@ -216,7 +216,6 @@ public class KeyBoxController extends BaseController {
216 } 216 }
217 217
218 218
219 -  
220 BasicSyncVo vo = convertBasicSyncVo(workLocations, schedulings, keyInfos, drivers, carInfos, equipment, venueInfo, equipmentList); 219 BasicSyncVo vo = convertBasicSyncVo(workLocations, schedulings, keyInfos, drivers, carInfos, equipment, venueInfo, equipmentList);
221 return ResponseResult.success(vo); 220 return ResponseResult.success(vo);
222 } catch (ParseException e) { 221 } catch (ParseException e) {
@@ -233,9 +232,9 @@ public class KeyBoxController extends BaseController { @@ -233,9 +232,9 @@ public class KeyBoxController extends BaseController {
233 } 232 }
234 233
235 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); 234 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice());
236 - if(StringUtils.isNotEmpty(msg)){ 235 + if (StringUtils.isNotEmpty(msg)) {
237 log.info(msg); 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 Equipment equipment = queryEquipment(dto.getDevice()); 240 Equipment equipment = queryEquipment(dto.getDevice());
@@ -256,20 +255,19 @@ public class KeyBoxController extends BaseController { @@ -256,20 +255,19 @@ public class KeyBoxController extends BaseController {
256 } 255 }
257 256
258 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); 257 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice());
259 - if(StringUtils.isNotEmpty(msg)){ 258 + if (StringUtils.isNotEmpty(msg)) {
260 log.info(msg); 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 LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation(); 264 LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation();
267 entity.setDevice(dto.getDevice()); 265 entity.setDevice(dto.getDevice());
268 List<LinggangKeyWorkLocation> schedulings = linggangKeyWorkLocationService.list(entity); 266 List<LinggangKeyWorkLocation> schedulings = linggangKeyWorkLocationService.list(entity);
269 267
270 List<KeyInfo> keyInfos = null; 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 keyInfos = keyInfoService.list(codes); 271 keyInfos = keyInfoService.list(codes);
274 } 272 }
275 273
@@ -279,7 +277,7 @@ public class KeyBoxController extends BaseController { @@ -279,7 +277,7 @@ public class KeyBoxController extends BaseController {
279 // return ResponseResult.error404(); 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 ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.TAKE_OUT); 281 ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.TAKE_OUT);
284 if (Objects.isNull(responseResult)) { 282 if (Objects.isNull(responseResult)) {
285 return ResponseResult.error(); 283 return ResponseResult.error();
@@ -299,9 +297,9 @@ public class KeyBoxController extends BaseController { @@ -299,9 +297,9 @@ public class KeyBoxController extends BaseController {
299 } 297 }
300 298
301 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); 299 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice());
302 - if(StringUtils.isNotEmpty(msg)){ 300 + if (StringUtils.isNotEmpty(msg)) {
303 log.info(msg); 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,19 +316,18 @@ public class KeyBoxController extends BaseController {
318 } 316 }
319 317
320 List<KeyInfo> keyInfos = null; 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 keyInfos = keyInfoService.list(codes); 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 // List<LinggangKeyWorkLocation> errorLocations = locations.stream().filter(l -> Objects.isNull(l.getKeyInfoId())).collect(Collectors.toList()); 331 // List<LinggangKeyWorkLocation> errorLocations = locations.stream().filter(l -> Objects.isNull(l.getKeyInfoId())).collect(Collectors.toList());
335 // locations = locations.stream().filter(l -> Objects.nonNull(l.getKeyInfoId())).collect(Collectors.toList()); 332 // locations = locations.stream().filter(l -> Objects.nonNull(l.getKeyInfoId())).collect(Collectors.toList());
336 ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.REPAY); 333 ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.REPAY);
@@ -357,45 +354,44 @@ public class KeyBoxController extends BaseController { @@ -357,45 +354,44 @@ public class KeyBoxController extends BaseController {
357 354
358 @PostMapping(value = "Driver/TurnKey/plan") 355 @PostMapping(value = "Driver/TurnKey/plan")
359 @ApiOperation(value = "钥匙归还计划") 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 if (bindingResult.hasErrors()) { 358 if (bindingResult.hasErrors()) {
362 return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); 359 return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage());
363 } 360 }
364 361
365 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); 362 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice());
366 - if(StringUtils.isNotEmpty(msg)){ 363 + if (StringUtils.isNotEmpty(msg)) {
367 log.info(msg); 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 LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation(); 369 LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation();
374 entity.setDevice(dto.getDevice()); 370 entity.setDevice(dto.getDevice());
375 entity.setType(2); 371 entity.setType(2);
376 entity.setDelFlag(Boolean.FALSE); 372 entity.setDelFlag(Boolean.FALSE);
377 entity.setStartScheduleDate(dto.getTime()); 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 List<LinggangKeyWorkLocation> schedulings = linggangKeyWorkLocationService.list(entity); 376 List<LinggangKeyWorkLocation> schedulings = linggangKeyWorkLocationService.list(entity);
381 - if(CollectionUtils.isEmpty(schedulings)){ 377 + if (CollectionUtils.isEmpty(schedulings)) {
382 return ResponseResult.success(); 378 return ResponseResult.success();
383 } 379 }
384 380
385 Set<Integer> keyIds = schedulings.stream().map(LinggangKeyWorkLocation::getKeyInfoId).collect(Collectors.toSet()); 381 Set<Integer> keyIds = schedulings.stream().map(LinggangKeyWorkLocation::getKeyInfoId).collect(Collectors.toSet());
386 382
387 List<KeyInfo> tempKeyInfos = null; 383 List<KeyInfo> tempKeyInfos = null;
388 - if(CollectionUtils.isNotEmpty(keyIds)){ 384 + if (CollectionUtils.isNotEmpty(keyIds)) {
389 tempKeyInfos = keyInfoService.listByIds(keyIds); 385 tempKeyInfos = keyInfoService.listByIds(keyIds);
390 } 386 }
391 List<KeyInfo> keyInfos = tempKeyInfos; 387 List<KeyInfo> keyInfos = tempKeyInfos;
392 int keyInfoSize = CollectionUtils.size(keyInfos); 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 TakeKeyPlanVo vo = convert(s); 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 vo.setKeyCode(optional.get().getKeyCode()); 395 vo.setKeyCode(optional.get().getKeyCode());
400 } 396 }
401 } 397 }
@@ -413,9 +409,9 @@ public class KeyBoxController extends BaseController { @@ -413,9 +409,9 @@ public class KeyBoxController extends BaseController {
413 } 409 }
414 410
415 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); 411 String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice());
416 - if(StringUtils.isNotEmpty(msg)){ 412 + if (StringUtils.isNotEmpty(msg)) {
417 log.info(msg); 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,15 +423,33 @@ public class KeyBoxController extends BaseController {
427 } 423 }
428 424
429 if (StringUtils.isNotEmpty(dto.getPlate())) { 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 KeyInfo keyInfo = new KeyInfo(); 443 KeyInfo keyInfo = new KeyInfo();
431 keyInfo.setPlateNum(dto.getPlate()); 444 keyInfo.setPlateNum(dto.getPlate());
432 keyInfos = keyInfoService.listLikePlate(keyInfo); 445 keyInfos = keyInfoService.listLikePlate(keyInfo);
433 if (CollectionUtils.isNotEmpty(keyInfos)) { 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 LinggangKeyWorkLocation location = new LinggangKeyWorkLocation(); 455 LinggangKeyWorkLocation location = new LinggangKeyWorkLocation();
@@ -468,7 +482,7 @@ public class KeyBoxController extends BaseController { @@ -468,7 +482,7 @@ public class KeyBoxController extends BaseController {
468 locationEq.setYardId(sourceEq.getYardId()); 482 locationEq.setYardId(sourceEq.getYardId());
469 locationEq.setStartScheduleDate(date); 483 locationEq.setStartScheduleDate(date);
470 locationEq.setKeyInfoIds(keyInfoIds); 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 // Set<Integer> types = new HashSet<>(); 487 // Set<Integer> types = new HashSet<>();
474 // types.add(1); 488 // types.add(1);
@@ -514,7 +528,7 @@ public class KeyBoxController extends BaseController { @@ -514,7 +528,7 @@ public class KeyBoxController extends BaseController {
514 scheduling.setJobCode(dto.getStaffCode()); 528 scheduling.setJobCode(dto.getStaffCode());
515 529
516 scheduling.setStartScheduleDate(DateUtil.shortDate(dto.getTime())); 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 // String bcType = Objects.equals(0, dto.getEventType()) ? ConstDriverProperties.BC_TYPE_OUT : Objects.equals(1, dto.getEventType()) ? ConstDriverProperties.BC_TYPE_IN : "other"; 532 // String bcType = Objects.equals(0, dto.getEventType()) ? ConstDriverProperties.BC_TYPE_OUT : Objects.equals(1, dto.getEventType()) ? ConstDriverProperties.BC_TYPE_IN : "other";
519 String bcType = ConstDriverProperties.BC_TYPE_OUT; 533 String bcType = ConstDriverProperties.BC_TYPE_OUT;
520 scheduling.setBcType(bcType); 534 scheduling.setBcType(bcType);
@@ -637,7 +651,7 @@ public class KeyBoxController extends BaseController { @@ -637,7 +651,7 @@ public class KeyBoxController extends BaseController {
637 // vo.setYardName(keyInfo.getY) 651 // vo.setYardName(keyInfo.getY)
638 vo.setDevice(workLocation.getDevice()); 652 vo.setDevice(workLocation.getDevice());
639 vo.setCabinetNo(workLocation.getCabinetNo()); 653 vo.setCabinetNo(workLocation.getCabinetNo());
640 - vo.setPlateNum(carInfo.getPlateNum()); 654 + vo.setPlateNum(carInfo.getNbbm());
641 655
642 return vo; 656 return vo;
643 } 657 }
@@ -701,7 +715,7 @@ public class KeyBoxController extends BaseController { @@ -701,7 +715,7 @@ public class KeyBoxController extends BaseController {
701 BasicSyncDriverWorkDriverPlanTimePlateVo planTimePlateVo = new BasicSyncDriverWorkDriverPlanTimePlateVo(); 715 BasicSyncDriverWorkDriverPlanTimePlateVo planTimePlateVo = new BasicSyncDriverWorkDriverPlanTimePlateVo();
702 planTimePlateVo.setKey(new Date(sc.getFcsjT())); 716 planTimePlateVo.setKey(new Date(sc.getFcsjT()));
703 717
704 - planTimePlateVo.setValue(carInfoOptional.get().getPlateNum()); 718 + planTimePlateVo.setValue(carInfoOptional.get().getNbbm());
705 planVo.setTimePlate(planTimePlateVo); 719 planVo.setTimePlate(planTimePlateVo);
706 720
707 return planVo; 721 return planVo;
@@ -716,7 +730,7 @@ public class KeyBoxController extends BaseController { @@ -716,7 +730,7 @@ public class KeyBoxController extends BaseController {
716 if (CollectionUtils.isNotEmpty(schedulings) && CollectionUtils.isNotEmpty(carInfos)) { 730 if (CollectionUtils.isNotEmpty(schedulings) && CollectionUtils.isNotEmpty(carInfos)) {
717 Set<String> nbbms = schedulings.stream().filter(s -> Objects.equals(s.getQdzcode(), venueInfo.getParkCode()) || 731 Set<String> nbbms = schedulings.stream().filter(s -> Objects.equals(s.getQdzcode(), venueInfo.getParkCode()) ||
718 Objects.equals(s.getZdzcode(), venueInfo.getParkCode())).map(LinggangScheduling::getNbbm).collect(Collectors.toSet()); 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 vo.setYardVehicles(plateNums); 734 vo.setYardVehicles(plateNums);
721 735
722 } 736 }
@@ -734,7 +748,7 @@ public class KeyBoxController extends BaseController { @@ -734,7 +748,7 @@ public class KeyBoxController extends BaseController {
734 return vo; 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 if (CollectionUtils.isEmpty(dto.getKeyItem())) { 752 if (CollectionUtils.isEmpty(dto.getKeyItem())) {
739 return Collections.emptyList(); 753 return Collections.emptyList();
740 } 754 }
@@ -754,12 +768,12 @@ public class KeyBoxController extends BaseController { @@ -754,12 +768,12 @@ public class KeyBoxController extends BaseController {
754 location.setKeyInfoId(opt.get().getKeyInfoId()); 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 if (optional.isPresent()) { 773 if (optional.isPresent()) {
760 location.setKeyInfoId(optional.get().getId()); 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 if (optional.isPresent()) { 777 if (optional.isPresent()) {
764 location.setKeyInfoId(optional.get().getId()); 778 location.setKeyInfoId(optional.get().getId());
765 } 779 }
@@ -869,7 +883,7 @@ public class KeyBoxController extends BaseController { @@ -869,7 +883,7 @@ public class KeyBoxController extends BaseController {
869 } 883 }
870 884
871 if (CollectionUtils.isNotEmpty(drivers)) { 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 if (opt.isPresent()) { 887 if (opt.isPresent()) {
874 recordsVo.setStaffName(opt.get().getPersonnelName()); 888 recordsVo.setStaffName(opt.get().getPersonnelName());
875 } 889 }
@@ -877,9 +891,9 @@ public class KeyBoxController extends BaseController { @@ -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 recordsVo.setTime(l.getUpdateTime()); 895 recordsVo.setTime(l.getUpdateTime());
882 - }else if(Objects.nonNull(l.getCreateTime())){ 896 + } else if (Objects.nonNull(l.getCreateTime())) {
883 recordsVo.setTime(l.getCreateTime()); 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&lt;SignIn&gt; { @@ -75,6 +75,8 @@ public interface ISignInService extends IService&lt;SignIn&gt; {
75 */ 75 */
76 AjaxResult addSignIn(SignIn signIn) throws FileUploadException, IOException; 76 AjaxResult addSignIn(SignIn signIn) throws FileUploadException, IOException;
77 77
  78 + AjaxResult getAjaxResultByDriverSignInfo(SignIn signIn, SignInResponseVo vo);
  79 +
78 AjaxResult addSign(SignIn signIn, Driver driver, LinggangScheduling scheduling) throws IOException; 80 AjaxResult addSign(SignIn signIn, Driver driver, LinggangScheduling scheduling) throws IOException;
79 81
80 String repairSignRecord(HttpServletRequest request); 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&lt;SignInMapper, SignIn&gt; impleme @@ -530,7 +530,8 @@ public class SignInServiceImpl extends ServiceImpl&lt;SignInMapper, SignIn&gt; impleme
530 return vo; 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 String key = REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW + ConstDateUtil.formatDate("yyyyMMdd") + ":" + signIn.getJobCode(); 535 String key = REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW + ConstDateUtil.formatDate("yyyyMMdd") + ":" + signIn.getJobCode();
535 // 驾驶员酒精测试连续超标两次则提示换人 536 // 驾驶员酒精测试连续超标两次则提示换人
536 Integer count = redisCache.getCacheObject(key); 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&lt;CarInfo&gt; { @@ -20,6 +20,8 @@ public interface CarInfoService extends IService&lt;CarInfo&gt; {
20 */ 20 */
21 List<CarInfo> list(CarInfo entity); 21 List<CarInfo> list(CarInfo entity);
22 22
  23 + List<CarInfo> listLikeNbbs(CarInfo carInfo);
  24 +
23 List<CarInfo> likePlateNumPlateNumTop30(CarInfo entity); 25 List<CarInfo> likePlateNumPlateNumTop30(CarInfo entity);
24 /**根据车辆自编号查询车辆信息*/ 26 /**根据车辆自编号查询车辆信息*/
25 List<CarInfo> list(Collection<String> nbbms); 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,6 +10,7 @@ import com.ruoyi.domain.caiinfo.CarInfo;
10 import com.ruoyi.mapper.carinfo.CarInfoMapper; 10 import com.ruoyi.mapper.carinfo.CarInfoMapper;
11 import com.ruoyi.service.carinfo.CarInfoService; 11 import com.ruoyi.service.carinfo.CarInfoService;
12 import org.apache.commons.collections4.CollectionUtils; 12 import org.apache.commons.collections4.CollectionUtils;
  13 +import org.apache.commons.lang3.StringUtils;
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
@@ -56,6 +57,17 @@ public class CarInfoServiceImpl extends ServiceImpl&lt;CarInfoMapper, CarInfo&gt; impl @@ -56,6 +57,17 @@ public class CarInfoServiceImpl extends ServiceImpl&lt;CarInfoMapper, CarInfo&gt; impl
56 } 57 }
57 58
58 @Override 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 public List<CarInfo> likePlateNumPlateNumTop30(CarInfo entity) { 71 public List<CarInfo> likePlateNumPlateNumTop30(CarInfo entity) {
60 String plateNum = entity.getPlateNum(); 72 String plateNum = entity.getPlateNum();
61 entity.setPlateNum(null); 73 entity.setPlateNum(null);
@@ -82,9 +94,9 @@ public class CarInfoServiceImpl extends ServiceImpl&lt;CarInfoMapper, CarInfo&gt; impl @@ -82,9 +94,9 @@ public class CarInfoServiceImpl extends ServiceImpl&lt;CarInfoMapper, CarInfo&gt; impl
82 @Override 94 @Override
83 public List<CarInfo> list(CarInfo carInfo, Collection<String> nbbms) { 95 public List<CarInfo> list(CarInfo carInfo, Collection<String> nbbms) {
84 LambdaQueryWrapper<CarInfo> wrapper = null; 96 LambdaQueryWrapper<CarInfo> wrapper = null;
85 - if(Objects.isNull(carInfo)) { 97 + if (Objects.isNull(carInfo)) {
86 wrapper = new LambdaQueryWrapper<>(); 98 wrapper = new LambdaQueryWrapper<>();
87 - }else{ 99 + } else {
88 wrapper = new LambdaQueryWrapper<>(carInfo); 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,7 +45,10 @@ public class FaceServiceImpl implements FaceService {
45 45
46 @Override 46 @Override
47 public NewDriver checkFace(NewDriver driver) { 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 return checkFace(drivers, driver); 52 return checkFace(drivers, driver);
50 } 53 }
51 54