#
Junjie
6 天以前 9ee1c19a9e982722ac16ca774fc0733ad78471a1
src/main/java/com/zy/core/utils/WmsOperateUtils.java
@@ -1,10 +1,8 @@
package com.zy.core.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.BasCrnp;
import com.zy.asrs.entity.HttpRequestLog;
import com.zy.asrs.entity.WrkMast;
@@ -66,6 +64,7 @@
        HashMap<String, Object> requestParam = new HashMap<>();
        String response = null;
        int result = 0;
        try {
            requestParam.put("barcode", barcode);
            requestParam.put("sourceStaNo", sourceStaNo);
@@ -79,7 +78,17 @@
                    .setTimeout(360, TimeUnit.SECONDS)
                    .build()
                    .doPost();
            if (response != null) {
                JSONObject jsonObject = JSON.parseObject(response);
                if (jsonObject.getInteger("code") == 200) {
                    result = 1;
            News.info("请求WMS入库接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response);
                }else {
                    News.info("请求WMS入库接口失败,接口返回Code异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response);
                }
            }else {
                News.info("请求WMS入库接口失败,接口未响应!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response);
            }
        } catch (Exception e) {
            News.error("请求WMS入库接口异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response, e);
        } finally {
@@ -88,6 +97,7 @@
            httpRequestLog.setRequest(JSON.toJSONString(requestParam));
            httpRequestLog.setResponse(response);
            httpRequestLog.setCreateTime(new Date());
            httpRequestLog.setResult(result);
            httpRequestLogService.insert(httpRequestLog);
        }
        return response;
@@ -125,6 +135,7 @@
        HashMap<String, Object> requestParam = new HashMap<>();
        String response = null;
        int result = 0;
        try {
            requestParam.put("taskNo", wrkMast.getWmsWrkNo());
            requestParam.put("row", Utils.getInTaskEnableRow(new ArrayList<>(wrkMast.getCrnNo()), false));
@@ -136,7 +147,17 @@
                    .setTimeout(360, TimeUnit.SECONDS)
                    .build()
                    .doPost();
            if (response != null) {
                JSONObject jsonObject = JSON.parseObject(response);
                if (jsonObject.getInteger("code") == 200) {
                    result = 1;
            News.info("请求申请任务重新分配入库接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response);
                }else {
                    News.info("请求申请任务重新分配入库接口失败,接口返回Code异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response);
                }
            }else {
                News.info("请求申请任务重新分配入库接口失败,接口未响应!!!url:{};request:{};response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response);
            }
        } catch (Exception e) {
            News.error("请求申请任务重新分配入库接口异常!!!url:{};request:{}; response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response, e);
        } finally {
@@ -145,6 +166,7 @@
            httpRequestLog.setRequest(JSON.toJSONString(requestParam));
            httpRequestLog.setResponse(response);
            httpRequestLog.setCreateTime(new Date());
            httpRequestLog.setResult(result);
            httpRequestLogService.insert(httpRequestLog);
        }
        return response;
@@ -191,6 +213,7 @@
        HashMap<String, Object> requestParam = new HashMap<>();
        String response = null;
        int result = 0;
        try {
            requestParam.put("locNo", locNo);
            requestParam.put("row", crnRows);
@@ -202,9 +225,18 @@
                    .setTimeout(360, TimeUnit.SECONDS)
                    .build()
                    .doPost();
            News.info("请求WMS申请更换库位接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response);
            return response;
            if (response != null) {
                JSONObject jsonObject = JSON.parseObject(response);
                if (jsonObject.getInteger("code") == 200) {
                    result = 1;
                    News.info("请求WMS申请更换库位接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response);
                }else {
                    News.info("请求WMS申请更换库位接口失败,接口返回Code异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response);
                }
            }else {
                News.info("请求WMS申请更换库位接口失败,接口未响应!!!url:{};request:{};response:{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response);
            }
        } catch (Exception e) {
            News.error("请求WMS申请更换库位接口异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response, e);
        } finally {
@@ -213,9 +245,10 @@
            httpRequestLog.setRequest(JSON.toJSONString(requestParam));
            httpRequestLog.setResponse(response);
            httpRequestLog.setCreateTime(new Date());
            httpRequestLog.setResult(result);
            httpRequestLogService.insert(httpRequestLog);
        }
        return null;
        return response;
    }
}