This commit is contained in:
2022-12-13 22:51:02 +08:00
parent 2bfb5c4e58
commit 65b13047d7
8 changed files with 192 additions and 155 deletions

View File

@@ -27,6 +27,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto; import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server; import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -152,9 +153,9 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (StrUtil.equals(inst1.getInstruction_status(), "0")) { if (StrUtil.equals(inst1.getInstruction_status(), "0")) {
inst1.setInstruction_status("1"); inst1.setInstruction_status("1");
instructionService.update(inst1); instructionService.update(inst1);
TaskDto taskDto = taskserver.findByCode(inst1.getTask_code()); TaskDto taskDto = taskserver.findByCodeFromCache(inst1.getTask_code());
if (ObjectUtil.isNotEmpty(taskDto)){ if (ObjectUtil.isNotEmpty(taskDto)) {
if (StrUtil.isNotEmpty(taskDto.getExt_task_id())){ if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) {
JSONArray array = new JSONArray(); JSONArray array = new JSONArray();
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("task_id", taskDto.getExt_task_id()); map.put("task_id", taskDto.getExt_task_id());
@@ -216,9 +217,9 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (StrUtil.equals(inst2.getInstruction_status(), "1")) { if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
this.finish_instruction(inst2); this.finish_instruction(inst2);
//获取当前工单数量 //获取当前工单数量
TaskDto taskDto = taskserver.findByCode(inst2.getTask_code()); TaskDto taskDto = taskserver.findByCodeFromCache(inst2.getTask_code());
if (ObjectUtil.isNotEmpty(taskDto)){ if (ObjectUtil.isNotEmpty(taskDto)) {
if (StrUtil.isNotEmpty(taskDto.getExt_task_id())){ if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) {
String next_device_code = inst2.getNext_device_code(); String next_device_code = inst2.getNext_device_code();
Device device = appService.findDeviceByCode(next_device_code); Device device = appService.findDeviceByCode(next_device_code);
HfStationDeviceDriver hfStationDeviceDriver; HfStationDeviceDriver hfStationDeviceDriver;
@@ -275,6 +276,7 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
//行架机械手申请任务 //行架机械手申请任务
if (mode == 2 && move == 0 && task == 0 && !requireSucess) { if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
applyTask(); applyTask();
log.info("行架机械手开始申请任务");
} }
} }
@@ -307,21 +309,17 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
for (int i = 0; i < getDeviceCodeList.size(); i++) { for (int i = 0; i < getDeviceCodeList.size(); i++) {
String startDeviceCode = getDeviceCodeList.get(i); String startDeviceCode = getDeviceCodeList.get(i);
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode); List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtos)){ if (ObjectUtil.isNotEmpty(taskDtos)) {
TaskDto taskDto = taskDtos.get(0); TaskDto taskDto = taskDtos.get(0);
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code()); Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
instruction.setInstruction_status("1"); instruction.setInstruction_status("1");
instruction.setUpdate_time(DateUtil.now()); instruction.setUpdate_time(DateUtil.now());
instructionService.update(instruction); instructionService.update(instruction);
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code()); this.sendSignalType(instruction);
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
writing("to_onset", String.valueOf(start_addrIndex + 1));
writing("to_target", String.valueOf(next_addrIndex + 1));
writing("to_task", instruction.getInstruction_code());
writing("to_command", "1");
this.setRequireSucess(true); this.setRequireSucess(true);
log.info("重新生成指令任务生成成功,指令号:{}", instruction.getInstruction_code());
return true; return true;
}else { } else {
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtoList)) { if (ObjectUtil.isNotEmpty(taskDtoList)) {
task = taskDtoList.get(0); task = taskDtoList.get(0);
@@ -362,20 +360,16 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
try { try {
instructionService.create(instdto); instructionService.create(instdto);
log.info("就绪任务生成指令生成成功,指令号:{}", instdto.getInstruction_code());
} catch (Exception e) { } catch (Exception e) {
log.error("就绪任务生成指令生成失败,任务号:{}", task.getTask_code());
e.printStackTrace(); e.printStackTrace();
} }
//创建指令后修改任务状态 //创建指令后修改任务状态
task.setTask_status("1"); task.setTask_status("1");
task.setUpdate_time(DateUtil.now()); task.setUpdate_time(DateUtil.now());
taskserver.update(task); taskserver.update(task);
//根据获取托盘信息返回的结果 得到对应抓取工位/放货工位设备编码所在的索引位置 this.sendSignalType(instdto);
int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
writing("to_onset", String.valueOf(start_addrIndex + 1));
writing("to_target", String.valueOf(next_addrIndex + 1));
writing("to_task", instdto.getInstruction_code());
writing("to_command", "1");
this.setRequireSucess(true); this.setRequireSucess(true);
} }
return true; return true;
@@ -426,10 +420,33 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} }
public synchronized void sendSignalType(Instruction dto) {
String start_device_code = dto.getStart_device_code();
String next_device_code = dto.getNext_device_code();
Device startDevice = appService.findDeviceByCode(start_device_code);
Device nextDevice = appService.findDeviceByCode(next_device_code);
this.isSetAddress(startDevice);
this.isSetAddress(nextDevice);
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
this.writing("to_onset", start_addr);
this.writing("to_target", next_addr);
this.writing("to_task", dto.getInstruction_code());
this.writing("to_command", "1");
}
//判断点位是否设置电气值
public void isSetAddress(Device device) {
if (ObjectUtil.isEmpty(device.getExtraValue().get("address"))) {
log.error("设备:{},未设置电气调度号!", device.getDevice_code());
throw new BadRequestException("设备:" + device.getDevice_code() + "未设置电气调度号!");
}
}
//将扩展表中的字符串数据转换成集合 //将扩展表中的字符串数据转换成集合
public List<String> getExtraDeviceCodes(String extraName) { public List<String> getExtraDeviceCodes(String extraName) {
String extraValue = (String) this.getDevice().getExtraValue().get(extraName); String extraValue = (String) this.getDevice().getExtraValue().get(extraName);
if (StrUtil.isEmpty(extraValue)){ if (StrUtil.isEmpty(extraValue)) {
return new ArrayList<>(); return new ArrayList<>();
} }
String devicesString = extraValue.substring(1, extraValue.length() - 1); String devicesString = extraValue.substring(1, extraValue.length() - 1);

View File

@@ -27,6 +27,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto; import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server; import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -90,7 +91,6 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
int last_task2 = 0; int last_task2 = 0;
Boolean isonline = true; Boolean isonline = true;
//后工位申请任务请求标记 //后工位申请任务请求标记
Boolean requireBackSucess = false; Boolean requireBackSucess = false;
@@ -151,14 +151,14 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
logServer.deviceExecuteLog(this.device_code, "", "", "信号status" + last_status + "->" + status); logServer.deviceExecuteLog(this.device_code, "", "", "信号status" + last_status + "->" + status);
} }
if (move1 != last_move1) { if (move1 != last_move1) {
if (move1 == 0){ if (move1 == 0) {
this.setRequireHeadSucess(false); this.setRequireHeadSucess(false);
} }
logServer.deviceItemValue(this.device_code, "move1", String.valueOf(move1)); logServer.deviceItemValue(this.device_code, "move1", String.valueOf(move1));
logServer.deviceExecuteLog(this.device_code, "", "", "信号move1" + last_move1 + "->" + move1); logServer.deviceExecuteLog(this.device_code, "", "", "信号move1" + last_move1 + "->" + move1);
} }
if (move2 != last_move2) { if (move2 != last_move2) {
if (move2 == 0){ if (move2 == 0) {
this.setRequireBackSucess(false); this.setRequireBackSucess(false);
} }
logServer.deviceItemValue(this.device_code, "move2", String.valueOf(move2)); logServer.deviceItemValue(this.device_code, "move2", String.valueOf(move2));
@@ -186,19 +186,19 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
} }
//前工位任务就绪->执行 //前工位任务就绪->执行
if ( task1 > 0) { if (task1 > 0) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
if (inst1 != null) { if (inst1 != null) {
if (StrUtil.equals(inst1.getInstruction_status(), "0")) { if (StrUtil.equals(inst1.getInstruction_status(), "0")) {
inst1.setInstruction_status("1"); inst1.setInstruction_status("1");
instructionService.update(inst1); instructionService.update(inst1);
TaskDto taskDto = taskserver.findByCode(inst1.getTask_code()); TaskDto taskDto = taskserver.findByCodeFromCache(inst1.getTask_code());
if (ObjectUtil.isNotEmpty(taskDto)){ if (ObjectUtil.isNotEmpty(taskDto)) {
if (StrUtil.isNotEmpty(taskDto.getExt_task_id())){ if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) {
JSONArray array = new JSONArray(); JSONArray array = new JSONArray();
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("task_id",taskDto.getExt_task_id()); map.put("task_id", taskDto.getExt_task_id());
map.put("task_status","1"); map.put("task_status", "1");
array.add(map); array.add(map);
acsToWmsService.feedbackTaskStatusToWms(array); acsToWmsService.feedbackTaskStatusToWms(array);
} }
@@ -210,23 +210,22 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
//前工位放货完成 任务完成 //前工位放货完成 任务完成
if (mode == 3 && action1 == 4 && move1 == 0 && task1 > 0) { if (mode == 3 && action1 == 4 && move1 == 0 && task1 > 0) {
//inst_message //inst_message
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
if (inst1 != null) { if (inst1 != null) {
if (StrUtil.equals(inst1.getInstruction_status(), "1")) { if (StrUtil.equals(inst1.getInstruction_status(), "1")) {
finish_instruction(inst1); finish_instruction(inst1);
JSONArray array = new JSONArray(); JSONArray array = new JSONArray();
TaskDto taskDto = taskserver.findByCode(inst1.getTask_code()); TaskDto taskDto = taskserver.findByCodeFromCache(inst1.getTask_code());
if (ObjectUtil.isNotEmpty(taskDto)){ if (ObjectUtil.isNotEmpty(taskDto)) {
if (StrUtil.isNotEmpty(taskDto.getExt_task_id())){ if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) {
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("task_id",taskDto.getExt_task_id()); map.put("task_id", taskDto.getExt_task_id());
map.put("task_status","2"); map.put("task_status", "2");
map.put("finished_type","1"); map.put("finished_type", "1");
array.add(map); array.add(map);
acsToWmsService.feedbackTaskStatusToWms(array); acsToWmsService.feedbackTaskStatusToWms(array);
} }
} }
writing("to_command1", "0"); writing("to_command1", "0");
writing("to_onset1", "0"); writing("to_onset1", "0");
writing("to_target1", "0"); writing("to_target1", "0");
@@ -243,13 +242,13 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
if (StrUtil.equals(inst2.getInstruction_status(), "0")) { if (StrUtil.equals(inst2.getInstruction_status(), "0")) {
inst2.setInstruction_status("1"); inst2.setInstruction_status("1");
instructionService.update(inst2); instructionService.update(inst2);
TaskDto taskDto = taskserver.findByCode(inst2.getTask_code()); TaskDto taskDto = taskserver.findByCodeFromCache(inst2.getTask_code());
if (ObjectUtil.isNotEmpty(taskDto)){ if (ObjectUtil.isNotEmpty(taskDto)) {
if (StrUtil.isNotEmpty(taskDto.getExt_task_id())){ if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) {
JSONArray array = new JSONArray(); JSONArray array = new JSONArray();
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("task_id",taskDto.getExt_task_id()); map.put("task_id", taskDto.getExt_task_id());
map.put("task_status","1"); map.put("task_status", "1");
array.add(map); array.add(map);
acsToWmsService.feedbackTaskStatusToWms(array); acsToWmsService.feedbackTaskStatusToWms(array);
} }
@@ -266,18 +265,17 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
if (StrUtil.equals(inst2.getInstruction_status(), "1")) { if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
finish_instruction(inst2); finish_instruction(inst2);
JSONArray array = new JSONArray(); JSONArray array = new JSONArray();
TaskDto taskDto = taskserver.findByCode(inst1.getTask_code()); TaskDto taskDto = taskserver.findByCodeFromCache(inst2.getTask_code());
if (ObjectUtil.isNotEmpty(taskDto)){ if (ObjectUtil.isNotEmpty(taskDto)) {
if (StrUtil.isNotEmpty(taskDto.getExt_task_id())){ if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) {
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("task_id",taskDto.getExt_task_id()); map.put("task_id", taskDto.getExt_task_id());
map.put("task_status","2"); map.put("task_status", "2");
map.put("finished_type","1"); map.put("finished_type", "1");
array.add(map); array.add(map);
acsToWmsService.feedbackTaskStatusToWms(array); acsToWmsService.feedbackTaskStatusToWms(array);
} }
} }
writing("to_command2", "0"); writing("to_command2", "0");
writing("to_onset2", "0"); writing("to_onset2", "0");
writing("to_target2", "0"); writing("to_target2", "0");
@@ -292,61 +290,61 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
String start_device_code = inst1.getStart_device_code(); String start_device_code = inst1.getStart_device_code();
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code); Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);
HfStationDeviceDriver hfStationDeviceDriver; HfStationDeviceDriver hfStationDeviceDriver;
if (startDevice.getDeviceDriver() instanceof HfStationDeviceDriver){ if (startDevice.getDeviceDriver() instanceof HfStationDeviceDriver) {
hfStationDeviceDriver = (HfStationDeviceDriver) startDevice.getDeviceDriver(); hfStationDeviceDriver = (HfStationDeviceDriver) startDevice.getDeviceDriver();
int move = hfStationDeviceDriver.getMove(); int move = hfStationDeviceDriver.getMove();
if (move == 1){ if (move == 1) {
this.writing("to_command1", "2"); this.writing("to_command1", "2");
} else { } else {
log.warn("前工位取货位无货,取货位:{}",start_device_code); log.warn("前工位取货位无货,取货位:{}", start_device_code);
} }
} }
} }
//前工位放货时判断放货位光电信号 //前工位放货时判断放货位光电信号
if (mode == 3 && action1 == 3 && move1 == 1 && task1 > 0){ if (mode == 3 && action1 == 3 && move1 == 1 && task1 > 0) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
String next_device_code = inst1.getNext_device_code(); String next_device_code = inst1.getNext_device_code();
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code); Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code);
HfStationDeviceDriver hfStationDeviceDriver; HfStationDeviceDriver hfStationDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof HfStationDeviceDriver){ if (nextDevice.getDeviceDriver() instanceof HfStationDeviceDriver) {
hfStationDeviceDriver = (HfStationDeviceDriver) nextDevice.getDeviceDriver(); hfStationDeviceDriver = (HfStationDeviceDriver) nextDevice.getDeviceDriver();
int move = hfStationDeviceDriver.getMove(); int move = hfStationDeviceDriver.getMove();
if (move == 0){ if (move == 0) {
this.writing("to_command1","3"); this.writing("to_command1", "3");
} else { } else {
log.warn("前工位放货位有货,放货位:{}",next_device_code); log.warn("前工位放货位有货,放货位:{}", next_device_code);
} }
} }
} }
//后工位取货时判断取货位光电信号 //后工位取货时判断取货位光电信号
if (mode == 3 && action2 == 2 && move2 == 0 && task2 > 0){ if (mode == 3 && action2 == 2 && move2 == 0 && task2 > 0) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2)); Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2));
String start_device_code = inst1.getStart_device_code(); String start_device_code = inst1.getStart_device_code();
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code); Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);
HfStationDeviceDriver hfStationDeviceDriver; HfStationDeviceDriver hfStationDeviceDriver;
if (startDevice.getDeviceDriver() instanceof HfStationDeviceDriver){ if (startDevice.getDeviceDriver() instanceof HfStationDeviceDriver) {
hfStationDeviceDriver = (HfStationDeviceDriver) startDevice.getDeviceDriver(); hfStationDeviceDriver = (HfStationDeviceDriver) startDevice.getDeviceDriver();
int move = hfStationDeviceDriver.getMove(); int move = hfStationDeviceDriver.getMove();
if (move == 1){ if (move == 1) {
this.writing("to_command2","2"); this.writing("to_command2", "2");
} else { } else {
log.warn("后工位取货位无货,取货位:{}",start_device_code); log.warn("后工位取货位无货,取货位:{}", start_device_code);
} }
} }
} }
//后工位放货时判断放货位光电信号 //后工位放货时判断放货位光电信号
if (mode == 3 && action2 == 3 && move2 == 1 && task2 > 0){ if (mode == 3 && action2 == 3 && move2 == 1 && task2 > 0) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2)); Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2));
String next_device_code = inst1.getNext_device_code(); String next_device_code = inst1.getNext_device_code();
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code); Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code);
HfStationDeviceDriver hfStationDeviceDriver; HfStationDeviceDriver hfStationDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof HfStationDeviceDriver){ if (nextDevice.getDeviceDriver() instanceof HfStationDeviceDriver) {
hfStationDeviceDriver = (HfStationDeviceDriver) nextDevice.getDeviceDriver(); hfStationDeviceDriver = (HfStationDeviceDriver) nextDevice.getDeviceDriver();
int move = hfStationDeviceDriver.getMove(); int move = hfStationDeviceDriver.getMove();
if (move == 0){ if (move == 0) {
this.writing("to_command2","3"); this.writing("to_command2", "3");
} else { } else {
log.warn("后工位放货位有货,放货位:{}",next_device_code); log.warn("后工位放货位有货,放货位:{}", next_device_code);
} }
} }
} }
@@ -384,19 +382,19 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
//后工位申请任务 //后工位申请任务
if (mode == 2 && move2 == 0 && action2 == 0 && !requireBackSucess) { if (mode == 2 && move2 == 0 && action2 == 0 && !requireBackSucess) {
instruction_require2(); instruction_require2();
logServer.deviceExecuteLog(device_code,"",String.valueOf(task2),"move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess); logServer.deviceExecuteLog(device_code, "", String.valueOf(task2), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess);
} }
//前工位申请任务 //前工位申请任务
if (mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0 && task1 > 0 && !requireHeadSucess) { if (mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0 && task1 > 0 && !requireHeadSucess) {
instruction_require(); instruction_require();
logServer.deviceExecuteLog(device_code,"",String.valueOf(task1),"move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireHeadSucess:" + requireHeadSucess); logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireHeadSucess:" + requireHeadSucess);
} }
break; break;
case 3: case 3:
//前工位申请任务 //前工位申请任务
if (mode == 3 && move2 == 1 && action2 == 1 && move1 == 0 && action1 == 0 && !requireHeadSucess) { if (mode == 3 && move2 == 1 && action2 == 1 && move1 == 0 && action1 == 0 && !requireHeadSucess) {
instruction_require(); instruction_require();
logServer.deviceExecuteLog(device_code,"",String.valueOf(task1),"move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireHeadSucess:" + requireHeadSucess); logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireHeadSucess:" + requireHeadSucess);
} }
} }
@@ -430,21 +428,16 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
for (int i = 0; i < getDeviceCodeList.size(); i++) { for (int i = 0; i < getDeviceCodeList.size(); i++) {
String startDeviceCode = getDeviceCodeList.get(i); String startDeviceCode = getDeviceCodeList.get(i);
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode); List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtos)){ if (ObjectUtil.isNotEmpty(taskDtos)) {
TaskDto taskDto = taskDtos.get(0); TaskDto taskDto = taskDtos.get(0);
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code()); Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
instruction.setInstruction_status("1"); instruction.setInstruction_status("1");
instruction.setUpdate_time(DateUtil.now()); instruction.setUpdate_time(DateUtil.now());
instructionService.update(instruction); instructionService.update(instruction);
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code()); this.sendHeadSignalType(instruction);
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
this.writing("to_onset1", String.valueOf(start_addrIndex + 1));
this.writing("to_target1", String.valueOf(next_addrIndex + 1));
this.writing("to_task1", instruction.getInstruction_code());
this.writing("to_command1", "1");
requireHeadSucess = true; requireHeadSucess = true;
return true; return true;
}else { } else {
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtoList)) { if (ObjectUtil.isNotEmpty(taskDtoList)) {
task = taskDtoList.get(0); task = taskDtoList.get(0);
@@ -494,14 +487,7 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
task.setTask_status("1"); task.setTask_status("1");
task.setUpdate_time(DateUtil.now()); task.setUpdate_time(DateUtil.now());
taskserver.update(task); taskserver.update(task);
this.sendHeadSignalType(instdto);
//根据查询的任务起始点位 得出取放工位的索引值 写入后工位电气中
int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
this.writing("to_onset1", String.valueOf(start_addrIndex + 1));
this.writing("to_target1", String.valueOf(next_addrIndex + 1));
this.writing("to_task1", instdto.getInstruction_code());
this.writing("to_command1", "1");
requireHeadSucess = true; requireHeadSucess = true;
} }
} }
@@ -526,21 +512,16 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
for (int i = 0; i < getDeviceCodeList.size(); i++) { for (int i = 0; i < getDeviceCodeList.size(); i++) {
String startDeviceCode = getDeviceCodeList.get(i); String startDeviceCode = getDeviceCodeList.get(i);
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode); List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtos)){ if (ObjectUtil.isNotEmpty(taskDtos)) {
TaskDto taskDto = taskDtos.get(0); TaskDto taskDto = taskDtos.get(0);
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code()); Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
instruction.setInstruction_status("1"); instruction.setInstruction_status("1");
instruction.setUpdate_time(DateUtil.now()); instruction.setUpdate_time(DateUtil.now());
instructionService.update(instruction); instructionService.update(instruction);
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code()); this.sendBackSignalType(instruction);
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
this.writing("to_onset1", String.valueOf(start_addrIndex + 1));
this.writing("to_target1", String.valueOf(next_addrIndex + 1));
this.writing("to_task1", instruction.getInstruction_code());
this.writing("to_command1", "1");
requireBackSucess = true; requireBackSucess = true;
return true; return true;
}else { } else {
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtoList)) { if (ObjectUtil.isNotEmpty(taskDtoList)) {
task = taskDtoList.get(0); task = taskDtoList.get(0);
@@ -589,20 +570,50 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
//创建指令后修改任务状态 //创建指令后修改任务状态
task.setTask_status("1"); task.setTask_status("1");
taskserver.update(task); taskserver.update(task);
this.sendBackSignalType(instdto);
//根据查询的任务起始点位 得出取放工位的索引值 写入后工位电气中
int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
this.writing("to_onset2", String.valueOf(start_addrIndex + 1));
this.writing("to_target2", String.valueOf(next_addrIndex + 1));
this.writing("to_task2", instdto.getInstruction_code());
this.writing("to_command2", "1");
requireBackSucess = true;
} }
} }
return true; return true;
} }
public synchronized void sendHeadSignalType(Instruction dto) {
String start_device_code = dto.getStart_device_code();
String next_device_code = dto.getNext_device_code();
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code);
this.isSetAddress(startDevice);
this.isSetAddress(nextDevice);
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
this.writing("to_onset1", start_addr);
this.writing("to_target1", next_addr);
this.writing("to_task1", dto.getInstruction_code());
this.writing("to_command1", "1");
}
public synchronized void sendBackSignalType(Instruction dto) {
String start_device_code = dto.getStart_device_code();
String next_device_code = dto.getNext_device_code();
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code);
this.isSetAddress(startDevice);
this.isSetAddress(nextDevice);
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
this.writing("to_onset2", start_addr);
this.writing("to_target2", next_addr);
this.writing("to_task2", dto.getInstruction_code());
this.writing("to_command2", "1");
}
//判断点位是否设置电气值
public void isSetAddress(Device device) {
if (ObjectUtil.isEmpty(device.getExtraValue().get("address"))) {
log.error("设备:{},未设置电气调度号!", device.getDevice_code());
throw new BadRequestException("设备:" + device.getDevice_code() + "未设置电气调度号!");
}
}
public boolean exe_error() { public boolean exe_error() {
if (this.error == 0) { if (this.error == 0) {
return true; return true;
@@ -684,9 +695,9 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
} }
//将扩展表中的字符串数组数据转换成集合 //将扩展表中的字符串数组数据转换成集合
public List<String> getExtraDeviceCodes(String extraName){ public List<String> getExtraDeviceCodes(String extraName) {
String extraValue = (String) this.getDevice().getExtraValue().get(extraName); String extraValue = (String) this.getDevice().getExtraValue().get(extraName);
if (StrUtil.isEmpty(extraValue)){ if (StrUtil.isEmpty(extraValue)) {
return new ArrayList<>(); return new ArrayList<>();
} }
String devicesString = extraValue.substring(1, extraValue.length() - 1); String devicesString = extraValue.substring(1, extraValue.length() - 1);

View File

@@ -67,7 +67,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
DeviceAppService deviceAppService; DeviceAppService deviceAppService;
@Autowired @Autowired
NDCAgvService ndcAgvService; NDCAgvService ndcAgvService;
@Autowired @Autowired
ParamService paramService; ParamService paramService;
@Autowired @Autowired
RouteLineService routeLineService; RouteLineService routeLineService;
@@ -220,10 +220,11 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
@Override @Override
public Instruction findByTaskcode(String code) { public Instruction findByTaskcode(String code) {
WQLObject wo = WQLObject.getWQLObject("acs_instruction"); WQLObject wo = WQLObject.getWQLObject("acs_instruction");
JSONObject json = wo.query("task_code ='" + code + "'").uniqueResult(0); JSONObject json = wo.query("instruction_status = '0' and task_code ='" + code + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(json)){ if (ObjectUtil.isNotEmpty(json)) {
final Instruction obj = json.toJavaObject(Instruction.class); final Instruction obj = json.toJavaObject(Instruction.class);
return obj; return obj;
} }
return null; return null;
} }
@@ -232,7 +233,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
public Instruction findByTaskcodeAndStatus(String code) { public Instruction findByTaskcodeAndStatus(String code) {
WQLObject wo = WQLObject.getWQLObject("acs_instruction"); WQLObject wo = WQLObject.getWQLObject("acs_instruction");
JSONObject json = wo.query("task_code ='" + code + "' and instruction_status = '0'").uniqueResult(0); JSONObject json = wo.query("task_code ='" + code + "' and instruction_status = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(json)){ if (ObjectUtil.isNotEmpty(json)) {
final Instruction obj = json.toJavaObject(Instruction.class); final Instruction obj = json.toJavaObject(Instruction.class);
return obj; return obj;
} }
@@ -326,20 +327,20 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
if (startdevice.getDeviceDriver() instanceof CargoLiftConveyorDeviceDriver) { if (startdevice.getDeviceDriver() instanceof CargoLiftConveyorDeviceDriver) {
cargoLiftConveyorDeviceDriver = (CargoLiftConveyorDeviceDriver) startdevice.getDeviceDriver(); cargoLiftConveyorDeviceDriver = (CargoLiftConveyorDeviceDriver) startdevice.getDeviceDriver();
cargoLiftConveyorDeviceDriver.writing(3, Integer.valueOf(dto.getInstruction_code())); cargoLiftConveyorDeviceDriver.writing(3, Integer.valueOf(dto.getInstruction_code()));
if (nextdevice.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver){ if (nextdevice.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) {
standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) nextdevice.getDeviceDriver(); standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) nextdevice.getDeviceDriver();
standardCoveyorControlWithScannerDeviceDriver.writing(1,1); standardCoveyorControlWithScannerDeviceDriver.writing(1, 1);
String address = standardCoveyorControlWithScannerDeviceDriver.getExtraValue().get("address").toString(); String address = standardCoveyorControlWithScannerDeviceDriver.getExtraValue().get("address").toString();
if (StrUtil.isEmpty(address)){ if (StrUtil.isEmpty(address)) {
throw new BadRequestException("设备:"+nextdevice.getDevice_code()+"未设置电气调度号!"); throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置电气调度号!");
} }
String door = standardCoveyorControlWithScannerDeviceDriver.getExtraValue().get("door").toString(); String door = standardCoveyorControlWithScannerDeviceDriver.getExtraValue().get("door").toString();
if (StrUtil.isEmpty(door)){ if (StrUtil.isEmpty(door)) {
throw new BadRequestException("设备:"+nextdevice.getDevice_code()+"未设置门!"); throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置门!");
} }
String floor = standardCoveyorControlWithScannerDeviceDriver.getExtraValue().get("floor").toString(); String floor = standardCoveyorControlWithScannerDeviceDriver.getExtraValue().get("floor").toString();
if (StrUtil.isEmpty(floor)){ if (StrUtil.isEmpty(floor)) {
throw new BadRequestException("设备:"+nextdevice.getDevice_code()+"未设置楼层!"); throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置楼层!");
} }
standardCoveyorControlWithScannerDeviceDriver.writing(2, Integer.parseInt(address)); standardCoveyorControlWithScannerDeviceDriver.writing(2, Integer.parseInt(address));
standardCoveyorControlWithScannerDeviceDriver.writing(3, Integer.parseInt(task_code)); standardCoveyorControlWithScannerDeviceDriver.writing(3, Integer.parseInt(task_code));
@@ -350,20 +351,20 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
if (startdevice.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) { if (startdevice.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) {
standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) startdevice.getDeviceDriver(); standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) startdevice.getDeviceDriver();
standardCoveyorControlWithScannerDeviceDriver.writing(3, Integer.valueOf(dto.getInstruction_code())); standardCoveyorControlWithScannerDeviceDriver.writing(3, Integer.valueOf(dto.getInstruction_code()));
if (nextdevice.getDeviceDriver() instanceof CargoLiftConveyorDeviceDriver){ if (nextdevice.getDeviceDriver() instanceof CargoLiftConveyorDeviceDriver) {
cargoLiftConveyorDeviceDriver = (CargoLiftConveyorDeviceDriver) nextdevice.getDeviceDriver(); cargoLiftConveyorDeviceDriver = (CargoLiftConveyorDeviceDriver) nextdevice.getDeviceDriver();
cargoLiftConveyorDeviceDriver.writing(1,1); cargoLiftConveyorDeviceDriver.writing(1, 1);
String address = cargoLiftConveyorDeviceDriver.getExtraValue().get("address").toString(); String address = cargoLiftConveyorDeviceDriver.getExtraValue().get("address").toString();
if (StrUtil.isEmpty(address)){ if (StrUtil.isEmpty(address)) {
throw new BadRequestException("设备:"+nextdevice.getDevice_code()+"未设置电气调度号!"); throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置电气调度号!");
} }
String door = cargoLiftConveyorDeviceDriver.getExtraValue().get("door").toString(); String door = cargoLiftConveyorDeviceDriver.getExtraValue().get("door").toString();
if (StrUtil.isEmpty(door)){ if (StrUtil.isEmpty(door)) {
throw new BadRequestException("设备:"+nextdevice.getDevice_code()+"未设置门!"); throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置门!");
} }
String floor = cargoLiftConveyorDeviceDriver.getExtraValue().get("floor").toString(); String floor = cargoLiftConveyorDeviceDriver.getExtraValue().get("floor").toString();
if (StrUtil.isEmpty(floor)){ if (StrUtil.isEmpty(floor)) {
throw new BadRequestException("设备:"+nextdevice.getDevice_code()+"未设置楼层!"); throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置楼层!");
} }
cargoLiftConveyorDeviceDriver.writing(2, Integer.parseInt(address)); cargoLiftConveyorDeviceDriver.writing(2, Integer.parseInt(address));
cargoLiftConveyorDeviceDriver.writing(3, Integer.parseInt(task_code)); cargoLiftConveyorDeviceDriver.writing(3, Integer.parseInt(task_code));
@@ -386,12 +387,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
RouteLineDto routeLineDto = shortPathsList.get(i); RouteLineDto routeLineDto = shortPathsList.get(i);
String route_device = routeLineDto.getDevice_code(); String route_device = routeLineDto.getDevice_code();
String route_next_device = routeLineDto.getNext_device_code(); String route_next_device = routeLineDto.getNext_device_code();
if (route_device.equals(dto.getStart_device_code()) && route_next_device.equals(dto.getNext_device_code())){ if (route_device.equals(dto.getStart_device_code()) && route_next_device.equals(dto.getNext_device_code())) {
route = routeLineDto; route = routeLineDto;
break; break;
} }
} }
if (ObjectUtil.isEmpty(route)){ if (ObjectUtil.isEmpty(route)) {
throw new BadRequestException("未查询到相关路由!"); throw new BadRequestException("未查询到相关路由!");
} }
if (StrUtil.equals(route.getType(), "1")) { if (StrUtil.equals(route.getType(), "1")) {

View File

@@ -136,7 +136,7 @@ https://juejin.cn/post/6844903775631572999
<!--生产环境:打印控制台和输出到文件--> <!--生产环境:打印控制台和输出到文件-->
<springProfile name="prod"> <springProfile name="prod">
<root level="off"> <root level="error">
<appender-ref ref="asyncFileAppender"/> <appender-ref ref="asyncFileAppender"/>
<appender-ref ref="lokiAppender" /> <appender-ref ref="lokiAppender" />
</root> </root>

View File

@@ -2,6 +2,6 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置 # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
VUE_APP_BASE_API = 'http://47.97.157.227:8010' VUE_APP_BASE_API = 'http://127.0.0.1:8010'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://47.97.157.227:8010' VUE_APP_WS_API = 'ws://127.0.0.1:8010'

View File

@@ -53,7 +53,7 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="电气调度号" label-width="150px"> <el-form-item label="电气调度号" label-width="150px">
<el-input v-model="form.OPCServer" /> <el-input v-model="form.address" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -263,7 +263,8 @@ export default {
apply_empty: [], apply_empty: [],
manual_create_task: true, manual_create_task: true,
is_pickup: true, is_pickup: true,
is_release: true is_release: true,
address: ''
}, },
rules: {} rules: {}
} }

View File

@@ -41,7 +41,7 @@
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
</el-col> </el-col>
<rrOperation/> <rrOperation />
</el-row> </el-row>
</div> </div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
@@ -67,7 +67,7 @@
> >
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item v-if="false" label="路线标识" prop="line_uuid"> <el-form-item v-if="false" label="路线标识" prop="line_uuid">
<el-input v-model="form.line_uuid" style="width: 370px;"/> <el-input v-model="form.line_uuid" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="路由方案" prop="route_plan_id"> <el-form-item label="路由方案" prop="route_plan_id">
@@ -87,15 +87,15 @@
<el-form-item label="当前设备名称" prop="device_code"> <el-form-item label="当前设备名称" prop="device_code">
<el-select <el-select
ref="test"
v-model="form.device_code" v-model="form.device_code"
filterable filterable
ref="test"
clearable clearable
multiple multiple
reserveKeyword reserve-keyword
@change="change"
placeholder="请选择" placeholder="请选择"
style="width: 370px;" style="width: 370px;"
@change="change"
> >
<el-option <el-option
v-for="item in deviceList" v-for="item in deviceList"
@@ -111,7 +111,7 @@
v-model="form.next_device_code" v-model="form.next_device_code"
filterable filterable
clearable clearable
reserveKeyword reserve-keyword
multiple multiple
placeholder="请选择" placeholder="请选择"
style="width: 370px;" style="width: 370px;"
@@ -140,10 +140,10 @@
</el-form-item> </el-form-item>
<el-form-item label="权值" prop="weights"> <el-form-item label="权值" prop="weights">
<el-input-number v-model="form.weights" :min="1" :max="10" label="描述文字"/> <el-input-number v-model="form.weights" :min="1" :max="10" label="描述文字" />
</el-form-item> </el-form-item>
<el-form-item label="描述信息" prop="description"> <el-form-item label="描述信息" prop="description">
<el-input v-model="form.remark" style="width: 370px;" rows="5" type="textarea"/> <el-input v-model="form.remark" style="width: 370px;" rows="5" type="textarea" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@@ -161,20 +161,20 @@
style="width: 100%;" style="width: 100%;"
@selection-change="crud.selectionChangeHandler" @selection-change="crud.selectionChangeHandler"
> >
<el-table-column type="selection" width="55"/> <el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="line_uuid" label="路线标识"/> <el-table-column v-if="false" prop="line_uuid" label="路线标识" />
<el-table-column prop="device_code" label="设备编码"/> <el-table-column prop="device_code" label="设备编码" />
<el-table-column v-if="false" prop="device_code" label="设备名称"/> <el-table-column v-if="false" prop="device_code" label="设备名称" />
<el-table-column prop="type" label="路由类型"> <el-table-column prop="type" label="路由类型">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.type=='0' ">输送路由</span> <span v-if="scope.row.type=='0' ">输送路由</span>
<span v-if="scope.row.type=='1' ">agv路由</span> <span v-if="scope.row.type=='1' ">agv路由</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="next_device_code" min-width="120" label="后置设备号"/> <el-table-column prop="next_device_code" min-width="120" label="后置设备号" />
<el-table-column v-if="false" prop="next_device_code" min-width="120" label="后置设备名称"/> <el-table-column v-if="false" prop="next_device_code" min-width="120" label="后置设备名称" />
<el-table-column v-if="false" prop="next_device_code" min-width="120" label="后置设备类型"/> <el-table-column v-if="false" prop="next_device_code" min-width="120" label="后置设备类型" />
<el-table-column prop="weights" label="权值"/> <el-table-column prop="weights" label="权值" />
<el-table-column label="是否启用" align="center" prop="is_active"> <el-table-column label="是否启用" align="center" prop="is_active">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -189,8 +189,8 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="update_by" label="修改者"/> <el-table-column prop="update_by" label="修改者" />
<el-table-column prop="update_time" min-width="160" label="修改时间"/> <el-table-column prop="update_time" min-width="160" label="修改时间" />
<el-table-column <el-table-column
v-permission="['admin','routeLine:edit','routeLine:del']" v-permission="['admin','routeLine:edit','routeLine:del']"
label="操作" label="操作"
@@ -207,7 +207,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination/> <pagination />
</div> </div>
</div> </div>
</template> </template>
@@ -313,6 +313,13 @@ export default {
this.form.next_device_code = Array.of(data.form.next_device_code.split('').join('')) this.form.next_device_code = Array.of(data.form.next_device_code.split('').join(''))
return true return true
}, },
[CRUD.HOOK.beforeSubmit](data) {
if (this.crud.status.edit === 1) {
this.form.device_code = data.form.device_code.join('')
this.form.next_device_code = data.form.next_device_code.join('')
}
return true
},
// 改变状态 // 改变状态
changeEnabled(data) { changeEnabled(data) {
var msg = '停用' var msg = '停用'

View File

@@ -2,6 +2,6 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置 # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
VUE_APP_BASE_API = 'http://47.97.157.227:8010' VUE_APP_BASE_API = 'http://127.0.0.1:8011'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://47.97.157.227:8010' VUE_APP_WS_API = 'ws://127.0.0.1:8011'