Commit 2f206ef0b7c695c5295ea61c2641d063bad7efb6

Authored by liujun001
1 parent 064837e1

酒测未通过审核

Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
... ... @@ -58,6 +58,8 @@ import java.io.IOException;
58 58 import java.util.*;
59 59 import java.util.stream.Collectors;
60 60  
  61 +import static com.ruoyi.common.ConstDriverProperties.BC_TYPE_OUT;
  62 +
61 63 /**
62 64 * @author liujun
63 65 * @date 2024年07月11日 16:37
... ... @@ -252,7 +254,7 @@ public class DssDriverController extends BaseController {
252 254 List<LinggangSignInResource> convertLinggangSignInResources = convertLinggangSignInResource(dto);
253 255 try {
254 256 boolean flag = signInResourceService.insertImage(convertLinggangSignInResources);
255   - Set<String> paths = convertLinggangSignInResources.stream().map(LinggangSignInResource::getPath).collect(Collectors.toSet());
  257 + Set<String> paths = convertLinggangSignInResources.stream().map(LinggangSignInResource::getPath).collect(Collectors.toSet());
256 258 return flag ? ResponseResult.success(paths) : ResponseResult.error("上传失败,请稍后再试");
257 259 } catch (InterruptException e) {
258 260 log.error("图片上传失败,[{}]", dto);
... ... @@ -525,13 +527,19 @@ public class DssDriverController extends BaseController {
525 527  
526 528 private LinggangScheduling convertScheduling(GetBusPlanListDTO dto) {
527 529 LinggangScheduling scheduling = new LinggangScheduling();
528   - if (Objects.equals(1, dto.getDateType())) {
  530 + if (Objects.equals(1, dto.getDateType())) {
529 531 scheduling.setStartScheduleDate(DateUtil.shortDate(DateUtils.addDays(new Date(), 1)));
530   - }else{
  532 + scheduling.setEndScheduleDate(DateUtils.addDays(scheduling.getStartScheduleDate(), 1));
  533 + } else if (Objects.equals(0, dto.getDateType())) {
  534 + scheduling.setStartScheduleDate(DateUtil.shortDate(new Date()));
  535 + scheduling.setEndScheduleDate(DateUtils.addDays(scheduling.getStartScheduleDate(), 1));
  536 + } else {
531 537 scheduling.setStartScheduleDate(DateUtil.shortDate(new Date()));
  538 + scheduling.setEndScheduleDate(DateUtils.addDays(scheduling.getStartScheduleDate(), 3));
532 539 }
533   - scheduling.setEndScheduleDate(DateUtils.addDays(scheduling.getStartScheduleDate(),3));
534   - scheduling.setType(1);
  540 + scheduling.setType(1);
  541 + scheduling.setBcType(BC_TYPE_OUT);
  542 + scheduling.setJobCode(dto.getStaffCode());
535 543 return scheduling;
536 544 }
537 545  
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
... ... @@ -448,11 +448,12 @@ public class KeyBoxController extends BaseController {
448 448 LinggangScheduling scheduling = new LinggangScheduling();
449 449 scheduling.setJobCode(dto.getStaffCode());
450 450  
451   - String dateStr = DateUtils.YYYY_MM_DD.format(dto.getTime());
452   - scheduling.setScheduleDate(DateUtils.YYYY_MM_DD.parse(dateStr));
  451 + scheduling.setStartScheduleDate(DateUtil.shortDate(dto.getTime()));
  452 + scheduling.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(scheduling.getStartScheduleDate(),1));
453 453 // String bcType = Objects.equals(0, dto.getEventType()) ? ConstDriverProperties.BC_TYPE_OUT : Objects.equals(1, dto.getEventType()) ? ConstDriverProperties.BC_TYPE_IN : "other";
454   - String bcType = ConstDriverProperties.BC_TYPE_IN;
  454 + String bcType = ConstDriverProperties.BC_TYPE_OUT;
455 455 scheduling.setBcType(bcType);
  456 + scheduling.setType(1);
456 457  
457 458 List<LinggangScheduling> linggangSchedulings = schedulingService.list(scheduling);
458 459 if (CollectionUtils.isEmpty(linggangSchedulings)) {
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/driver/dto/GetBusPlanListDTO.java
... ... @@ -34,6 +34,9 @@ public class GetBusPlanListDTO implements java.io.Serializable{
34 34 @ApiModelProperty(value = "数据类型;0今天,1明天,2/null全部",required = true,example = "1")
35 35 private Integer dateType;
36 36  
  37 + @ApiModelProperty(value = "工号")
  38 + private String staffCode;
  39 +
37 40 @NotNull(message = "第几页为空")
38 41 @ApiModelProperty(value = "第几页",required = true,example = "1")
39 42 private Integer pageNumber;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/scheduling/LinggangScheduling.java
... ... @@ -78,7 +78,7 @@ public class LinggangScheduling {
78 78  
79 79 /***签到表id*/
80 80 @Excel(name = "签到表id")
81   - private Integer signInId;
  81 + private Long signInId;
82 82  
83 83  
84 84 /***记录状态*/
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/scheduling/dto/LinggangSchedulingAddDTO.java
... ... @@ -51,7 +51,7 @@ public class LinggangSchedulingAddDTO implements java.io.Serializable {
51 51 private Long zdsjT;
52 52 /***签到表id*/
53 53 @ApiModelProperty(value = "签到表id", example = "1")
54   - private Integer signInId;
  54 + private Long signInId;
55 55 /***记录状态*/
56 56 @ApiModelProperty(value = "记录状态", example = "1")
57 57 private Integer exType;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/scheduling/dto/LinggangSchedulingQueryDTO.java
... ... @@ -51,7 +51,7 @@ public class LinggangSchedulingQueryDTO implements java.io.Serializable {
51 51 private Long zdsjT;
52 52 /***签到表id*/
53 53 @ApiModelProperty(value = "签到表id", example = "1")
54   - private Integer signInId;
  54 + private Long signInId;
55 55 /***记录状态*/
56 56 @ApiModelProperty(value = "记录状态", example = "1")
57 57 private Integer exType;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/scheduling/dto/LinggangSchedulingUpdateDTO.java
... ... @@ -51,7 +51,7 @@ public class LinggangSchedulingUpdateDTO implements java.io.Serializable {
51 51 private Long zdsjT;
52 52 /***签到表id*/
53 53 @ApiModelProperty(value = "签到表id", example = "1")
54   - private Integer signInId;
  54 + private Long signInId;
55 55 /***记录状态*/
56 56 @ApiModelProperty(value = "记录状态", example = "1")
57 57 private Integer exType;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/scheduling/vo/LinggangSchedulingVO.java
... ... @@ -56,7 +56,7 @@ public class LinggangSchedulingVO implements java.io.Serializable {
56 56 private Long zdsjT;
57 57 /***签到表id*/
58 58 @ApiModelProperty(value = "签到表id", example = "1")
59   - private Integer signInId;
  59 + private Long signInId;
60 60 /***记录状态*/
61 61 @ApiModelProperty(value = "记录状态", example = "1")
62 62 private Integer exType;
... ...
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
1 1 package com.ruoyi.in.service.impl;
2 2  
3 3 import cn.hutool.core.collection.CollectionUtil;
4   -import cn.hutool.core.convert.Convert;
5 4 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
6 5 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 6 import com.github.pagehelper.PageHelper;
... ... @@ -258,7 +257,7 @@ public class SignInServiceImpl extends ServiceImpl&lt;SignInMapper, SignIn&gt; impleme
258 257 signIn.setSchedulingId(scheduling.getId());
259 258 signInMapper.insertSignIn(signIn);
260 259  
261   - scheduling.setSignInId(Convert.toInt(signIn.getId()));
  260 + scheduling.setSignInId(signIn.getId());
262 261 // 更新考勤
263 262 linggangSchedulingService.updateByPrimaryKey(scheduling);
264 263  
... ...
Bsth-admin/src/main/java/com/ruoyi/pojo/response/ResponseSchedulingDto.java
1 1 package com.ruoyi.pojo.response;
2 2  
  3 +import com.ruoyi.utils.DateUtil;
3 4 import lombok.Data;
  5 +import org.apache.commons.lang3.StringUtils;
4 6 import org.springframework.format.annotation.DateTimeFormat;
5 7  
6 8 import java.io.Serializable;
  9 +import java.text.ParseException;
7 10 import java.util.Date;
8 11 import java.util.List;
  12 +import java.util.Objects;
9 13  
10 14 /**
11 15 * Auto-generated: 2023-07-05 21:23:27
... ... @@ -51,4 +55,57 @@ public class ResponseSchedulingDto implements Serializable {
51 55 private String name;
52 56  
53 57  
  58 + private String fcsj;
  59 + private Integer dfsj;
  60 + private String scheduleDateStr;
  61 +
  62 + public void setScheduleDateStr(Object scheduleDateStr) {
  63 + if (Objects.nonNull(scheduleDateStr)) {
  64 + this.scheduleDateStr = scheduleDateStr.toString();
  65 + try {
  66 + scheduleDate = DateUtil.YYYY_MM_DD_LINK.parse(this.scheduleDateStr);
  67 + } catch (ParseException e) {
  68 + throw new RuntimeException(e);
  69 + }
  70 +
  71 + }
  72 +
  73 + }
  74 +
  75 + public Long getfcsjTValue() {
  76 + if (Objects.nonNull(fcsjT) && fcsjT >0) {
  77 + return fcsjT;
  78 + }
  79 +
  80 + if (StringUtils.isNotEmpty(fcsj) && StringUtils.isNotEmpty(this.scheduleDateStr)) {
  81 + String dateStr = StringUtils.join(this.scheduleDateStr, " ", fcsj);
  82 + try {
  83 + Date date = DateUtil.YYYY_MM_DD_LINK_HH_MM.parse(dateStr);
  84 + fcsjT = date.getTime();
  85 + return fcsjT;
  86 + } catch (ParseException e) {
  87 + throw new RuntimeException(e);
  88 + }
  89 + }
  90 + return null;
  91 + }
  92 +
  93 + public Long getzdsjTTValue() {
  94 + if (Objects.nonNull(zdsjT) && zdsjT >0) {
  95 + return zdsjT;
  96 + }
  97 +
  98 + if(Objects.nonNull(bcsj)){
  99 + Long value = getfcsjTValue();
  100 + zdsjT = value+bcsj*60000;
  101 + return zdsjT;
  102 + }
  103 + return null;
  104 + }
  105 +
  106 + public void setUpDowm(String upDowm){
  107 + this.upDown = upDowm;
  108 + }
  109 +
  110 +
54 111 }
55 112 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
... ... @@ -418,9 +418,9 @@ public class ThreadJobService {
418 418 @Transactional(rollbackFor = {Exception.class})
419 419 public void asyncComputedScheduling(Map<String, List<ResponseSchedulingDto>> originSchedulingMap, String timeOut, Date date, int type) {
420 420 //查询当天是否保存过考情表 如果不存在则保存
421   - List<DriverScheduling> bcList = schedulingMapper.queryToDay(DateUtil.YYYY_MM_DD_LINK.format(date),DateUtil.YYYY_MM_DD_LINK.format(org.apache.commons.lang3.time.DateUtils.addDays(date,1)), null, null, null);
  421 + List<DriverScheduling> bcList = schedulingMapper.queryToDay(DateUtil.YYYY_MM_DD_LINK.format(date), DateUtil.YYYY_MM_DD_LINK.format(org.apache.commons.lang3.time.DateUtils.addDays(date, 1)), null, null, null);
422 422 Map<String, List<DriverScheduling>> dto = nowSchedulingCache.getCacheScheduling(ConstDateUtil.formatDate(date));
423   - if(CollectionUtils.isNotEmpty(bcList) && MapUtils.isEmpty(dto) && Objects.equals(1,type)){
  423 + if (CollectionUtils.isNotEmpty(bcList) && MapUtils.isEmpty(dto) && Objects.equals(1, type)) {
424 424 String dateStr = DateUtil.YYYY_MM_DD.format(date);
425 425 Map<String, List<DriverScheduling>> resultMap = new HashMap<>(800);
426 426 NowSchedulingCache.handlerResultMap(resultMap, bcList);
... ... @@ -430,11 +430,11 @@ public class ThreadJobService {
430 430  
431 431 // 当天已有记录则不在保存 或者 调度记录为空则不在保存
432 432 if ((CollectionUtil.isNotEmpty(dto) && CollectionUtil.isNotEmpty(bcList)) || originSchedulingMap.size() == 0) {
433   - log.info("调度最新数据:{},当天获取数据:{},时间:[{}]", originSchedulingMap.size(),bcList.size(),date);
  433 + log.info("调度最新数据:{},当天获取数据:{},时间:[{}]", originSchedulingMap.size(), bcList.size(), date);
434 434 return;
435 435 }
436 436  
437   - if(Objects.equals(1,type)) {
  437 + if (Objects.equals(1, type)) {
438 438 TempCache.resetMapStatus();
439 439 }
440 440 bcList = getBcList(originSchedulingMap, type);
... ... @@ -444,7 +444,31 @@ public class ThreadJobService {
444 444 // 插入排班
445 445 List<LinggangScheduling> schedulings = bcList.stream().map(b -> {
446 446 LinggangScheduling scheduling = new LinggangScheduling();
447   - BeanUtils.copyProperties(b, scheduling);
  447 + scheduling.setJobCode(b.getJobCode());
  448 + scheduling.setName(b.getName());
  449 + scheduling.setPosts(b.getPosts());
  450 + scheduling.setScheduleDate(b.getScheduleDate());
  451 + scheduling.setLineName(b.getLineName());
  452 + scheduling.setLpName(b.getLpName());
  453 + scheduling.setNbbm(b.getNbbm());
  454 + scheduling.setBcType(b.getBcType());
  455 + scheduling.setFcsjT(b.getFcsjT());
  456 + scheduling.setZdsjT(b.getZdsjT());
  457 + scheduling.setSignInId(b.getSignInId());
  458 + scheduling.setExType(b.getExType());
  459 + scheduling.setSignType(b.getSignType());
  460 + scheduling.setSignTime(b.getSignTime());
  461 + scheduling.setAlcoholFlag(b.getAlcoholFlag());
  462 + scheduling.setAlcoholIntake(b.getAlcoholIntake());
  463 + scheduling.setRemark(b.getRemark());
  464 +
  465 + scheduling.setUpdown(b.getUpDown());
  466 + scheduling.setQdzcode(b.getQdzCode());
  467 + scheduling.setQdzname(b.getQdzName());
  468 + scheduling.setZdzcode(b.getZdzCode());
  469 + scheduling.setZdzname(b.getZdzName());
  470 + scheduling.setType(b.getType());
  471 +
448 472 return scheduling;
449 473 }).collect(Collectors.toList());
450 474 if (CollectionUtils.isNotEmpty(schedulings)) {
... ... @@ -465,15 +489,15 @@ public class ThreadJobService {
465 489 if (size == 1) {
466 490 schedulings.add(entry.getValue().get(0));
467 491 } else if (size > 1) {
468   - List<LinggangScheduling> values = entry.getValue().stream().filter(s->!Objects.equals(s.getZdsjT(),s.getFcsjT())).collect(Collectors.toList());
  492 + List<LinggangScheduling> values = entry.getValue().stream().filter(s -> !Objects.equals(s.getZdsjT(), s.getFcsjT())).collect(Collectors.toList());
469 493 size = CollectionUtils.size(values);
470   - if(size == 0){
  494 + if (size == 0) {
471 495 schedulings.add(entry.getValue().get(0));
472   - }else if(size == 1){
  496 + } else if (size == 1) {
473 497 schedulings.add(values.get(0));
474   - }else{
  498 + } else {
475 499 values = values.stream().sorted(Comparator.comparing(LinggangScheduling::getZdsjT)).collect(Collectors.toList());
476   - schedulings.add(values.get(size-1));
  500 + schedulings.add(values.get(size - 1));
477 501 }
478 502 }
479 503 }
... ... @@ -482,10 +506,10 @@ public class ThreadJobService {
482 506 }
483 507 String dateStr1 = DateUtil.YYYY_MM_DD_LINK.format(date);
484 508 // 异常数据过多,不通过自增获取id再次查询获取
485   - bcList = schedulingMapper.queryToDay(dateStr1, DateUtil.YYYY_MM_DD_LINK.format(org.apache.commons.lang3.time.DateUtils.addDays(date,1)), null, null, null);
  509 + bcList = schedulingMapper.queryToDay(dateStr1, DateUtil.YYYY_MM_DD_LINK.format(org.apache.commons.lang3.time.DateUtils.addDays(date, 1)), null, null, null);
486 510 // 处理缓存和错误排班
487 511 String dateStr = DateUtil.YYYY_MM_DD.format(date);
488   - if (!CollectionUtil.isEmpty(bcList) && Objects.equals(1,type)) {
  512 + if (!CollectionUtil.isEmpty(bcList) && Objects.equals(1, type)) {
489 513 Map<String, List<DriverScheduling>> resultMap = new HashMap<>(800);
490 514 NowSchedulingCache.handlerResultMap(resultMap, bcList);
491 515 // 更新缓存
... ... @@ -590,6 +614,13 @@ public class ThreadJobService {
590 614 BeanUtils.copyProperties(item, scheduling, "id");
591 615 scheduling.setUpDown(Convert.toInt(item.getUpDown()));
592 616 scheduling.setType(type);
  617 + if (Objects.isNull(scheduling.getFcsjT()) || Objects.equals(0L, scheduling.getFcsjT())) {
  618 + scheduling.setFcsjT(item.getfcsjTValue());
  619 + }
  620 +
  621 + if (Objects.nonNull(scheduling.getZdsjT()) || Objects.equals(0L, scheduling.getZdsjT())) {
  622 + scheduling.setZdsjT(item.getzdsjTTValue());
  623 + }
593 624 return scheduling;
594 625 })
595 626 .sorted(Comparator.comparing(DriverScheduling::getFcsjT))
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/key/location/LinggangKeyWorkLocationServiceImpl.java
... ... @@ -44,7 +44,7 @@ import java.text.ParseException;
44 44 import java.util.*;
45 45 import java.util.stream.Collectors;
46 46  
47   -import static com.ruoyi.common.ConstDriverProperties.BC_TYPE_IN;
  47 +import static com.ruoyi.common.ConstDriverProperties.BC_TYPE_OUT;
48 48  
49 49 @Slf4j
50 50 @Service
... ... @@ -709,8 +709,9 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
709 709  
710 710 private List<LinggangScheduling> querySchedulingByTiime(Date date) {
711 711 LinggangScheduling scheduling = new LinggangScheduling();
712   - scheduling.setScheduleDate(date);
713   - scheduling.setBcType(BC_TYPE_IN);
  712 + scheduling.setStartScheduleDate(DateUtil.shortDate(date));
  713 + scheduling.setEndScheduleDate(DateUtils.addDays(scheduling.getStartScheduleDate(),1));
  714 + scheduling.setBcType(BC_TYPE_OUT);
714 715 List<LinggangScheduling> schedulings = schedulingService.list(scheduling);
715 716 if (CollectionUtils.isEmpty(schedulings)) {
716 717 log.info("没有查到排班信息:[{}]", date);
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/scheduling/LinggangSchedulingServiceImpl.java
... ... @@ -53,7 +53,9 @@ public class LinggangSchedulingServiceImpl extends ServiceImpl&lt;LinggangSchedulin
53 53  
54 54 @Override
55 55 public List<LinggangScheduling> list(LinggangScheduling entity) {
56   - return list(new LambdaQueryWrapper<>(entity));
  56 + LambdaQueryWrapper<LinggangScheduling> wrapper = new LambdaQueryWrapper<>(entity);
  57 + switchScheduleDate(wrapper,entity);
  58 + return list(wrapper);
57 59 }
58 60  
59 61 @Override
... ...
Bsth-admin/src/main/java/com/ruoyi/utils/DateUtil.java
... ... @@ -16,6 +16,8 @@ import java.util.Date;
16 16 public class DateUtil {
17 17  
18 18 public static FastDateFormat YYYY_MM_DD_LINK_HH_MM_SS = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss");
  19 +
  20 + public static FastDateFormat YYYY_MM_DD_LINK_HH_MM = FastDateFormat.getInstance("yyyy-MM-dd HH:mm");
19 21 public static FastDateFormat YYYY_MM_DD_LINK = FastDateFormat.getInstance("yyyy-MM-dd");
20 22 public static FastDateFormat YYYY_MM_DD = FastDateFormat.getInstance("yyyyMMdd");
21 23 public static FastDateFormat HH_MM_ss = FastDateFormat.getInstance("HH:mm:ss");
... ...