Commit 23708446dcf81f326f2ff171269b46ac24131e4e
1 parent
d3450601
fix&feat: 修复超时过滤未到签到时间也显示问题。更改签到规则一小时内变成 在计算签到时间一小时以内前,签退变成正1小时 负两小时 改为 计划签退一小时以内。
Showing
4 changed files
with
49 additions
and
94 deletions
Bsth-admin/src/main/java/com/ruoyi/common/cache/NowSchedulingCache.java
| ... | ... | @@ -102,16 +102,18 @@ public class NowSchedulingCache { |
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | 104 | * 更新缓存 |
| 105 | + * | |
| 106 | + * @param remark | |
| 105 | 107 | * @param key |
| 106 | 108 | * @param index |
| 107 | 109 | * @param signIn |
| 108 | 110 | */ |
| 109 | - public void updateCacheByJobCode(String key, Integer index, SignIn signIn) { | |
| 111 | + public void updateCacheByJobCode(String remark, String key, Integer index, SignIn signIn) { | |
| 110 | 112 | if (key.equals(ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(0))) |
| 111 | 113 | || key.equals(ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1)))){ |
| 112 | 114 | DriverScheduling scheduling = cacheNowDayScheduling.get(key).get(signIn.getJobCode()).get(index); |
| 113 | 115 | scheduling.setSignInId(signIn.getId()); |
| 114 | - scheduling.setRemark(signIn.getRemark()); | |
| 116 | + scheduling.setRemark(remark); | |
| 115 | 117 | scheduling.setExType(signIn.getExType()); |
| 116 | 118 | scheduling.setSignTime(signIn.getCreateTime()); |
| 117 | 119 | scheduling.setSignType(signIn.getType()); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/driver/service/impl/DriverServiceImpl.java
| ... | ... | @@ -164,7 +164,7 @@ public class DriverServiceImpl implements IDriverService { |
| 164 | 164 | LocalDateTime nowTime = ConstDateUtil.getLocalDateTimeByLongTime(now); |
| 165 | 165 | LocalDateTime signTime = ConstDateUtil.getLocalDateTimeByLongTime(timeMap.get(index).getTimestamps()); |
| 166 | 166 | long range = ChronoUnit.MINUTES.between(signTime, nowTime); |
| 167 | - // 如果当前记录靠近签退,但是未到签退小于合法范围 上一次记录未签到,则返回签到记录 | |
| 167 | + // 如果当前记录靠近签退,但是未到签退小于有效范围 上一次记录未签到,则返回签到记录 | |
| 168 | 168 | if (dto.size() > 1 |
| 169 | 169 | && BC_TYPE_IN.equals(timeMap.get(index).getBcType()) |
| 170 | 170 | && range < -60L |
| ... | ... | @@ -174,20 +174,26 @@ public class DriverServiceImpl implements IDriverService { |
| 174 | 174 | index = index - 1; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - // 如果当前记录是异常的记录且还在目前还在签到范围内 | |
| 177 | + // 如果当前记录是异常的记录且还在目前还在打卡范围内 | |
| 178 | 178 | if (!Objects.isNull(timeMap.get(index).getSignInId()) && dto.size() > 1) { |
| 179 | 179 | LocalDateTime endTime = ConstDateUtil.getLocalDateTimeByLongTime(timeMap.get(index).getTimestamps()); |
| 180 | 180 | long nowBetween = ChronoUnit.MINUTES.between(endTime, nowTime); |
| 181 | - // 如果当前有效范围内签 | |
| 182 | - if ((Math.abs(nowBetween) <= 60)) { | |
| 183 | - return timeMap.get(index); | |
| 184 | - } else if (nowBetween > 60L) { | |
| 181 | + // 如果当前不在有效范围内签 | |
| 182 | + if (nowBetween > 60L) { | |
| 185 | 183 | index = index < timeMap.size() - 1 ? index + 1 : index; |
| 186 | 184 | } |
| 187 | 185 | } |
| 188 | 186 | return timeMap.get(index); |
| 189 | 187 | } |
| 190 | 188 | |
| 189 | + /** | |
| 190 | + * 比较当前时间戳 推荐签到操作 | |
| 191 | + * | |
| 192 | + * @param dto | |
| 193 | + * @param now | |
| 194 | + * @param timeMap | |
| 195 | + * @return | |
| 196 | + */ | |
| 191 | 197 | private static Integer handleSchedulingMap(List<DriverScheduling> dto, Long now, Map<Integer, DriverSignInRecommendation> timeMap) { |
| 192 | 198 | Integer index = 0; |
| 193 | 199 | for (int i = 0; i < dto.size(); i++) { |
| ... | ... | @@ -374,7 +380,7 @@ public class DriverServiceImpl implements IDriverService { |
| 374 | 380 | for (Driver item : drivers) { |
| 375 | 381 | dto = schedulingService.queryScheduling(item.getJobCode(), now); |
| 376 | 382 | DriverResponseVo vo = handlerRecommendation(item, now, dto, schedulingFlag, alcoholFlag); |
| 377 | - // 针对指定用户操作 | |
| 383 | + // TODO 针对指定用户操作 | |
| 378 | 384 | if (item.getJobCode().equals("722717") || item.getJobCode().equals("700001")) { |
| 379 | 385 | if (!CollectionUtil.isEmpty(dto) && vo.getPlanAction().equals(SIGN_IN_STRING)) { |
| 380 | 386 | vos.add(DriverResponseVo.createDriverResponseVo(null, item, SIGN_IN_STRING, needCheckAlcoholDevice, true, "测试", "测试", "测试")); |
| ... | ... | @@ -383,6 +389,7 @@ public class DriverServiceImpl implements IDriverService { |
| 383 | 389 | } else { |
| 384 | 390 | vos.add(DriverResponseVo.createDriverResponseVo(null, item, SIGN_IN_STRING, needCheckAlcoholDevice, true, "测试", "测试", "测试")); |
| 385 | 391 | } |
| 392 | + // 上面可删除 | |
| 386 | 393 | } else { |
| 387 | 394 | // 无排班 工种是驾驶员需要酒测 |
| 388 | 395 | if (Objects.isNull(vo)) { | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
| ... | ... | @@ -276,7 +276,7 @@ public class SignInServiceImpl implements ISignInService { |
| 276 | 276 | if (CollectionUtil.isNotEmpty(dto)) { |
| 277 | 277 | schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), signIn.getRemark(), signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 278 | 278 | // 更新缓存 |
| 279 | - nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | |
| 279 | + nowSchedulingCache.updateCacheByJobCode(signIn.getRemark(), ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | // 异常保存到异常异常中 |
| ... | ... | @@ -353,7 +353,7 @@ public class SignInServiceImpl implements ISignInService { |
| 353 | 353 | |
| 354 | 354 | schedulingService.computedSignInBySignIn(new ArrayList<>(Arrays.asList(transformMap.get(signIn.getJobCode()))), signIn, new GlobalIndex()); |
| 355 | 355 | // // 更新缓存 |
| 356 | - nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(transformMap.get(signIn.getJobCode()).getScheduleDate()), 0, signIn); | |
| 356 | + nowSchedulingCache.updateCacheByJobCode(signIn.getRemark(), ConstDateUtil.formatDate(transformMap.get(signIn.getJobCode()).getScheduleDate()), 0, signIn); | |
| 357 | 357 | signInMapper.updateSignIn(signIn); |
| 358 | 358 | |
| 359 | 359 | } |
| ... | ... | @@ -484,7 +484,7 @@ public class SignInServiceImpl implements ISignInService { |
| 484 | 484 | break; |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | - // 超时校验司售人员 | |
| 487 | + // 超时校验 | |
| 488 | 488 | if (result) { |
| 489 | 489 | result = checkTimeOut(globalIndex, signIn, dto, posts, now); |
| 490 | 490 | if (!result) { |
| ... | ... | @@ -517,7 +517,7 @@ public class SignInServiceImpl implements ISignInService { |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | private boolean checkTimeOut(GlobalIndex globalIndex, SignIn signIn, List<DriverScheduling> dto, String posts, long now) { |
| 520 | - // 司售人员拿发车时间和到站时间作为开始上班的时间 | |
| 520 | + // 发车时间和到站时间作为开始上班的时间 | |
| 521 | 521 | return driverCheckTimeOut(globalIndex, signIn, dto, now); |
| 522 | 522 | } |
| 523 | 523 | |
| ... | ... | @@ -544,14 +544,8 @@ public class SignInServiceImpl implements ISignInService { |
| 544 | 544 | globalIndex.setIndex(lastClosestTimestamp.getIndex()); |
| 545 | 545 | result = false; |
| 546 | 546 | } |
| 547 | - // 上一次无记无|签到,type:签退 当前时间小于最近签到时间 -> 超时签退 | |
| 548 | - else if (nowBetween < -60L && Objects.isNull(lastClosestTimestamp.getSignInId()) && signIn.getType().equals(SIGN_OUT) && lastClosestTimestamp.getIndex().equals(currentScheduling.getIndex())) { | |
| 549 | - signIn.setRemark(SIGN_IN_TIMEOUT + getPrompt(currentScheduling)); | |
| 550 | - globalIndex.setIndex(currentScheduling.getIndex()); | |
| 551 | - result = false; | |
| 552 | - } | |
| 553 | - // 当前最近无记录|签到,type:签到|签退 -> 签到超时给上 | |
| 554 | - else { | |
| 547 | + // 上一次无记无|签到,type:签退 当前时间小于最近签到时间 -> 早签 或者 超时 | |
| 548 | + else { | |
| 555 | 549 | signIn.setRemark(SIGN_IN_TIMEOUT + getPrompt(currentScheduling)); |
| 556 | 550 | globalIndex.setIndex(currentScheduling.getIndex()); |
| 557 | 551 | result = false; |
| ... | ... | @@ -592,7 +586,9 @@ public class SignInServiceImpl implements ISignInService { |
| 592 | 586 | } |
| 593 | 587 | result = false; |
| 594 | 588 | } |
| 595 | - } else { | |
| 589 | + } | |
| 590 | + // 有效直接保存记录 | |
| 591 | + else { | |
| 596 | 592 | globalIndex.setIndex(currentScheduling.getIndex()); |
| 597 | 593 | result = true; |
| 598 | 594 | } |
| ... | ... | @@ -604,7 +600,8 @@ public class SignInServiceImpl implements ISignInService { |
| 604 | 600 | } |
| 605 | 601 | |
| 606 | 602 | private boolean handleTimeOut(String bcType, long nowBetween, GlobalIndex globalIndex, DriverSignInRecommendation currentScheduling) { |
| 607 | - if (BC_TYPE_OUT.equals(bcType) && nowBetween > 60L || BC_TYPE_IN.equals(bcType) && nowBetween <= 120L) { | |
| 603 | + if ((BC_TYPE_OUT.equals(bcType) && nowBetween > 0 ) | |
| 604 | + ||( BC_TYPE_IN.equals(bcType) && nowBetween <= 60L)) { | |
| 608 | 605 | return true; |
| 609 | 606 | } else { |
| 610 | 607 | return false; |
| ... | ... | @@ -613,11 +610,11 @@ public class SignInServiceImpl implements ISignInService { |
| 613 | 610 | |
| 614 | 611 | private String getPrompt(DriverSignInRecommendation currentScheduling) { |
| 615 | 612 | if (BC_TYPE_OUT.equals(currentScheduling.getBcType())) { |
| 616 | - return "请在" + ConstDateUtil.formatDate("HH:mm", new Date(currentScheduling.getTimestamps())) + "前后一小时内打卡。"; | |
| 613 | + return "请在" + ConstDateUtil.formatDate("HH:mm", new Date(currentScheduling.getTimestamps())) + "前一小时内打卡。"; | |
| 617 | 614 | } else { |
| 618 | - // 正两小时 负 1小时 | |
| 615 | + // 正1小时 负 1小时 | |
| 619 | 616 | LocalDateTime time = ConstDateUtil.stringTransformLocalDateTime(ConstDateUtil.formatDate("yyyy-MM-dd HH:mm:ss", new Date(currentScheduling.getTimestamps())), "yyyy-MM-dd HH:mm:ss"); |
| 620 | - LocalDateTime addHours = time.plusHours(2); | |
| 617 | + LocalDateTime addHours = time.plusHours(1); | |
| 621 | 618 | LocalDateTime hours = time.plusHours(-1); |
| 622 | 619 | return "请在" + ConstDateUtil.formatDate("HH:mm", hours) + "到" |
| 623 | 620 | + ConstDateUtil.formatDate("HH:mm", addHours) + "之间打卡"; |
| ... | ... | @@ -625,13 +622,13 @@ public class SignInServiceImpl implements ISignInService { |
| 625 | 622 | } |
| 626 | 623 | |
| 627 | 624 | |
| 628 | - private static boolean checkTimerSign(long nowBetween, String bcType) { | |
| 625 | + public static boolean checkTimerSign(long nowBetween, String bcType) { | |
| 629 | 626 | // 如果是签到就是正负一小时内有效 |
| 630 | 627 | if (BC_TYPE_OUT.equals(bcType)) { |
| 631 | - return !(Math.abs(nowBetween) <= 60); | |
| 628 | + return !(nowBetween <= 0L && nowBetween >= -60L); | |
| 632 | 629 | } else { |
| 633 | - // 如果是签退就是负1小时 正两小时有效 | |
| 634 | - return !((nowBetween >= 0 && nowBetween <= 120L) || (nowBetween < 0 && nowBetween >= -60L)); | |
| 630 | + // 如果是签退就是就是正负一小时内有效 | |
| 631 | + return !(Math.abs(nowBetween) <= 60); | |
| 635 | 632 | } |
| 636 | 633 | } |
| 637 | 634 | |
| ... | ... | @@ -643,7 +640,7 @@ public class SignInServiceImpl implements ISignInService { |
| 643 | 640 | globalIndex.setIndex(0); |
| 644 | 641 | // 单条数据 且不在范围内 |
| 645 | 642 | if (BC_TYPE_IN.equals(dto.get(0).getBcType())) { |
| 646 | - if (!(Math.abs(nowBetween) <= 60)) { | |
| 643 | + if (!(nowBetween < 0L && nowBetween >= -60L)) { | |
| 647 | 644 | signIn.setRemark(SIGN_OUT_TIMEOUT); |
| 648 | 645 | return false; |
| 649 | 646 | } else { | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/SchedulingService.java
| ... | ... | @@ -6,6 +6,7 @@ import com.ruoyi.common.utils.DateUtils; |
| 6 | 6 | import com.ruoyi.driver.mapper.DriverSchedulingMapper; |
| 7 | 7 | import com.ruoyi.in.domain.SignIn; |
| 8 | 8 | import com.ruoyi.in.mapper.SignInMapper; |
| 9 | +import com.ruoyi.in.service.impl.SignInServiceImpl; | |
| 9 | 10 | import com.ruoyi.pojo.DriverSignInRecommendation; |
| 10 | 11 | import com.ruoyi.pojo.GlobalIndex; |
| 11 | 12 | import com.ruoyi.domain.DriverScheduling; |
| ... | ... | @@ -118,20 +119,18 @@ public class SchedulingService { |
| 118 | 119 | if (CollectionUtil.isEmpty(dto)) { |
| 119 | 120 | return; |
| 120 | 121 | } |
| 121 | - | |
| 122 | 122 | String remark = getRemark(dto, signIn, globalIndex.getIndex()); |
| 123 | - signIn.setRemark(remark); | |
| 124 | 123 | // 更新最新的签到记录判断是否需要更新考勤 |
| 125 | 124 | // 记录为空直接插入记录 |
| 126 | 125 | if (Objects.isNull(dto.get(globalIndex.getIndex()).getSignInId()) || dto.size() == 1) { |
| 127 | 126 | schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 128 | 127 | // 更新缓存 |
| 129 | - nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | |
| 128 | + nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | |
| 130 | 129 | } |
| 131 | 130 | // 之前的无效 |
| 132 | 131 | else if (!SIGN_NO_EX_NUM.equals(dto.get(globalIndex.getIndex()).getExType())) { |
| 133 | 132 | schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 134 | - nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | |
| 133 | + nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | |
| 135 | 134 | } |
| 136 | 135 | // 之前的有效 |
| 137 | 136 | else { |
| ... | ... | @@ -145,7 +144,7 @@ public class SchedulingService { |
| 145 | 144 | DriverScheduling scheduling = dto.get(globalIndex); |
| 146 | 145 | long date = scheduling.getBcType().equals(BC_TYPE_IN) ? scheduling.getZdsjT() : scheduling.getFcsjT(); |
| 147 | 146 | long nowBetween = ChronoUnit.MINUTES.between(ConstDateUtil.getLocalDateTimeByLongTime(date), ConstDateUtil.getLocalDateTimeByLongTime(signIn.getCreateTime().getTime())); |
| 148 | - if (checkTimerSign(nowBetween, scheduling.getBcType())) { | |
| 147 | + if (SignInServiceImpl.checkTimerSign(nowBetween, scheduling.getBcType())) { | |
| 149 | 148 | if (nowBetween < -60L) { |
| 150 | 149 | sb.append(EARLY); |
| 151 | 150 | } else { |
| ... | ... | @@ -161,34 +160,19 @@ public class SchedulingService { |
| 161 | 160 | return sb.toString(); |
| 162 | 161 | } |
| 163 | 162 | |
| 164 | - private static boolean checkTimerSign(long nowBetween, String bcType) { | |
| 165 | - // 如果是签到就是正负一小时内有效 | |
| 166 | - if (BC_TYPE_OUT.equals(bcType)) { | |
| 167 | - return !(Math.abs(nowBetween) <= 60); | |
| 168 | - } else { | |
| 169 | - // 如果是签退就是负1小时 正两小时有效 | |
| 170 | - return !((nowBetween >= 0 && nowBetween <= 120L) || (nowBetween < 0 && nowBetween >= -60L)); | |
| 171 | - } | |
| 172 | - } | |
| 173 | 163 | |
| 174 | 164 | |
| 175 | 165 | private void handlerRecord(List<DriverScheduling> dto, SignIn signIn, GlobalIndex globalIndex) { |
| 176 | 166 | if (globalIndex.getIndex() == dto.size() - 1) { |
| 177 | 167 | return; |
| 178 | 168 | } |
| 179 | - long timer = 1000 * 60 * 60; | |
| 169 | + long timer = 1000 * 60 * 3; | |
| 180 | 170 | // 有效的在一小时内内重复签到不做修改 |
| 181 | 171 | if (signIn.getExType().equals(SIGN_NO_EX_NUM) && (DateUtils.getNowDate().getTime() - dto.get(globalIndex.getIndex()).getSignTime().getTime()) <= timer) { |
| 182 | - signIn.setRemark("您已经打卡过了,请勿在一小时内重复打卡"); | |
| 172 | + signIn.setRemark("您已经打卡过了,请勿在3分钟内重复打卡"); | |
| 183 | 173 | return; |
| 184 | 174 | } |
| 185 | 175 | int index = globalIndex.getIndex() + 1; |
| 186 | - // 目前有效记录 -》进行修改 变成无效 | |
| 187 | -// if (signIn.getExType().equals(SIGN_NO_EX_NUM)) { | |
| 188 | -// signIn.setStatus(SIGN_IN_FAIL); | |
| 189 | -// signIn.setExType(SIGN_TIME_OUT_EX_NUM); | |
| 190 | -// signInMapper.updateSignIn(signIn); | |
| 191 | -// } | |
| 192 | 176 | DriverScheduling scheduling = dto.get(index); |
| 193 | 177 | long date = scheduling.getBcType().equals(BC_TYPE_IN) ? scheduling.getZdsjT() : scheduling.getFcsjT(); |
| 194 | 178 | String prompt = getPrompt(new Date(date), scheduling.getBcType()); |
| ... | ... | @@ -197,7 +181,7 @@ public class SchedulingService { |
| 197 | 181 | // 目前无效 -》往后更新 |
| 198 | 182 | String remark = getRemark(dto, signIn, index); |
| 199 | 183 | schedulingMapper.updateRoster(scheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 200 | - nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex() + 1, signIn); | |
| 184 | + nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex() + 1, signIn); | |
| 201 | 185 | } |
| 202 | 186 | |
| 203 | 187 | private String getPrompt(Date date, String bcType) { |
| ... | ... | @@ -218,39 +202,9 @@ public class SchedulingService { |
| 218 | 202 | if (requestVo.getExportFlag().equals(NOW)) { |
| 219 | 203 | return getDayReportTableResponseVo(requestVo, response); |
| 220 | 204 | } |
| 221 | -// // 处理月 | |
| 222 | -// else if (requestVo.getExportFlag().equals(MONTH)) { | |
| 223 | -// return getMonthReportTableResponseVo(requestVo, response); | |
| 224 | -// } | |
| 225 | - | |
| 226 | - return null; | |
| 227 | - } | |
| 228 | - | |
| 229 | - private List<ReportViewResponseVo> getMonthReportTableResponseVo(ReportViewRequestVo requestVo, HttpServletResponse response) { | |
| 230 | - // 获取当月到目前为止的所有数据 | |
| 231 | - List<String> dayList = getAllDaysOfTheMonth(); | |
| 232 | -// for (String date : dayList) { | |
| 233 | -// getDayReportTableResponseVo(date, response); | |
| 234 | -// } | |
| 235 | 205 | return null; |
| 236 | 206 | } |
| 237 | 207 | |
| 238 | - private List<String> getAllDaysOfTheMonth() { | |
| 239 | - // 获取当前日期 | |
| 240 | - LocalDate currentDate = LocalDate.now(); | |
| 241 | - | |
| 242 | - // 获取当前月份 | |
| 243 | - YearMonth currentMonth = YearMonth.from(currentDate); | |
| 244 | - int nowDay = Integer.parseInt(ConstDateUtil.formatDate("dd")); | |
| 245 | - // 构建日期集合 | |
| 246 | - List<String> datesInMonth = new ArrayList<>(); | |
| 247 | - for (int day = 1; day <= nowDay; day++) { | |
| 248 | - String date = currentMonth.atDay(day).toString(); | |
| 249 | - datesInMonth.add(date); | |
| 250 | - } | |
| 251 | - return datesInMonth; | |
| 252 | - } | |
| 253 | - | |
| 254 | 208 | |
| 255 | 209 | private List<ReportViewResponseVo> getDayReportTableResponseVo(ReportViewRequestVo vo, HttpServletResponse response) { |
| 256 | 210 | // 签到数据 |
| ... | ... | @@ -262,7 +216,7 @@ public class SchedulingService { |
| 262 | 216 | Map<String, ReportViewResponseVo> resultMap = new HashMap<>(1200); |
| 263 | 217 | for (String key : orangeMap.keySet()) { |
| 264 | 218 | List<DriverScheduling> list = orangeMap.get(key); |
| 265 | - // 过滤 vo | |
| 219 | + // 如果有选超时过滤的话过滤 | |
| 266 | 220 | if (filterReportVoList(vo.getStage(), list)) { |
| 267 | 221 | continue; |
| 268 | 222 | } |
| ... | ... | @@ -296,18 +250,13 @@ public class SchedulingService { |
| 296 | 250 | if (list.size() < stage) { |
| 297 | 251 | return true; |
| 298 | 252 | } |
| 299 | - | |
| 300 | - if (Objects.isNull(list.get(stage - 1).getSignTime())) { | |
| 301 | - return false; | |
| 302 | - } | |
| 303 | - | |
| 304 | 253 | DriverScheduling scheduling = list.get(stage - 1); |
| 305 | 254 | // 获取两个 Date 对象之间的时间差(以毫秒为单位) |
| 306 | - long timeDifferenceInMillis = scheduling.getSignTime().getTime() - (scheduling.getBcType().equals(BC_TYPE_OUT) ? scheduling.getFcsjT() : scheduling.getZdsjT()); | |
| 255 | + long signTime = scheduling.getSignTime() == null ? System.currentTimeMillis() : scheduling.getSignTime().getTime(); | |
| 256 | + long timeDifferenceInMillis = signTime - (scheduling.getBcType().equals(BC_TYPE_OUT) ? scheduling.getFcsjT() : scheduling.getZdsjT()); | |
| 257 | + long diffTime = 60 * 1000 * 15; | |
| 307 | 258 | // 相差十五分钟 |
| 308 | - if (timeDifferenceInMillis > 0 && timeDifferenceInMillis < (60 * 1000 * 15)) { | |
| 309 | - return true; | |
| 310 | - } else if (timeDifferenceInMillis <= 0) { | |
| 259 | + if (timeDifferenceInMillis <= diffTime) { | |
| 311 | 260 | return true; |
| 312 | 261 | } |
| 313 | 262 | return false; | ... | ... |