fe0653b458fbcac5a07c62e328a95c76d2b88e0e..bd4363e0ca7d8c69de47309db31f12cc7af20253
2025-05-29 tjx
更改
bd4363 对比 | 目录
2025-05-29 啊鑫
添加srm与U9订单数据的对比
b20ba7 对比 | 目录
已修改3个文件
已删除2个文件
10140 ■■■■■ 文件已修改
logs/xky_service.log 9996 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
logs/xky_service.log.2025-05-21.0.gz 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gs/xky/entity/MesInvItemArn.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gs/xky/service/XkyService.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/gs/xky/XkyApplicationTests.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
logs/xky_service.log
ÎļþÒÑɾ³ý
logs/xky_service.log.2025-05-21.0.gz
Binary files differ
src/main/java/com/gs/xky/entity/MesInvItemArn.java
@@ -168,11 +168,39 @@
     */
    private Integer thstatus;
    /**
     * ERP退货单号
     * ASN单号 æŽ¨é€U9
     */
    private String erpthno;
    /**
     * ç»„织编码
     */
    private String organizeCode;
    /**
     * æ˜¯å¦SRM同步1-是,0是否
     */
    private String isSrm;
    /**
     * ç‚¹æ”¶çŠ¶æ€
     */
    private Long receiveFlag;
    /**
     * åŒæ­¥æ ‡è¯†
     */
    private Integer syncFlag;
    /**
     * å…·ä½“信息
     */
    private String syncMsg;
    /**
     * ç¡®è®¤åˆ°è´§çŠ¶æ€
     */
    private Long arrivalConfirmationFlag;
    /**
     * ç¡®è®¤åˆ°è´§äººå‘˜
     */
    private String arrivalConfirmationBy;
    /**
     * ç¡®è®¤åˆ°è´§æ—¶é—´
     */
    private Date arrivalConfirmationTime;
}
src/main/java/com/gs/xky/service/XkyService.java
@@ -70,7 +70,7 @@
            try {
                if ("6".equals(deliveryNo.getStatus()) || "0".equals(deliveryNo.getLogisticsStatus())) {
                    log.info("【GetSaveDetail】移除送货单: {}", deliveryNo.getDeliveryNo());
                    remove(deliveryNo);
                    remove1(deliveryNo);
                } else if ("1".equals(deliveryNo.getStatus()) && ("2".equals(deliveryNo.getLogisticsStatus()) || "1".equals(deliveryNo.getLogisticsStatus()))) {
                    XkyDetail detail = getDetail(deliveryNo.getDeliveryNo());
                    deliveryNoticeService.saveDeliveryNotice(detail);
@@ -86,6 +86,68 @@
                throw new RuntimeException(e);
            }
        });
    }
    public void remove1(XkyEntity deliveryNo) {
        //MesQaItemsDetect01与MesInvItemArnDetail的关联关系是
        //MesQaItemsDetect01.lotNo=MesInvItemArnDetail.billNo
        //and MesQaItemsDetect01.item_id=MesInvItemArnDetail.item_id
        //我现在希望不清空DeliveryNotice,DeliveryNoticeDetail,TblBarcodeInformation表的数据了
        //还有MesInvItemArn,MesInvItemArnDetail,MesInvItemBarcodes表的数据
        //只删除MesQaItemsDetect01表的数据
        LambdaQueryWrapper<MesInvItemArn> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(MesInvItemArn::getPaperBillNo, deliveryNo.getDeliveryNo());
        MesInvItemArn mesInvItemArn = mesInvItemArnService.getOne(wrapper, false);
        // åªæœ‰å½“找到对应的MesInvItemArn记录时才删除MesQaItemsDetect01表的数据
        if (mesInvItemArn != null) {
            // æ›´æ–°MesInvItemArn表,设置syncFlag=1,syncMsg="SRM手动删除送货单"
            LambdaUpdateWrapper<MesInvItemArn> updateWrapper = new LambdaUpdateWrapper<>();
            updateWrapper.eq(MesInvItemArn::getId, mesInvItemArn.getId())
                    .set(MesInvItemArn::getSyncFlag, 1)
                    .set(MesInvItemArn::getSyncMsg, "SRM手动删除送货单");
            mesInvItemArnService.update(updateWrapper);
            // åˆ é™¤MesQaItemsDetect01表的数据
            mesQaItemsDetect01Service.removeQa(mesInvItemArn.getBillNo());
        }
    }
    private XkyDetail getDetail(String deliveryNo) throws IOException {
        XkyCommonParam<BodyParam> param = XkyCommonParam.GetInit();
        // åˆ›å»º BodyParam å¯¹è±¡å¹¶èµ‹å€¼
        BodyParam bodyParam = new BodyParam();
        bodyParam.setErpCode(DataAcquisitionConfiguration.TEST_ERP_CODE);
        bodyParam.setDeliveryNo(deliveryNo);
        param.setBody(bodyParam);
        ApiResponse<XkyDetail> noList = apiService.sendListRequest(param, XkyDetail.class, "https://openapi.xiekeyun.com/delivery/getDetail.json");
        return noList.getData();
    }
    private List<BarcodeDeliveryNo> GetBarcodeInformation(String deliveryNo) throws IOException {
        XkyCommonParam<BodyParam> param = XkyCommonParam.GetInit();
        // åˆ›å»º BodyParam å¯¹è±¡å¹¶èµ‹å€¼
        BodyParam bodyParam = new BodyParam();
        bodyParam.setErpCode(DataAcquisitionConfiguration.TEST_ERP_CODE);
        bodyParam.setDeliveryNo(deliveryNo);
        param.setBody(bodyParam);
        ApiResponse<BarcodeDeliveryNo> noList = apiService.sendListRequest(param, BarcodeDeliveryNo.class, "https://openapi.xiekeyun.com/barcode/byDeliveryNo.json");
        return noList.getDataList();
    }
    private void remove(XkyEntity deliveryNo) {
@@ -130,39 +192,5 @@
                mesQaItemsDetect01Service.removeQa(mesInvItemArn.getBillNo());
            }
        }
    }
    private XkyDetail getDetail(String deliveryNo) throws IOException {
        XkyCommonParam<BodyParam> param = XkyCommonParam.GetInit();
        // åˆ›å»º BodyParam å¯¹è±¡å¹¶èµ‹å€¼
        BodyParam bodyParam = new BodyParam();
        bodyParam.setErpCode(DataAcquisitionConfiguration.TEST_ERP_CODE);
        bodyParam.setDeliveryNo(deliveryNo);
        param.setBody(bodyParam);
        ApiResponse<XkyDetail> noList = apiService.sendListRequest(param, XkyDetail.class, "https://openapi.xiekeyun.com/delivery/getDetail.json");
        return noList.getData();
    }
    private List<BarcodeDeliveryNo> GetBarcodeInformation(String deliveryNo) throws IOException {
        XkyCommonParam<BodyParam> param = XkyCommonParam.GetInit();
        // åˆ›å»º BodyParam å¯¹è±¡å¹¶èµ‹å€¼
        BodyParam bodyParam = new BodyParam();
        bodyParam.setErpCode(DataAcquisitionConfiguration.TEST_ERP_CODE);
        bodyParam.setDeliveryNo(deliveryNo);
        param.setBody(bodyParam);
        ApiResponse<BarcodeDeliveryNo> noList = apiService.sendListRequest(param, BarcodeDeliveryNo.class, "https://openapi.xiekeyun.com/barcode/byDeliveryNo.json");
        return noList.getDataList();
    }
}
src/test/java/com/gs/xky/XkyApplicationTests.java
@@ -7,6 +7,7 @@
import com.gs.xky.config.XkyCommonParam;
import com.gs.xky.dto.BarcodeDeliveryNo;
import com.gs.xky.dto.XkyDetail;
import com.gs.xky.dto.XkyEntity;
import com.gs.xky.entity.MesInvItemArn;
import com.gs.xky.service.*;
import org.junit.jupiter.api.Test;
@@ -57,7 +58,7 @@
    @Test
    void cs() throws IOException {
        String str = "22250510W8LC";
        String str = "22250529EHH1";
        String[] split = str.split(";");
@@ -77,7 +78,9 @@
            XkyDetail deliveryNo = detail.getData();
            if ("6".equals(deliveryNo.getStatus()) || "0".equals(deliveryNo.getLogisticsStatus())) {
//            remove(deliveryNo);
                XkyEntity xkyEntity = new XkyEntity();
                xkyEntity.setDeliveryNo(deliveryNo.getDeliveryNo());
                xkyService.remove1(xkyEntity);
            } else if ("1".equals(deliveryNo.getStatus()) && ("2".equals(deliveryNo.getLogisticsStatus()) || "1".equals(deliveryNo.getLogisticsStatus()))) {
                XkyDetail detail1 = deliveryNo;
                deliveryNoticeService.saveDeliveryNotice(detail1);
@@ -87,16 +90,7 @@
                    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(), "");
        }
    }
    private List<BarcodeDeliveryNo> GetBarcodeInformation(String deliveryNo) throws IOException {