啊鑫
2025-05-26 a627c05912ab55061c7ee9b670512e3ee3800d44
添加检验生成失败的补偿机制
已修改2个文件
36 ■■■■ 文件已修改
src/main/java/com/gs/xky/service/XkyService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/gs/xky/XkyApplicationTests.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gs/xky/service/XkyService.java
@@ -71,13 +71,15 @@
                if ("6".equals(deliveryNo.getStatus()) || "0".equals(deliveryNo.getLogisticsStatus())) {
                    log.info("【GetSaveDetail】移除送货单: {}", deliveryNo.getDeliveryNo());
                    remove(deliveryNo);
                } else if ("1".equals(deliveryNo.getStatus()) && "2".equals(deliveryNo.getLogisticsStatus())) {
                    log.info("【GetSaveDetail】处理送货单: {}", deliveryNo.getDeliveryNo());
                } else if ("1".equals(deliveryNo.getStatus()) && ("2".equals(deliveryNo.getLogisticsStatus()) || "1".equals(deliveryNo.getLogisticsStatus()))) {
                    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(), "");
                    //已送达的才自动转换为MES到货单
                    if ("2".equals(deliveryNo.getLogisticsStatus())) {
                        deliveryNoticeService.callPdaReceiptBtn("送货单签收[BTNOK[PL017[" + deliveryNo.getDeliveryNo(), "");
                    }
                }
            } catch (IOException e) {
                log.error("【GetSaveDetail 处理异常】送货单: {}, 异常: {}", deliveryNo.getDeliveryNo(), e.getMessage(), e);
src/test/java/com/gs/xky/XkyApplicationTests.java
@@ -47,6 +47,11 @@
    }
    @Test
    public void getDeviceRealTimeData() throws IOException {
        // xkyService.GetSaveDetail();
    }
    @Test
    void cs() throws IOException {
        XkyCommonParam param = XkyCommonParam.GetInit();
@@ -54,7 +59,7 @@
        BodyParam bodyParam = new BodyParam();
        bodyParam.setErpCode(DataAcquisitionConfiguration.TEST_ERP_CODE);
        bodyParam.setDeliveryNo("222504279H65");
        bodyParam.setDeliveryNo("22250526H9UR");
        bodyParam.setStatus(new int[]{1, 6});
        param.setBody(bodyParam);
@@ -62,13 +67,24 @@
        ApiResponse<XkyDetail> detail = apiService.sendListRequest(param, XkyDetail.class, "https://openapi.xiekeyun.com/delivery/getDetail.json");
        XkyDetail deliveryNo = detail.getData();
        if ("6".equals(deliveryNo.getStatus()) || "0".equals(deliveryNo.getLogisticsStatus())) {
//            remove(deliveryNo);
        } else if ("1".equals(deliveryNo.getStatus()) && ("2".equals(deliveryNo.getLogisticsStatus()) || "1".equals(deliveryNo.getLogisticsStatus()))) {
            XkyDetail detail1 = deliveryNo;
            deliveryNoticeService.saveDeliveryNotice(detail1);
            List<BarcodeDeliveryNo> barcodeDeliveryNos = GetBarcodeInformation(deliveryNo.getDeliveryNo());
            barcodeInformationService.SaveBarcodeInformation(barcodeDeliveryNos, deliveryNo.getDeliveryNo());
            if ("2".equals(deliveryNo.getLogisticsStatus())) {
                deliveryNoticeService.callPdaReceiptBtn("送货单签收[BTNOK[PL017[" + deliveryNo.getDeliveryNo(), "");
            }
        }
//        List<LineList> collect = deliveryNo.getLineList().stream().filter(s -> "1".equals(s.getStatus())).collect(Collectors.toList());
//        System.out.println(JSON.toJSONString(collect));
        deliveryNoticeService.saveDeliveryNotice(deliveryNo);
        List<BarcodeDeliveryNo> barcodeDeliveryNos = GetBarcodeInformation(deliveryNo.getDeliveryNo());
        barcodeInformationService.SaveBarcodeInformation(barcodeDeliveryNos, deliveryNo.getDeliveryNo());
        deliveryNoticeService.callPdaReceiptBtn("送货单签收[BTNOK[PL017[" + deliveryNo.getDeliveryNo(), "");
//        deliveryNoticeService.saveDeliveryNotice(deliveryNo);
//        List<BarcodeDeliveryNo> barcodeDeliveryNos = GetBarcodeInformation(deliveryNo.getDeliveryNo());
//        barcodeInformationService.SaveBarcodeInformation(barcodeDeliveryNos, deliveryNo.getDeliveryNo());
//
//        deliveryNoticeService.callPdaReceiptBtn("送货单签收[BTNOK[PL017[" + deliveryNo.getDeliveryNo(), "");
    }
    private List<BarcodeDeliveryNo> GetBarcodeInformation(String deliveryNo) throws IOException {