Commit 0a29b0194ea6aa14c56ba1af047f99c428ed75f6

Authored by liujun001
1 parent 241ef253

钥匙归还

Bsth-admin/src/main/java/com/ruoyi/service/impl/key/location/LinggangKeyWorkLocationServiceImpl.java
@@ -338,7 +338,13 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl<LinggangKeyW @@ -338,7 +338,13 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl<LinggangKeyW
338 List<LinggangKeyWorkLocation> success = new ArrayList<>(); 338 List<LinggangKeyWorkLocation> success = new ArrayList<>();
339 List<LinggangKeyWorkLocation> error = new ArrayList<>(); 339 List<LinggangKeyWorkLocation> error = new ArrayList<>();
340 source.forEach(s -> { 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 if (flag) { 348 if (flag) {
343 success.add(s); 349 success.add(s);
344 } else { 350 } else {
@@ -472,7 +478,9 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW @@ -472,7 +478,9 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
472 478
473 List<LinggangKeyWorkLocation> sources = listRecentDates(dates, keyIds).stream().filter(s -> !Objects.equals(s.getType(), typeEnum.getValue())).collect(Collectors.toList()); 479 List<LinggangKeyWorkLocation> sources = listRecentDates(dates, keyIds).stream().filter(s -> !Objects.equals(s.getType(), typeEnum.getValue())).collect(Collectors.toList());
474 if (CollectionUtils.isEmpty(sources)) { 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 if (CollectionUtils.isEmpty(keyInfos)) { 486 if (CollectionUtils.isEmpty(keyInfos)) {
@@ -496,7 +504,9 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW @@ -496,7 +504,9 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
496 Set<Long> schedulingIds = sources.stream().map(LinggangKeyWorkLocation::getSchedulingId).collect(Collectors.toSet()); 504 Set<Long> schedulingIds = sources.stream().map(LinggangKeyWorkLocation::getSchedulingId).collect(Collectors.toSet());
497 List<LinggangScheduling> schedulings = schedulingService.listByIds(schedulingIds); 505 List<LinggangScheduling> schedulings = schedulingService.listByIds(schedulingIds);
498 if (CollectionUtils.isEmpty(schedulings)) { 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