From b804c33d655898ffc906ead2e244ee32f3e815d9 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Sun, 11 Dec 2022 11:47:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SlitTwoManipulatorDeviceDriver.java | 297 ++++++++++-------- .../main/java/org/nl/acs/ext/wms/AcsUtil.java | 4 +- 2 files changed, 160 insertions(+), 141 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index a14c6e74a..71ff21035 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -107,13 +107,13 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl int flag; //前工位任务执行当前步骤 - //0未执行 1更改指令状态 2下发电气任务信息 3前工位允许取货 4前工位允许放货 5放货完成 + //0未执行 1更改指令状态 2下发电气任务信息 3前工位允许取货 4前工位取货完成 5前工位允许放货 6放货完成 int now_steps_type1 = 0; //后工位当前执行步骤 - //0未执行 1更改指令状态 2下发电气任务信息 3后工位允许取货 4后工位允许放货 5放货完成 + //0未执行 1更改指令状态 2下发电气任务信息 3后工位允许取货4后工位取货完成 5后工位允许放货 6放货完成 int now_steps_type2 = 0; //双工位任务当前执行步骤 - //0未执行 1更改指令状态 2下发电气任务信息 3后工位允许取货 4前工位允许取货 5后工位允许放货 6后工位放货完成 7前工位允许放货 8前工位放货完成 + //0未执行 1更改指令状态 2下发电气任务信息 3后工位允许取货 4后工位取货完成 5前工位允许取货 6前工位取货完成 7后工位允许放货 8后工位放货完成 9前工位允许放货 10前工位放货完成 int now_steps_type3 = 0; String device_code; @@ -277,128 +277,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } ; - // this.setNow_steps_type3(1); } } } - //单任务前工位放货完成 任务完成 - if (mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && type == 1) { - //inst_message - Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); - if (inst1 != null) { - if (StrUtil.equals(inst1.getInstruction_status(), "1")) { - this.finish_instruction(inst1); - TaskDto taskDto = taskserver.findByCodeFromCache(inst1.getTask_code()); - if (!ObjectUtil.isEmpty(taskDto)) { - if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) { - JSONArray array = new JSONArray(); - JSONObject map = new JSONObject(); - map.put("task_id", taskDto.getExt_task_id()); - map.put("task_status", "2"); - array.add(map); - acsToWmsService.feedbackTaskStatusToWms(array); - } - } - ; - this.writing("to_command1", "4"); - this.setNow_steps_type1(5); - this.setNow_steps_type1(0); -// this.writing("to_onset1", "0"); -// this.writing("to_target1", "0"); -// this.writing("to_task1", "0"); -// this.writing("to_type", "0"); - } - } - } else { - if (this.getNow_steps_type1() == 4) { - feedMessage = "请检查:mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && type == 1"; - } - } - - //单任务 后工位放货完成 任务完成 - if (mode == 3 && action2 == 4 && move2 == 0 && task2 > 0 && type == 2) { - //inst_message - Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task2)); - if (inst2 != null) { - if (StrUtil.equals(inst2.getInstruction_status(), "1")) { - finish_instruction(inst2); - TaskDto taskDto = taskserver.findByCodeFromCache(inst2.getTask_code()); - if (!ObjectUtil.isEmpty(taskDto)) { - if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) { - JSONArray array = new JSONArray(); - JSONObject map = new JSONObject(); - map.put("task_id", taskDto.getExt_task_id()); - map.put("task_status", "2"); - array.add(map); - acsToWmsService.feedbackTaskStatusToWms(array); - } - } - ; - this.writing("to_command2", "4"); - this.setNow_steps_type2(5); - this.setNow_steps_type2(0); -// this.writing("to_onset2", "0"); -// this.writing("to_target2", "0"); -// this.writing("to_task2", "0"); -// this.writing("to_type", "0"); - } - } - } else { - if (this.getNow_steps_type2() == 4) { - feedMessage = "请检查:mode == 3 && action2 == 4 && move2 == 0 && task2 > 0 && type == 2"; - } - } - - //双任务后工位反馈4 - if (mode == 3 && action2 == 4 && move2 == 0 && task1 > 0 && task2 > 0 && type == 3) { - this.writing("to_command2", "4"); - this.setNow_steps_type3(6); - } else { - if (this.getNow_steps_type3() == 5) { - feedMessage = "请检查:mode == 3 && action2 == 4 && move2 == 0 && task1 > 0 && task2 > 0 && type == 3"; - } - } - - //双工位 任务完成 前工位反馈4 - if (mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && task2 > 0 && type == 3) { - //inst_message - Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); - if (inst1 != null) { - if (StrUtil.equals(inst1.getInstruction_status(), "1")) { - this.finish_instruction(inst1); - TaskDto taskDto = taskserver.findByCodeFromCache(inst1.getTask_code()); - if (!ObjectUtil.isEmpty(taskDto)) { - if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) { - JSONArray array = new JSONArray(); - JSONObject map = new JSONObject(); - map.put("task_id", taskDto.getExt_task_id()); - map.put("task_status", "2"); - array.add(map); - acsToWmsService.feedbackTaskStatusToWms(array); - } - } - ; - this.writing("to_command1", "4"); - this.setNow_steps_type3(8); - this.setNow_steps_type3(0); -// this.writing("to_onset1", "0"); -// this.writing("to_target1", "0"); -// this.writing("to_task1", "0"); -// this.writing("to_onset2", "0"); -// this.writing("to_target2", "0"); -// this.writing("to_task2", "0"); -// this.writing("to_type", "0"); - } - } - } else { - if (this.getNow_steps_type3() == 7) { - feedMessage = "请检查:mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && task2 > 0 && type == 3"; - } - } - - - //后工位取货时判断取货位光电信号 + //双任务/单任务 后工位取空时判断动作信号,并反馈 if (mode == 3 && action2 == 1 && move2 == 0 && task2 > 0) { Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2)); String start_device_code = ""; @@ -434,35 +317,106 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } - //后工位允许放货 - if (mode == 3 && action2 == 3 && move2 == 1 && task2 > 0) { - this.writing("to_command2", "3"); - if (type == 2) { + //单任务/或双任务 后工位收到取货完成信号并反馈 + if (mode == 3 && action2 == 2 && move2 == 1 && task2 > 0){ + this.writing("to_command2","3"); + if (type == 2){ this.setNow_steps_type2(4); - } else if (type == 3) { - this.setNow_steps_type3(5); } - } else { - if (this.getNow_steps_type2() == 3 || this.getNow_steps_type3() == 4) { - feedMessage = "请检查:mode == 3 && action2 == 3 && move2 == 1 && task2 > 0"; + if (type == 3){ + this.setNow_steps_type3(4); + } + }else { + if (this.getNow_steps_type2() == 3 || this.getNow_steps_type3() == 3) { + feedMessage = "请检查:mode == 3 && action2 == 2 && move2 == 1 && task2 > 0"; } } - //前工位允许取货 + //单任务/双任务 前工位取货时判断动作信号并反馈 if (mode == 3 && action1 == 1 && move1 == 0 && task1 > 0) { this.writing("to_command1", "2"); if (type == 1) { this.setNow_steps_type1(3); } else if (type == 3) { - this.setNow_steps_type3(4); + this.setNow_steps_type3(5); } } else { - if (this.getNow_steps_type1() == 2 || this.getNow_steps_type3() == 3) { + if (this.getNow_steps_type1() == 2 || this.getNow_steps_type3() == 4) { feedMessage = "请检查mode == 3 && action1 == 1 && move1 == 0 && task1 > 0"; } } - //前工位放货时判断放货位光电信号 + //单任务/双任务 前工位取货完成并反馈 + if (mode == 3 && action1 == 2 && move1 == 1 && task1 > 0){ + this.writing("to_command1","3"); + if (type == 1){ + this.setNow_steps_type1(4); + } + if (type == 3){ + this.setNow_steps_type3(6); + } + }else { + if (this.getNow_steps_type1() == 3 || this.getNow_steps_type3() == 5) { + feedMessage = "请检查:mode == 3 && action1 == 2 && move1 == 1 && task1 > 0"; + } + } + + + //单任务/双任务 后工位放货时判断信号并反馈 + if (mode == 3 && action2 == 3 && move2 == 1 && task2 > 0) { + this.writing("to_command2", "4"); + if (type == 2) { + this.setNow_steps_type2(5); + } else if (type == 3) { + this.setNow_steps_type3(7); + } + } else { + if (this.getNow_steps_type2() == 4 || this.getNow_steps_type3() == 6) { + feedMessage = "请检查:mode == 3 && action2 == 3 && move2 == 1 && task2 > 0"; + } + } + + //单任务 后工位放货完成 任务完成 + if (mode == 3 && action2 == 4 && move2 == 0 && task2 > 0 && type == 2) { + //inst_message + Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task2)); + if (inst2 != null) { + if (StrUtil.equals(inst2.getInstruction_status(), "1")) { + finish_instruction(inst2); + TaskDto taskDto = taskserver.findByCodeFromCache(inst2.getTask_code()); + if (!ObjectUtil.isEmpty(taskDto)) { + if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) { + JSONArray array = new JSONArray(); + JSONObject map = new JSONObject(); + map.put("task_id", taskDto.getExt_task_id()); + map.put("task_status", "2"); + array.add(map); + acsToWmsService.feedbackTaskStatusToWms(array); + } + } + ; + this.writing("to_command2", "5"); + this.setNow_steps_type2(6); + this.setNow_steps_type2(0); + } + } + } else { + if (this.getNow_steps_type2() == 5) { + feedMessage = "请检查:mode == 3 && action2 == 4 && move2 == 0 && task2 > 0 && type == 2"; + } + } + + //双任务 后工位反馈任务完成 并反馈 + if (mode == 3 && action2 == 4 && move2 == 0 && task1 > 0 && task2 > 0 && type == 3) { + this.writing("to_command2", "5"); + this.setNow_steps_type3(8); + } else { + if (this.getNow_steps_type3() == 7) { + feedMessage = "请检查:mode == 3 && action2 == 4 && move2 == 0 && task1 > 0 && task2 > 0 && type == 3"; + } + } + + //单任务/双任务 前工位放货时判断放货位光电信号 if (mode == 3 && action1 == 3 && move1 == 1 && task1 > 0) { Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); String next_device_code = inst1.getNext_device_code(); @@ -473,25 +427,90 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl int move = siemensConveyorDeviceDriver.getMove(); int mode = siemensConveyorDeviceDriver.getMode(); if (move == 0 && mode == 2) { - this.writing("to_command1", "3"); + this.writing("to_command1", "4"); if (type == 1) { - this.setNow_steps_type1(4); + this.setNow_steps_type1(5); } else if (type == 3) { - this.setNow_steps_type3(7); + this.setNow_steps_type3(9); } } else { log.warn("后工位放货位有货,放货位:{},mode:{},move:{}", next_device_code, mode, move); - if (this.getNow_steps_type1() == 3 || this.getNow_steps_type3() == 6) { + if (this.getNow_steps_type1() == 4 || this.getNow_steps_type3() == 8) { feedMessage = "请检查输送线:move == 0 && mode == 2"; } } } } else { - if (this.getNow_steps_type1() == 3 || this.getNow_steps_type3() == 6) { + if (this.getNow_steps_type1() == 4 || this.getNow_steps_type3() == 8) { feedMessage = "请检查:mode == 3 && action1 == 3 && move1 == 1 && task1 > 0"; } } + + //单任务前工位放货完成 任务完成 + if (mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && type == 1) { + //inst_message + Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); + if (inst1 != null) { + if (StrUtil.equals(inst1.getInstruction_status(), "1")) { + this.finish_instruction(inst1); + TaskDto taskDto = taskserver.findByCodeFromCache(inst1.getTask_code()); + if (!ObjectUtil.isEmpty(taskDto)) { + if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) { + JSONArray array = new JSONArray(); + JSONObject map = new JSONObject(); + map.put("task_id", taskDto.getExt_task_id()); + map.put("task_status", "2"); + array.add(map); + acsToWmsService.feedbackTaskStatusToWms(array); + } + } + ; + this.writing("to_command1", "5"); + this.setNow_steps_type1(6); + this.setNow_steps_type1(0); + } + } + } else { + if (this.getNow_steps_type1() == 5) { + feedMessage = "请检查:mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && type == 1"; + } + } + + + + //双工位 任务完成 前工位反馈4 + if (mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && task2 > 0 && type == 3) { + //inst_message + Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); + if (inst1 != null) { + if (StrUtil.equals(inst1.getInstruction_status(), "1")) { + this.finish_instruction(inst1); + TaskDto taskDto = taskserver.findByCodeFromCache(inst1.getTask_code()); + if (!ObjectUtil.isEmpty(taskDto)) { + if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) { + JSONArray array = new JSONArray(); + JSONObject map = new JSONObject(); + map.put("task_id", taskDto.getExt_task_id()); + map.put("task_status", "2"); + array.add(map); + acsToWmsService.feedbackTaskStatusToWms(array); + } + } + ; + this.writing("to_command1", "5"); + this.setNow_steps_type3(10); + this.setNow_steps_type3(0); + } + } + } else { + if (this.getNow_steps_type3() == 9) { + feedMessage = "请检查:mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && task2 > 0 && type == 3"; + } + } + + + } catch (Exception var17) { return; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java index 8db03aa1f..8f78cb017 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java @@ -3,7 +3,7 @@ package org.nl.acs.ext.wms; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; -import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.system.service.ParamService; @@ -25,7 +25,7 @@ public class AcsUtil { try { return HttpRequest .post(liKu_wcs_url + api) - .body(String.valueOf(requestParam)) + .body(JSON.toJSONString(requestParam)) .execute() .body(); } catch (Exception e) { From 44efdbc3296739bdb29d994decf7fa033ff73245 Mon Sep 17 00:00:00 2001 From: liuxy Date: Mon, 12 Dec 2022 11:39:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/pda/task/rest/PdaTaskController.java | 55 ++++++++++ .../wms/pda/task/service/PdaTaskService.java | 34 ++++++ .../task/service/impl/PdaTaskServiceImpl.java | 77 ++++++++++++++ .../java/org/nl/wms/pda/task/wql/PDA_TASK.wql | 100 ++++++++++++++++++ 4 files changed, 266 insertions(+) create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/task/rest/PdaTaskController.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/task/service/PdaTaskService.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/task/service/impl/PdaTaskServiceImpl.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/task/wql/PDA_TASK.wql diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/rest/PdaTaskController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/rest/PdaTaskController.java new file mode 100644 index 000000000..32b7bb221 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/rest/PdaTaskController.java @@ -0,0 +1,55 @@ + +package org.nl.wms.pda.task.rest; + + +import com.alibaba.fastjson.JSONObject; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.logging.annotation.Log; +import org.nl.modules.wql.core.content.HttpContext; +import org.nl.wms.pda.st.service.CoolInService; +import org.nl.wms.pda.task.service.PdaTaskService; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author liuxy + * @date 2022-05-25 + **/ +@RestController +@RequiredArgsConstructor +@Api(tags = "任务管理") +@RequestMapping("/api/pda/task") +@Slf4j +public class PdaTaskController { + + private final PdaTaskService pdaTaskService; + + @PostMapping("/taskQuery") + @Log("任务查询") + @ApiOperation("任务查询") + public ResponseEntity taskQuery(@RequestBody JSONObject whereJson) { + return new ResponseEntity<>(pdaTaskService.taskQuery(whereJson), HttpStatus.OK); + } + + @PostMapping("/againLssued") + @Log("重新下发") + @ApiOperation("重新下发") + public ResponseEntity againLssued(@RequestBody JSONObject whereJson) { + return new ResponseEntity<>(pdaTaskService.againLssued(whereJson), HttpStatus.OK); + } + + @PostMapping("/confirm") + @Log("强制完成") + @ApiOperation("强制完成") + public ResponseEntity confirm(@RequestBody JSONObject whereJson) { + return new ResponseEntity<>(pdaTaskService.confirm(whereJson), HttpStatus.OK); + } + +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/service/PdaTaskService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/service/PdaTaskService.java new file mode 100644 index 000000000..067e88d78 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/service/PdaTaskService.java @@ -0,0 +1,34 @@ + +package org.nl.wms.pda.task.service; + +import com.alibaba.fastjson.JSONObject; +import org.nl.modules.wql.core.content.HttpContext; + +/** +* @description 服务接口 +* @author liuxy +* @date 2022-05-25 +**/ +public interface PdaTaskService { + + /** + * 任务查询 + * @param whereJson / + * @return JSONObject / + */ + JSONObject taskQuery(JSONObject whereJson); + + /** + * 重新下发 + * @param whereJson / + * @return JSONObject / + */ + JSONObject againLssued(JSONObject whereJson); + + /** + * 强制完成 + * @param whereJson / + * @return JSONObject / + */ + JSONObject confirm(JSONObject whereJson); +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/service/impl/PdaTaskServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/service/impl/PdaTaskServiceImpl.java new file mode 100644 index 000000000..24b495d53 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/service/impl/PdaTaskServiceImpl.java @@ -0,0 +1,77 @@ + +package org.nl.wms.pda.task.service.impl; + + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.common.utils.SecurityUtils; +import org.nl.modules.wql.WQL; +import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.modules.wql.core.content.HttpContext; +import org.nl.modules.wql.util.SpringContextHolder; +import org.nl.wms.pda.st.service.CoolInService; +import org.nl.wms.pda.task.service.PdaTaskService; +import org.nl.wms.sch.service.TaskService; +import org.nl.wms.sch.service.impl.TaskServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * @author liuxy + * @description 服务实现 + * @date 2022-05-25 + **/ +@Service +@RequiredArgsConstructor +@Slf4j +public class PdaTaskServiceImpl implements PdaTaskService { + + @Override + public JSONObject taskQuery(JSONObject whereJson) { + String search = whereJson.getString("search"); + + JSONObject map = new JSONObject(); + map.put("flag", "1"); + if (ObjectUtil.isNotEmpty(search)) map.put("search", "%"+search+"%"); + JSONArray resultJSONArray = WQL.getWO("PDA_TASK").addParamMap(map).process().getResultJSONArray(0); + + JSONObject jo = new JSONObject(); + jo.put("data", resultJSONArray); + jo.put("message", "查询成功!"); + return jo; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public JSONObject againLssued(JSONObject whereJson) { + WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task"); + JSONObject task_rows = whereJson.getJSONObject("task_rows"); + + JSONObject jsonTask = tab.query("task_code = '" + task_rows.getString("task_code") + "'").uniqueResult(0); + jsonTask.put("method_name", "immediateNotifyAcs"); + SpringContextHolder.getBean(TaskService.class).operation(jsonTask); + + JSONObject result = new JSONObject(); + result.put("message", "下发成功"); + return result; + } + + @Override + public JSONObject confirm(JSONObject whereJson) { + WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task"); + JSONObject task_rows = whereJson.getJSONObject("task_rows"); + + JSONObject jsonTask = tab.query("task_code = '" + task_rows.getString("task_code") + "'").uniqueResult(0); + jsonTask.put("method_name", "forceFinish"); + SpringContextHolder.getBean(TaskService.class).operation(jsonTask); + + JSONObject result = new JSONObject(); + result.put("message", "下发成功"); + return result; + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/wql/PDA_TASK.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/wql/PDA_TASK.wql new file mode 100644 index 000000000..866f45aae --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/task/wql/PDA_TASK.wql @@ -0,0 +1,100 @@ +[交易说明] + 交易名: 手持任务管理 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.search TYPEAS s_string + + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + IF 输入.flag = "1" + QUERY + SELECT + task_code, + vehicle_code, + point_code1, + point_code2, + point_code3, + point_code4, + ( + CASE task_status + WHEN '1' THEN '生成' + WHEN '2' THEN '确定起点' + WHEN '3' THEN '确定终点' + WHEN '4' THEN '起点和终点确定' + WHEN '5' THEN '下发' + WHEN '6' THEN '执行中' + END + ) AS task_status, + ( + CASE task_type + WHEN '010101' THEN '标准任务' + WHEN '010102' THEN '取满(生箔->冷却)' + WHEN '010103' THEN '取空(冷却->生箔)' + WHEN '010201' THEN '冷却->烘箱' + WHEN '010202' THEN '烘箱->暂存位' + WHEN '010203' THEN '暂存位->烘箱' + WHEN '010204' THEN '暂存位->冷却' + WHEN '010301' THEN '标准任务' + WHEN '010302' THEN '取满(冷却->分切)' + WHEN '010303' THEN '取空(分切->冷却)' + WHEN '010401' THEN '输送出' + WHEN '010402' THEN '输送入' + WHEN '010403' THEN '桁架标准任务' + WHEN '010404' THEN '分切>输送线' + WHEN '010405' THEN '输送线>分切' + END + ) AS task_type, + car_no, + create_time + FROM + SCH_BASE_Task + WHERE + is_delete = '0' + AND task_status <> '7' + + OPTION 输入.search <> "" + (vehicle_code like 输入.search or + point_code1 like 输入.search or + point_code2 like 输入.search or + point_code3 like 输入.search or + point_code4 like 输入.search or + task_code like 输入.search or + car_no like 输入.search) + ENDOPTION + + ENDSELECT + ENDQUERY + ENDIF \ No newline at end of file