啊鑫
2025-02-13 f8811412e983fdc1d35a909c004c858fc3194636
src/main/java/com/gs/xky/service/XkyService.java
@@ -10,6 +10,8 @@
import com.gs.xky.dto.XkyDetail;
import com.gs.xky.dto.XkyEntity;
import com.gs.xky.entity.DeliveryNotice;
import com.gs.xky.entity.DeliveryNoticeDetail;
import com.gs.xky.entity.TblBarcodeInformation;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -28,6 +30,7 @@
    private final DeliveryNoticeService deliveryNoticeService;
    private final TblBarcodeInformationService barcodeInformationService;
    private final DeliveryNoticeDetailService deliveryNoticeDetailService;
    public void GetSaveDetail() throws IOException {
        long currentTimeMillis = System.currentTimeMillis();
@@ -55,19 +58,39 @@
        LambdaUpdateWrapper<DeliveryNotice> deliveryNoticeWrapper = new LambdaUpdateWrapper<>();
        LambdaUpdateWrapper<DeliveryNoticeDetail> updateWrapper = new LambdaUpdateWrapper<>();
        LambdaUpdateWrapper<TblBarcodeInformation> updateWrapper1 = new LambdaUpdateWrapper<>();
        deliveryNoList.forEach(deliveryNo -> {
            try {
                if ("4".equals(deliveryNo.getStatus()) || "8".equals(deliveryNo.getStatus())) {
                    deliveryNoticeWrapper.clear();
                    updateWrapper.clear();
                    updateWrapper1.clear();
                    deliveryNoticeWrapper.eq(DeliveryNotice::getDeliveryNo, deliveryNo.getDeliveryNo());
                    deliveryNoticeService.remove(deliveryNoticeWrapper);
                    DeliveryNotice one = deliveryNoticeService.getOne(deliveryNoticeWrapper, false);
                    if (deliveryNoticeService.remove(deliveryNoticeWrapper)) {
                        updateWrapper.eq(DeliveryNoticeDetail::getPid, one.getId());
                        deliveryNoticeDetailService.remove(updateWrapper);
                        updateWrapper1.eq(TblBarcodeInformation::getDeliveryNo, deliveryNo.getDeliveryNo());
                        barcodeInformationService.remove(updateWrapper1);
                    }
                }
                XkyDetail detail = getDetail(deliveryNo.getDeliveryNo());
                deliveryNoticeService.saveDeliveryNotice(detail);
                List<BarcodeDeliveryNo> barcodeDeliveryNos = GetBarcodeInformation(deliveryNo.getDeliveryNo());
                barcodeInformationService.SaveBarcodeInformation(barcodeDeliveryNos, deliveryNo.getDeliveryNo());
                deliveryNoticeService.callPdaReceiptBtn("送货单签收[BTNOK[PL017[" + deliveryNo.getDeliveryNo(), "");
            } catch (IOException e) {
                throw new RuntimeException(e);
            }