1
zhang
1 天以前 8d5c70aef9cbacbcc412d73c4b730e21f94e6514
src/main/java/com/zy/asrs/service/impl/ToWmsServiceImpl.java
@@ -17,8 +17,8 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.Date;
import java.util.concurrent.TimeUnit;
@Slf4j
@Service("toWmsService")
@@ -107,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 (IOException e) {
        } catch (Exception e) {
            e.printStackTrace();
            log.info("请求wms报错,{}", e.getMessage());
            log.info("请求wms报错,入参:{},异常:{}", JSON.toJSONString(wmsParam), e.getMessage());
        } finally {
            addApiLog("入库任务请求获取库位", wmsUrl + inboundTaskApplyPath, JSON.toJSONString(wmsParam), response, success);
        }
@@ -133,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)
@@ -148,7 +153,7 @@
            }
        } catch (Exception e) {
            log.error("任务执行状态上报异常" +  e);
            log.error("任务执行状态上报异常" + e);
        } finally {
            apiLogService.save("任务状态上报"
                    , wmsUrl + executionStatusReport
@@ -179,7 +184,6 @@
        taskWrk.setCrnNo(locMast.getCrnNo());
        taskWrk.setTargetPoint(locNo);
        taskWrk.setStartPoint(startPoint + "");
        taskWrk.setCrnNo(locMast.getCrnNo());
        if (taskWrk.getIoType() == 1) {
            taskWrk.setWrkSts(2);
            if (!Cools.isEmpty(taskWrk.getTargetPoint())) {