更新
This commit is contained in:
@@ -152,7 +152,6 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
@@ -169,7 +168,7 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
|
||||
if (move != last_move) {
|
||||
this.execute_log.setResource(this.device_code, this.device_code);
|
||||
this.execute_log.log("设备:" + device_code + ",last_move -> move:" + last_mode + "->" + move);
|
||||
if (move == 0) {
|
||||
if (move == 0 && mode == 2) {
|
||||
thingToNothing();
|
||||
}
|
||||
this.setRequireSucess(false);
|
||||
@@ -191,6 +190,12 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
|
||||
inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
||||
if(mode == 2){
|
||||
if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
||||
// try{
|
||||
// finish_instruction();
|
||||
// container = inst.getVehicle_code();
|
||||
// } catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
finish_instruction();
|
||||
container = inst.getVehicle_code();
|
||||
}
|
||||
@@ -224,7 +229,6 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
switch (mode) {
|
||||
@@ -244,9 +248,29 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
|
||||
//申请任务
|
||||
if (hasGoods > 0 && error == 0 && !StrUtil.isEmpty(container) && !requireSucess) {
|
||||
instruction_require(container);
|
||||
} else {
|
||||
if(StrUtil.isEmpty(container) ){
|
||||
message ="申请任务托盘号为空无法申请指令";
|
||||
}
|
||||
if(error > 0){
|
||||
message ="申请任务error>0无法申请指令";
|
||||
}
|
||||
if(requireSucess){
|
||||
message ="申请任务请求成功标记未复位无法申请指令";
|
||||
}
|
||||
}
|
||||
if (hasGoods > 0 && error == 0 && !StrUtil.isEmpty(container) && !applySucess) {
|
||||
instruction_apply(container);
|
||||
} else {
|
||||
if(StrUtil.isEmpty(container) ){
|
||||
message ="申请指令托盘号为空无法申请指令";
|
||||
}
|
||||
if(error > 0){
|
||||
message ="申请指令error>0无法申请指令";
|
||||
}
|
||||
if(applySucess){
|
||||
message ="申请指令请求成功标记未复位无法申请指令";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@@ -636,6 +660,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
|
||||
if (byNextDeviceCode.size() >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "查询此终点的指令数量异常(661)";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -652,6 +677,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
//如果当前关联的设备中都有货的话,就返回
|
||||
if (count != 0 && count >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "当前关联的设备中都有货,异常(678)";
|
||||
return true;
|
||||
}
|
||||
instructionService.create(instdto);
|
||||
@@ -702,6 +728,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
|
||||
if (byNextDeviceCode.size() >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "查询此终点的指令数量,异常(729)";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -718,6 +745,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
//如果当前关联的设备中都有货的话,就返回
|
||||
if (count != 0 && count >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "当前关联的设备中都有货的话,就返回异常(746)";
|
||||
return true;
|
||||
}
|
||||
instructionService.create(instdto);
|
||||
@@ -758,6 +786,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
|
||||
if (byNextDeviceCode.size() >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "查询此终点的指令数量返回异常(787)";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -774,6 +803,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
//如果当前关联的设备中都有货的话,就返回
|
||||
if (count != 0 && count >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "当前关联的设备中都有货返回异常(804)";
|
||||
return true;
|
||||
}
|
||||
instructionService.create(instdto);
|
||||
@@ -1018,6 +1048,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
|
||||
if (byNextDeviceCode.size() >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "查询此终点的指令数量返回异常(1051)";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1034,6 +1065,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
//如果当前关联的设备中都有货的话,就返回
|
||||
if (count != 0 && count >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "当前关联的设备中都有货返回异常(1068)";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1085,6 +1117,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
|
||||
if (byNextDeviceCode.size() >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "当前关联的设备中都有货返回异常(1120)";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1101,6 +1134,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
//如果当前关联的设备中都有货的话,就返回
|
||||
if (count != 0 && count >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "当前关联的设备中都有货返回异常(1137)";
|
||||
return true;
|
||||
}
|
||||
instructionService.create(instdto);
|
||||
@@ -1142,6 +1176,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
List<Instruction> byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code);
|
||||
if (byNextDeviceCode.size() >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "查询此终点的指令数量返回异常(1179)";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1158,6 +1193,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce
|
||||
//如果当前关联的设备中都有货的话,就返回
|
||||
if (count != 0 && count >= list.size()) {
|
||||
logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container);
|
||||
message = "当前关联的设备中都有货(1196)";
|
||||
return true;
|
||||
}
|
||||
instructionService.create(instdto);
|
||||
|
||||
@@ -351,7 +351,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
RouteLineDto routeLineDto = shortPathsList.get(i);
|
||||
if (routeLineDto.getType().equals("0")) {
|
||||
Instruction byContainer = this.findByContainer(dto.getVehicle_code());
|
||||
if (ObjectUtil.isNotEmpty(byContainer)) {
|
||||
if (ObjectUtil.isNotEmpty(byContainer) && StrUtil.isEmpty(byContainer.getCarno())) {
|
||||
throw new RuntimeException("已有当前载具号的输送指令");
|
||||
}
|
||||
}
|
||||
@@ -1169,7 +1169,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
// =0 则不用再次请求
|
||||
if (StrUtil.equals(obj.getRequest_again(), "0")) {
|
||||
if (StrUtil.equals(obj.getRequest_again(), "0") && !StrUtil.equals(dto.getNext_device_code(),"1004")) {
|
||||
if (StrUtil.equals(obj.getNext_device_code(), instnextdevice)) {
|
||||
dto.setInstruction_status("2");
|
||||
JSONObject jsonObject = JSONObject.fromObject(dto);
|
||||
|
||||
@@ -20,7 +20,7 @@ public class AutoCleanLog {
|
||||
|
||||
public void run() throws Exception {
|
||||
System.out.println("111");
|
||||
// 0 0/1 0,1 * * ? 每天0-1点执行间隔10分钟一次
|
||||
// 0 0/10 0,1 * * ? 每天0-1点执行间隔10分钟一次
|
||||
//sys_log
|
||||
//delete from sys_log where DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL 30 day)) limit 10;
|
||||
WQLObject logTab = WQLObject.getWQLObject("sys_log");
|
||||
|
||||
Reference in New Issue
Block a user