|  |  | 
 |  |  | 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") | 
 |  |  | 
 |  |  |         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); | 
 |  |  |                     success = true; | 
 |  |  |                     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); | 
 |  |  |             addApiLog("入库请求WMS", wmsUrl + inboundTaskApplyPath, JSON.toJSONString(wmsParam), response, success); | 
 |  |  |         } | 
 |  |  |         return null; | 
 |  |  |     } | 
 |  |  | 
 |  |  |         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) | 
 |  |  | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("任务执行状态上报异常" +  e); | 
 |  |  |             log.error("任务执行状态上报异常" + e); | 
 |  |  |         } finally { | 
 |  |  |             apiLogService.save("任务状态上报" | 
 |  |  |                     , wmsUrl + executionStatusReport | 
 |  |  | 
 |  |  |         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())) { |