| | |
| | | @Transactional(timeout = 60, rollbackFor = Exception.class) |
| | | public R syncCheckDiffs(SyncCheckDiffParams syncParams) { |
| | | List<CheckDiff> diffs = checkDiffService.list(new LambdaQueryWrapper<CheckDiff>() |
| | | .eq(CheckDiff::getExceStatus, CheckExceStatus.CHECK_ORDER_STATUS_EXCE_DONE.val) |
| | | .eq(CheckDiff::getExceStatus, CheckDiffExceStatus.CHECK_DIFF_EXCE_STATUS_END.val) |
| | | .in(CheckDiff::getOrderCode, syncParams.getDiffCode())); |
| | | if (diffs.isEmpty()) { |
| | | return R.ok(); |
| | | } |
| | | List<CheckDiffDto> dtos = new ArrayList<>(); |
| | | diffs.forEach(check -> { |
| | | CheckDiffDto dto = new CheckDiffDto(); |
| | | BeanUtils.copyProperties(check, dto); |
| | | CheckDiffDto checkDto = new CheckDiffDto(); |
| | | CheckDiff checkDiff = new CheckDiff(); |
| | | BeanUtils.copyProperties(check, checkDiff); |
| | | List<CheckDiffItem> items = checkDiffItemService.list(new LambdaQueryWrapper<CheckDiffItem>().eq(CheckDiffItem::getCheckId, check.getId())); |
| | | dto.setItems(items); |
| | | dtos.add(dto); |
| | | checkDto.setItems(items) |
| | | .setCheckDiff(checkDiff); |
| | | dtos.add(checkDto); |
| | | }); |
| | | |
| | | return R.ok().add(dtos); |