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