Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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<Object> taskQuery(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaTaskService.taskQuery(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/againLssued")
|
||||
@Log("重新下发")
|
||||
@ApiOperation("重新下发")
|
||||
public ResponseEntity<Object> againLssued(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaTaskService.againLssued(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("强制完成")
|
||||
@ApiOperation("强制完成")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaTaskService.confirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user