自动化立体仓库 - WMS系统
#
dubin
2026-04-15 c5ec00c68631a250a692a689d733daee29276f23
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -75,10 +75,10 @@
    @Autowired
    private PlatformTransactionManager transactionManager;
    @Value("${mes-wk.base-url.test:http://192.168.0.41}")
    @Value("${mes-wk.base-url.test:http://192.168.0.41:8080}")
    private String mesWkBaseUrlTest;
    @Value("${mes-wk.base-url.prod:http://192.168.0.42}")
    @Value("${mes-wk.base-url.prod:http://192.168.0.42:8080}")
    private String mesWkBaseUrlProd;
    @Value("${mes-wk.auth.ent-code:lfd}")
@@ -702,19 +702,19 @@
    // 模拟调用仓库1接口
    private String syncToWarehouse1(ErpMat mat) {
        log.info("Calling Warehouse 1 API for mat: {}", mat.getMatNr());
        return callMatSyncApi(mat, "http://localhost:8888");
        return callMatSyncApi(mat, "http://localhost:8080");
    }
    // 模拟调用仓库2接口
    private String syncToWarehouse2(ErpMat mat) {
        log.info("Calling Warehouse 2 API for mat: {}", mat.getMatNr());
        return callMatSyncApi(mat, "http://localhost:8080");
        return callMatSyncApi(mat, "http://192.168.0.17:8080");
    }
    // 模拟调用仓库3接口
    private String syncToWarehouse3(ErpMat mat) {
        log.info("Calling Warehouse 3 API for mat: {}", mat.getMatNr());
        return callMatSyncApi(mat, "http://localhost:8080");
        return callMatSyncApi(mat, "http://192.168.0.17:8080");
    }
    private String callMatSyncApi(ErpMat mat, String baseUrl) {
@@ -1015,6 +1015,7 @@
        } else {
            throw new CoolException("不支持的wkType:" + param.getWkType());
        }
        payload.put("warehouseId", "WH01");
        try {
            Map<String, Object> res = callMesWkApi(baseUrl, path, headers, payload, bizDesc);
@@ -1045,13 +1046,13 @@
        }
        String wh = wareHouseId.trim();
        if ("WH01".equalsIgnoreCase(wh) || "WH1".equalsIgnoreCase(wh)) {
            return "http://localhost:8888";
            return "http://localhost:8080";
        }
        if ("WH02".equalsIgnoreCase(wh) || "WH2".equalsIgnoreCase(wh)) {
            return "http://localhost:8080";
            return "http://192.168.0.17:8080";
        }
        if ("WH03".equalsIgnoreCase(wh) || "WH3".equalsIgnoreCase(wh)) {
            return "http://localhost:8080";
            return "http://192.168.0.17:8080";
        }
        return null;
    }
@@ -1138,10 +1139,8 @@
                return "http://" + v;
            }
        }
        String wkType = param != null ? param.getWkType() : null;
        String norm = wkType == null ? "" : wkType.trim().toLowerCase();
        if (norm.contains("test") || norm.contains("41") || norm.contains("测试")) {
        boolean result = true;
        if (result) {
            return normalizeHttpBaseUrl(mesWkBaseUrlTest);
        }
        return normalizeHttpBaseUrl(mesWkBaseUrlProd);
@@ -1363,19 +1362,19 @@
    // 模拟调用仓库1接口
    private String syncOrderToWarehouse1(ErpOrder order, List<ErpOrderDetl> details, Integer orderType) {
        log.info("Calling Warehouse 1 API for order: {}", order.getOrderNo());
        return callOrderSyncApi(order, details, orderType, "http://localhost:8888");
        return callOrderSyncApi(order, details, orderType, "http://localhost:8080");
    }
    // 模拟调用仓库2接口
    private String syncOrderToWarehouse2(ErpOrder order, List<ErpOrderDetl> details, Integer orderType) {
        log.info("Calling Warehouse 2 API for order: {}", order.getOrderNo());
        return callOrderSyncApi(order, details, orderType, "http://localhost:8080");
        return callOrderSyncApi(order, details, orderType, "http://192.168.0.17:8080");
    }
    // 模拟调用仓库3接口
    private String syncOrderToWarehouse3(ErpOrder order, List<ErpOrderDetl> details, Integer orderType) {
        log.info("Calling Warehouse 3 API for order: {}", order.getOrderNo());
        return callOrderSyncApi(order, details, orderType, "http://localhost:8080");
        return callOrderSyncApi(order, details, orderType, "http://192.168.0.17:8080");
    }
    private String callOrderSyncApi(ErpOrder order, List<ErpOrderDetl> details, Integer orderType, String baseUrl) {
@@ -1394,12 +1393,15 @@
                param.setOrderNo(order.getOrderNo());
                param.setOrderType(order.getWkType());
                param.setOrderTime(DateUtils.convert(new Date(order.getBusinessTime())));
                param.setWareHouseId(order.getWarehouseId());
                List<DetlDto> detlDtos = new ArrayList<>();
                for (ErpOrderDetl d : details) {
                    DetlDto dto = new DetlDto();
                    dto.setMatnr(d.getMatNr());
                    dto.setBatch(d.getBatch());
                    dto.setQcStatus(String.valueOf(d.getQcStatus()));
                    dto.setPlanNo(d.getPlanNo());
                    dto.setAnfme(d.getAnfme() != null ? d.getAnfme().doubleValue() : 0.0);
                    detlDtos.add(dto);
                }
@@ -1422,6 +1424,8 @@
                    DetlDto dto = new DetlDto();
                    dto.setMatnr(d.getMatNr());
                    dto.setBatch(d.getBatch());
                    dto.setQcStatus(String.valueOf(d.getQcStatus()));
                    dto.setPlanNo(d.getPlanNo());
                    dto.setAnfme(d.getAnfme() != null ? d.getAnfme().doubleValue() : 0.0);
                    detlDtos.add(dto);
                }
@@ -1518,7 +1522,7 @@
                url,
                request,
                null,
                null,
                request,
                response,
                success
        );