Commit c18b21e5ed39fcf4d977edc12ce25e397f14e7f2

Authored by liujun001
1 parent 4e50ae8e

临港二期

Bsth-admin/src/main/java/com/ruoyi/controller/app/AppSignExceptionController.java
@@ -11,6 +11,7 @@ import com.ruoyi.domain.scheduling.LinggangScheduling; @@ -11,6 +11,7 @@ import com.ruoyi.domain.scheduling.LinggangScheduling;
11 import com.ruoyi.domain.sign.in.exception.report.EquipmentExceptionReport; 11 import com.ruoyi.domain.sign.in.exception.report.EquipmentExceptionReport;
12 import com.ruoyi.in.domain.SignIn; 12 import com.ruoyi.in.domain.SignIn;
13 import com.ruoyi.in.service.ISignInService; 13 import com.ruoyi.in.service.ISignInService;
  14 +import com.ruoyi.service.BigViewServiceV1;
14 import com.ruoyi.service.driver.NewDriverService; 15 import com.ruoyi.service.driver.NewDriverService;
15 import com.ruoyi.service.scheduling.LinggangSchedulingService; 16 import com.ruoyi.service.scheduling.LinggangSchedulingService;
16 import com.ruoyi.service.sign.in.exception.report.EquipmentExceptionReportService; 17 import com.ruoyi.service.sign.in.exception.report.EquipmentExceptionReportService;
@@ -51,6 +52,8 @@ public class AppSignExceptionController extends BaseController { @@ -51,6 +52,8 @@ public class AppSignExceptionController extends BaseController {
51 private ISignInService signInService; 52 private ISignInService signInService;
52 @Autowired 53 @Autowired
53 private ISysDictDataService dictDataService; 54 private ISysDictDataService dictDataService;
  55 + @Autowired
  56 + private BigViewServiceV1 bigViewServiceV1;
54 57
55 @ApiOperation("酒测签到异常") 58 @ApiOperation("酒测签到异常")
56 @PostMapping("/sign/exception/list") 59 @PostMapping("/sign/exception/list")
@@ -127,7 +130,11 @@ public class AppSignExceptionController extends BaseController { @@ -127,7 +130,11 @@ public class AppSignExceptionController extends BaseController {
127 Optional<SignIn> optSign = signIns.stream().filter(s -> Objects.equals(s.getId(), r.getSignId())).findFirst(); 130 Optional<SignIn> optSign = signIns.stream().filter(s -> Objects.equals(s.getId(), r.getSignId())).findFirst();
128 if (optSign.isPresent()) { 131 if (optSign.isPresent()) {
129 vo.setSignTime(optSign.get().getCreateTime()); 132 vo.setSignTime(optSign.get().getCreateTime());
130 - vo.setSignStatus(optSign.get().getExType()); 133 + if (bigViewServiceV1.isSignStatusWineEnum(optSign.get())) {
  134 + vo.setSignStatus(3);
  135 + } else {
  136 + vo.setSignStatus(optSign.get().getExType());
  137 + }
131 vo.setAlcoholIntake(optSign.get().getAlcoholIntake()); 138 vo.setAlcoholIntake(optSign.get().getAlcoholIntake());
132 139
133 if (schedulingSize > 0) { 140 if (schedulingSize > 0) {
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
@@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.AjaxResult; @@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
10 import com.ruoyi.common.core.domain.ResponseResult; 10 import com.ruoyi.common.core.domain.ResponseResult;
11 import com.ruoyi.common.core.domain.entity.SysDictData; 11 import com.ruoyi.common.core.domain.entity.SysDictData;
12 import com.ruoyi.common.core.redis.RedisCache; 12 import com.ruoyi.common.core.redis.RedisCache;
  13 +import com.ruoyi.domain.DriverScheduling;
13 import com.ruoyi.domain.OrderEntity; 14 import com.ruoyi.domain.OrderEntity;
14 import com.ruoyi.domain.caiinfo.CarInfo; 15 import com.ruoyi.domain.caiinfo.CarInfo;
15 import com.ruoyi.domain.driver.NewDriver; 16 import com.ruoyi.domain.driver.NewDriver;
@@ -246,11 +247,13 @@ public class DssDriverController extends BaseController { @@ -246,11 +247,13 @@ public class DssDriverController extends BaseController {
246 247
247 CalDriverScheduling calDriverScheduling = signInServiceV1.findSchedulingByDateTime(dto.getStaffCode(), new Date(), 1); 248 CalDriverScheduling calDriverScheduling = signInServiceV1.findSchedulingByDateTime(dto.getStaffCode(), new Date(), 1);
248 if(Objects.isNull(calDriverScheduling) || Objects.isNull(calDriverScheduling.getDriverScheduling()) || Objects.isNull(calDriverScheduling.getDriverScheduling().getSignInId())){ 249 if(Objects.isNull(calDriverScheduling) || Objects.isNull(calDriverScheduling.getDriverScheduling()) || Objects.isNull(calDriverScheduling.getDriverScheduling().getSignInId())){
249 - return ResponseResult.success(convertGetWineRecordVo(null)); 250 + return ResponseResult.success(convertGetWineRecordVo(null,null,null));
250 } 251 }
251 252
  253 +
  254 + Integer count = signInService.count(calDriverScheduling.getDriverScheduling().getId());
252 SignIn dataSignIn = signInService.getById(calDriverScheduling.getDriverScheduling().getSignInId()); 255 SignIn dataSignIn = signInService.getById(calDriverScheduling.getDriverScheduling().getSignInId());
253 - return ResponseResult.success(convertGetWineRecordVo(dataSignIn)); 256 + return ResponseResult.success(convertGetWineRecordVo(dataSignIn,calDriverScheduling.getDriverScheduling(),count));
254 } 257 }
255 258
256 @PostMapping(value = "/Info/GetBusPlanList") 259 @PostMapping(value = "/Info/GetBusPlanList")
@@ -627,19 +630,32 @@ public class DssDriverController extends BaseController { @@ -627,19 +630,32 @@ public class DssDriverController extends BaseController {
627 return new SignOutVo(dto.getDevice(), dto.getDriverCode(), dto.getLogoutTime(), vo.getId()); 630 return new SignOutVo(dto.getDevice(), dto.getDriverCode(), dto.getLogoutTime(), vo.getId());
628 } 631 }
629 632
630 - private GetWineRecordVo convertGetWineRecordVo(SignIn signIn) { 633 + private GetWineRecordVo convertGetWineRecordVo(SignIn signIn, DriverScheduling scheduling,Integer count) {
631 GetWineRecordVo vo = new GetWineRecordVo(); 634 GetWineRecordVo vo = new GetWineRecordVo();
632 if (Objects.isNull(signIn)) { 635 if (Objects.isNull(signIn)) {
633 vo.setCheck(true); 636 vo.setCheck(true);
634 return vo; 637 return vo;
635 } 638 }
636 vo.setCheckTime(signIn.getCreateTime()); 639 vo.setCheckTime(signIn.getCreateTime());
  640 + if(bigViewServiceV1.isSignStatusWineEnum(signIn)){
  641 + vo.setCheck(Boolean.TRUE);
  642 + return vo;
  643 + }
637 644
638 - String key = REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW + ConstDateUtil.formatDate("yyyyMMdd") + ":" + signIn.getJobCode()+":"+signIn.getSchedulingId();  
639 -  
640 - Integer count = redisCache.getCacheObject(key);  
641 - if (Objects.nonNull(count) && SIGN_IN_ERROR_COUNT.compareTo(count) <= 0) {  
642 - vo.setCheck(Objects.equals(signIn.getType(), 0)); 645 + Integer total = Objects.isNull(scheduling)||Objects.isNull(scheduling.getAlcoholCount())?SIGN_IN_ERROR_COUNT:scheduling.getAlcoholCount();
  646 + if (Objects.isNull(count) || total.compareTo(count) >= 0) {
  647 + if(bigViewServiceV1.isSignStatusDelayEnum(signIn)){
  648 + vo.setCheck(Boolean.FALSE);
  649 + return vo;
  650 + }
  651 + vo.setCheck(!Objects.equals(signIn.getType(), 0));
  652 + return vo;
  653 + }else if(count > total){
  654 + if(bigViewServiceV1.isSignStatusDelayEnum(signIn)){
  655 + vo.setCheck(Boolean.FALSE);
  656 + return vo;
  657 + }
  658 + vo.setCheck(!Objects.equals(signIn.getType(), 0));
643 return vo; 659 return vo;
644 } 660 }
645 661
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
@@ -278,9 +278,34 @@ public class KeyBoxController extends BaseController { @@ -278,9 +278,34 @@ public class KeyBoxController extends BaseController {
278 List<LinggangKeyWorkLocation> schedulings = linggangKeyWorkLocationService.list(entity); 278 List<LinggangKeyWorkLocation> schedulings = linggangKeyWorkLocationService.list(entity);
279 279
280 List<KeyInfo> keyInfos = null; 280 List<KeyInfo> keyInfos = null;
281 - if (CollectionUtils.isNotEmpty(dto.getKeyItem())) {  
282 - Set<String> codes = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getKeyCode).filter(obj -> Objects.nonNull(obj)).collect(Collectors.toSet());  
283 - keyInfos = keyInfoService.list(codes); 281 +// if (CollectionUtils.isNotEmpty(dto.getKeyItem())) {
  282 +// Set<String> codes = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getKeyCode).filter(obj -> Objects.nonNull(obj)).collect(Collectors.toSet());
  283 +// keyInfos = keyInfoService.list(codes);
  284 +// }
  285 +
  286 + Set<String> nbbms = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getPlate).filter(obj -> StringUtils.isNotEmpty(obj)).collect(Collectors.toSet());
  287 + if (CollectionUtils.isNotEmpty(nbbms)) {
  288 + List<CarInfo> carInfos = carInfoService.list(nbbms);
  289 + if (CollectionUtils.isNotEmpty(nbbms)) {
  290 + Set<String> plateNums = carInfos.stream().map(CarInfo::getPlateNum).filter(obj -> StringUtils.isNotEmpty(obj)).collect(Collectors.toSet());
  291 + if (CollectionUtils.isNotEmpty(plateNums)) {
  292 + keyInfos = keyInfoService.listPlateNums(plateNums);
  293 + if(CollectionUtils.isNotEmpty(keyInfos)){
  294 + keyInfos = keyInfos.stream().map(k->{
  295 + Optional<CarInfo> optCar = carInfos.stream().filter(c->Objects.equals(k.getPlateNum(),c.getPlateNum())).findFirst();
  296 + optCar.ifPresent(c->k.setNmmb(c.getNbbm()));
  297 +
  298 + return k;
  299 + }).collect(Collectors.toList());
  300 + }
  301 + }
  302 + }
  303 + }
  304 +
  305 + Equipment equipment = equipmentService.getOneByDeviceId(dto.getDevice());
  306 + LinggangVenueInfo venueInfo = null;
  307 + if(Objects.nonNull(equipment)){
  308 + venueInfo = venueInfoService.getById(equipment.getYardId());
284 } 309 }
285 310
286 NewDriver driver = newDriverService.getOne(dto.getStaffCode()); 311 NewDriver driver = newDriverService.getOne(dto.getStaffCode());
@@ -289,12 +314,11 @@ public class KeyBoxController extends BaseController { @@ -289,12 +314,11 @@ public class KeyBoxController extends BaseController {
289 // return ResponseResult.error404(); 314 // return ResponseResult.error404();
290 // } 315 // }
291 316
292 - List<LinggangKeyWorkLocation> locations = convert(dto, schedulings, driver, keyInfos, 0);  
293 - ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.TAKE_OUT); 317 + List<LinggangKeyWorkLocation> locations = convert(dto, schedulings, driver, keyInfos, 1,venueInfo);
  318 + ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.saveAndDel(locations);
294 if (Objects.isNull(responseResult)) { 319 if (Objects.isNull(responseResult)) {
295 return ResponseResult.error(); 320 return ResponseResult.error();
296 } 321 }
297 - Equipment equipment = equipmentService.getOneByDeviceId(dto.getDevice());  
298 322
299 TakeKeyVo vo = convertTakeKeyVo(dto, responseResult, equipment); 323 TakeKeyVo vo = convertTakeKeyVo(dto, responseResult, equipment);
300 324
@@ -328,21 +352,36 @@ public class KeyBoxController extends BaseController { @@ -328,21 +352,36 @@ public class KeyBoxController extends BaseController {
328 } 352 }
329 353
330 List<KeyInfo> keyInfos = null; 354 List<KeyInfo> keyInfos = null;
331 - if (CollectionUtils.isNotEmpty(dto.getKeyItem())) {  
332 - Set<String> codes = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getKeyCode).filter(obj -> Objects.nonNull(obj)).collect(Collectors.toSet());  
333 - keyInfos = keyInfoService.list(codes);  
334 355
335 - if (CollectionUtils.isEmpty(keyInfos)) {  
336 - codes = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getPlate).filter(obj -> Objects.nonNull(obj)).collect(Collectors.toSet());  
337 - keyInfos = keyInfoService.list(null, codes); 356 +
  357 + Set<String> nbbms = dto.getKeyItem().stream().map(TakeKeyKeyItemDTO::getPlate).filter(obj -> StringUtils.isNotEmpty(obj)).collect(Collectors.toSet());
  358 + if (CollectionUtils.isNotEmpty(nbbms)) {
  359 + List<CarInfo> carInfos = carInfoService.list(nbbms);
  360 + if (CollectionUtils.isNotEmpty(nbbms)) {
  361 + Set<String> plateNums = carInfos.stream().map(CarInfo::getPlateNum).filter(obj -> StringUtils.isNotEmpty(obj)).collect(Collectors.toSet());
  362 + if (CollectionUtils.isNotEmpty(plateNums)) {
  363 + keyInfos = keyInfoService.listPlateNums(plateNums);
  364 + if(CollectionUtils.isNotEmpty(keyInfos)){
  365 + keyInfos = keyInfos.stream().map(k->{
  366 + Optional<CarInfo> optCar = carInfos.stream().filter(c->Objects.equals(k.getPlateNum(),c.getPlateNum())).findFirst();
  367 + optCar.ifPresent(c->k.setNmmb(c.getNbbm()));
  368 +
  369 + return k;
  370 + }).collect(Collectors.toList());
  371 + }
  372 + }
338 } 373 }
339 } 374 }
340 375
341 -  
342 - List<LinggangKeyWorkLocation> locations = convert(dto, schedulings, driver, keyInfos, 1); 376 + Equipment equipment = equipmentService.getOneByDeviceId(dto.getDevice());
  377 + LinggangVenueInfo venueInfo = null;
  378 + if(Objects.nonNull(equipment)){
  379 + venueInfo = venueInfoService.getById(equipment.getYardId());
  380 + }
  381 + List<LinggangKeyWorkLocation> locations = convert(dto, schedulings, driver, keyInfos, 0,venueInfo);
343 // List<LinggangKeyWorkLocation> errorLocations = locations.stream().filter(l -> Objects.isNull(l.getKeyInfoId())).collect(Collectors.toList()); 382 // List<LinggangKeyWorkLocation> errorLocations = locations.stream().filter(l -> Objects.isNull(l.getKeyInfoId())).collect(Collectors.toList());
344 // locations = locations.stream().filter(l -> Objects.nonNull(l.getKeyInfoId())).collect(Collectors.toList()); 383 // locations = locations.stream().filter(l -> Objects.nonNull(l.getKeyInfoId())).collect(Collectors.toList());
345 - ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.REPAY); 384 + ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.saveAndDel(locations);
346 if (Objects.isNull(responseResult)) { 385 if (Objects.isNull(responseResult)) {
347 return ResponseResult.error(); 386 return ResponseResult.error();
348 } 387 }
@@ -357,8 +396,6 @@ public class KeyBoxController extends BaseController { @@ -357,8 +396,6 @@ public class KeyBoxController extends BaseController {
357 // return ResponseResult.error(responseResult.getCode(), JSON.toJSONString(errorCode) + "归还失败,请归还到指定位置"); 396 // return ResponseResult.error(responseResult.getCode(), JSON.toJSONString(errorCode) + "归还失败,请归还到指定位置");
358 // } 397 // }
359 398
360 -  
361 - Equipment equipment = equipmentService.getOneByDeviceId(dto.getDevice());  
362 TakeKeyVo vo = convertTakeKeyVo(dto, responseResult, equipment); 399 TakeKeyVo vo = convertTakeKeyVo(dto, responseResult, equipment);
363 400
364 return new ResponseResult<>(responseResult.getCode(), responseResult.getMsg(), vo); 401 return new ResponseResult<>(responseResult.getCode(), responseResult.getMsg(), vo);
@@ -751,7 +788,7 @@ public class KeyBoxController extends BaseController { @@ -751,7 +788,7 @@ public class KeyBoxController extends BaseController {
751 return vo; 788 return vo;
752 } 789 }
753 790
754 - private List<LinggangKeyWorkLocation> convert(TakeKeyDTO dto, List<LinggangKeyWorkLocation> schedulings, NewDriver driver, List<KeyInfo> keyInfos, int ty) { 791 + private List<LinggangKeyWorkLocation> convert(TakeKeyDTO dto, List<LinggangKeyWorkLocation> schedulings, NewDriver driver, List<KeyInfo> keyInfos, int ty,LinggangVenueInfo venueInfo) {
755 if (CollectionUtils.isEmpty(dto.getKeyItem())) { 792 if (CollectionUtils.isEmpty(dto.getKeyItem())) {
756 return Collections.emptyList(); 793 return Collections.emptyList();
757 } 794 }
@@ -766,6 +803,7 @@ public class KeyBoxController extends BaseController { @@ -766,6 +803,7 @@ public class KeyBoxController extends BaseController {
766 location.setPlate(item.getPlate()); 803 location.setPlate(item.getPlate());
767 location.setTime(dto.getTime()); 804 location.setTime(dto.getTime());
768 location.setType1(ty); 805 location.setType1(ty);
  806 + location.setCabinetNo(item.getParkCode());
769 location.setJobCode(dto.getStaffCode()); 807 location.setJobCode(dto.getStaffCode());
770 if (CollectionUtils.isNotEmpty(schedulings)) { 808 if (CollectionUtils.isNotEmpty(schedulings)) {
771 Optional<LinggangKeyWorkLocation> opt = schedulings.stream().filter(s -> Objects.equals(item.getKey(), s.getCabinetNo())).findFirst(); 809 Optional<LinggangKeyWorkLocation> opt = schedulings.stream().filter(s -> Objects.equals(item.getKey(), s.getCabinetNo())).findFirst();
@@ -778,7 +816,7 @@ public class KeyBoxController extends BaseController { @@ -778,7 +816,7 @@ public class KeyBoxController extends BaseController {
778 if (optional.isPresent()) { 816 if (optional.isPresent()) {
779 location.setKeyInfoId(optional.get().getId()); 817 location.setKeyInfoId(optional.get().getId());
780 } else { 818 } else {
781 - optional = keyInfos.stream().filter(k -> Objects.equals(k.getPlateNum(), item.getPlate())).findFirst(); 819 + optional = keyInfos.stream().filter(k -> Objects.equals(k.getNmmb(), item.getPlate())).findFirst();
782 if (optional.isPresent()) { 820 if (optional.isPresent()) {
783 location.setKeyInfoId(optional.get().getId()); 821 location.setKeyInfoId(optional.get().getId());
784 } 822 }
@@ -788,6 +826,11 @@ public class KeyBoxController extends BaseController { @@ -788,6 +826,11 @@ public class KeyBoxController extends BaseController {
788 if (Objects.nonNull(driver)) { 826 if (Objects.nonNull(driver)) {
789 location.setCreateBy(Convert.toLong(driver.getId())); 827 location.setCreateBy(Convert.toLong(driver.getId()));
790 } 828 }
  829 +
  830 + if(Objects.nonNull(venueInfo)){
  831 + location.setYardId(venueInfo.getId());
  832 + location.setYardName(venueInfo.getName());
  833 + }
791 location.setCreateTime(new Date()); 834 location.setCreateTime(new Date());
792 835
793 return location; 836 return location;
Bsth-admin/src/main/java/com/ruoyi/domain/dss/key/box/dto/TakeKeyDTO.java
@@ -52,7 +52,7 @@ public class TakeKeyDTO implements java.io.Serializable { @@ -52,7 +52,7 @@ public class TakeKeyDTO implements java.io.Serializable {
52 52
53 // @NotEmpty(message = "选择的钥匙位车牌 不能为空") 53 // @NotEmpty(message = "选择的钥匙位车牌 不能为空")
54 // @ApiModelProperty(value = "选择的钥匙位车牌", required = true) 54 // @ApiModelProperty(value = "选择的钥匙位车牌", required = true)
55 -// private String plate; 55 + private String plate;
56 @ApiModelProperty(value = "领取钥匙信息集合") 56 @ApiModelProperty(value = "领取钥匙信息集合")
57 private List<TakeKeyKeyItemDTO> keyItem; 57 private List<TakeKeyKeyItemDTO> keyItem;
58 58
Bsth-admin/src/main/java/com/ruoyi/domain/key/info/KeyInfo.java
@@ -63,6 +63,9 @@ public class KeyInfo { @@ -63,6 +63,9 @@ public class KeyInfo {
63 @Excel(name = "钥匙编码") 63 @Excel(name = "钥匙编码")
64 private java.lang.String keyCode; 64 private java.lang.String keyCode;
65 65
  66 + @TableField(exist = false)
  67 + private String nmmb;
  68 +
66 69
67 @Override 70 @Override
68 public String toString() { 71 public String toString() {
Bsth-admin/src/main/java/com/ruoyi/in/domain/SignInV1.java
@@ -118,6 +118,8 @@ public class SignInV1 { @@ -118,6 +118,8 @@ public class SignInV1 {
118 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 118 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
119 private Date updateTime; 119 private Date updateTime;
120 120
  121 + private java.lang.Long schedulingId;
  122 +
121 /** 123 /**
122 * 备注 124 * 备注
123 */ 125 */
Bsth-admin/src/main/java/com/ruoyi/in/service/ISignInService.java
@@ -106,4 +106,6 @@ public interface ISignInService extends IService&lt;SignIn&gt; { @@ -106,4 +106,6 @@ public interface ISignInService extends IService&lt;SignIn&gt; {
106 * @return int 0:未签到,1:已签到 106 * @return int 0:未签到,1:已签到
107 */ 107 */
108 int signOutType(NewDriver driver); 108 int signOutType(NewDriver driver);
  109 +
  110 + int count(Long scheduleId);
109 } 111 }
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
@@ -413,6 +413,14 @@ public class SignInServiceImpl extends ServiceImpl&lt;SignInMapper, SignIn&gt; impleme @@ -413,6 +413,14 @@ public class SignInServiceImpl extends ServiceImpl&lt;SignInMapper, SignIn&gt; impleme
413 return 0; 413 return 0;
414 } 414 }
415 415
  416 + @Override
  417 + public int count(Long scheduleId) {
  418 + LambdaQueryWrapper<SignIn> countWrapper = new LambdaQueryWrapper<>();
  419 + countWrapper.select(SignIn::getId);
  420 + countWrapper.eq(SignIn::getSchedulingId,scheduleId);
  421 + return count(countWrapper);
  422 + }
  423 +
416 424
417 private String handleDate(String dateString) { 425 private String handleDate(String dateString) {
418 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); 426 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceV1Impl.java
@@ -2,6 +2,7 @@ package com.ruoyi.in.service.impl; @@ -2,6 +2,7 @@ package com.ruoyi.in.service.impl;
2 2
3 import cn.hutool.core.convert.Convert; 3 import cn.hutool.core.convert.Convert;
4 import com.alibaba.fastjson2.JSON; 4 import com.alibaba.fastjson2.JSON;
  5 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
5 import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; 6 import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
6 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 import com.ruoyi.common.ConstDriverProperties; 8 import com.ruoyi.common.ConstDriverProperties;
@@ -295,7 +296,7 @@ public class SignInServiceV1Impl extends ServiceImpl&lt;SignInMapperV1, SignInV1&gt; i @@ -295,7 +296,7 @@ public class SignInServiceV1Impl extends ServiceImpl&lt;SignInMapperV1, SignInV1&gt; i
295 signInResource.setCreateBy(Convert.toLong(signIn.getCreateBy())); 296 signInResource.setCreateBy(Convert.toLong(signIn.getCreateBy()));
296 signInResourceService.save(signInResource); 297 signInResourceService.save(signInResource);
297 } 298 }
298 - signInV1.setId(signInV1.getId()); 299 + signInV1.setId(signIn.getId());
299 // 更新考勤 300 // 更新考勤
300 if (Objects.nonNull(calDriverScheduling)) { 301 if (Objects.nonNull(calDriverScheduling)) {
301 schedulingService.computedSignInBySignIn(scheduling, calDriverScheduling.getIndex(), signIn, true, signInService); 302 schedulingService.computedSignInBySignIn(scheduling, calDriverScheduling.getIndex(), signIn, true, signInService);
@@ -305,6 +306,10 @@ public class SignInServiceV1Impl extends ServiceImpl&lt;SignInMapperV1, SignInV1&gt; i @@ -305,6 +306,10 @@ public class SignInServiceV1Impl extends ServiceImpl&lt;SignInMapperV1, SignInV1&gt; i
305 TempCache.updateSignStatus(signIn.getJobCode()); 306 TempCache.updateSignStatus(signIn.getJobCode());
306 } 307 }
307 308
  309 + LambdaUpdateWrapper<SignInV1> updateWrapper = new LambdaUpdateWrapper<>();
  310 + updateWrapper.set(SignInV1::getSchedulingId, scheduling.getId());
  311 + updateWrapper.eq(SignInV1::getId, signIn.getId());
  312 + update(updateWrapper);
308 // 异常保存到异常异常中 313 // 异常保存到异常异常中
309 threadJobService.asyncInsertExceptionRecord(signIn, driver, scheduling); 314 threadJobService.asyncInsertExceptionRecord(signIn, driver, scheduling);
310 315
Bsth-admin/src/main/java/com/ruoyi/scheduling/service/impl/SchedulingServiceV1Impl.java
@@ -24,7 +24,8 @@ public class SchedulingServiceV1Impl extends ServiceImpl&lt;SchedulingMapperV1, Dri @@ -24,7 +24,8 @@ public class SchedulingServiceV1Impl extends ServiceImpl&lt;SchedulingMapperV1, Dri
24 SchedulingDateEntity entity = switchSchedulingDate(date); 24 SchedulingDateEntity entity = switchSchedulingDate(date);
25 wrapper.eq(DriverSchedulingV1::getJobCode, jobCode); 25 wrapper.eq(DriverSchedulingV1::getJobCode, jobCode);
26 wrapper.and(wr -> { 26 wrapper.and(wr -> {
27 - wr.eq(DriverSchedulingV1::getScheduleDate, date).or().between(DriverSchedulingV1::getFcsjT, entity.getStartDate().getTime(), entity.getEndDate().getTime()); 27 + String dateStr = DateUtils.YYYY_MM_DD.format(date);
  28 + wr.likeRight(DriverSchedulingV1::getScheduleDate, dateStr).or().between(DriverSchedulingV1::getFcsjT, entity.getStartDate().getTime(), entity.getEndDate().getTime());
28 }); 29 });
29 wrapper.orderByAsc(DriverSchedulingV1::getFcsjT); 30 wrapper.orderByAsc(DriverSchedulingV1::getFcsjT);
30 31
Bsth-admin/src/main/java/com/ruoyi/service/impl/BigViewServiceV1Impl.java
@@ -107,8 +107,10 @@ public class BigViewServiceV1Impl implements BigViewServiceV1 { @@ -107,8 +107,10 @@ public class BigViewServiceV1Impl implements BigViewServiceV1 {
107 if (Objects.isNull(count) || count.equals(0)) { 107 if (Objects.isNull(count) || count.equals(0)) {
108 count = 1; 108 count = 1;
109 redisCache.setCacheObject(key, count, 1, TimeUnit.DAYS); 109 redisCache.setCacheObject(key, count, 1, TimeUnit.DAYS);
  110 + redisCache.setCacheObject(key1, count, 1, TimeUnit.DAYS);
110 } else { 111 } else {
111 redisCache.setCacheObject(key, ++count, 1, TimeUnit.DAYS); 112 redisCache.setCacheObject(key, ++count, 1, TimeUnit.DAYS);
  113 + redisCache.setCacheObject(key1, count, 1, TimeUnit.DAYS);
112 } 114 }
113 if (driverScheduling.getAlcoholCount() - count <= 0) { 115 if (driverScheduling.getAlcoholCount() - count <= 0) {
114 116
Bsth-admin/src/main/java/com/ruoyi/service/impl/key/location/LinggangKeyWorkLocationServiceImpl.java
@@ -440,6 +440,12 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW @@ -440,6 +440,12 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
440 return ResponseResult.error(resultStr.toString()); 440 return ResponseResult.error(resultStr.toString());
441 } 441 }
442 442
  443 + @Override
  444 + public ResponseResult<Boolean> saveAndDel(List<LinggangKeyWorkLocation> locations) {
  445 + boolean flag = saveBatch(locations);
  446 + return ResponseResult.success(flag);
  447 + }
  448 +
443 public boolean update(LinggangKeyWorkLocation location) { 449 public boolean update(LinggangKeyWorkLocation location) {
444 LambdaUpdateWrapper<LinggangKeyWorkLocation> wrapper = new LambdaUpdateWrapper<>(); 450 LambdaUpdateWrapper<LinggangKeyWorkLocation> wrapper = new LambdaUpdateWrapper<>();
445 wrapper.set(LinggangKeyWorkLocation::getEventType, location.getEventType()).set(LinggangKeyWorkLocation::getUpdateTime, new Date()) 451 wrapper.set(LinggangKeyWorkLocation::getEventType, location.getEventType()).set(LinggangKeyWorkLocation::getUpdateTime, new Date())
Bsth-admin/src/main/java/com/ruoyi/service/key/location/LinggangKeyWorkLocationService.java
@@ -77,6 +77,8 @@ public interface LinggangKeyWorkLocationService extends IService&lt;LinggangKeyWork @@ -77,6 +77,8 @@ public interface LinggangKeyWorkLocationService extends IService&lt;LinggangKeyWork
77 */ 77 */
78 ResponseResult<Boolean> updateTakeKey(List<LinggangKeyWorkLocation> locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum typeEnum); 78 ResponseResult<Boolean> updateTakeKey(List<LinggangKeyWorkLocation> locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum typeEnum);
79 79
  80 + ResponseResult<Boolean> saveAndDel(List<LinggangKeyWorkLocation> locations);
  81 +
80 boolean deleteById(Long id); 82 boolean deleteById(Long id);
81 83
82 boolean removeBySchedulingId(Set<Long> schedulingId ); 84 boolean removeBySchedulingId(Set<Long> schedulingId );
Bsth-admin/src/main/resources/application-druid-dev.yml
@@ -101,8 +101,8 @@ spring: @@ -101,8 +101,8 @@ spring:
101 redis: 101 redis:
102 # 地址 102 # 地址
103 # host: 121.41.83.61 103 # host: 121.41.83.61
104 - host: 192.168.168.124  
105 - database: 10 104 + host: 192.168.169.100
  105 + database: 2
106 # password: "guzijian" 106 # password: "guzijian"
107 port: 6379 107 port: 6379
108 # 连接超时时间 108 # 连接超时时间
Bsth-admin/src/main/resources/mapper/in/SignInMapper.xml
@@ -172,6 +172,7 @@ @@ -172,6 +172,7 @@
172 <if test="remark != null">remark,</if> 172 <if test="remark != null">remark,</if>
173 <if test="exType != null">ex_type,</if> 173 <if test="exType != null">ex_type,</if>
174 <if test="null!=schedulingId">scheduling_id,</if> 174 <if test="null!=schedulingId">scheduling_id,</if>
  175 + <if test="null!=exType1">ex_type1,</if>
175 </trim> 176 </trim>
176 <trim prefix="values (" suffix=")" suffixOverrides=","> 177 <trim prefix="values (" suffix=")" suffixOverrides=",">
177 <if test="createTime != null">#{createTime},</if> 178 <if test="createTime != null">#{createTime},</if>
@@ -189,6 +190,7 @@ @@ -189,6 +190,7 @@
189 <if test="remark != null">#{remark},</if> 190 <if test="remark != null">#{remark},</if>
190 <if test="exType != null">#{exType},</if> 191 <if test="exType != null">#{exType},</if>
191 <if test="null!=schedulingId">#{schedulingId,jdbcType=INTEGER},</if> 192 <if test="null!=schedulingId">#{schedulingId,jdbcType=INTEGER},</if>
  193 + <if test="null!=exType1">#{exType1,jdbcType=INTEGER},</if>
192 </trim> 194 </trim>
193 </insert> 195 </insert>
194 196