Commit 0a29b0194ea6aa14c56ba1af047f99c428ed75f6
1 parent
241ef253
钥匙归还
Showing
1 changed file
with
13 additions
and
3 deletions
Bsth-admin/src/main/java/com/ruoyi/service/impl/key/location/LinggangKeyWorkLocationServiceImpl.java
| ... | ... | @@ -338,7 +338,13 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl<LinggangKeyW |
| 338 | 338 | List<LinggangKeyWorkLocation> success = new ArrayList<>(); |
| 339 | 339 | List<LinggangKeyWorkLocation> error = new ArrayList<>(); |
| 340 | 340 | source.forEach(s -> { |
| 341 | - boolean flag = update(s); | |
| 341 | + boolean flag = false; | |
| 342 | + if(Objects.isNull(s.getId())){ | |
| 343 | + flag = save(s); | |
| 344 | + }else{ | |
| 345 | + flag = update(s); | |
| 346 | + } | |
| 347 | + | |
| 342 | 348 | if (flag) { |
| 343 | 349 | success.add(s); |
| 344 | 350 | } else { |
| ... | ... | @@ -472,7 +478,9 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl<LinggangKeyW |
| 472 | 478 | |
| 473 | 479 | List<LinggangKeyWorkLocation> sources = listRecentDates(dates, keyIds).stream().filter(s -> !Objects.equals(s.getType(), typeEnum.getValue())).collect(Collectors.toList()); |
| 474 | 480 | if (CollectionUtils.isEmpty(sources)) { |
| 475 | - return ResponseResult.error404("无法找到钥匙归还信息"); | |
| 481 | + log.info("[{}] 无法找到钥匙归还信息",locations); | |
| 482 | + return ResponseResult.success(locations); | |
| 483 | +// return ResponseResult.error404("无法找到钥匙归还信息"); | |
| 476 | 484 | } |
| 477 | 485 | |
| 478 | 486 | if (CollectionUtils.isEmpty(keyInfos)) { |
| ... | ... | @@ -496,7 +504,9 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl<LinggangKeyW |
| 496 | 504 | Set<Long> schedulingIds = sources.stream().map(LinggangKeyWorkLocation::getSchedulingId).collect(Collectors.toSet()); |
| 497 | 505 | List<LinggangScheduling> schedulings = schedulingService.listByIds(schedulingIds); |
| 498 | 506 | if (CollectionUtils.isEmpty(schedulings)) { |
| 499 | - return ResponseResult.error404("无法找到排班信息"); | |
| 507 | + log.info("[{}] 无法找到钥匙归还信息",locations); | |
| 508 | + return ResponseResult.success(locations); | |
| 509 | +// return ResponseResult.error404("无法找到排班信息"); | |
| 500 | 510 | } |
| 501 | 511 | |
| 502 | 512 | ... | ... |