更新
This commit is contained in:
@@ -69,6 +69,10 @@ public interface OpcDeviceDriver extends DeviceDriver {
|
|||||||
return (String) this.getOpcValueAccessor().getValue(this.getItem(protocol));
|
return (String) this.getOpcValueAccessor().getValue(this.getItem(protocol));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default Float getFloatValue(String protocol) {
|
||||||
|
return (Float) this.getOpcValueAccessor().getValue(this.getItem(protocol));
|
||||||
|
}
|
||||||
|
|
||||||
default Object getValue(String protocol) {
|
default Object getValue(String protocol) {
|
||||||
return this.getOpcValueAccessor().getValue(this.getItem(protocol));
|
return this.getOpcValueAccessor().getValue(this.getItem(protocol));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
|
|||||||
int labeling_order = 0;
|
int labeling_order = 0;
|
||||||
int detail_labeling_qualified_qty = 0;
|
int detail_labeling_qualified_qty = 0;
|
||||||
int detail_labeling_qty = 0;
|
int detail_labeling_qty = 0;
|
||||||
int line_speed = 0;
|
Float line_speed = 0.0f;
|
||||||
int feeding_mouth = 0;
|
int feeding_mouth = 0;
|
||||||
int is_lettering = 0;
|
int is_lettering = 0;
|
||||||
int is_risking = 0;
|
int is_risking = 0;
|
||||||
@@ -79,7 +79,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
|
|||||||
int is_labeling = 0;
|
int is_labeling = 0;
|
||||||
int delay_time = 0;
|
int delay_time = 0;
|
||||||
int lettering_frequency = 0;
|
int lettering_frequency = 0;
|
||||||
int one_speed = 0;
|
Float one_speed = 0.0f;
|
||||||
int coating_frequency = 0;
|
int coating_frequency = 0;
|
||||||
|
|
||||||
int last_mode = 0;
|
int last_mode = 0;
|
||||||
@@ -104,7 +104,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
|
|||||||
int last_labeling_order = 0;
|
int last_labeling_order = 0;
|
||||||
int last_detail_labeling_qualified_qty = 0;
|
int last_detail_labeling_qualified_qty = 0;
|
||||||
int last_detail_labeling_qty = 0;
|
int last_detail_labeling_qty = 0;
|
||||||
int last_line_speed = 0;
|
Float last_line_speed = 0.0f;
|
||||||
int last_feeding_mouth = 0;
|
int last_feeding_mouth = 0;
|
||||||
int last_is_lettering = 0;
|
int last_is_lettering = 0;
|
||||||
int last_is_risking = 0;
|
int last_is_risking = 0;
|
||||||
@@ -113,7 +113,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
|
|||||||
int last_is_labeling = 0;
|
int last_is_labeling = 0;
|
||||||
int last_delay_time = 0;
|
int last_delay_time = 0;
|
||||||
int last_lettering_frequency = 0;
|
int last_lettering_frequency = 0;
|
||||||
int last_one_speed = 0;
|
Float last_one_speed = 0.0f;
|
||||||
int last_coating_frequency = 0;
|
int last_coating_frequency = 0;
|
||||||
|
|
||||||
Boolean send_letter_flag_back = false;
|
Boolean send_letter_flag_back = false;
|
||||||
@@ -520,6 +520,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
|
|||||||
public boolean apply_order() throws Exception {
|
public boolean apply_order() throws Exception {
|
||||||
ProduceshiftorderDto dto = produceshiftorderService.apply_order();
|
ProduceshiftorderDto dto = produceshiftorderService.apply_order();
|
||||||
if(ObjectUtil.isEmpty(dto)){
|
if(ObjectUtil.isEmpty(dto)){
|
||||||
|
logServer.deviceLogToacs(this.device_code,"","","未找到");
|
||||||
throw new BadRequestException("未找到可下发工单!");
|
throw new BadRequestException("未找到可下发工单!");
|
||||||
}
|
}
|
||||||
String order = dto.getOrder_code();
|
String order = dto.getOrder_code();
|
||||||
@@ -592,8 +593,8 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
|
|||||||
writing(ItemProtocol.item_to_coating_qty,strap_pack_number);
|
writing(ItemProtocol.item_to_coating_qty,strap_pack_number);
|
||||||
writing(ItemProtocol.item_to_labeling_qty,strap_pack_number);
|
writing(ItemProtocol.item_to_labeling_qty,strap_pack_number);
|
||||||
writing(ItemProtocol.item_to_command,String.valueOf(mode));
|
writing(ItemProtocol.item_to_command,String.valueOf(mode));
|
||||||
// dto.setOrder_detail_status("01");
|
dto.setOrder_detail_status("02");
|
||||||
// produceshiftorderdetailService.update(dto);
|
produceshiftorderdetailService.update(dto);
|
||||||
send_letter_flag = false;
|
send_letter_flag = false;
|
||||||
send_letter_flag_back = false;
|
send_letter_flag_back = false;
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.acs.device_driver.hailiang.hailiang_feeding_trunk;
|
package org.nl.acs.device_driver.hailiang.hailiang_feeding_trunk;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||||
|
|
||||||
@@ -182,8 +183,8 @@ public class ItemProtocol {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public int getLine_speed() {
|
public Float getLine_speed() {
|
||||||
return this.getOpcIntegerValue(item_line_speed);
|
return this.getOpcFloatValue(item_line_speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getFeeding_mouth() {
|
public int getFeeding_mouth() {
|
||||||
@@ -218,8 +219,8 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_lettering_frequency);
|
return this.getOpcIntegerValue(item_lettering_frequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getOne_speed() {
|
public Float getOne_speed() {
|
||||||
return this.getOpcIntegerValue(item_one_speed);
|
return this.getOpcFloatValue(item_one_speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCoating_frequency() {
|
public int getCoating_frequency() {
|
||||||
@@ -367,6 +368,27 @@ public class ItemProtocol {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Float getOpcFloatValue(String protocol) {
|
||||||
|
Float value = this.driver.getFloatValue(protocol);
|
||||||
|
if (ObjectUtil.isEmpty(value)) {
|
||||||
|
// log.error("读取错误!");
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpcStringValue(String protocol) {
|
||||||
|
String value = this.driver.getStringValue(protocol);
|
||||||
|
if (value == null) {
|
||||||
|
// log.error("读取错误!");
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
|
||||||
public static List<ItemDto> getReadableItemDtos() {
|
public static List<ItemDto> getReadableItemDtos() {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB600.W0"));
|
list.add(new ItemDto(item_heartbeat, "心跳", "DB600.W0"));
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void autoInitial() throws Exception {
|
public void autoInitial() throws Exception {
|
||||||
//this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void reload() {
|
public synchronized void reload() {
|
||||||
@@ -69,7 +69,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
|
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
|
||||||
String where = "1=1 and is_deleted= '0'";
|
String where = "1=1 and is_deleted= '0' and (order_status !='07' or order_status !='08' or order_status !='09' )";
|
||||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), where, "order_id desc");
|
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), where, "order_id desc");
|
||||||
final JSONObject json = rb.pageResult();
|
final JSONObject json = rb.pageResult();
|
||||||
JSONArray newja = new JSONArray();
|
JSONArray newja = new JSONArray();
|
||||||
@@ -464,9 +464,8 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
|||||||
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
|
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
|
||||||
JSONObject json= (JSONObject) JSONObject.toJSON(entity);
|
JSONObject json= (JSONObject) JSONObject.toJSON(entity);
|
||||||
wo.update(json);
|
wo.update(json);
|
||||||
|
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("is_deleted","1");
|
map.put("order_status","09");
|
||||||
WQLObject.getWQLObject("acs_produceshiftorderdetail").update(map,"order_id = '"+ id + "'");
|
WQLObject.getWQLObject("acs_produceshiftorderdetail").update(map,"order_id = '"+ id + "'");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -489,7 +488,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
|||||||
List<HaiLiangFeedingTrunkDeviceDriver> deviceAll = deviceAppService.findDeviceDriver(HaiLiangFeedingTrunkDeviceDriver.class);
|
List<HaiLiangFeedingTrunkDeviceDriver> deviceAll = deviceAppService.findDeviceDriver(HaiLiangFeedingTrunkDeviceDriver.class);
|
||||||
if (deviceAll.get(0) instanceof HaiLiangFeedingTrunkDeviceDriver) {
|
if (deviceAll.get(0) instanceof HaiLiangFeedingTrunkDeviceDriver) {
|
||||||
haiLiangFeedingTrunkDeviceDriver = (HaiLiangFeedingTrunkDeviceDriver) deviceAll.get(0);
|
haiLiangFeedingTrunkDeviceDriver = (HaiLiangFeedingTrunkDeviceDriver) deviceAll.get(0);
|
||||||
if(haiLiangFeedingTrunkDeviceDriver.getMode() !=2 || haiLiangFeedingTrunkDeviceDriver.getReady() != 1){
|
if(haiLiangFeedingTrunkDeviceDriver.getMode() <2 || haiLiangFeedingTrunkDeviceDriver.getReady() != 1){
|
||||||
throw new BadRequestException("设备未就绪,无法下发!");
|
throw new BadRequestException("设备未就绪,无法下发!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ public class ProduceshiftorderdetailServiceImpl implements Produceshiftorderdeta
|
|||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!StrUtil.equals(dto.getOrder_detail_status(), "07") || !StrUtil.equals(dto.getOrder_detail_status(), "08")) {
|
if (!StrUtil.equals(dto.getOrder_detail_status(), "07") || !StrUtil.equals(dto.getOrder_detail_status(), "08")
|
||||||
|
||!StrUtil.equals(dto.getOrder_detail_status(), "09")) {
|
||||||
detail.add(dto);
|
detail.add(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +249,7 @@ public class ProduceshiftorderdetailServiceImpl implements Produceshiftorderdeta
|
|||||||
String msg1 = dto.getLettering_message();
|
String msg1 = dto.getLettering_message();
|
||||||
String msg2 = dto.getLettering_message2();
|
String msg2 = dto.getLettering_message2();
|
||||||
String icon = dto.getLettering_icon();
|
String icon = dto.getLettering_icon();
|
||||||
|
message = msg1 + msg2;
|
||||||
//清缓存
|
//清缓存
|
||||||
try {
|
try {
|
||||||
LetteringSocketConnectionAutoRun.write("BUFFERCLEAR" + "\r\n");
|
LetteringSocketConnectionAutoRun.write("BUFFERCLEAR" + "\r\n");
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
diff a/src/router/routers.js b/src/router/routers.js (rejected hunks)
|
|
||||||
@@ -52,7 +52,7 @@
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'dashboard',
|
|
||||||
- component: (resolve) => require(['@/views/acs/monitor/device/index'], resolve),
|
|
||||||
+ component: (resolve) => require(['@/views/home2'], resolve),
|
|
||||||
name: 'Dashboard',
|
|
||||||
meta: { title: '首页', icon: 'index', affix: true, noCache: false }
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user