#
taisheng
2025-05-24 53ae8e478f6034579303c51bdf881ffa526c942c
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -85,48 +85,48 @@
    @Override
    public R toWmsLocStatus(LocMast locMast) {
        String response = null;
        Map<String, Object> map = new HashMap<>();
        map.put("x-api-key","7a15b5db-29b6-552c-8cff-0cfec3756da2");
        WmsLocStatus param = new WmsLocStatus();
        param.setWarehouseId("1688469798893297665");
        param.setLocationCode(Utils.getWmsLocNo(locMast.getLocNo()));
        param.setEmptyContainer(locMast.getEmptyContainer$());
        if (locMast.getLocSts().equals("Z")){
            param.setStatus("JY");
        }else {
            param.setStatus("QY");
        }
        if (Cools.isEmpty(locMast.getBarcode()) || locMast.getLocSts().equals("O")){
            param.setContainerCode("");
            param.setContainerTypeCode("");
        }else {
            param.setContainerCode(locMast.getBarcode());
            param.setContainerTypeCode(locMast.getContainerTypeCode());
        }
        try {
            response = new HttpHandler.Builder()
                    .setHeaders(map)
                    .setUri(wmsUrl)
                    .setPath("wcsManager/wcsInterface/locationUpdate")
                    .setJson(JSON.toJSONString(param))
                    .build()
                    .doPost();
        }catch (Exception e){
            log.error("堆垛机任务完成,请求wms任务完成接口失败");
        }
        JSONObject jsonObject = JSON.parseObject(response);
        apiLogService.save("Wms变更货位状态"
                ,wmsUrl+"wcsManager/wcsInterface/inboundTaskApply"
                ,null
                ,"127.0.0.1"
                ,JSON.toJSONString(param)
                ,response
                ,true
        );
//        String response = null;
//        Map<String, Object> map = new HashMap<>();
//        map.put("x-api-key","7a15b5db-29b6-552c-8cff-0cfec3756da2");
//        WmsLocStatus param = new WmsLocStatus();
//        param.setWarehouseId("1688469798893297665");
//        param.setLocationCode(Utils.getWmsLocNo(locMast.getLocNo()));
//        param.setEmptyContainer(locMast.getEmptyContainer$());
//        if (locMast.getLocSts().equals("Z")){
//            param.setStatus("JY");
//        }else {
//            param.setStatus("QY");
//        }
//        if (Cools.isEmpty(locMast.getBarcode()) || locMast.getLocSts().equals("O")){
//            param.setContainerCode("");
//            param.setContainerTypeCode("");
//        }else {
//            param.setContainerCode(locMast.getBarcode());
//            param.setContainerTypeCode(locMast.getContainerTypeCode());
//        }
//
//        try {
//            response = new HttpHandler.Builder()
//                    .setHeaders(map)
//                    .setUri(wmsUrl)
//                    .setPath("wcsManager/wcsInterface/locationUpdate")
//                    .setJson(JSON.toJSONString(param))
//                    .build()
//                    .doPost();
//        }catch (Exception e){
//            log.error("堆垛机任务完成,请求wms任务完成接口失败");
//        }
//        JSONObject jsonObject = JSON.parseObject(response);
//
//
//        apiLogService.save("Wms变更货位状态"
//                ,wmsUrl+"wcsManager/wcsInterface/inboundTaskApply"
//                ,null
//                ,"127.0.0.1"
//                ,JSON.toJSONString(param)
//                ,response
//                ,true
//        );
        return null;
    }