Browse Source

update

v1.1_20240705
张江玮 1 year ago
parent
commit
1504737964
  1. 3
      acs/nladmin-system/src/main/java/org/nl/acs/agv/rest/XianGongAgvController.java
  2. 16
      acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java
  3. 83
      acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java
  4. 131
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java
  5. 136
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/nl4/station/NL4StationDeviceDriver.java
  6. 12
      acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceAppServiceImpl.java
  7. 14
      acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceExecuteAutoRun.java
  8. 4
      acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java
  9. 122
      acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
  10. 52
      acs/nladmin-system/src/main/java/org/nl/hand/amb/service/impl/HFHandServiceImpl.java
  11. 2
      acs/nladmin-system/src/main/java/org/nl/modules/wql/core/bean/ResultBean.java
  12. 2
      acs/nladmin-system/src/main/resources/config/application-dev.yml
  13. 5
      acs/nladmin-system/src/main/resources/config/application-prod.yml
  14. 2
      acs/nladmin-system/src/main/resources/config/application.yml
  15. 4
      acs/nladmin-ui/.env.production
  16. 11
      acs/nladmin-ui/src/views/acs/instruction/index.vue

3
acs/nladmin-system/src/main/java/org/nl/acs/agv/rest/XianGongAgvController.java

@ -1,5 +1,6 @@
package org.nl.acs.agv.rest; package org.nl.acs.agv.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -11,6 +12,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** /**
@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor @RequiredArgsConstructor
@Api(tags = "仙工AGV") @Api(tags = "仙工AGV")
@Slf4j @Slf4j
@SaIgnore
public class XianGongAgvController { public class XianGongAgvController {
private final XianGongAgvService agvService; private final XianGongAgvService agvService;

16
acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java

@ -229,6 +229,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
jo.put("complete", true); jo.put("complete", true);
jo.put("blocks", createBlocksData(inst)); jo.put("blocks", createBlocksData(inst));
jo.put("priority", inst.getPriority()); jo.put("priority", inst.getPriority());
Device device1 = deviceAppService.findDeviceByCode(inst.getStart_device_code());
if (Arrays.asList("1", "2", "3").contains(device1.getRegion())) {
jo.put("group", "NT");
} else if (Arrays.asList("4", "8").contains(device1.getRegion())) {
jo.put("group", "JF");
} else if (Arrays.asList("5", "6", "7").contains(device1.getRegion())) {
jo.put("group", "ZZ");
}
log.info("任务号:{},指令号{},下发agv订单序列参数:{}", inst.getTask_code(), inst.getInstruction_code(), jo.toString()); log.info("任务号:{},指令号{},下发agv订单序列参数:{}", inst.getTask_code(), inst.getInstruction_code(), jo.toString());
if (StrUtil.equals(paramService.findByCode(org.nl.acs.config.AcsConfig.FORKAGV).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(org.nl.acs.config.AcsConfig.FORKAGV).getValue(), "1")) {
@ -462,7 +470,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
public JSONArray createBlocksData(Instruction inst) { public JSONArray createBlocksData(Instruction inst) {
String ip = paramService.findByCode("local_host").getValue(); String ip = paramService.findByCode("local_host").getValue();
String addr = ip + port; String addr = "http://" + ip + ":" + port;
JSONArray blocks = new JSONArray(); JSONArray blocks = new JSONArray();
@ -493,6 +501,9 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
block.put("blockId", IdUtil.simpleUUID()); block.put("blockId", IdUtil.simpleUUID());
block.put("location", inst.getStart_point_code()); block.put("location", inst.getStart_point_code());
block.put("operation", "JackLoad"); block.put("operation", "JackLoad");
block.put("operationArgs", new JSONObject() {{
put("recognize", true);
}});
blocks.add(block); blocks.add(block);
if ("true".equals(device1.getExtraValue().get("ignore_pickup_check"))) { if ("true".equals(device1.getExtraValue().get("ignore_pickup_check"))) {
@ -593,6 +604,9 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
block.put("blockId", IdUtil.simpleUUID()); block.put("blockId", IdUtil.simpleUUID());
block.put("location", inst.getStart_point_code2()); block.put("location", inst.getStart_point_code2());
block.put("operation", "JackLoad"); block.put("operation", "JackLoad");
block.put("operationArgs", new JSONObject() {{
put("recognize", true);
}});
blocks.add(block); blocks.add(block);
if ("true".equals(device3.getExtraValue().get("ignore_pickup_check"))) { if ("true".equals(device3.getExtraValue().get("ignore_pickup_check"))) {

83
acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java

@ -933,89 +933,6 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
@Override @Override
public void changeDeviceStatus(JSONObject form) { public void changeDeviceStatus(JSONObject form) {
String device_code = form.getString("device_code");
if (StrUtil.contains(device_code, "-") && StrUtil.count(device_code, "-") == 2) {
String[] point = device_code.split("-");
device_code = point[0];
}
//需要数量
String hasGoodStatus = form.getString("hasGoodStatus");
if (StrUtil.isEmpty(hasGoodStatus)) {
hasGoodStatus = "0";
}
String batch = form.getString("batch");
String material_type = form.getString("material_type");
String quantity = form.getString("quantity");
String remark = form.getString("remark");
String islock = form.getString("islock");
if (device_code.indexOf(".") != -1) {
device_code = device_code.substring(0, device_code.indexOf("."));
}
Device device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("未找到对应设备:" + device_code);
}
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
//检测站点
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if (!StrUtil.isEmpty(hasGoodStatus)) {
standardOrdinarySiteDeviceDriver.setHasGoods(Integer.parseInt(hasGoodStatus));
device.setHas_goods(Integer.parseInt(hasGoodStatus));
}
if (StrUtil.isNotEmpty(material_type)) {
standardOrdinarySiteDeviceDriver.setMaterial(material_type);
device.setMaterial_type(material_type);
} else {
standardOrdinarySiteDeviceDriver.setMaterial("");
device.setMaterial_type("");
}
if (StrUtil.isNotEmpty(quantity)) {
standardOrdinarySiteDeviceDriver.setQty(quantity);
device.setQuantity(quantity);
} else {
standardOrdinarySiteDeviceDriver.setQty("");
device.setQuantity("");
}
if (StrUtil.isNotEmpty(remark)) {
standardOrdinarySiteDeviceDriver.setRemark(remark);
device.setRemark(remark);
} else {
standardOrdinarySiteDeviceDriver.setRemark("");
device.setRemark("");
}
if (StrUtil.isNotEmpty(batch)) {
standardOrdinarySiteDeviceDriver.setBatch(batch);
device.setBatch(batch);
} else {
standardOrdinarySiteDeviceDriver.setBatch("");
device.setBatch("");
}
WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint");
JSONObject json = runpointwo.query("device_code ='" + device_code + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(json)) {
DeviceRunpointDto obj = json.toJavaObject(DeviceRunpointDto.class);
obj.setHasgoods(hasGoodStatus);
obj.setMaterial_type(material_type);
obj.setBatch(batch);
device.setHas_goods(Integer.parseInt(hasGoodStatus));
device.setMaterial_type(material_type);
device.setRemark(remark);
device.setQuantity(quantity);
device.setBatch(batch);
device.setIslock(islock);
JSONObject updatejson = (JSONObject) JSONObject.toJSON(obj);
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
}
}
else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.setMaterial(material_type);
standardInspectSiteDeviceDriver.setBatch(batch);
device.setMaterial_type(material_type);
device.setBatch(batch);
}
} }
@Override @Override

131
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java

@ -118,72 +118,71 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
@Override @Override
public void execute() { public void execute() {
hasGoods = this.getDevice().getHas_goods(); // hasGoods = this.getDevice().getHas_goods();
batch = this.getDevice().getBatch(); // batch = this.getDevice().getBatch();
device_code = this.getDeviceCode(); // device_code = this.getDeviceCode();
//
if (agvphase == 0x03) { // if (agvphase == 0x03) {
if (ObjectUtil.isNotEmpty(inst)) { // if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("1"); // inst.setExecute_status("1");
instructionService.update(inst); // instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); // byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
agvphase = 0; // agvphase = 0;
index = 0; // index = 0;
inst = null; // inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); // logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else { // } else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); // logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
//
} // }
} // }
//
if (agvphase == 0x05) { // if (agvphase == 0x05) {
if (ObjectUtil.isNotEmpty(inst)) { // if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("2"); // inst.setExecute_status("2");
instructionService.update(inst); // instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); // byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
// OneNDCSocketConnectionAutoRun.write(data); //// OneNDCSocketConnectionAutoRun.write(data);
agvphase = 0; // agvphase = 0;
index = 0; // index = 0;
inst = null; // inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); // logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else { // } else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); // logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
//
} // }
} // }
//
if (agvphase == 0x07) { // if (agvphase == 0x07) {
if (ObjectUtil.isNotEmpty(inst)) { // if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("5"); // inst.setExecute_status("5");
instructionService.update(inst); // instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); // byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
// OneNDCSocketConnectionAutoRun.write(data); //// OneNDCSocketConnectionAutoRun.write(data);
agvphase = 0; // agvphase = 0;
index = 0; // index = 0;
inst = null; // inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); // logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else { // } else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); // logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
} // }
} // }
//
if (agvphase == 0x09) { // if (agvphase == 0x09) {
if (ObjectUtil.isNotEmpty(inst)) { // if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("6"); // inst.setExecute_status("6");
instructionService.update(inst); // instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); // byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
// OneNDCSocketConnectionAutoRun.write(data); //// OneNDCSocketConnectionAutoRun.write(data);
agvphase = 0; // agvphase = 0;
index = 0; // index = 0;
inst = null; // inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); // logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else { // } else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); // logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
//
} // }
} // }
} }
@Override @Override

136
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/nl4/station/NL4StationDeviceDriver.java

@ -64,7 +64,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
private int toQty = 0; private int toQty = 0;
private int lastToQty = this.toQty; private int lastToQty = this.toQty;
private String deviceCode = null; private String currentDeviceCode = null;
private boolean isOnline = false; private boolean isOnline = false;
private boolean isError = false; private boolean isError = false;
private String message = ""; private String message = "";
@ -85,7 +85,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
this.message = ""; this.message = "";
try { try {
this.deviceCode = this.device.getDevice_code(); this.currentDeviceCode = this.getDeviceCode();
this.mode = this.itemProtocol.getMode(); this.mode = this.itemProtocol.getMode();
this.move = this.itemProtocol.getMove(); this.move = this.itemProtocol.getMove();
@ -99,40 +99,43 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (this.mode != this.lastMode) { if (this.mode != this.lastMode) {
this.requireSuccess = false; this.requireSuccess = false;
this.deviceExecuteLogService.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_MODE, String.valueOf(mode)); if (mode == 2) {
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_MODE + " " + this.lastMode + " -> " + this.mode); this.writing("to_command", "0");
}
this.deviceExecuteLogService.deviceItemValue(this.currentDeviceCode, ItemProtocol.ITEM_MODE, String.valueOf(mode));
this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", ItemProtocol.ITEM_MODE + " " + this.lastMode + " -> " + this.mode);
} }
if (this.move != this.lastMove) { if (this.move != this.lastMove) {
this.deviceExecuteLogService.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_MOVE, String.valueOf(this.move)); this.deviceExecuteLogService.deviceItemValue(this.currentDeviceCode, ItemProtocol.ITEM_MOVE, String.valueOf(this.move));
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_MOVE + " " + this.lastMove + " -> " + this.move); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", ItemProtocol.ITEM_MOVE + " " + this.lastMove + " -> " + this.move);
} }
if (this.action != this.lastAction) { if (this.action != this.lastAction) {
this.deviceExecuteLogService.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_ACTION, String.valueOf(this.action)); this.deviceExecuteLogService.deviceItemValue(this.currentDeviceCode, ItemProtocol.ITEM_ACTION, String.valueOf(this.action));
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_ACTION + " " + this.lastAction + " -> " + this.action); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", ItemProtocol.ITEM_ACTION + " " + this.lastAction + " -> " + this.action);
} }
if (this.error != this.lastError) { if (this.error != this.lastError) {
this.deviceExecuteLogService.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_ERROR, String.valueOf(this.error)); this.deviceExecuteLogService.deviceItemValue(this.currentDeviceCode, ItemProtocol.ITEM_ERROR, String.valueOf(this.error));
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_ERROR + " " + this.lastError + " -> " + this.error); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", ItemProtocol.ITEM_ERROR + " " + this.lastError + " -> " + this.error);
} }
if (this.task != this.lastTask) { if (this.task != this.lastTask) {
this.deviceExecuteLogService.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_TASK, String.valueOf(this.task)); this.deviceExecuteLogService.deviceItemValue(this.currentDeviceCode, ItemProtocol.ITEM_TASK, String.valueOf(this.task));
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_TASK + " " + this.lastTask + " -> " + this.task); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", ItemProtocol.ITEM_TASK + " " + this.lastTask + " -> " + this.task);
} }
if (this.toCommand != this.lastToCommand) { if (this.toCommand != this.lastToCommand) {
this.deviceExecuteLogService.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_TO_COMMAND, String.valueOf(this.toCommand)); this.deviceExecuteLogService.deviceItemValue(this.currentDeviceCode, ItemProtocol.ITEM_TO_COMMAND, String.valueOf(this.toCommand));
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_TO_COMMAND + " " + this.lastToCommand + " -> " + this.toCommand); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", ItemProtocol.ITEM_TO_COMMAND + " " + this.lastToCommand + " -> " + this.toCommand);
} }
if (this.toMaterial != this.lastToMaterial) { if (this.toMaterial != this.lastToMaterial) {
this.deviceExecuteLogService.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_TO_MATERIAL, String.valueOf(this.toMaterial)); this.deviceExecuteLogService.deviceItemValue(this.currentDeviceCode, ItemProtocol.ITEM_TO_MATERIAL, String.valueOf(this.toMaterial));
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_TO_MATERIAL + " " + this.lastToMaterial + " -> " + this.toMaterial); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", ItemProtocol.ITEM_TO_MATERIAL + " " + this.lastToMaterial + " -> " + this.toMaterial);
} }
if (this.toQty != this.lastToQty) { if (this.toQty != this.lastToQty) {
this.deviceExecuteLogService.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_TO_QTY, String.valueOf(this.toQty)); this.deviceExecuteLogService.deviceItemValue(this.currentDeviceCode, ItemProtocol.ITEM_TO_QTY, String.valueOf(this.toQty));
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_TO_QTY + " " + this.lastToQty + " -> " + this.toQty); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", ItemProtocol.ITEM_TO_QTY + " " + this.lastToQty + " -> " + this.toQty);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("{} device driver execute error!", deviceCode); log.error("{} device driver execute error!", currentDeviceCode);
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return; return;
} }
@ -158,23 +161,32 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isNotEmpty(methodName)) { if (ObjectUtil.isNotEmpty(methodName)) {
try { try {
this.executionMethodByMode(methodName.toString()); this.executionMethodByMode(methodName.toString());
this.requireSuccess = true;
} catch (Exception e) { } catch (Exception e) {
log.error("{} device driver execute error!", deviceCode); log.error("{} device driver execute error!", currentDeviceCode);
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
String message = "执行工作模式对应方法 " + methodName + " 错误!错误信息:" + e.getMessage(); String message = "执行工作模式对应方法 " + methodName + " 错误!错误信息:" + e.getMessage();
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
this.isError = true; this.isError = true;
} }
} else { } else {
String message = "未知工作模式,驱动未配置对应方法。"; String message = "未知工作模式,驱动未配置对应方法。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
} }
} }
} }
this.lastMode = this.mode;
this.lastMove = this.move;
this.lastAction = this.action;
this.lastError = this.error;
this.lastTask = this.task;
this.lastToCommand = this.toCommand;
this.lastToMaterial = this.toMaterial;
this.lastToQty = this.toQty;
} }
@Override @Override
@ -198,7 +210,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
itemMap.put(to_param, value); itemMap.put(to_param, value);
this.control(itemMap); this.control(itemMap);
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", param + " 写入 " + value); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", param + " 写入 " + value);
} }
private synchronized void executionMethodByMode(String methodName) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { private synchronized void executionMethodByMode(String methodName) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
@ -244,7 +256,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
private Device findHasGoodsDevice(JSONArray deviceCodes) { private Device findHasGoodsDevice(JSONArray deviceCodes) {
for (int i = 0; i < deviceCodes.size(); i++) { for (int i = 0; i < deviceCodes.size(); i++) {
Device device = this.deviceAppService.findDeviceByCode(deviceCodes.getString(i)); Device device = this.deviceAppService.findDeviceByCode(deviceCodes.getString(i));
if ("0".equals(device.getIslock()) && 1 == device.getHas_goods()) { if (device != null && "0".equals(device.getIslock()) && 1 == device.getHas_goods()) {
return device; return device;
} }
} }
@ -254,7 +266,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
private Device findNotHasGoodsDevice(JSONArray deviceCodes) { private Device findNotHasGoodsDevice(JSONArray deviceCodes) {
for (int i = 0; i < deviceCodes.size(); i++) { for (int i = 0; i < deviceCodes.size(); i++) {
Device device = this.deviceAppService.findDeviceByCode(deviceCodes.getString(i)); Device device = this.deviceAppService.findDeviceByCode(deviceCodes.getString(i));
if ("0".equals(device.getIslock()) && 0 == device.getHas_goods()) { if (device != null && "0".equals(device.getIslock()) && 0 == device.getHas_goods()) {
return device; return device;
} }
} }
@ -265,15 +277,16 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
* 门架上料完成 * 门架上料完成
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public synchronized void gantryMaterialFinished() throws Exception { public void gantryMaterialFinished() throws Exception {
Device currentDevice = this.deviceAppService.findDeviceByCode(this.deviceCode); synchronized (NL4StationDeviceDriver.class) {
Device currentDevice = this.deviceAppService.findDeviceByCode(this.currentDeviceCode);
if ("0".equals(currentDevice.getIslock())) { if ("0".equals(currentDevice.getIslock())) {
// 门架上料完成放空设备 // 门架上料完成放空设备
Object gantryDeviceCode1 = this.getDevice().getExtraValue().get("gantry_device_code1"); Object gantryDeviceCode1 = this.getDevice().getExtraValue().get("gantry_device_code1");
if (ObjectUtil.isEmpty(gantryDeviceCode1)) { if (ObjectUtil.isEmpty(gantryDeviceCode1)) {
String message = "门架上料完成放空设备未配置。"; String message = "门架上料完成放空设备未配置。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
JSONArray emptyDeviceCodes = JSONArray.parseArray(gantryDeviceCode1.toString()); JSONArray emptyDeviceCodes = JSONArray.parseArray(gantryDeviceCode1.toString());
@ -282,7 +295,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(gantryDeviceCode2)) { if (ObjectUtil.isEmpty(gantryDeviceCode2)) {
String message = "门架上料完成取满设备未配置。"; String message = "门架上料完成取满设备未配置。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
JSONArray materialDeviceCodes = JSONArray.parseArray(gantryDeviceCode2.toString()); JSONArray materialDeviceCodes = JSONArray.parseArray(gantryDeviceCode2.toString());
@ -292,7 +305,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(emptyDevice)) { if (ObjectUtil.isEmpty(emptyDevice)) {
String message = "未找到合适的门架上料完成放空设备。"; String message = "未找到合适的门架上料完成放空设备。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
assert emptyDevice != null; assert emptyDevice != null;
@ -302,12 +315,15 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(materialDevice)) { if (ObjectUtil.isEmpty(materialDevice)) {
String message = "未找到合适的门架上料完成取满设备。"; String message = "未找到合适的门架上料完成取满设备。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
assert materialDevice != null; assert materialDevice != null;
this.taskService.create(this.creatTask(currentDevice, emptyDevice, materialDevice, currentDevice, RequestMethodEnum.GANTRY_MATERIAL_FINISHED)); this.taskService.create(this.creatTask(currentDevice, emptyDevice, materialDevice, currentDevice, RequestMethodEnum.GANTRY_MATERIAL_FINISHED));
this.requireSuccess = true;
this.writing("to_command", this.mode);
}
} }
} }
@ -315,15 +331,16 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
* 槽钢上料完成 * 槽钢上料完成
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public synchronized void channelSteelMaterialFinished() throws Exception { public void channelSteelMaterialFinished() throws Exception {
Device currentDevice = this.deviceAppService.findDeviceByCode(this.deviceCode); synchronized (NL4StationDeviceDriver.class) {
Device currentDevice = this.deviceAppService.findDeviceByCode(this.currentDeviceCode);
if ("0".equals(currentDevice.getIslock())) { if ("0".equals(currentDevice.getIslock())) {
// 槽钢上料完成取满设备 // 槽钢上料完成取满设备
Object channelSteelDeviceCode1 = this.getDevice().getExtraValue().get("channel_steel_device_code1"); Object channelSteelDeviceCode1 = this.getDevice().getExtraValue().get("channel_steel_device_code1");
if (ObjectUtil.isEmpty(channelSteelDeviceCode1)) { if (ObjectUtil.isEmpty(channelSteelDeviceCode1)) {
String message = "槽钢上料完成取满设备未配置。"; String message = "槽钢上料完成取满设备未配置。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
JSONArray deviceCodes1 = JSONArray.parseArray(channelSteelDeviceCode1.toString()); JSONArray deviceCodes1 = JSONArray.parseArray(channelSteelDeviceCode1.toString());
@ -332,7 +349,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(channelSteelDeviceCode2)) { if (ObjectUtil.isEmpty(channelSteelDeviceCode2)) {
String message = "槽钢上料完成放满设备未配置。"; String message = "槽钢上料完成放满设备未配置。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
JSONArray deviceCodes2 = JSONArray.parseArray(channelSteelDeviceCode2.toString()); JSONArray deviceCodes2 = JSONArray.parseArray(channelSteelDeviceCode2.toString());
@ -341,7 +358,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(channelSteelDeviceCode4)) { if (ObjectUtil.isEmpty(channelSteelDeviceCode4)) {
String message = "槽钢上料完成放空设备未配置。"; String message = "槽钢上料完成放空设备未配置。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
JSONArray deviceCodes4 = JSONArray.parseArray(channelSteelDeviceCode4.toString()); JSONArray deviceCodes4 = JSONArray.parseArray(channelSteelDeviceCode4.toString());
@ -351,7 +368,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(device1)) { if (ObjectUtil.isEmpty(device1)) {
String message = "未找到合适的槽钢上料完成取满设备。"; String message = "未找到合适的槽钢上料完成取满设备。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
assert device1 != null; assert device1 != null;
@ -361,7 +378,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(device2)) { if (ObjectUtil.isEmpty(device2)) {
String message = "未找到合适的槽钢上料完成放满设备。"; String message = "未找到合适的槽钢上料完成放满设备。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
assert device2 != null; assert device2 != null;
@ -371,12 +388,15 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(device4)) { if (ObjectUtil.isEmpty(device4)) {
String message = "未找到合适的槽钢上料完成放空设备。"; String message = "未找到合适的槽钢上料完成放空设备。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
assert device4 != null; assert device4 != null;
this.taskService.create(this.creatTask(device1, device2, currentDevice, device4, RequestMethodEnum.CHANNEL_STEEL_MATERIAL_FINISHED)); this.taskService.create(this.creatTask(device1, device2, currentDevice, device4, RequestMethodEnum.CHANNEL_STEEL_MATERIAL_FINISHED));
this.requireSuccess = true;
this.writing("to_command", this.mode);
}
} }
} }
@ -384,15 +404,16 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
* 槽钢呼叫满料 * 槽钢呼叫满料
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public synchronized void channelSteelCallMaterial() throws Exception { public void channelSteelCallMaterial() throws Exception {
Device currentDevice = this.deviceAppService.findDeviceByCode(this.deviceCode); synchronized (NL4StationDeviceDriver.class) {
Device currentDevice = this.deviceAppService.findDeviceByCode(this.currentDeviceCode);
if ("0".equals(currentDevice.getIslock())) { if ("0".equals(currentDevice.getIslock())) {
// 槽钢呼叫满料取满设备 // 槽钢呼叫满料取满设备
Object channelSteelCallMaterialDeviceCode1 = this.getDevice().getExtraValue().get("channel_steel_call_material_device_code1"); Object channelSteelCallMaterialDeviceCode1 = this.getDevice().getExtraValue().get("channel_steel_call_material_device_code1");
if (ObjectUtil.isEmpty(channelSteelCallMaterialDeviceCode1)) { if (ObjectUtil.isEmpty(channelSteelCallMaterialDeviceCode1)) {
String message = "槽钢呼叫满料取满设备未配置。"; String message = "槽钢呼叫满料取满设备未配置。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
JSONArray deviceCodes1 = JSONArray.parseArray(channelSteelCallMaterialDeviceCode1.toString()); JSONArray deviceCodes1 = JSONArray.parseArray(channelSteelCallMaterialDeviceCode1.toString());
@ -401,7 +422,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(channelSteelCallMaterialDeviceCode3)) { if (ObjectUtil.isEmpty(channelSteelCallMaterialDeviceCode3)) {
String message = "槽钢呼叫满料取空设备未配置。"; String message = "槽钢呼叫满料取空设备未配置。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
JSONArray deviceCodes3 = JSONArray.parseArray(channelSteelCallMaterialDeviceCode3.toString()); JSONArray deviceCodes3 = JSONArray.parseArray(channelSteelCallMaterialDeviceCode3.toString());
@ -410,7 +431,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(channelSteelCallMaterialDeviceCode4)) { if (ObjectUtil.isEmpty(channelSteelCallMaterialDeviceCode4)) {
String message = "槽钢呼叫满料放空设备未配置。"; String message = "槽钢呼叫满料放空设备未配置。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
JSONArray deviceCodes4 = JSONArray.parseArray(channelSteelCallMaterialDeviceCode4.toString()); JSONArray deviceCodes4 = JSONArray.parseArray(channelSteelCallMaterialDeviceCode4.toString());
@ -420,7 +441,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(device1)) { if (ObjectUtil.isEmpty(device1)) {
String message = "未找到合适的槽钢呼叫满料取满设备。"; String message = "未找到合适的槽钢呼叫满料取满设备。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
assert device1 != null; assert device1 != null;
@ -430,7 +451,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(device3)) { if (ObjectUtil.isEmpty(device3)) {
String message = "未找到合适的槽钢呼叫满料取空设备。"; String message = "未找到合适的槽钢呼叫满料取空设备。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
assert device3 != null; assert device3 != null;
@ -440,12 +461,15 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(device4)) { if (ObjectUtil.isEmpty(device4)) {
String message = "未找到合适的槽钢呼叫满料放空设备。"; String message = "未找到合适的槽钢呼叫满料放空设备。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
assert device4 != null; assert device4 != null;
this.taskService.create(this.creatTask(device1, currentDevice, device3, device4, RequestMethodEnum.CHANNEL_STEEL_CALL_MATERIAL)); this.taskService.create(this.creatTask(device1, currentDevice, device3, device4, RequestMethodEnum.CHANNEL_STEEL_CALL_MATERIAL));
this.requireSuccess = true;
this.writing("to_command", this.mode);
}
} }
} }
@ -453,15 +477,16 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
* 下料完成 * 下料完成
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public synchronized void productionCompleted() throws Exception { public void productionCompleted() throws Exception {
Device currentDevice = this.deviceAppService.findDeviceByCode(this.deviceCode); synchronized (NL4StationDeviceDriver.class) {
Device currentDevice = this.deviceAppService.findDeviceByCode(this.currentDeviceCode);
if ("0".equals(currentDevice.getIslock())) { if ("0".equals(currentDevice.getIslock())) {
// 下料完成放满设备 // 下料完成放满设备
Object productionCompletedDeviceCode2 = this.getDevice().getExtraValue().get("production_completed_device_code2"); Object productionCompletedDeviceCode2 = this.getDevice().getExtraValue().get("production_completed_device_code2");
if (ObjectUtil.isEmpty(productionCompletedDeviceCode2)) { if (ObjectUtil.isEmpty(productionCompletedDeviceCode2)) {
String message = "下料完成放满设备未配置。"; String message = "下料完成放满设备未配置。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
JSONArray deviceCodes2 = JSONArray.parseArray(productionCompletedDeviceCode2.toString()); JSONArray deviceCodes2 = JSONArray.parseArray(productionCompletedDeviceCode2.toString());
@ -470,7 +495,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(productionCompletedDeviceCode3)) { if (ObjectUtil.isEmpty(productionCompletedDeviceCode3)) {
String message = "下料完成取空设备未配置。"; String message = "下料完成取空设备未配置。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
JSONArray deviceCodes3 = JSONArray.parseArray(productionCompletedDeviceCode3.toString()); JSONArray deviceCodes3 = JSONArray.parseArray(productionCompletedDeviceCode3.toString());
@ -480,7 +505,7 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(device2)) { if (ObjectUtil.isEmpty(device2)) {
String message = "未找到合适的下料完成放满设备。"; String message = "未找到合适的下料完成放满设备。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
assert device2 != null; assert device2 != null;
@ -490,12 +515,15 @@ public class NL4StationDeviceDriver extends AbstractOpcDeviceDriver implements D
if (ObjectUtil.isEmpty(device3)) { if (ObjectUtil.isEmpty(device3)) {
String message = "未找到合适的下料完成取空设备。"; String message = "未找到合适的下料完成取空设备。";
this.message = message; this.message = message;
this.deviceExecuteLogService.deviceExecuteLog(this.deviceCode, "", "", message); this.deviceExecuteLogService.deviceExecuteLog(this.currentDeviceCode, "", "", message);
return; return;
} }
assert device3 != null; assert device3 != null;
this.taskService.create(this.creatTask(currentDevice, device2, device3, currentDevice, RequestMethodEnum.PRODUCTION_COMPLETED)); this.taskService.create(this.creatTask(currentDevice, device2, device3, currentDevice, RequestMethodEnum.PRODUCTION_COMPLETED));
this.requireSuccess = true;
this.writing("to_command", this.mode);
}
} }
} }
} }

12
acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceAppServiceImpl.java

@ -18,8 +18,8 @@ import java.util.*;
@Slf4j @Slf4j
@Service @Service
public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoInitial { public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoInitial {
private List<Device> devices = new ArrayList(); private List<Device> devices = new ArrayList<>();
private List<String> code_indexs = new ArrayList(); private List<String> code_indexs = new ArrayList<>();
@Autowired @Autowired
private DeviceManageService deviceManageService; private DeviceManageService deviceManageService;
@Autowired @Autowired
@ -36,7 +36,7 @@ public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoIn
return null; return null;
} }
Iterator var2 = this.findAllDevice().iterator(); Iterator<Device> var2 = this.findAllDevice().iterator();
Device device; Device device;
do { do {
@ -44,7 +44,7 @@ public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoIn
return null; return null;
} }
device = (Device) var2.next(); device = var2.next();
} while (!StrUtil.equals(device.getDevice_code(), device_code)); } while (!StrUtil.equals(device.getDevice_code(), device_code));
return device; return device;
@ -236,8 +236,8 @@ public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoIn
@Override @Override
public <T extends DeviceDriver> List<T> findDeviceDriver(Class<T> clazz) { public <T extends DeviceDriver> List<T> findDeviceDriver(Class<T> clazz) {
List<T> list = new ArrayList(); List<T> list = new ArrayList<>();
Iterator var3 = this.findAllDevice().iterator(); Iterator<Device> var3 = this.findAllDevice().iterator();
while (var3.hasNext()) { while (var3.hasNext()) {
Device device = (Device) var3.next(); Device device = (Device) var3.next();

14
acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceExecuteAutoRun.java

@ -38,8 +38,8 @@ public class DeviceExecuteAutoRun extends AbstractAutoRunnable {
new TheadFactoryName() new TheadFactoryName()
);*/ );*/
this.executorService = new ThreadPoolExecutor( this.executorService = new ThreadPoolExecutor(
10, 32,
20, 64,
1L, 1L,
TimeUnit.SECONDS, TimeUnit.SECONDS,
new ArrayBlockingQueue<>(queueLength), new ArrayBlockingQueue<>(queueLength),
@ -87,14 +87,12 @@ public class DeviceExecuteAutoRun extends AbstractAutoRunnable {
log.info("设备执行线程开始..."); log.info("设备执行线程开始...");
while (true) { while (true) {
Thread.sleep((long) this.loop_time_millions); Thread.sleep(this.loop_time_millions);
List<ExecutableDeviceDriver> deviceDrivers = this.deviceAppService.findDeviceDriver(ExecutableDeviceDriver.class); List<ExecutableDeviceDriver> deviceDrivers = this.deviceAppService.findDeviceDriver(ExecutableDeviceDriver.class);
Iterator it = deviceDrivers.iterator(); for (ExecutableDeviceDriver deviceDriver : deviceDrivers) {
while (it.hasNext()) {
final ExecutableDeviceDriver deviceDriver = (ExecutableDeviceDriver) it.next();
//不包含正在执行的线程,则进行执行 //不包含正在执行的线程,则进行执行
if (!this.runs.keySet().contains(deviceDriver.getDeviceCode())) { if (!this.runs.containsKey(deviceDriver.getDeviceCode())) {
BlockedRunable runnable = new BlockedRunable() { BlockedRunable runnable = new BlockedRunable() {
@Override @Override
public void subRun() { public void subRun() {
@ -106,7 +104,7 @@ public class DeviceExecuteAutoRun extends AbstractAutoRunnable {
return deviceDriver.getDeviceCode(); return deviceDriver.getDeviceCode();
} }
}; };
if (!this.runs.keySet().contains(deviceDriver.getDeviceCode())) { if (!this.runs.containsKey(deviceDriver.getDeviceCode())) {
this.runs.put(deviceDriver.getDeviceCode(), runnable); this.runs.put(deviceDriver.getDeviceCode(), runnable);
} }

4
acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java

@ -197,14 +197,10 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
if (!UnifiedDataAppService.isEquals(value, his)) { if (!UnifiedDataAppService.isEquals(value, his)) {
OpcItemDto itemDto = this.getItem(itemId); OpcItemDto itemDto = this.getItem(itemId);
if (true) {
this.logItemChanged(itemId, accessor_value, value, itemDto); this.logItemChanged(itemId, accessor_value, value, itemDto);
}
if(!ObjectUtil.isEmpty(value)){
accessor_value.setValue(itemId, value); accessor_value.setValue(itemId, value);
} }
} }
}
end = System.currentTimeMillis(); end = System.currentTimeMillis();
if (log.isTraceEnabled()) { if (log.isTraceEnabled()) {

122
acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java

@ -788,6 +788,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
String priority = acsTask.getPriority(); String priority = acsTask.getPriority();
String start_point_code = acsTask.getStart_point_code(); String start_point_code = acsTask.getStart_point_code();
String start_device_code = acsTask.getStart_device_code(); String start_device_code = acsTask.getStart_device_code();
String start_point_code2 = acsTask.getStart_point_code2();
String start_device_code2 = acsTask.getStart_device_code2();
String route_plan_code = acsTask.getRoute_plan_code(); String route_plan_code = acsTask.getRoute_plan_code();
String vehicleType = acsTask.getVehicle_type(); String vehicleType = acsTask.getVehicle_type();
//是否复合任务 =0非复合任务 //是否复合任务 =0非复合任务
@ -795,11 +797,19 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
String compound_task_data = null; String compound_task_data = null;
String next_point_code = acsTask.getNext_point_code(); String next_point_code = acsTask.getNext_point_code();
String next_device_code = acsTask.getNext_device_code(); String next_device_code = acsTask.getNext_device_code();
String next_point_code2 = acsTask.getNext_point_code2();
String next_device_code2 = acsTask.getNext_device_code2();
if (StrUtil.isEmpty(start_device_code)) { if (StrUtil.isEmpty(start_device_code)) {
throw new BadRequestException("起点设备为空,无法生成指令!"); throw new BadRequestException("起点设备为空,无法生成指令");
} }
if (StrUtil.isEmpty(next_device_code)) { if (StrUtil.isEmpty(next_device_code)) {
throw new BadRequestException("终点设备为空,无法生成指令!"); throw new BadRequestException("终点设备为空,无法生成指令。");
}
if (StrUtil.isEmpty(start_device_code2)) {
throw new BadRequestException("起点设备2为空,无法生成指令。");
}
if (StrUtil.isEmpty(next_device_code2)) {
throw new BadRequestException("终点设备为2空,无法生成指令。");
} }
List<Instruction> instructions = instructionService.queryAll("instruction_status < 2"); List<Instruction> instructions = instructionService.queryAll("instruction_status < 2");
String maxInstnumber = acsConfigService.findByCode(AcsConfig.MAXINSTNUMBER).getValue(); String maxInstnumber = acsConfigService.findByCode(AcsConfig.MAXINSTNUMBER).getValue();
@ -853,113 +863,21 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppService.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppService.class);
Device startdevice = appService.findDeviceByCode(start_device_code); Device startdevice = appService.findDeviceByCode(start_device_code);
Device nextdevice = appService.findDeviceByCode(next_device_code); Device nextdevice = appService.findDeviceByCode(next_device_code);
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) { Device startdevice2 = appService.findDeviceByCode(start_device_code2);
next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z(); Device nextdevice2 = appService.findDeviceByCode(next_device_code2);
} else {
next_point_code = next_device_code;
}
if (ObjectUtils.isEmpty(startdevice)) { if (ObjectUtils.isEmpty(startdevice)) {
throw new BadRequestException("起点设备编码 [" + start_device_code + "] 对应设备未找到,无法生成指令。"); throw new BadRequestException("起点设备编码 [" + start_device_code + "] 对应设备未找到,无法生成指令。");
} }
if (ObjectUtils.isEmpty(nextdevice)) { if (ObjectUtils.isEmpty(nextdevice)) {
throw new BadRequestException("终点设备编码 [" + next_device_code + "] 对应设备未找到,无法生成指令。"); throw new BadRequestException("终点设备编码 [" + next_device_code + "] 对应设备未找到,无法生成指令。");
} }
//普通站点 if (ObjectUtils.isEmpty(startdevice2)) {
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; throw new BadRequestException("起点设备2编码 [" + start_device_code + "] 对应设备未找到,无法生成指令。");
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
StandardEmptyPalletSiteDeviceDriver standardEmptsyPalletSiteDeviceDriver;
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
LnshFoldDiscSiteDeviceDriver lnshFoldDiscSiteDeviceDriver;
String createTaskCheck = acsConfigService.findByCode(AcsConfig.CREATETASKCHECK).getValue();
if (StrUtil.equals(createTaskCheck, "1")) {
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMode() != 2) {
throw new BadRequestException("起点设备:" + startdevice.getDevice_code() + "设备未待机,任务号:" + taskcode);
}
}
if (startdevice.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver) {
standardEmptsyPalletSiteDeviceDriver = (StandardEmptyPalletSiteDeviceDriver) startdevice.getDeviceDriver();
if (standardEmptsyPalletSiteDeviceDriver.getMode() != 2) {
throw new BadRequestException("目标设备:" + nextdevice.getDevice_code() + "设备未待机,任务号:" + taskcode);
}
}
if (startdevice.getDeviceDriver() instanceof LnshFoldDiscSiteDeviceDriver) {
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) startdevice.getDeviceDriver();
if (lnshFoldDiscSiteDeviceDriver.getMode() != 2) {
throw new BadRequestException("目标设备:" + nextdevice.getDevice_code() + "设备未待机,任务号:" + taskcode);
} }
if (ObjectUtils.isEmpty(nextdevice2)) {
throw new BadRequestException("终点设备2编码 [" + next_device_code + "] 对应设备未找到,无法生成指令。");
} }
//校验 是否同任务是否存在相同终点、未完成的指令
int sameqty = instructionService.querySameDestinationInst(next_point_code);
if (sameqty > 0) {
throw new BadRequestException("存在相同终点的指令,任务号:" + taskcode);
}
}
//空盘位生成指令需要另外逻辑
if (nextdevice.getDeviceDriver() instanceof LnshFoldDiscSiteDeviceDriver) {
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) nextdevice.getDeviceDriver();
if (lnshFoldDiscSiteDeviceDriver.getMode() == 0) {
throw new BadRequestException("终点 [" + nextdevice.getDevice_name() + "] 未联机,无法生成指令。");
} else if (lnshFoldDiscSiteDeviceDriver.getError() != 0
|| lnshFoldDiscSiteDeviceDriver.getStatus() == 3) {
throw new BadRequestException("终点 [" + nextdevice.getDevice_name() + "] 异常,无法生成指令。");
}
int max_emptypalletnum = Integer.parseInt(nextdevice.getExtraValue().get("max_emptypalletnum").toString());
int nowNumber = lnshFoldDiscSiteDeviceDriver.getContainer_qty();
if (nowNumber >= max_emptypalletnum) {
throw new BadRequestException("终点 [" + nextdevice.getDevice_name() + "] 已满,无法生成指令。");
}
// 查看是否有相同终点的指令
int count = instructionService.queryDeviceInstCount(next_device_code);
if (count > 0) {
throw new BadRequestException("终点 [" + nextdevice.getDevice_name() + "] 已被占用,无法生成指令。");
}
next_point_code = next_device_code + "." + (nowNumber + 1);
} else if (nextdevice.getDeviceDriver() instanceof LnshStationDeviceDriver
&& "true".equals(nextdevice.getExtraValue().get("inspect_in_stocck"))) {
LnshStationDeviceDriver deviceDriver = (LnshStationDeviceDriver) nextdevice.getDeviceDriver();
if (deviceDriver.getMode() == 0) {
throw new BadRequestException("终点 [" + nextdevice.getDevice_name() + "] 未联机,无法生成指令。");
} else if (deviceDriver.getMove() != 0) {
throw new BadRequestException("终点 [" + nextdevice.getDevice_name() + "] 有货,无法生成指令。");
}
}
if (startdevice.getDeviceDriver() instanceof LnshFoldDiscSiteDeviceDriver) {
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) startdevice.getDeviceDriver();
if (lnshFoldDiscSiteDeviceDriver.getMode() == 0) {
throw new BadRequestException("起点 [" + startdevice.getDevice_name() + "] 未联机,无法生成指令。");
} else if (lnshFoldDiscSiteDeviceDriver.getError() != 0
|| lnshFoldDiscSiteDeviceDriver.getStatus() == 3) {
throw new BadRequestException("起点 [" + startdevice.getDevice_name() + "] 异常,无法生成指令。");
}
int container_qty = lnshFoldDiscSiteDeviceDriver.getContainer_qty();
int max_emptypalletnum = Integer.parseInt(startdevice.getExtraValue().get("max_emptypalletnum").toString());
if (container_qty < (max_emptypalletnum / 2)) {
throw new BadRequestException("起点 [" + startdevice.getDevice_name() + "] 可用托盘数量少于最大托盘数量 [" + max_emptypalletnum + "] / 2,无法生成指令。");
}
int count = instructionService.queryDeviceInstCount(start_device_code);
if (count > 0) {
throw new BadRequestException("起点 [" + startdevice.getDevice_name() + "] 已被占用,无法生成指令。");
}
start_point_code = start_device_code + ".1";
} else if (startdevice.getDeviceDriver() instanceof LnshStationDeviceDriver
&& "true".equals(startdevice.getExtraValue().get("inspect_in_stocck"))) {
LnshStationDeviceDriver deviceDriver = (LnshStationDeviceDriver) startdevice.getDeviceDriver();
if (deviceDriver.getMode() == 0) {
throw new BadRequestException("起点 [" + startdevice.getDevice_name() + "] 未联机,无法生成指令。");
} else if (deviceDriver.getMove() == 0) {
throw new BadRequestException("起点 [" + startdevice.getDevice_name() + "] 无货,无法生成指令。");
}
}
Instruction instdto = new Instruction(); Instruction instdto = new Instruction();
instdto.setInstruction_type(acsTask.getTask_type()); instdto.setInstruction_type(acsTask.getTask_type());
@ -978,6 +896,10 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
instdto.setNext_device_code(next_device_code); instdto.setNext_device_code(next_device_code);
instdto.setStart_point_code(start_point_code); instdto.setStart_point_code(start_point_code);
instdto.setNext_point_code(next_point_code); instdto.setNext_point_code(next_point_code);
instdto.setStart_device_code2(start_device_code2);
instdto.setStart_point_code2(start_point_code2);
instdto.setNext_device_code2(next_device_code2);
instdto.setNext_point_code2(next_point_code2);
instdto.setCompound_inst_data(compound_task_data); instdto.setCompound_inst_data(compound_task_data);
instdto.setPriority(priority); instdto.setPriority(priority);
instdto.setInstruction_status("0"); instdto.setInstruction_status("0");

52
acs/nladmin-system/src/main/java/org/nl/hand/amb/service/impl/HFHandServiceImpl.java

@ -285,7 +285,7 @@ public class HFHandServiceImpl implements HFHandService {
startDevice.setIslock("true"); startDevice.setIslock("true");
nextDevice.setIslock("true"); nextDevice.setIslock("true");
} catch (Exception e) { } catch (Exception e) {
resultJson.put("code", "2"); resultJson.put("code", "0");
resultJson.put("desc", e.getMessage()); resultJson.put("desc", e.getMessage());
resultJson.put("result", ""); resultJson.put("result", "");
return resultJson; return resultJson;
@ -433,7 +433,7 @@ public class HFHandServiceImpl implements HFHandService {
resultJson.put("code", "1"); resultJson.put("code", "1");
resultJson.put("desc", "登陆成功"); resultJson.put("desc", "登陆成功");
} else { } else {
resultJson.put("code", "2"); resultJson.put("code", "0");
resultJson.put("desc", "登陆失败!"); resultJson.put("desc", "登陆失败!");
} }
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
@ -520,10 +520,6 @@ public class HFHandServiceImpl implements HFHandService {
String task_uuid = jsonObject.get("inst_uuid"); String task_uuid = jsonObject.get("inst_uuid");
String type = jsonObject.get("type"); String type = jsonObject.get("type");
JSONObject taskjo = WQLObject.getWQLObject("acs_task").query("task_id='" + task_uuid + "'").uniqueResult(0); JSONObject taskjo = WQLObject.getWQLObject("acs_task").query("task_id='" + task_uuid + "'").uniqueResult(0);
String task_code = taskjo.getString("task_code");
String start_point_code = taskjo.getString("start_point_code");
String next_point_code = taskjo.getString("next_point_code");
String task_id = taskjo.getString("task_id");
if (StrUtil.isEmpty(task_uuid)) { if (StrUtil.isEmpty(task_uuid)) {
throw new BadRequestException("id不能为空!"); throw new BadRequestException("id不能为空!");
@ -533,7 +529,7 @@ public class HFHandServiceImpl implements HFHandService {
} }
if (StrUtil.equals(taskjo.getString("task_status"), "2") || if (StrUtil.equals(taskjo.getString("task_status"), "2") ||
StrUtil.equals(taskjo.getString("task_status"), "3")) { StrUtil.equals(taskjo.getString("task_status"), "3")) {
jo.put("code", "2"); jo.put("code", "0");
jo.put("desc", "任务已完成或已取消,无法操作"); jo.put("desc", "任务已完成或已取消,无法操作");
jo.put("result", ""); jo.put("result", "");
return jo; return jo;
@ -541,51 +537,15 @@ public class HFHandServiceImpl implements HFHandService {
//重新生成 //重新生成
if (type.equals("1")) { if (type.equals("1")) {
//重新生产指令 //重新生产指令
Instruction instdto = new Instruction(); TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class);
instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setInstruction_code(CodeUtil.getNewCode("INSTRUCT_NO"));
instdto.setRemark(taskjo.getString("remark"));
instdto.setMaterial(taskjo.getString("material"));
instdto.setTask_id(taskjo.getString("task_id"));
instdto.setTask_code(taskjo.getString("task_code"));
instdto.setVehicle_code(taskjo.getString("vehicle_code"));
String now = DateUtil.now();
instdto.setCreate_time(now);
instdto.setCreate_by("auto");
instdto.setStart_point_code(taskjo.getString("start_point_code"));
instdto.setNext_point_code(taskjo.getString("next_point_code"));
instdto.setStart_device_code(taskjo.getString("start_device_code"));
instdto.setNext_device_code(taskjo.getString("next_device_code"));
instdto.setInstruction_status("0");
instdto.setIs_delete("0");
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
WQLObject instwo = WQLObject.getWQLObject("acs_instruction");
JSONObject instcheckjson = instwo.query(" instruction_status <2 and next_point_code= '" + next_point_code + "'" + " and start_point_code = '" + start_point_code + "'" + " and task_id = '" + task_id + "'").uniqueResult(0);
if (instcheckjson != null) {
jo.put("code", "2");
jo.put("desc", "操作失败");
jo.put("result", task_code + ":该任务已存在待完成指令!");
return jo;
}
try { try {
instructionService.create(instdto); taskService.createInst(task_uuid);
} catch (Exception e) { } catch (Exception e) {
jo.put("code", "2"); jo.put("code", "0");
jo.put("desc", e.getMessage()); jo.put("desc", e.getMessage());
jo.put("result", ""); jo.put("result", "");
return jo; return jo;
} }
instdto.setExecute_device_code(taskjo.getString("start_point_code"));
//下发指令给agv
// AgvService agvserver = SpringContextHolder.getBean("agvServiceImpl");
// try {
// agvserver.sendAgvInstToMagic(instdto);
// } catch (Exception e) {
// jo.put("code", "2");
// jo.put("desc", e.getMessage());
// jo.put("result", "");
// return jo;
// }
} }
//强制完成 //强制完成

2
acs/nladmin-system/src/main/java/org/nl/modules/wql/core/bean/ResultBean.java

@ -230,7 +230,7 @@ public class ResultBean implements Serializable, Cloneable {
rows = new ArrayList(); rows = new ArrayList();
} }
JSONArray jrows = this.rows2jsonarray(rows); JSONArray jrows = this.rows2jsonarray(rows);
JSONObject jrow = new JSONObject(); JSONObject jrow = null;
if (jrows.size() > 0) { if (jrows.size() > 0) {
jrow = jrows.getJSONObject(0); jrow = jrows.getJSONObject(0);
} }

2
acs/nladmin-system/src/main/resources/config/application-dev.yml

@ -6,7 +6,7 @@ spring:
druid: druid:
db-type: com.alibaba.druid.pool.DruidDataSource db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl4_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl4_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: ${DB_USER:root} username: ${DB_USER:root}
password: ${DB_PWD:123456} password: ${DB_PWD:123456}
# 初始连接数 # 初始连接数

5
acs/nladmin-system/src/main/resources/config/application-prod.yml

@ -6,8 +6,7 @@ spring:
druid: druid:
db-type: com.alibaba.druid.pool.DruidDataSource db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
# url: jdbc:log4jdbc:mysql://${DB_HOST:10.93.41.198}:${DB_PORT:3306}/${DB_NAME:rl_mg_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true url: jdbc:log4jdbc:mysql://${DB_HOST:188.188.69.101}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:rl_mg_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root} username: ${DB_USER:root}
password: ${DB_PWD:123456} password: ${DB_PWD:123456}
# 初始连接数 # 初始连接数
@ -131,7 +130,7 @@ logging:
config: classpath:logback-spring.xml config: classpath:logback-spring.xml
lucene: lucene:
index: index:
path: D:\lucene\index path: C:\lucene\index
# Sa-Token配置 # Sa-Token配置
sa-token: sa-token:

2
acs/nladmin-system/src/main/resources/config/application.yml

@ -2,7 +2,7 @@ spring:
freemarker: freemarker:
check-template-location: false check-template-location: false
profiles: profiles:
active: dev active: prod
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
data: data:

4
acs/nladmin-ui/.env.production

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

11
acs/nladmin-ui/src/views/acs/instruction/index.vue

@ -164,7 +164,7 @@
v-permission="['admin','instruction:edit','instruction:del']" v-permission="['admin','instruction:edit','instruction:del']"
fixed="left" fixed="left"
label="操作" label="操作"
width="150px" width="80px"
align="center" align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@ -172,7 +172,7 @@
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<i class="el-icon-menu" /> <i class="el-icon-menu" />
</span> </span>
<el-dropdown-menu slot="dropdonwn"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item> <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item> <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">下发</el-dropdown-item> <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">下发</el-dropdown-item>
@ -347,11 +347,8 @@ export default {
case 'b':// case 'b'://
this.cancel(command.index, command.row) this.cancel(command.index, command.row)
break break
case 'c':// case 'c':
this.forceCancel(command.index, command.row) this.sendToAGV(command.index, command.row)
break
case 'd'://
this.init(command.index, command.row)
break break
} }
} }

Loading…
Cancel
Save