Commit 04f3b0e8fe524db1a572ac6cdb7fc3b536f528eb
1 parent
8ca0bcc3
优化导入数据
Showing
2 changed files
with
8 additions
and
2 deletions
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
| ... | ... | @@ -419,7 +419,7 @@ public class ThreadJobService { |
| 419 | 419 | public synchronized void asyncComputedScheduling(Map<String, List<ResponseSchedulingDto>> originSchedulingMap, String timeOut, Date date, int type, Set<Long> idSets, String requestId) { |
| 420 | 420 | JwtAuthenticationTokenFilter.putMDC("job", requestId); |
| 421 | 421 | // //查询当天是否保存过考情表 如果不存在则保存 |
| 422 | - List<DriverScheduling> bcList = schedulingMapper.queryToDay(DateUtil.YYYY_MM_DD_LINK.format(date), DateUtil.YYYY_MM_DD_LINK.format(org.apache.commons.lang3.time.DateUtils.addDays(date, 1)), null, null, null); | |
| 422 | +// List<DriverScheduling> bcList = schedulingMapper.queryToDay(DateUtil.YYYY_MM_DD_LINK.format(date), DateUtil.YYYY_MM_DD_LINK.format(org.apache.commons.lang3.time.DateUtils.addDays(date, 1)), null, null, null); | |
| 423 | 423 | // Map<String, List<DriverScheduling>> dto = nowSchedulingCache.getCacheScheduling(ConstDateUtil.formatDate(date)); |
| 424 | 424 | // if (CollectionUtils.isNotEmpty(bcList) && MapUtils.isEmpty(dto) && Objects.equals(1, type)) { |
| 425 | 425 | // String dateStr = DateUtil.YYYY_MM_DD.format(date); |
| ... | ... | @@ -438,7 +438,7 @@ public class ThreadJobService { |
| 438 | 438 | if (Objects.equals(1, type)) { |
| 439 | 439 | TempCache.resetMapStatus(); |
| 440 | 440 | } |
| 441 | - bcList = getBcList(originSchedulingMap, type); | |
| 441 | + List<DriverScheduling> bcList = getBcList(originSchedulingMap, type); | |
| 442 | 442 | |
| 443 | 443 | // 处理非司售人员的排班明细 |
| 444 | 444 | bcList.addAll(handleOtherPostsScheduling(type)); |
| ... | ... | @@ -513,6 +513,9 @@ public class ThreadJobService { |
| 513 | 513 | if (CollectionUtils.isNotEmpty(sourceList)) { |
| 514 | 514 | schedulings = schedulings.stream().filter(s -> { |
| 515 | 515 | Optional<LinggangScheduling> opt = sourceList.stream().filter(s1 -> s1.importEqus(s)).findFirst(); |
| 516 | + if(opt.isPresent()){ | |
| 517 | + log.debug("排班数据已经存在:[{}]",s); | |
| 518 | + } | |
| 516 | 519 | return !opt.isPresent(); |
| 517 | 520 | }).filter(s -> Objects.nonNull(s)).collect(Collectors.toList()); |
| 518 | 521 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/impl/key/location/LinggangKeyWorkLocationServiceImpl.java
| ... | ... | @@ -315,6 +315,9 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl<LinggangKeyW |
| 315 | 315 | if (CollectionUtils.isNotEmpty(source)) { |
| 316 | 316 | locations = locations.stream().filter(l -> { |
| 317 | 317 | Optional<LinggangKeyWorkLocation> opt = source.stream().filter(s -> s.importEquals(l)).findFirst(); |
| 318 | + if(opt.isPresent()){ | |
| 319 | + log.debug("钥匙存放数据已经存在:[{}]",l); | |
| 320 | + } | |
| 318 | 321 | return !opt.isPresent(); |
| 319 | 322 | }).collect(Collectors.toList()); |
| 320 | 323 | } | ... | ... |