Commit 0c728fa5dffb28495d35f7e097e47aaf5b69bd42

Authored by guzijian
1 parent 3b7cf951

fix: 修复补签后签到报表签到无信息问题

Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
... ... @@ -267,12 +267,14 @@ public class SignInServiceImpl implements ISignInService {
267 267 if (Objects.isNull(driver)) return AjaxResult.warn("这个工号的员工不存在!");
268 268 GlobalIndex globalIndex = new GlobalIndex();
269 269 long now = signIn.getCreateTime().getTime();
270   -// List<DriverScheduling> dto = schedulingService.queryScheduling(signIn.getJobCode(), now);
  270 + List<DriverScheduling> dto = schedulingService.queryScheduling(signIn.getJobCode(), now);
271 271 // 只能补签当月
272 272 if (checkSupplementarySignatureTime(signIn.getCreateTime())) {
273 273 throw new RuntimeException("只能对当前月的数据进行补签!");
274 274 }
275   - List<DriverScheduling> dto = schedulingMapper.queryToDay(ConstDateUtil.formatDate("yyyy-MM-dd",signIn.getCreateTime()),null,driver.getJobCode(),null);
  275 + if (CollectionUtil.isEmpty(dto)) {
  276 + dto = schedulingMapper.queryToDay(ConstDateUtil.formatDate("yyyy-MM-dd", signIn.getCreateTime()), null, driver.getJobCode(), null);
  277 + }
276 278 handleSignBody(signIn, driver, globalIndex, now, dto);
277 279 signIn.setUpdateBy(SecurityUtils.getUsername());
278 280 signIn.setRemark("补签");
... ... @@ -293,7 +295,7 @@ public class SignInServiceImpl implements ISignInService {
293 295 private boolean checkSupplementarySignatureTime(Date createTime) {
294 296 String date = ConstDateUtil.formatDate("yyyy-MM", createTime);
295 297 String now = ConstDateUtil.formatDate("yyyy-MM", new Date());
296   - if (date.equals(now)){
  298 + if (date.equals(now)) {
297 299 return false;
298 300 }
299 301 return true;
... ...
Bsth-admin/src/main/java/com/ruoyi/service/SchedulingService.java
... ... @@ -50,7 +50,7 @@ public class SchedulingService {
50 50  
51 51  
52 52 /**
53   - * 获取排班信息
  53 + * 获取排班信息 并排序
54 54 *
55 55 * @param jobCode
56 56 * @param now
... ...