更新
This commit is contained in:
@@ -82,6 +82,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
agvurl = agvurl2 + ":" + agvport2 + "/v1/transportOrders/" + inst.getInstruction_code();
|
agvurl = agvurl2 + ":" + agvport2 + "/v1/transportOrders/" + inst.getInstruction_code();
|
||||||
}
|
}
|
||||||
log.info("下发agv任务请求:{}", agvurl);
|
log.info("下发agv任务请求:{}", agvurl);
|
||||||
|
log.info("下发agv任务参数:{}", jo.toString());
|
||||||
|
|
||||||
HttpResponse result = HttpRequest.post(agvurl)
|
HttpResponse result = HttpRequest.post(agvurl)
|
||||||
.body(String.valueOf(jo))//表单内容
|
.body(String.valueOf(jo))//表单内容
|
||||||
@@ -114,7 +115,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
HttpResponse result = HttpRequest.get(agvurl)
|
HttpResponse result = HttpRequest.get(agvurl)
|
||||||
.timeout(20000)//超时,毫秒
|
.timeout(20000)//超时,毫秒
|
||||||
.execute();
|
.execute();
|
||||||
System.out.println("查询agv指令数据:" + result.body());
|
|
||||||
|
log.info("查询agv指令数据:{}", result.body());
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
Boolean isonline = true;
|
Boolean isonline = true;
|
||||||
|
|
||||||
Boolean iserror = false;
|
Boolean iserror = false;
|
||||||
|
String inst_message;
|
||||||
|
|
||||||
//1-执行任务;2-取货完成;3-放货完成;
|
//1-执行任务;2-取货完成;3-放货完成;
|
||||||
int flag;
|
int flag;
|
||||||
@@ -87,6 +88,7 @@ public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
int last_error = 0;
|
int last_error = 0;
|
||||||
|
|
||||||
String device_code;
|
String device_code;
|
||||||
|
Instruction inst = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Device getDevice() {
|
public Device getDevice() {
|
||||||
@@ -103,16 +105,14 @@ public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
device_code = this.getDeviceCode();
|
device_code = this.getDeviceCode();
|
||||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||||
mode = this.itemProtocol.getItem_mode();
|
mode = this.itemProtocol.getItem_mode();
|
||||||
move = this.itemProtocol.getItem_mode();
|
move = this.itemProtocol.getItem_move();
|
||||||
error = this.itemProtocol.getItem_error();
|
error = this.itemProtocol.getItem_error();
|
||||||
task = this.itemProtocol.getItem_task();
|
task = this.itemProtocol.getItem_task();
|
||||||
action = this.itemProtocol.getItem_action();
|
action = this.itemProtocol.getItem_action();
|
||||||
|
|
||||||
|
|
||||||
if (mode != last_mode) {
|
|
||||||
this.setRequireSucess(false);
|
|
||||||
}
|
|
||||||
if (move != last_move) {
|
if (move != last_move) {
|
||||||
|
this.setRequireSucess(false);
|
||||||
if (move == 0) {
|
if (move == 0) {
|
||||||
thingToNothing();
|
thingToNothing();
|
||||||
}
|
}
|
||||||
@@ -148,9 +148,24 @@ public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
//申请任务
|
//申请任务
|
||||||
if (move > 0 && !requireSucess) {
|
if (move > 0) {
|
||||||
instruction_require();
|
instruction_require();
|
||||||
}
|
}
|
||||||
|
if (mode == 2 && move != 0 && task > 0) {
|
||||||
|
//inst_message
|
||||||
|
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
|
if (inst != null) {
|
||||||
|
inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
||||||
|
if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
||||||
|
finish_instruction();
|
||||||
|
}
|
||||||
|
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
||||||
|
inst.setInstruction_status("1");
|
||||||
|
instructionService.update(inst);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
switch (flag) {
|
switch (flag) {
|
||||||
//取货完成
|
//取货完成
|
||||||
@@ -170,6 +185,10 @@ public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
last_error = error;
|
last_error = error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized boolean finish_instruction() throws Exception {
|
||||||
|
instructionService.finish(inst);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized boolean instruction_apply(String container_code) throws Exception {
|
public synchronized boolean instruction_apply(String container_code) throws Exception {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
@@ -295,6 +314,10 @@ public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
+ "." + ItemProtocol.item_to_target;
|
+ "." + ItemProtocol.item_to_target;
|
||||||
String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
+ "." + ItemProtocol.item_to_task;
|
+ "." + ItemProtocol.item_to_task;
|
||||||
|
String to_door = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
|
+ "." + ItemProtocol.item_to_door;
|
||||||
|
String to_floor = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
|
+ "." + ItemProtocol.item_to_floor;
|
||||||
String opcservcerid = this.getDevice().getOpc_server_id();
|
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||||
Server server = ReadUtil.getServer(opcservcerid);
|
Server server = ReadUtil.getServer(opcservcerid);
|
||||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||||
@@ -304,18 +327,23 @@ public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
} else if (type == 2) {
|
} else if (type == 2) {
|
||||||
itemMap.put(to_target, command);
|
itemMap.put(to_target, command);
|
||||||
log.info("设备:" + device_code + ",下发PLC信号" + to_target + ",value:" + command);
|
log.info("设备:" + device_code + ",下发PLC信号" + to_target + ",value:" + command);
|
||||||
|
|
||||||
} else if (type == 3) {
|
} else if (type == 3) {
|
||||||
itemMap.put(to_task, command);
|
itemMap.put(to_task, command);
|
||||||
log.info("设备:" + device_code + ",下发PLC信号" + to_task + ",value:" + command);
|
log.info("设备:" + device_code + ",下发PLC信号" + to_task + ",value:" + command);
|
||||||
|
} else if (type == 4) {
|
||||||
|
itemMap.put(to_door, command);
|
||||||
|
log.info("设备:" + device_code + ",下发PLC信号" + to_door + ",value:" + command);
|
||||||
|
} else if (type == 5) {
|
||||||
|
itemMap.put(to_floor, command);
|
||||||
|
log.info("设备:" + device_code + ",下发PLC信号" + to_floor + ",value:" + command);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadUtil.write(itemMap, server);
|
ReadUtil.write(itemMap, server);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject getDeviceStatusName() {
|
public JSONObject getDeviceStatusName() {
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
|
String device_code = this.getDevice_code();
|
||||||
String mode = "";
|
String mode = "";
|
||||||
String action = "";
|
String action = "";
|
||||||
String move = "";
|
String move = "";
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public class ItemProtocol {
|
|||||||
public static String item_move = "move";
|
public static String item_move = "move";
|
||||||
public static String item_action = "action";
|
public static String item_action = "action";
|
||||||
public static String item_error = "error";
|
public static String item_error = "error";
|
||||||
|
public static String item_container_type = "container_type";
|
||||||
public static String item_task = "task";
|
public static String item_task = "task";
|
||||||
|
|
||||||
|
|
||||||
@@ -50,10 +51,15 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_action);
|
return this.getOpcIntegerValue(item_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getItem_container_type() {
|
||||||
|
return this.getOpcIntegerValue(item_container_type);
|
||||||
|
}
|
||||||
|
|
||||||
public int getItem_task() {
|
public int getItem_task() {
|
||||||
return this.getOpcIntegerValue(item_task);
|
return this.getOpcIntegerValue(item_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Boolean isonline;
|
Boolean isonline;
|
||||||
|
|
||||||
public int getOpcIntegerValue(String protocol) {
|
public int getOpcIntegerValue(String protocol) {
|
||||||
@@ -75,7 +81,8 @@ public class ItemProtocol {
|
|||||||
list.add(new ItemDto(item_move, "光电信号", "VW4"));
|
list.add(new ItemDto(item_move, "光电信号", "VW4"));
|
||||||
list.add(new ItemDto(item_action, "取放信号", "VW6"));
|
list.add(new ItemDto(item_action, "取放信号", "VW6"));
|
||||||
list.add(new ItemDto(item_error, "故障", "VW8"));
|
list.add(new ItemDto(item_error, "故障", "VW8"));
|
||||||
list.add(new ItemDto(item_task, "任务号", "VD10"));
|
list.add(new ItemDto(item_container_type, "托盘类型", "VW10"));
|
||||||
|
list.add(new ItemDto(item_task, "任务号", "VD12"));
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,10 +232,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
//申请任务
|
//申请任务
|
||||||
if (move > 0 && !StrUtil.isEmpty(barcode()) && !requireSucess) {
|
if (!StrUtil.isEmpty(barcode()) && !requireSucess) {
|
||||||
instruction_require(barcode());
|
instruction_require(barcode());
|
||||||
}
|
}
|
||||||
if (move > 0 && !StrUtil.isEmpty(barcode()) && !applySucess) {
|
if (!StrUtil.isEmpty(barcode()) && !applySucess) {
|
||||||
instruction_apply(barcode());
|
instruction_apply(barcode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -320,31 +320,34 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
|
|
||||||
public void writing(int type, int command) {
|
public void writing(int type, int command) {
|
||||||
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
+ "." + ItemProtocol.item_to_command;
|
+ "." + org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.ItemProtocol.item_to_command;
|
||||||
String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
+ "." + ItemProtocol.item_to_target;
|
+ "." + org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.ItemProtocol.item_to_target;
|
||||||
String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
+ "." + ItemProtocol.item_to_task;
|
+ "." + org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.ItemProtocol.item_to_task;
|
||||||
String to_door = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
String to_door = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
+ "." + ItemProtocol.item_to_door;
|
+ "." + org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.ItemProtocol.item_to_door;
|
||||||
String to_floor = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
String to_floor = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
+ "." + ItemProtocol.item_to_floor;
|
+ "." + org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.ItemProtocol.item_to_floor;
|
||||||
String opcservcerid = this.getDevice().getOpc_server_id();
|
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||||
Server server = ReadUtil.getServer(opcservcerid);
|
Server server = ReadUtil.getServer(opcservcerid);
|
||||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
itemMap.put(to_command, command);
|
itemMap.put(to_command, command);
|
||||||
|
log.info("设备:" + device_code + ",下发PLC信号" + to_command + ",value:" + command);
|
||||||
} else if (type == 2) {
|
} else if (type == 2) {
|
||||||
itemMap.put(to_target, command);
|
itemMap.put(to_target, command);
|
||||||
|
log.info("设备:" + device_code + ",下发PLC信号" + to_target + ",value:" + command);
|
||||||
} else if (type == 3) {
|
} else if (type == 3) {
|
||||||
itemMap.put(to_task, command);
|
itemMap.put(to_task, command);
|
||||||
} else if (type == 4) {
|
log.info("设备:" + device_code + ",下发PLC信号" + to_task + ",value:" + command);
|
||||||
|
} else if (type == 4) {
|
||||||
itemMap.put(to_door, command);
|
itemMap.put(to_door, command);
|
||||||
} else if (type == 5) {
|
log.info("设备:" + device_code + ",下发PLC信号" + to_task + ",value:" + command);
|
||||||
|
} else if (type == 5) {
|
||||||
itemMap.put(to_floor, command);
|
itemMap.put(to_floor, command);
|
||||||
|
log.info("设备:" + device_code + ",下发PLC信号" + to_task + ",value:" + command);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadUtil.write(itemMap, server);
|
ReadUtil.write(itemMap, server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -304,7 +304,6 @@ 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()));
|
|
||||||
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);
|
||||||
@@ -320,15 +319,16 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
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));
|
cargoLiftConveyorDeviceDriver.writing(1, 0);
|
||||||
standardCoveyorControlWithScannerDeviceDriver.writing(3, Integer.parseInt(task_code));
|
cargoLiftConveyorDeviceDriver.writing(1, 1);
|
||||||
standardCoveyorControlWithScannerDeviceDriver.writing(4, Integer.parseInt(door));
|
cargoLiftConveyorDeviceDriver.writing(2, Integer.parseInt(address));
|
||||||
standardCoveyorControlWithScannerDeviceDriver.writing(5, Integer.parseInt(floor));
|
cargoLiftConveyorDeviceDriver.writing(3, Integer.parseInt(dto.getInstruction_code()));
|
||||||
|
cargoLiftConveyorDeviceDriver.writing(4, Integer.parseInt(door));
|
||||||
|
cargoLiftConveyorDeviceDriver.writing(5, Integer.parseInt(floor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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()));
|
|
||||||
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);
|
||||||
@@ -344,10 +344,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
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(1, 0);
|
||||||
cargoLiftConveyorDeviceDriver.writing(3, Integer.parseInt(task_code));
|
standardCoveyorControlWithScannerDeviceDriver.writing(1, 1);
|
||||||
cargoLiftConveyorDeviceDriver.writing(4, Integer.parseInt(door));
|
standardCoveyorControlWithScannerDeviceDriver.writing(2, Integer.parseInt(address));
|
||||||
cargoLiftConveyorDeviceDriver.writing(5, Integer.parseInt(floor));
|
standardCoveyorControlWithScannerDeviceDriver.writing(3, Integer.parseInt(dto.getInstruction_code()));
|
||||||
|
standardCoveyorControlWithScannerDeviceDriver.writing(4, Integer.parseInt(door));
|
||||||
|
standardCoveyorControlWithScannerDeviceDriver.writing(5, Integer.parseInt(floor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (startdevice.getDeviceDriver() instanceof HaoKaiAutoConveyorDeviceDriver) {
|
if (startdevice.getDeviceDriver() instanceof HaoKaiAutoConveyorDeviceDriver) {
|
||||||
@@ -898,27 +900,48 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
entity.setRoute_plan_code(task.getRoute_plan_code());
|
entity.setRoute_plan_code(task.getRoute_plan_code());
|
||||||
}
|
}
|
||||||
|
|
||||||
// != 0 为agv任务 1=magic 2=NDC 3=XZ,4=ZHEDA
|
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(entity.getStart_device_code(), entity.getNext_device_code(), entity.getRoute_plan_code());
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "1")
|
if (ObjectUtils.isEmpty(shortPathsList)) {
|
||||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
throw new Exception(entity.getStart_device_code() + "->" + entity.getNext_device_code() + "路由不通");
|
||||||
MagicAgvService magicAgvService = SpringContextHolder.getBean(MagicAgvService.class);
|
}
|
||||||
magicAgvService.deleteAgvInst(entity.getInstruction_code());
|
String type = shortPathsList.get(0).getType();
|
||||||
flag = true;
|
|
||||||
|
|
||||||
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) {
|
RouteLineDto route = null;
|
||||||
//NDC agv指令不当场取消指令,需要等agv上报
|
for (int i = 0; i < shortPathsList.size(); i++) {
|
||||||
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
RouteLineDto routeLineDto = shortPathsList.get(i);
|
||||||
ndcAgvService.deleteAgvInstToNDC(entity);
|
String route_device = routeLineDto.getDevice_code();
|
||||||
|
String route_next_device = routeLineDto.getNext_device_code();
|
||||||
|
if (route_device.equals(entity.getStart_device_code()) && route_next_device.equals(entity.getNext_device_code())){
|
||||||
|
route = routeLineDto;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(route)){
|
||||||
|
throw new BadRequestException("未查询到相关路由!");
|
||||||
|
}
|
||||||
|
if (StrUtil.equals(route.getType(), "1")) {
|
||||||
|
// != 0 为agv任务 1=magic 2=NDC 3=XZ,4=ZHEDA
|
||||||
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "1")
|
||||||
|
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
||||||
|
MagicAgvService magicAgvService = SpringContextHolder.getBean(MagicAgvService.class);
|
||||||
|
magicAgvService.deleteAgvInst(entity.getInstruction_code());
|
||||||
|
flag = true;
|
||||||
|
|
||||||
|
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) {
|
||||||
|
//NDC agv指令不当场取消指令,需要等agv上报
|
||||||
|
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
||||||
|
ndcAgvService.deleteAgvInstToNDC(entity);
|
||||||
|
} else {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")
|
||||||
|
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
||||||
|
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
||||||
|
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
|
||||||
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")
|
|
||||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
|
||||||
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
|
||||||
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
|
|
||||||
flag = true;
|
|
||||||
} else {
|
|
||||||
flag = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
|||||||
Thread.sleep((long) (OpcConfig.synchronized_exception_wait_second * 1000));
|
Thread.sleep((long) (OpcConfig.synchronized_exception_wait_second * 1000));
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
++this.error_num;
|
++this.error_num;
|
||||||
if (this.error_num > 3 && !StrUtil.equals(this.message, error_message)) {
|
if (this.error_num > 3 && !StrUtil.equals(this.message, error_message)) {
|
||||||
|
|||||||
@@ -45,14 +45,12 @@ public class DeviceOpcSynchronizeAutoRun extends AbstractAutoRunnable {
|
|||||||
}while (ObjectUtil.isEmpty(pros));
|
}while (ObjectUtil.isEmpty(pros));
|
||||||
Set<String> keys = pros.keySet();
|
Set<String> keys = pros.keySet();
|
||||||
Iterator var4 = keys.iterator();
|
Iterator var4 = keys.iterator();
|
||||||
System.out.println("test:" + var4.hasNext());
|
|
||||||
//代码执行一次
|
//代码执行一次
|
||||||
while (var4.hasNext()) {
|
while (var4.hasNext()) {
|
||||||
String key = (String) var4.next();
|
String key = (String) var4.next();
|
||||||
List<List<OpcItemDto>> list = (List) pros.get(key);
|
List<List<OpcItemDto>> list = (List) pros.get(key);
|
||||||
OpcServerManageDto opcServer = (OpcServerManageDto) servers.get(key);
|
OpcServerManageDto opcServer = (OpcServerManageDto) servers.get(key);
|
||||||
Iterator var8 = list.iterator();
|
Iterator var8 = list.iterator();
|
||||||
System.out.println("test2:" + var8.hasNext());
|
|
||||||
|
|
||||||
while (var8.hasNext()) {
|
while (var8.hasNext()) {
|
||||||
List<OpcItemDto> groupProtols = (List) var8.next();
|
List<OpcItemDto> groupProtols = (List) var8.next();
|
||||||
|
|||||||
@@ -6,11 +6,12 @@ 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:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:yongyu_acs2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
# url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:yongyu_acs2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:yongyu_acs2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:yy_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:P@ssw0rd}
|
# password: ${DB_PWD:P@ssw0rd}
|
||||||
# password: ${DB_PWD:Root.123456}
|
# password: ${DB_PWD:Root.123456}
|
||||||
|
password: ${DB_PWD:123456}
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
initial-size: 5
|
initial-size: 5
|
||||||
# 最小连接数
|
# 最小连接数
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ 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.16.1.25}:${DB_PORT:3306}/${DB_NAME:whxr_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.4.121}:${DB_PORT:3306}/${DB_NAME:yy_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:whxr_root}
|
# password: ${DB_PWD:P@ssw0rd}
|
||||||
|
# password: ${DB_PWD:Root.123456}
|
||||||
|
password: ${DB_PWD:123456}
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
initial-size: 5
|
initial-size: 5
|
||||||
# 最小连接数
|
# 最小连接数
|
||||||
@@ -54,7 +56,7 @@ spring:
|
|||||||
redis:
|
redis:
|
||||||
#数据库索引
|
#数据库索引
|
||||||
database: ${REDIS_DB:15}
|
database: ${REDIS_DB:15}
|
||||||
host: ${REDIS_HOST:10.16.1.25}
|
host: ${REDIS_HOST:127.0.0.1}
|
||||||
port: ${REDIS_PORT:6379}
|
port: ${REDIS_PORT:6379}
|
||||||
password: ${REDIS_PWD:}
|
password: ${REDIS_PWD:}
|
||||||
#连接超时时间
|
#连接超时时间
|
||||||
|
|||||||
Reference in New Issue
Block a user