| | |
| | | private String movePath; |
| | | @Value("${wms.inboundTaskApplyPath}") |
| | | private String inboundTaskApplyPath; |
| | | @Value("${wms.TaskExecCallback}") |
| | | private String TaskExecCallback; |
| | | @Value("${wms.taskLeave}") |
| | | private String taskLeave; |
| | | @Value("${wms.taskStatusFeedbackPath}") |
| | | private String taskStatusFeedbackPath; |
| | | |
| | |
| | | List<TaskWrk> taskWrkList = taskWrkService.selectList(new EntityWrapper<TaskWrk>().in("wrk_sts", 7,18)); |
| | | for (TaskWrk taskWrk : taskWrkList) { |
| | | TaskWrkLog taskWrkLog = new TaskWrkLog(taskWrk); |
| | | if(taskWrkLog.getIoType().equals(2)){ |
| | | taskWrkLog.setWrkSts(19); |
| | | }else{ |
| | | if(taskWrkLog.getIoType().equals(1)){ |
| | | taskWrkLog.setWrkSts(8); |
| | | taskWrkLog.setModiTime(new Date()); |
| | | if (!wrkLogService.insert(taskWrkLog)) { |
| | | throw new CoolException("转历史档失败" + taskWrkLog); |
| | | } |
| | | if (!taskWrkService.deleteById(taskWrk)) { |
| | | throw new CoolException("任务档删除失败" + taskWrkLog); |
| | | } |
| | | }else if(taskWrkLog.getIoType().equals(2)){ |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("wrk_no",taskWrk.getWrkNo())); |
| | | if(basDevp==null){ |
| | | HashMap<Object, Object> headParam = new HashMap<>(); |
| | | String response = ""; |
| | | Boolean bool = false; |
| | | try { |
| | | headParam.put("TaskNo", taskWrk.getTaskNo()); |
| | | log.info("wcs"+"出库搬离任务上报wms={}", taskWrk); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskLeave) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if(jsonObject.get("ReturnStatus").equals(0)){ |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("wcs搬离出库给wms失败{},返回值={}", taskWrk, response); |
| | | }finally { |
| | | apiLogService.save("wcs搬离出库给wms" |
| | | , wmsUrl + taskLeave |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam) |
| | | , response |
| | | , bool |
| | | ); |
| | | } |
| | | taskWrkLog.setWrkSts(19); |
| | | taskWrkLog.setModiTime(new Date()); |
| | | if (!wrkLogService.insert(taskWrkLog)) { |
| | | throw new CoolException("转历史档失败" + taskWrkLog); |
| | | } |
| | | if (!taskWrkService.deleteById(taskWrk)) { |
| | | throw new CoolException("任务档删除失败" + taskWrkLog); |
| | | } |
| | | } |
| | | |
| | | } |
| | | taskWrkLog.setModiTime(new Date()); |
| | | if (!wrkLogService.insert(taskWrkLog)) { |
| | | throw new CoolException("转历史档失败" + taskWrkLog); |
| | | } |
| | | if (!taskWrkService.deleteById(taskWrk)) { |
| | | throw new CoolException("任务档删除失败" + taskWrkLog); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |