| | |
| | | for (TaskWrk taskWrk : taskWrkService.selectToBeHistoryData()) { |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | if (taskWrk.getStatus().equals(TaskStatusType.OVER.id)||taskWrk.getStatus()==7) {//完成 |
| | | //区分入出库 |
| | | TaskWrkLog taskWrkLog = new TaskWrkLog(taskWrk); |
| | | if (!wrkLogService.insert(taskWrkLog)) { |
| | | throw new CoolException("转历史档失败" + taskWrkLog); |
| | | } |
| | | if (!taskWrkService.deleteById(taskWrk)) { |
| | | throw new CoolException("任务档删除失败" + taskWrkLog); |
| | | } |
| | | headParam.put("Result", 1); |
| | | } else if (taskWrk.getStatus().equals(TaskStatusType.CANCEL.id)) { |
| | | TaskWrkLog taskWrkLog=new TaskWrkLog(taskWrk); |
| | | if(!wrkLogService.insert(taskWrkLog)){ |
| | | throw new CoolException("转历史档失败"+taskWrkLog); |
| | | } |
| | | if(!taskWrkService.deleteById(taskWrk)){ |
| | | throw new CoolException("任务档删除失败"+taskWrkLog); |
| | | } |
| | | headParam.put("Result", 2); |
| | | } |
| | | String response = ""; |
| | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | Boolean bool = false; |
| | | if(jsonObject.get("ReturnStatus").equals(0)){ |
| | | TaskWrkLog taskWrkLog=new TaskWrkLog(taskWrk); |
| | | if(!wrkLogService.insert(taskWrkLog)){ |
| | | throw new CoolException("转历史档失败"+taskWrkLog); |
| | | } |
| | | if(!taskWrkService.deleteById(taskWrk)){ |
| | | throw new CoolException("任务档删除失败"+taskWrkLog); |
| | | } |
| | | bool = true; |
| | | } |
| | | apiLogService.save("wcs完成或者取消任务上报wms" |