自动化立体仓库 - WCS系统
野心家
2024-10-12 55204060a168f92059dfad82ec0b80e36d12b833
优化完成任务
1个文件已修改
22 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/task/TaskLogScheduler.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/TaskLogScheduler.java
@@ -64,23 +64,8 @@
        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 = "";
@@ -97,6 +82,13 @@
                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"