Commit d5821badf323018fdd48f9c150bc1199cd7d1e16
1 parent
d9f8d937
feat: 设定时间界限
Showing
1 changed file
with
4 additions
and
3 deletions
Bsth-admin/src/main/java/com/ruoyi/driver/service/impl/DriverServiceImpl.java
| ... | ... | @@ -61,7 +61,6 @@ import javax.servlet.http.HttpServletResponse; |
| 61 | 61 | import static com.ruoyi.common.ApiProperties.PERSONNEL_API_KEY; |
| 62 | 62 | import static com.ruoyi.common.ConstDriverProperties.*; |
| 63 | 63 | import static com.ruoyi.common.ConstSignInConstSignInProperties.*; |
| 64 | -import static com.ruoyi.common.ErrorTypeProperties.WORK_DAY_ERROR; | |
| 65 | 64 | import static com.ruoyi.common.redispre.GlobalRedisPreName.DRIVER_SCHEDULING_PRE; |
| 66 | 65 | |
| 67 | 66 | /** |
| ... | ... | @@ -544,7 +543,7 @@ public class DriverServiceImpl implements IDriverService { |
| 544 | 543 | nowTimerList.add(timeMap.get(index)); |
| 545 | 544 | } |
| 546 | 545 | // 处理当前时间段未签人员 |
| 547 | - nowTimerList = handleTimeOutPerson(nowTimerList); | |
| 546 | + nowTimerList = handleTimeOutPerson(nowTimerList,now); | |
| 548 | 547 | sendNotice(nowTimerList); |
| 549 | 548 | } |
| 550 | 549 | |
| ... | ... | @@ -574,10 +573,12 @@ public class DriverServiceImpl implements IDriverService { |
| 574 | 573 | noticeService.saveBatch(noticeList); |
| 575 | 574 | } |
| 576 | 575 | |
| 577 | - private List<DriverSignInRecommendation> handleTimeOutPerson(List<DriverSignInRecommendation> nowTimerList) { | |
| 576 | + private List<DriverSignInRecommendation> handleTimeOutPerson(List<DriverSignInRecommendation> nowTimerList, Long now) { | |
| 578 | 577 | return nowTimerList.stream() |
| 579 | 578 | // 只需要签到 |
| 580 | 579 | .filter(item-> BC_TYPE_OUT.equals(item.getBcType()) && checkPosts(item)) |
| 580 | + // 给出范围界限 不能未到具体时间的也发送通知 | |
| 581 | + .filter(item -> now - item.getTimestamps() >= 0) | |
| 581 | 582 | // 筛选应签未签人员 |
| 582 | 583 | .filter(item -> Objects.isNull(item.getSignTime()) || item.getTimestamps() - item.getSignTime() < 0) |
| 583 | 584 | .collect(Collectors.toList()); | ... | ... |