1
zhang
昨天 8d5c70aef9cbacbcc412d73c4b730e21f94e6514
src/main/java/com/zy/asrs/service/impl/ToWmsServiceImpl.java
@@ -18,6 +18,7 @@
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.concurrent.TimeUnit;
@Slf4j
@Service("toWmsService")
@@ -106,20 +107,25 @@
        try {
            response = new HttpHandler.Builder()
                    .setUri(wmsUrl)
                    .setTimeout(30, TimeUnit.SECONDS)
                    .setPath(inboundTaskApplyPath)
                    .setJson(JSON.toJSONString(wmsParam))
                    .build()
                    .doPost();
            if (!Cools.isEmpty(response)) {
                JSONObject jsonObject = JSON.parseObject(response);
                if (successCode.equals(jsonObject.get(code).toString())) {
                if ("700".equals(jsonObject.get(code).toString())) {
                    TaskWrk taskWrk=new TaskWrk();
                    taskWrk.setWrkNo(-1);
                    return taskWrk;
                } else if (successCode.equals(jsonObject.get(code).toString())) {
                    WmsResult result = JSON.parseObject(jsonObject.get(data).toString(), WmsResult.class);
                    return createInTask(result, wmsParam.getBarcode(), wmsParam.getStationCode());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.info("请求wms报错,入参:{},异常:{}",JSON.toJSONString(wmsParam), e.getMessage());
            log.info("请求wms报错,入参:{},异常:{}", JSON.toJSONString(wmsParam), e.getMessage());
        } finally {
            addApiLog("入库任务请求获取库位", wmsUrl + inboundTaskApplyPath, JSON.toJSONString(wmsParam), response, success);
        }
@@ -132,9 +138,9 @@
        boolean bool = false;
        JSONObject param = new JSONObject();
        try {
            log.info("任务执行状态上报,任务号:{},执行状态:{}", taskNo,wrkSts);
            param.put("taskNo",taskNo);
            param.put("wrkSts",wrkSts);
            log.info("任务执行状态上报,任务号:{},执行状态:{}", taskNo, wrkSts);
            param.put("taskNo", taskNo);
            param.put("wrkSts", wrkSts);
            response = new HttpHandler.Builder()
                    // .setHeaders(headParam)
                    .setUri(wmsUrl)
@@ -147,7 +153,7 @@
            }
        } catch (Exception e) {
            log.error("任务执行状态上报异常" +  e);
            log.error("任务执行状态上报异常" + e);
        } finally {
            apiLogService.save("任务状态上报"
                    , wmsUrl + executionStatusReport