| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author 28567 |
| | |
| | | |
| | | wrapper.eq(DeliveryNotice::getDeliveryNo, xkyDetail.getDeliveryNo()); |
| | | |
| | | long count = count(wrapper); |
| | | // long count = count(wrapper); |
| | | DeliveryNotice one = getOne(wrapper, false); |
| | | |
| | | if (count > 0) { |
| | | if (one != null) { |
| | | LambdaUpdateWrapper<DeliveryNotice> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(DeliveryNotice::getDeliveryNo, xkyDetail.getDeliveryNo()); |
| | | remove(updateWrapper); |
| | | |
| | | LambdaUpdateWrapper<DeliveryNoticeDetail> updateWrapper1 = new LambdaUpdateWrapper<>(); |
| | | updateWrapper1.eq(DeliveryNoticeDetail::getPid, one.getId()); |
| | | detailService.remove(updateWrapper1); |
| | | } |
| | | |
| | | |
| | | DeliveryNotice deliveryNotice = new DeliveryNotice(); |
| | | BeanUtil.copyProperties(xkyDetail, deliveryNotice); |
| | |
| | | } |
| | | |
| | | List<DeliveryNoticeDetail> noticeDetails = new ArrayList<>(); |
| | | for (LineList list : lineList) { |
| | | |
| | | List<LineList> collect = lineList.stream().filter(s -> "1".equals(s.getStatus())).collect(Collectors.toList()); |
| | | for (LineList list : collect) { |
| | | DeliveryNoticeDetail detail = new DeliveryNoticeDetail(); |
| | | BeanUtil.copyProperties(list, detail); |
| | | detail.setPid(id); |
| | |
| | | if (StrUtil.isNotEmpty(detail.getPoLineNo())) { |
| | | String[] split = detail.getPoLineNo().split("-"); |
| | | detail.setPoLineNo(split[0]); |
| | | detail.setPlanLineNo(split[1] + "-" + detail.getDeliveryQty()); |
| | | } |
| | | |
| | | |
| | | noticeDetails.add(detail); |
| | | } |
| | | |
| | | return save(deliveryNotice) && detailService.saveBatch(noticeDetails); |
| | | } |
| | | |
| | | @Override |
| | | public void callPdaReceiptBtn(String inStr, String result) { |
| | | baseMapper.callPdaReceiptBtn(inStr, result); |
| | | } |
| | | } |
| | | |
| | | |