fix: 读空指针异常解决阻塞问题
This commit is contained in:
@@ -256,82 +256,88 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
}
|
||||
});
|
||||
}
|
||||
//申请空托盘出库
|
||||
if (mode == 8 && !requireSucess) {
|
||||
if (container_type == 0) {
|
||||
message = "托盘类型为空";
|
||||
}else {
|
||||
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "脱机";
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("弃用(留作兼容)");
|
||||
break;
|
||||
case 2:
|
||||
//申请任务
|
||||
if (move == 1 && !requireSucess) {
|
||||
instruction_require();
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
log.info("运行中");
|
||||
break;
|
||||
case 4:
|
||||
//申请出货
|
||||
if (move == 1 && !requireSucess) {
|
||||
//request_for_shipment(String.valueOf(mode), item_out_seq_arr, item_out_qty_arr);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code+ "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + var17.getMessage();
|
||||
var17.printStackTrace();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
||||
}
|
||||
|
||||
|
||||
//申请空托盘出库
|
||||
if (mode == 8 && !requireSucess) {
|
||||
if (container_type == 0) {
|
||||
message = "托盘类型为空";
|
||||
}else {
|
||||
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "脱机";
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("弃用(留作兼容)");
|
||||
break;
|
||||
case 2:
|
||||
//申请任务
|
||||
if (move == 1 && !requireSucess) {
|
||||
instruction_require();
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
log.info("运行中");
|
||||
break;
|
||||
case 4:
|
||||
//申请出货
|
||||
if (move == 1 && !requireSucess) {
|
||||
//request_for_shipment(String.valueOf(mode), item_out_seq_arr, item_out_qty_arr);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
last_heartbeat = heartbeat;
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
|
||||
@@ -139,7 +139,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public class ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
return value;
|
||||
}
|
||||
|
||||
public int[] getOpcArrayValue(String protocol) {
|
||||
|
||||
@@ -242,10 +242,11 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code+ "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol))
|
||||
.content(this.device_code+ "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + var17.getMessage();
|
||||
var17.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ public class ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -192,80 +192,88 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
requireSucess = false;
|
||||
}
|
||||
if (move != 0 && task > 0) {
|
||||
if (null!=inst) {
|
||||
if (null != inst) {
|
||||
inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code();
|
||||
}
|
||||
update_instruction_status();
|
||||
}
|
||||
} catch (Exception var17) {
|
||||
var17.printStackTrace();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
||||
}
|
||||
|
||||
|
||||
if (move != last_move && move == 0 && last_move == 1) {
|
||||
requireSucess = false;
|
||||
clearWrite();
|
||||
}
|
||||
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
if (move != last_move && move == 0 && last_move == 1) {
|
||||
requireSucess = false;
|
||||
clearWrite();
|
||||
}
|
||||
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("设备运转模式:等待工作");
|
||||
break;
|
||||
case 19:
|
||||
//申请AGV任务
|
||||
if (move == 1 && !requireSucess) {
|
||||
if (StrUtil.isEmpty(material_barcode)) {
|
||||
message = "条码为空";
|
||||
}else {
|
||||
applyAgvTask();
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
//申请任务
|
||||
if (move > 0 && !requireSucess) {
|
||||
instruction_require();
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
}
|
||||
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("设备运转模式:等待工作");
|
||||
break;
|
||||
case 19:
|
||||
//申请AGV任务
|
||||
if (move == 1 && !requireSucess) {
|
||||
if (StrUtil.isEmpty(material_barcode)) {
|
||||
message = "条码为空";
|
||||
} else {
|
||||
applyAgvTask();
|
||||
}
|
||||
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
break;
|
||||
case 2:
|
||||
//申请任务
|
||||
if (move > 0 && !requireSucess) {
|
||||
instruction_require();
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception var17) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + var17.getMessage();
|
||||
var17.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
last_carrier_direction = carrier_direction;
|
||||
@@ -390,7 +398,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo);
|
||||
requireSucess = true;
|
||||
}else {
|
||||
} else {
|
||||
message = "申请AGV任务报错,参数,接口返回:" + jo;
|
||||
this.iserror = true;
|
||||
}
|
||||
@@ -426,6 +434,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
itemMap.put(to_command, command);
|
||||
this.control(itemMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
@@ -142,7 +142,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public class ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "";
|
||||
return value;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
|
||||
@@ -200,105 +200,113 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
||||
if (move != 0 && task > 0) {
|
||||
update_instruction_status();
|
||||
}
|
||||
if (move != last_move && move==0 && last_move==1) {
|
||||
requireSucess = false;
|
||||
clearWrite();
|
||||
}
|
||||
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "脱机";
|
||||
|
||||
//有报警
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有警报";
|
||||
}
|
||||
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("设备运转模式:等待工作");
|
||||
break;
|
||||
case 2:
|
||||
//申请任务
|
||||
if (move > 0 && !requireSucess) {
|
||||
instruction_require();
|
||||
}else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
//申请贴标
|
||||
applyLabeling(mode);
|
||||
break;
|
||||
case 10:
|
||||
//申请捆轧贴标信息
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulationAndLabeling(mode);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
//申请贴标(未贴标)
|
||||
applyLabeling(mode);
|
||||
break;
|
||||
case 13:
|
||||
//申请捆轧贴标信息(未捆扎)
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulationAndLabeling(mode);
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
//申请捆轧贴标信息(未贴标)
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulationAndLabeling(mode);
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
//申请捆轧贴标信息(未贴标,未捆扎)
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulationAndLabeling(mode);
|
||||
}
|
||||
case 17:
|
||||
//申请调试贴标
|
||||
if(move > 0 && !requireSucess){
|
||||
applyLaStrangulationAndLabeling(mode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + var17.getMessage();
|
||||
var17.printStackTrace();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
||||
}
|
||||
|
||||
|
||||
if (move != last_move && move==0 && last_move==1) {
|
||||
requireSucess = false;
|
||||
clearWrite();
|
||||
}
|
||||
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "脱机";
|
||||
|
||||
//有报警
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有警报";
|
||||
}
|
||||
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("设备运转模式:等待工作");
|
||||
break;
|
||||
case 2:
|
||||
//申请任务
|
||||
if (move > 0 && !requireSucess) {
|
||||
instruction_require();
|
||||
}else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
//申请贴标
|
||||
applyLabeling(mode);
|
||||
break;
|
||||
case 10:
|
||||
//申请捆轧贴标信息
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulationAndLabeling(mode);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
//申请贴标(未贴标)
|
||||
applyLabeling(mode);
|
||||
break;
|
||||
case 13:
|
||||
//申请捆轧贴标信息(未捆扎)
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulationAndLabeling(mode);
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
//申请捆轧贴标信息(未贴标)
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulationAndLabeling(mode);
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
//申请捆轧贴标信息(未贴标,未捆扎)
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulationAndLabeling(mode);
|
||||
}
|
||||
case 17:
|
||||
//申请调试贴标
|
||||
if(move > 0 && !requireSucess){
|
||||
applyLaStrangulationAndLabeling(mode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
last_carrier_direction = carrier_direction;
|
||||
|
||||
@@ -194,7 +194,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public class ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
return value;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
|
||||
@@ -198,101 +198,109 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if (move != 0 && task > 0) {
|
||||
update_instruction_status();
|
||||
}
|
||||
if (move != last_move && move == 0 && last_move == 1) {
|
||||
requireSucess = false;
|
||||
clearWrite();
|
||||
}
|
||||
|
||||
|
||||
//托盘去扫码位
|
||||
if (mode == 4) {
|
||||
List list1 = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_command");
|
||||
map.put("value", 0);
|
||||
list1.add(map);
|
||||
this.writing(list1);
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "脱机";
|
||||
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//申请空托盘入库
|
||||
if (mode == 9 && move == 1 && !requireSucess) {
|
||||
if (container_type == 0) {
|
||||
message = "托盘类型为空";
|
||||
} else {
|
||||
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//申请空托盘出库
|
||||
if (mode == 8 && !requireSucess) {
|
||||
if (container_type == 0) {
|
||||
message = "托盘类型为空";
|
||||
} else {
|
||||
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//碟盘位申请任务
|
||||
if (mode == 2 && move == 1 && !requireSucess) {
|
||||
boolean res = instruction_require();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
} else {
|
||||
if (mode == 2) {
|
||||
//if (!requireSucess) {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = LangProcess.msg("universal_remark4");
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = LangProcess.msg("universal_remark5");
|
||||
}
|
||||
this.setNotCreateTaskMessage(remark);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + var17.getMessage();
|
||||
var17.printStackTrace();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (move != last_move && move == 0 && last_move == 1) {
|
||||
requireSucess = false;
|
||||
clearWrite();
|
||||
}
|
||||
|
||||
|
||||
//托盘去扫码位
|
||||
if (mode == 4) {
|
||||
List list1 = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_command");
|
||||
map.put("value", 0);
|
||||
list1.add(map);
|
||||
this.writing(list1);
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "脱机";
|
||||
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//申请空托盘入库
|
||||
if (mode == 9 && move == 1 && !requireSucess) {
|
||||
if (container_type == 0) {
|
||||
message = "托盘类型为空";
|
||||
} else {
|
||||
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//申请空托盘出库
|
||||
if (mode == 8 && !requireSucess) {
|
||||
if (container_type == 0) {
|
||||
message = "托盘类型为空";
|
||||
} else {
|
||||
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//碟盘位申请任务
|
||||
if (mode == 2 && move == 1 && !requireSucess) {
|
||||
boolean res = instruction_require();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
} else {
|
||||
if (mode == 2) {
|
||||
//if (!requireSucess) {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = LangProcess.msg("universal_remark4");
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = LangProcess.msg("universal_remark5");
|
||||
}
|
||||
this.setNotCreateTaskMessage(remark);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
last_action = action;
|
||||
|
||||
@@ -112,7 +112,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getOpcStringValue(String protocol) {
|
||||
@@ -123,7 +123,7 @@ public class ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
return value;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
|
||||
@@ -243,15 +243,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (mode == -99){
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("PLC断连需重启程序")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
throw new BadRequestException("PLC断连需重启程序");
|
||||
}
|
||||
|
||||
|
||||
if (move != last_move && move == 0 && last_move == 1) {
|
||||
@@ -287,105 +278,113 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
update_instruction_status();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
|
||||
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//申请异常位任务
|
||||
applyErrorTask();
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
//木箱入库申请入库任务
|
||||
if (mode == 6 && !requireSucess) {
|
||||
if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) {
|
||||
message = "托盘条码为空、或者子卷码为空";
|
||||
} else {
|
||||
applyIn(StorageTypeEnum.BOX_IN.getType(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//子卷入库申请入库任务
|
||||
if (mode == 7 && move == 1 && !requireSucess) {
|
||||
if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) {
|
||||
message = "托盘条码为空、或者子卷码为空";
|
||||
} else {
|
||||
applyIn(StorageTypeEnum.STORAGE.getType(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//申请空托盘入库
|
||||
if (mode == 9 && move == 1 && !requireSucess) {
|
||||
if (container_type == 0 || StrUtil.isEmpty(barcode)) {
|
||||
message = "托盘类型为空";
|
||||
} else {
|
||||
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
|
||||
}
|
||||
}
|
||||
|
||||
//申请退货入库
|
||||
if (mode == 18 && move == 1 && !requireSucess) {
|
||||
if (StrUtil.isEmpty(barcode)) {
|
||||
message = "托盘条码为空";
|
||||
} else {
|
||||
applyBoxReturnTask(StorageTypeEnum.BOX_RETURN.getType(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
//申请高度
|
||||
if (mode == 23 && !requireSucess) {
|
||||
if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) {
|
||||
message = "条码为空";
|
||||
} else {
|
||||
applyErrorHeight();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//申请入库指令、异常位指令
|
||||
if (mode == 2 && move == 1 && !requireSucess) {
|
||||
boolean res = instruction_require();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//申请异常位任务
|
||||
applyErrorTask();
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
//木箱入库申请入库任务
|
||||
if (mode == 6 && !requireSucess) {
|
||||
if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) {
|
||||
message = "托盘条码为空、或者子卷码为空";
|
||||
} else {
|
||||
applyIn(StorageTypeEnum.BOX_IN.getType(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
|
||||
//子卷入库申请入库任务
|
||||
if (mode == 7 && move == 1 && !requireSucess) {
|
||||
if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) {
|
||||
message = "托盘条码为空、或者子卷码为空";
|
||||
} else {
|
||||
applyIn(StorageTypeEnum.STORAGE.getType(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
|
||||
|
||||
//申请空托盘入库
|
||||
if (mode == 9 && move == 1 && !requireSucess) {
|
||||
if (container_type == 0 || StrUtil.isEmpty(barcode)) {
|
||||
message = "托盘类型为空";
|
||||
} else {
|
||||
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
|
||||
//申请退货入库
|
||||
if (mode == 18 && move == 1 && !requireSucess) {
|
||||
if (StrUtil.isEmpty(barcode)) {
|
||||
message = "托盘条码为空";
|
||||
} else {
|
||||
applyBoxReturnTask(StorageTypeEnum.BOX_RETURN.getType(), mode);
|
||||
}
|
||||
|
||||
}
|
||||
//申请高度
|
||||
if (mode == 23 && !requireSucess) {
|
||||
if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) {
|
||||
message = "条码为空";
|
||||
} else {
|
||||
applyErrorHeight();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//申请入库指令、异常位指令
|
||||
if (mode == 2 && move == 1 && !requireSucess) {
|
||||
boolean res = instruction_require();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + e.getMessage();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
last_action = action;
|
||||
|
||||
@@ -166,7 +166,7 @@ public class ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
return value;
|
||||
}
|
||||
|
||||
public int getOpcIntegerValue(String protocol) {
|
||||
@@ -178,7 +178,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return -99;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public class ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
return value;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
|
||||
@@ -178,48 +178,55 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
to_target = this.itemProtocol.getTo_target();
|
||||
to_task = this.itemProtocol.getTo_task();
|
||||
heartbeat = this.itemProtocol.getHeartbeat();
|
||||
if (mode != last_mode) {
|
||||
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
|
||||
|
||||
}
|
||||
|
||||
if (mode != last_mode) {
|
||||
|
||||
requireSucess = false;
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "脱机";
|
||||
|
||||
//有报警
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
}
|
||||
inst = checkInst();
|
||||
if (inst != null) {
|
||||
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
||||
requireSucess = false;
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "脱机";
|
||||
|
||||
Instruction instruction = instructionService.findByCode(String.valueOf(task));
|
||||
//空箱出库开盖位,申请开盖
|
||||
if (mode == 15 && move == 1 && task > 0 ) {
|
||||
//不允许开盖,完成出库任务,自动去扫码位
|
||||
if (StrUtil.isEmpty(instruction.getVehicle_code())){
|
||||
message = "任务托盘码为空";
|
||||
//有报警
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
}
|
||||
inst = checkInst();
|
||||
if (inst != null) {
|
||||
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
||||
}
|
||||
applyUnbox(instruction.getVehicle_code());
|
||||
|
||||
Instruction instruction = instructionService.findByCode(String.valueOf(task));
|
||||
//空箱出库开盖位,申请开盖
|
||||
if (mode == 15 && move == 1 && task > 0 ) {
|
||||
//不允许开盖,完成出库任务,自动去扫码位
|
||||
if (StrUtil.isEmpty(instruction.getVehicle_code())){
|
||||
message = "任务托盘码为空";
|
||||
}
|
||||
applyUnbox(instruction.getVehicle_code());
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + e.getMessage();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
last_mode =mode;
|
||||
last_move =move;
|
||||
last_carrier_direction =carrier_direction;
|
||||
|
||||
@@ -194,59 +194,66 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
updateInstrction();
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "universal_off-line";
|
||||
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "universal_off-line";
|
||||
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
}else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
}else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + e.getMessage();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
last_action = action;
|
||||
|
||||
@@ -199,7 +199,7 @@ public class ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
return value;
|
||||
}
|
||||
|
||||
public float getOpcFloatValue(String protocol) {
|
||||
@@ -211,7 +211,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -164,64 +164,68 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
updateInstructionStatus();
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "universal_off-line";
|
||||
|
||||
} catch (Exception e) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("读取信号值时出现异常" + this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.device_code + "." + Arrays.toString(e.getStackTrace()))
|
||||
.build();
|
||||
logDto.setLog_level(2);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "universal_off-line";
|
||||
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//无报警
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + e.getMessage();
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
|
||||
last_mode =mode;
|
||||
last_action = action;
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
|
||||
}
|
||||
public String getOpcStringValue(String protocol) {
|
||||
@@ -209,7 +209,7 @@ public class ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
return value;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
|
||||
@@ -173,7 +173,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
|
||||
}
|
||||
public int getOpcIntegerValue(String protocol) {
|
||||
@@ -184,7 +184,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
|
||||
@@ -177,60 +177,68 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
updateInstructionStatus();
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "universal_off-line";
|
||||
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
|
||||
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + e.getMessage();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "universal_off-line";
|
||||
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
last_action = action;
|
||||
|
||||
@@ -81,7 +81,7 @@ ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getOpcStringValue(String protocol) {
|
||||
@@ -91,7 +91,7 @@ ItemProtocol {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
return value;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
|
||||
@@ -163,32 +163,39 @@ public class StandardManipulatoDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
if (mode != last_mode) {
|
||||
requireSucess = false;
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "universal_off-line";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + var17.getMessage();
|
||||
var17.printStackTrace();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
||||
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "universal_off-line";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
|
||||
|
||||
}
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
last_action = action;
|
||||
|
||||
@@ -182,7 +182,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
public float getOpcFloatValue(String protocol) {
|
||||
@@ -194,7 +194,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -172,58 +172,65 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
|
||||
}
|
||||
updateInstructionStatus();
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
var17.printStackTrace();
|
||||
// feedMessage = var17.getMessage();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
||||
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//无报警
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + var17.getMessage();
|
||||
var17.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
last_action = action;
|
||||
|
||||
@@ -177,7 +177,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
public float getOpcFloatValue(String protocol) {
|
||||
@@ -189,7 +189,7 @@ public class ItemProtocol {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -210,60 +210,68 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
|
||||
Integer actionType = ActionTypeEnum.IN_FINISHING.getCode();
|
||||
creatAGV(actionType, action);
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "universal_off-line";
|
||||
|
||||
} catch (Exception var17) {
|
||||
var17.printStackTrace();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
||||
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "universal_off-line";
|
||||
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//无报警
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
feedMessage = "";
|
||||
}
|
||||
} else {
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
message = "读取信号值时出现异常:" + var17.getMessage();
|
||||
var17.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
last_action = action;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<slot name="left"/>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<el-table :data="modeform.plans" border fit highlight-current-row style="width: 100%;" class="tb-edit">
|
||||
<el-table-column label="任务类型" prop="type" width="180">
|
||||
<el-table-column label="任务类型" prop="type" width="250">
|
||||
<template scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.type"
|
||||
@@ -40,7 +40,7 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="指令起点" prop="from" width="180">
|
||||
<el-table-column label="指令起点" prop="from" width="250">
|
||||
<template scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.from"
|
||||
@@ -57,7 +57,7 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="指令终点" prop="to" width="180">
|
||||
<el-table-column label="指令终点" prop="to" width="250">
|
||||
<template scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.to"
|
||||
@@ -74,15 +74,29 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="quantity" width="180">
|
||||
<el-table-column label="数量" prop="quantity" width="250">
|
||||
<template scope="scope">
|
||||
<el-input-number v-model="scope.row.quantity" value="0" :min="0" size="mini" />
|
||||
<el-input-number v-model="scope.row.quantity" value="0" :min="0" size="mini"/>
|
||||
<span v-show="scope.row.edit">{{ scope.row.quantity }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="操作" width="170">
|
||||
<el-table-column align="center" label="顺序" width="300" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-top"
|
||||
@click="moveUp(scope.$index)"
|
||||
>
|
||||
上移
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-top"
|
||||
@click="moveDown(scope.$index)"
|
||||
>
|
||||
下移
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
class="filter-item"
|
||||
@@ -97,7 +111,7 @@
|
||||
</el-card>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span" />
|
||||
<span class="role-span"/>
|
||||
<el-button
|
||||
:loading="false"
|
||||
icon="el-icon-check"
|
||||
@@ -129,9 +143,16 @@ import crud from '@/mixins/crud'
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
import crudCustomPolicy from '@/api/acs/device/customPolicy'
|
||||
import CRUD from '@crud/crud'
|
||||
import * as constants from 'constants'
|
||||
import index from '@/views/system/build/tinymce/example/Index.vue'
|
||||
|
||||
export default {
|
||||
name: 'CustomPolicyType',
|
||||
computed: {
|
||||
index() {
|
||||
return index
|
||||
}
|
||||
},
|
||||
mixins: [crud],
|
||||
props: {
|
||||
parentForm: {
|
||||
@@ -140,11 +161,20 @@ export default {
|
||||
}
|
||||
},
|
||||
cruds() {
|
||||
return CRUD({ title: '自定义策略', url: 'api/customPolicy', idField: 'id', sort: 'id,desc', crudMethod: { ...crudCustomPolicy }})
|
||||
return CRUD({
|
||||
title: '自定义策略',
|
||||
url: 'api/customPolicy',
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...crudCustomPolicy }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
requestMethodList: [{ code: 1, name: '上架' }, { code: 2, name: '下架' }, { code: 3, name: '摆渡' }],
|
||||
requestMethodList: [{ code: 1, name: '出库(起点货架终点输送线)' }, {
|
||||
code: 2,
|
||||
name: '入库(起点输送线终点货位)'
|
||||
}, { code: 3, name: '移库(起点终点为货位)' }],
|
||||
key_code: this.$route.query.key_code,
|
||||
id: this.$route.query.id,
|
||||
deviceList: [],
|
||||
@@ -174,6 +204,26 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
moveUp(index) {
|
||||
if (index > 0) {
|
||||
const upDate = this.modeform.plans[index - 1]
|
||||
this.modeform.plans.splice(index - 1, 1)
|
||||
this.modeform.plans.splice(index, 0, upDate)
|
||||
} else {
|
||||
this.$message.error('已经是第一条,不可上移')
|
||||
}
|
||||
},
|
||||
moveDown(index) {
|
||||
if ((index + 1) === this.modeform.plans.length) {
|
||||
this.$message.error('已经是最后一条,不可下移')
|
||||
} else {
|
||||
console.log(index)
|
||||
const downDate = this.modeform.plans[index + 1]
|
||||
this.modeform.plans.splice(index + 1, 1)
|
||||
this.modeform.plans.splice(index, 0, downDate)
|
||||
}
|
||||
},
|
||||
insertdtl() {
|
||||
this.modeform.plans.push({ quantity: '', type: '' })
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user