This commit is contained in:
2022-08-08 19:36:21 +08:00
parent 02f5ec1bd3
commit 6ea0f433ce
9 changed files with 34 additions and 28 deletions

View File

@@ -174,6 +174,8 @@
status_type = '05'
AND
IFNULL( end_time, '' ) = ''
and
device.is_active = '1'
OPTION 输入.workprocedure_id <> ""
device.workprocedure_id = 输入.workprocedure_id
ENDOPTION
@@ -192,6 +194,8 @@
status_type = '03'
AND
IFNULL( end_time, '' ) = ''
and
device.is_active = '1'
OPTION 输入.workprocedure_id <> ""
device.workprocedure_id = 输入.workprocedure_id
ENDOPTION
@@ -209,6 +213,8 @@
INNER JOIN pdm_bi_devicerunstatusrecord run ON run.device_id = device.device_id AND IFNULL(run.end_time,'') =''
WHERE
shift.is_delete = '0'
and
device.is_active = '1'
AND
shift.order_status <> '04'
AND
@@ -258,6 +264,8 @@
pdm_bi_device device
LEFT JOIN pdm_bi_devicerunstatusrecord run ON run.device_id = device.device_id AND IFNULL(run.end_time,'') = ''
LEFT JOIN pdm_bi_workprocedure pro ON pro.workprocedure_id = device.workprocedure_id
where
device.is_active = '1'
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -66,11 +66,12 @@
:visible.sync="devicedialogVisible"
width="35%"
:before-close="handleClose">
<el-form :model="deviceForm" status-icon label-width="120px" ref="deviceForm" class="demo-ruleForm">
<el-form :model="deviceForm" status-icon label-width="90px" ref="deviceForm" class="demo-ruleForm">
<el-form-item label="选择设备" prop="device_id">
<el-select
v-model="deviceForm.device_id"
clearable
filterable
size="mini"
class="filter-item"
>
@@ -94,7 +95,7 @@
:visible.sync="reportdialogVisibler"
width="35%"
:before-close="handleClose">
<el-form :model="reportForm" status-icon ref="reportForm" label-width="120px" class="demo-ruleForm">
<el-form :model="reportForm" status-icon ref="reportForm" label-width="90px" class="demo-ruleForm">
<el-form-item label="生产数量" prop="produce_qty">
<el-input disabled v-model="reportForm.produce_qty" />
</el-form-item>

View File

@@ -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){

View File

@@ -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)) {

View File

@@ -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;

View File

@@ -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"));

View File

@@ -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());

View File

@@ -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();

View File

@@ -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);
}
}