diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java
index 55d99582f..3313ddc15 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java
@@ -177,28 +177,31 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
}
- if (mode == 2 && move != 0 && task > 0) {
+ if ( 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")) {
- if(StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())){
- vehicle_code = inst.getVehicle_code();
- inst.setExecute_device_code(this.device_code);
- finish_instruction();
- } else {
- if(!StrUtil.equals(inst.getExecute_code(),this.device_code)){
+ if(mode == 2){
+ if (StrUtil.equals(inst.getInstruction_status(), "1")) {
+ if(StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())){
+ vehicle_code = inst.getVehicle_code();
inst.setExecute_device_code(this.device_code);
- instructionService.update(inst);
+ finish_instruction();
+ } else {
+ if(!StrUtil.equals(inst.getExecute_code(),this.device_code)){
+ inst.setExecute_device_code(this.device_code);
+ instructionService.update(inst);
+ }
}
- }
- }
- if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
- inst.setInstruction_status("1");
- inst.setExecute_device_code(this.device_code);
- instructionService.update(inst);
+ }
+ } else {
+ if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
+ inst.setInstruction_status("1");
+ inst.setExecute_device_code(this.device_code);
+ instructionService.update(inst);
+ }
}
}
}
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java
index b5d8f2069..1602f5927 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java
@@ -654,7 +654,11 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
}
if(task >0 ){
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
+ if (ObjectUtil.isEmpty(instruction)){
+ instruction = instructionService.findByCode(String.valueOf(task));
+ }
vehicle_code = instruction.getVehicle_code();
+
} else {
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:"+task+"异常");
message = "申请贴标电气设备任务号:"+task+"异常";
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java
index 34a3910a2..816117424 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java
@@ -140,6 +140,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
public void clearBarcode() throws Exception {
ScannerDeviceDriver scanner = this.getScanner();
scanner.cleanBarcode();
+ logServer.deviceExecuteLog(this.device_code, "", "", "清理条码");
}
public synchronized boolean finish_instruction() throws Exception {
instructionService.finish(inst);
@@ -197,6 +198,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
if (move == 0 && mode == 2) {
message = null;
inst_message = null;
+ clearBarcode();
thingToNothing();
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
@@ -292,7 +294,8 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
last_error = error;
last_move = move;
last_task = task;
-
+ last_plcbarcode_length = plcbarcode_length;
+ last_plcbarcode = plcbarcode;
}
public boolean exe_error() {
@@ -426,6 +429,11 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
TaskDto task = taskserver.findByContainer(container_code);
if (!ObjectUtil.isEmpty(task)) {
Instruction instdto = instructionService.findByTaskcodeAndStatus(task.getTask_code());
+ if(!StrUtil.equals(instdto.getStart_device_code(),this.device_code)){
+ message ="当前载具号"+container_code+"查找对应指令起点与当前设备不符";
+// this.setIserror(true);
+ return false;
+ }
if(ObjectUtil.isNotEmpty(instdto)){
List list = new ArrayList();
Map map = new HashMap();
@@ -484,6 +492,27 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
if (!ObjectUtil.isEmpty(taskdto)) {
if (!ObjectUtils.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()))) {
Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
+ if(!StrUtil.equals(instdto.getStart_device_code(),this.device_code)){
+ message ="当前载具号"+container_code+"查找对应指令起点与当前设备不符";
+// this.setIserror(true);
+// List list = new ArrayList();
+// Map map = new HashMap();
+// map.put("code","to_target");
+// map.put("value","1011");
+// list.add(map);
+// Map map2 = new HashMap();
+// map2.put("code","to_command");
+// map2.put("value","1");
+// Map map3 = new HashMap();
+// map3.put("code","to_task");
+// map3.put("value","0");
+// list.add(map3);
+// this.writing(list);
+// this.setRequireSucess(true);
+// this.setApplySucess(true);
+ return false;
+ }
+ this.setIserror(false);
if (ObjectUtil.isNotEmpty(instdto)) {
List list = new ArrayList();
Map map = new HashMap();
@@ -522,6 +551,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
}
return true;
}
+
String taskid = taskdto.getTask_id();
String taskcode = taskdto.getTask_code();
String vehiclecode = taskdto.getVehicle_code();
@@ -571,6 +601,26 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
} else {
next_point_code = next_device_code;
}
+
+ if(!StrUtil.equals(taskdto.getStart_device_code(),this.device_code)){
+ message ="当前载具号"+container_code+"查找对应指令起点与当前设备不符";
+// List list = new ArrayList();
+// Map map = new HashMap();
+// map.put("code","to_target");
+// map.put("value","1011");
+// list.add(map);
+// Map map2 = new HashMap();
+// map2.put("code","to_command");
+// map2.put("value","1");
+// Map map3 = new HashMap();
+// map3.put("code","to_task");
+// map3.put("value","0");
+// list.add(map3);
+// this.writing(list);
+// this.setRequireSucess(true);
+// this.setApplySucess(true);
+ return false;
+ }
Instruction instdto = new Instruction();
instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setRoute_plan_code(route_plan_code);
@@ -646,7 +696,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
Map map2 = new HashMap();
map2.put("code","to_command");
map2.put("value","1");
- list.add(map2);
+ Map map3 = new HashMap();
+ map3.put("code","to_task");
+ map3.put("value","0");
+ list.add(map3);
this.writing(list);
message = "申请任务失败接口不通下发退回";
} else {
@@ -666,6 +719,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
map2.put("code","to_command");
map2.put("value","1");
list.add(map2);
+ Map map3 = new HashMap();
+ map3.put("code","to_task");
+ map3.put("value","0");
+ list.add(map3);
this.writing(list);
message = "申请任务失败下发退回,"+message;
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcServerUtl.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcServerUtl.java
index 5cdc7eda2..8bce071be 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcServerUtl.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcServerUtl.java
@@ -12,6 +12,7 @@ public class OpcServerUtl {
domain = "";
}
return OpcUtl.getServer(host, clsid, user, password, domain);
+// return OpcUtl.getAutoServer(host, clsid, user, password, domain);
} else {
return null;
}
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcUtl.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcUtl.java
index 2ec809262..6c8bc199d 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcUtl.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcUtl.java
@@ -159,6 +159,15 @@ public class OpcUtl {
}
}
+ public static Server getAutoServer(String host, String clsid, String user, String password, String domain) throws WDKException {
+ checkTimeout();
+ Server server = null;
+ server = new Server(getConnection(host, clsid, user, password, domain), Executors.newSingleThreadScheduledExecutor());
+ AutoReconnectController autoReconnectController = new AutoReconnectController(server);
+ autoReconnectController.connect();
+ return server;
+ }
+
public static ConnectionInformation getConnection(String host, String clsid, String user, String password,
String domain) {
ConnectionInformation connection = new ConnectionInformation();
diff --git a/acs/nladmin-ui/src/views/acs/instruction/index.vue b/acs/nladmin-ui/src/views/acs/instruction/index.vue
index b42b7e7f4..d3af064a9 100644
--- a/acs/nladmin-ui/src/views/acs/instruction/index.vue
+++ b/acs/nladmin-ui/src/views/acs/instruction/index.vue
@@ -144,10 +144,11 @@
-
+
+
diff --git a/acs/nladmin-ui/src/views/system/monitor/device/index.vue b/acs/nladmin-ui/src/views/system/monitor/device/index.vue
index d0055ab22..5816a051e 100644
--- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue
+++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue
@@ -362,6 +362,9 @@ export default {
} else if (val === 'instruction_message') {
const obj = { name: '指令信息', value: data[val] }
this.arr.push(obj)
+ } else if (val === 'message') {
+ const obj = { name: '备注信息', value: data[val] }
+ this.arr.push(obj)
} else if (val === 'last_instruction_message') {
const obj = { name: '上次指令信息', value: data[val] }
this.arr.push(obj)
diff --git a/lms/nladmin-system/src/main/java/org/nl/modules/wql/core/engine/object/WP.java b/lms/nladmin-system/src/main/java/org/nl/modules/wql/core/engine/object/WP.java
index 91c73ea41..3bfc87118 100644
--- a/lms/nladmin-system/src/main/java/org/nl/modules/wql/core/engine/object/WP.java
+++ b/lms/nladmin-system/src/main/java/org/nl/modules/wql/core/engine/object/WP.java
@@ -258,7 +258,7 @@ public class WP implements Serializable,Cloneable{
if(null!=o){
this.IN.put("输入对象."+name, value);
}else{
- log.error("IO输入参数没有找到对应的属性对象:IO no Param "+name);
+ log.warn("IO输入参数没有找到对应的属性对象:IO no Param "+name);
}
}
}
diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/OutService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/OutService.java
index 9b397ce5f..044095e42 100644
--- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/OutService.java
+++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/OutService.java
@@ -13,7 +13,7 @@ public interface OutService {
JSONObject queryMaterialInfo(JSONObject whereJson);
/**
- * 出站确认
+ * 子卷出站确认
* @param whereJson /
* @return JSONObject
*/
diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/OutServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/OutServiceImpl.java
index aaf811cdf..3c23a3808 100644
--- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/OutServiceImpl.java
+++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/OutServiceImpl.java
@@ -123,6 +123,7 @@ public class OutServiceImpl implements OutService {
jo.put("point_code2", empty_vehicle.getString("point_code"));
jo.put("vehicle_code", cut_qzzno);
jo.put("product_area", cut_ivt.getString("product_area"));
+ //分切>输送线 子卷出站
jo.put("task_type", "010404");
cutTrussTask.createTask(jo);
@@ -130,15 +131,15 @@ public class OutServiceImpl implements OutService {
String ext_code = cut_ivt.getString("ext_code");
//查询该机台编号已经配送完成,套轴完成但是未完成的分切计划
- JSONObject delivery_point = WQL.getWO("PDA_02").addParam("ext_code",ext_code).addParam("flag","16").process().uniqueResult(0);
+ JSONObject delivery_point = WQL.getWO("PDA_02").addParam("ext_code", ext_code).addParam("flag", "16").process().uniqueResult(0);
if (ObjectUtil.isEmpty(delivery_point)) {
- throw new BadRequestException("输送线不存在该分切机已经配送完成的气涨轴!");
+ throw new BadRequestException("分切机【" + ext_code + "】无配送完成的气涨轴!");
}
char dtl_type = delivery_point.getString("point_code").charAt(delivery_point.getString("point_code").length() - 1);
JSONObject jo = new JSONObject();
- jo.put("point_code1",delivery_point.getString("point_code"));
+ jo.put("point_code1", delivery_point.getString("point_code"));
jo.put("point_code2", point_code);
jo.put("point_code3", point_code);
jo.put("point_code4", delivery_point.getString("point_code"));
@@ -185,8 +186,8 @@ public class OutServiceImpl implements OutService {
//如果查询到给ACS下发一个输送线任务
JSONObject form = new JSONObject();
form.put("point_code1", point_code);
- JSONObject convey_jo = WQLObject.getWQLObject("").query("point_code = '"+point_code+"'").uniqueResult(0);
- JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '"+convey_jo.getString("product_area")+"' AND point_type = '7'").uniqueResult(0);
+ JSONObject convey_jo = WQLObject.getWQLObject("").query("point_code = '" + point_code + "'").uniqueResult(0);
+ JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + convey_jo.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
form.put("point_code2", ss_jo.getString("point_code"));
form.put("task_type", "010401");
CutConveyorTask cutConveyorTask = new CutConveyorTask();
diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/ShippingServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/ShippingServiceImpl.java
index b09c1787e..e1b59a800 100644
--- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/ShippingServiceImpl.java
+++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/ShippingServiceImpl.java
@@ -282,6 +282,7 @@ public class ShippingServiceImpl implements ShippingService {
@Override
public JSONObject acrossVehicle(JSONObject whereJson) {
+ //载具横移起点
String point_code = whereJson.getString("point_code");
if (StrUtil.isEmpty(point_code)) {
@@ -294,7 +295,7 @@ public class ShippingServiceImpl implements ShippingService {
}
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 = '" + point_code + "' OR point_code2 = '" + point_code + "') AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task_jo)) {
- throw new BadRequestException("该点位存在未完成的任务,请先完成任务!");
+ throw new BadRequestException("点位" + point_code + "存在未完成的任务,请先完成任务!");
}
String point_status = del_jo.getString("point_status");
@@ -341,7 +342,7 @@ public class ShippingServiceImpl implements ShippingService {
}
JSONObject plan = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("qzzno = '" + qzzno + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(plan)) {
- throw new BadRequestException("未查询到该气涨轴对应的分切计划!");
+ throw new BadRequestException("未找到气涨轴【" + qzzno + "】对应的分切计划!");
}
String resource_name = plan.getString("resource_name");
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + resource_name + "'").uniqueResult(0);
@@ -351,7 +352,7 @@ public class ShippingServiceImpl implements ShippingService {
JSONObject vehicle_area = WQLObject.getWQLObject("md_pb_vehiclearea").query("product_area = '" + product_area + "' AND point_location = '" + point_location + "' AND vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(vehicle_area)) {
- throw new BadRequestException("该气涨轴无法放在该载具上!");
+ throw new BadRequestException("载具号【" + vehicle_code + "】无法放到区域【" + product_area + "】的位置【" + point_location + "】上!");
}
//判断当前输送线上是否超过最大负荷任务数量组3组
diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CutTrussTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CutTrussTask.java
index 1d069ee94..93cecf3d0 100644
--- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CutTrussTask.java
+++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CutTrussTask.java
@@ -208,6 +208,7 @@ public class CutTrussTask extends AbstractAcsTask {
}
//如果桁架任务执行完,右侧的输送线上存在气涨轴,则生成一个输送出的任务
+ log.debug("如果桁架任务执行完,右侧的输送线上存在气涨轴,则生成一个输送出的任务");
char dtl_type = jsonTask.getString("point_code1").charAt(jsonTask.getString("point_code1").length() - 1);
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
String point_location = delivery_point.getString("point_location");
@@ -221,11 +222,13 @@ public class CutTrussTask extends AbstractAcsTask {
.addParam("find_type", "3")
.addParam("flag", "17").process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(right_point)){
+ log.debug("生成一个输送线出库任务");
//生成一个输送线出库任务
JSONObject form = new JSONObject();
form.put("point_code1", jsonTask.getString("point_code1"));
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + delivery_point.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
form.put("point_code2", ss_jo.getString("point_code"));
+ //分切输送出
form.put("task_type", "010401");
cutConveyorTask.createTask(form);
}
@@ -299,6 +302,7 @@ public class CutTrussTask extends AbstractAcsTask {
json.put("acs_task_type", "6");
tab.insert(json);
+ //桁架标准任务
if (form.getString("task_type").equals("010403")) {
//更新入站气涨轴的分切计划状态
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + json.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '03'").getResultJSONArray(0);
@@ -325,6 +329,7 @@ public class CutTrussTask extends AbstractAcsTask {
}
}
+ //分切>输送线 子卷出站
if (form.getString("task_type").equals("010404")) {
//更新出站气涨轴的分切计划状态
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + json.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '05'").getResultJSONArray(0);
@@ -338,7 +343,7 @@ public class CutTrussTask extends AbstractAcsTask {
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
}
}
-
+ //分切>输送线 子卷入站
if (form.getString("task_type").equals("010405")) {
//更新入站气涨轴的分切计划状态
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + json.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '03'").getResultJSONArray(0);