更新
This commit is contained in:
@@ -319,13 +319,13 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
|
||||
synchronized (this){
|
||||
long now_feedTime = System.currentTimeMillis();
|
||||
if (now_feedTime - last_feedDeviceStatusTime >= 3000){
|
||||
if (now_feedTime - last_feedDeviceStatusTime >= 5000){
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
if (heartbeat == last_heartbeat){
|
||||
status_type = 01;
|
||||
} else {
|
||||
status_type = 02;
|
||||
if (error > 0) {
|
||||
if (error == 1 || error == 51) {
|
||||
status_type = 05;
|
||||
}else if (mode == 1 && order > 0) {
|
||||
status_type = 03;
|
||||
@@ -371,7 +371,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
|
||||
if ( mode == 1 && order_finish == 1 && order > 0){
|
||||
if ( mode == 1 && order_finish == 1 && last_order_finish != order_finish && order > 0){
|
||||
ProduceshiftorderDto dto = new ProduceshiftorderDto();
|
||||
dto.setOrder_code(order + "");
|
||||
dto.setOrder_status("2");
|
||||
@@ -396,7 +396,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
this.writing("to_pause","1");
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,任务确认完成,电器信号写入成功");
|
||||
}else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move + ",order_finish>"+ order_finish +",last_order_finish>"+last_order_finish);
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,mode:"+mode + ",order_finish>"+ order_finish +",last_order_finish>"+last_order_finish + "order:" + order);
|
||||
}
|
||||
|
||||
if(!requireSucess){
|
||||
|
||||
@@ -263,13 +263,13 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
synchronized (this){
|
||||
long now_feedTime = System.currentTimeMillis();
|
||||
if (now_feedTime - last_feedDeviceStatusTime >= 3000){
|
||||
if (now_feedTime - last_feedDeviceStatusTime >= 5000){
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
if (heartbeat == last_heartbeat){
|
||||
status_type = 01;
|
||||
} else {
|
||||
status_type = 02;
|
||||
if (error > 0) {
|
||||
if (error == 1 || error == 51) {
|
||||
status_type = 05;
|
||||
}else if (mode == 1 && order > 0) {
|
||||
status_type = 03;
|
||||
@@ -341,6 +341,8 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
this.writing("to_pause", "1");
|
||||
this.writing("to_order", "0");
|
||||
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,任务确认完成,电器信号写入成功");
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,order_finish>"+ order_finish +",last_order_finish>"+last_order_finish + "mode:" + mode + "order:" + order);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
|
||||
@@ -353,13 +353,13 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
synchronized (this){
|
||||
long now_feedTime = System.currentTimeMillis();
|
||||
if (now_feedTime - last_feedDeviceStatusTime >= 3000){
|
||||
if (now_feedTime - last_feedDeviceStatusTime >= 5000){
|
||||
heartbeat = this.itemProtocol.getHeartbeat();
|
||||
if (heartbeat == last_heartbeat){
|
||||
status_type = 01;
|
||||
} else {
|
||||
status_type = 02;
|
||||
if (error > 0) {
|
||||
if (error == 1 || error == 51) {
|
||||
status_type = 05;
|
||||
}else if (mode == 1 && order > 0) {
|
||||
status_type = 03;
|
||||
@@ -431,7 +431,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
this.writing("to_order", "0");
|
||||
this.writing("to_pause","1");
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,order_finish>"+ finish +",last_finish>"+last_finish);
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,finish>"+ finish +",last_finish>"+last_finish + "mode:" + mode + "order:" + order);
|
||||
}
|
||||
}
|
||||
last_mode = mode;
|
||||
|
||||
@@ -216,6 +216,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_mode, "手自动状态", "DB1.B1.7", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(item_is_open, "线体是否启动", "DB1.B0.1"));
|
||||
list.add(new ItemDto(item_running, "是否运行", "DB1.B0.6"));
|
||||
list.add(new ItemDto(item_finish, "订单完成", "DB1.B1.2"));
|
||||
list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.B1.6"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.W4"));
|
||||
list.add(new ItemDto(item_order_compel_finish, "订单强制完成", "DB1.B2.0"));
|
||||
|
||||
@@ -663,7 +663,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
}
|
||||
//强制完成
|
||||
if (type.equals("3")){
|
||||
hailiangSpecialDeviceDriver.writing("to_order_compel_finished","0");
|
||||
hailiangSpecialDeviceDriver.writing("to_order_compel_finished","1");
|
||||
obj.setOrder_status("3");
|
||||
obj.setUpdate_by("mes");
|
||||
obj.setUpdate_time(DateUtil.now());
|
||||
@@ -693,7 +693,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
}
|
||||
//强制完成
|
||||
if (type.equals("3")){
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order_compel_finished","0");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order_compel_finished","1");
|
||||
obj.setOrder_status("3");
|
||||
obj.setUpdate_by("mes");
|
||||
obj.setUpdate_time(DateUtil.now());
|
||||
|
||||
@@ -237,12 +237,15 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
||||
HailiangSpecialDeviceDriver hailiangSpecialDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof HailiangSpecialDeviceDriver){
|
||||
hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver();
|
||||
hailiangSpecialDeviceDriver.writing("to_confirm_finished","1");
|
||||
hailiangSpecialDeviceDriver.writing("to_order","0");
|
||||
} else if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){
|
||||
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver();
|
||||
hailiangPackerStationDeviceDriver.writing("to_confirm_finished","1");
|
||||
hailiangPackerStationDeviceDriver.writing("to_order","0");
|
||||
} else if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){
|
||||
hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver();
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_confirm_finished","1");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order","0");
|
||||
}
|
||||
}
|
||||
@@ -332,17 +335,17 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
||||
HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof HailiangSpecialDeviceDriver) {
|
||||
hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver();
|
||||
hailiangSpecialDeviceDriver.writing("to_order_compel_finished", "1");
|
||||
hailiangSpecialDeviceDriver.writing("to_confirm_finished","1");
|
||||
hailiangSpecialDeviceDriver.writing("to_order", "0");
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) {
|
||||
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver();
|
||||
hailiangPackerStationDeviceDriver.writing("to_order_compel_finished", "1");
|
||||
hailiangPackerStationDeviceDriver.writing("to_confirm_finished","1");
|
||||
hailiangPackerStationDeviceDriver.writing("to_order", "0");
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) {
|
||||
hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver();
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order_compel_finished", "1");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_confirm_finished","1");
|
||||
hailiangEngravingMachineDeviceDriver.writing("to_order", "0");
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.start;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -10,6 +11,7 @@ import org.nl.modules.quartz.repository.QuartzJobRepository;
|
||||
import org.nl.modules.quartz.utils.QuartzManage;
|
||||
import org.nl.start.auto.initial.ApplicationAutoInitialExecuter;
|
||||
import org.nl.start.auto.initial.WebAutoInitialExecuter;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wql.WQLCore;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
@@ -43,20 +45,9 @@ public class Init implements ApplicationRunner {
|
||||
initQuartz();
|
||||
isStart = true;
|
||||
System.out.println("系统启动成功!");
|
||||
// test();
|
||||
}
|
||||
private void test(){
|
||||
WQLObject cellTab = WQLObject.getWQLObject("acs_storage_cell");
|
||||
WQLObject deviceTab = WQLObject.getWQLObject("acs_device");
|
||||
JSONObject jsonObject = cellTab.query("storage_id = '13ddf528b64249b1818504545a7586c9'").uniqueResult(0);
|
||||
JSONArray arr = deviceTab.query().getResultJSONArray(0);
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
jsonObject.put("storage_id", IdUtil.simpleUUID());
|
||||
jsonObject.put("storage_code", json.getString("device_code"));
|
||||
jsonObject.put("parent_storage_code", json.getString("device_code"));
|
||||
cellTab.insert(jsonObject);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user