From faed2be0024babbba02ed3651c0372b22c0757db Mon Sep 17 00:00:00 2001 From: loujf Date: Mon, 6 Jun 2022 14:32:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=9B=91=E6=8E=A7=E8=88=9E?= =?UTF-8?q?=E5=8F=B0=E9=A1=B5=E9=9D=A2=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HaiLiangCoatingDeviceDriver.java | 9 +- .../HaiLiangFeedingDeviceDriver.java | 25 +- .../HaiLiangFeedingTrunkDeviceDriver.java | 105 ++++++- .../HaiLiangLabelingDeviceDriver.java | 12 +- .../HaiLiangLetteringDeviceDriver.java | 13 +- .../HaiLiangRiskingDeviceDriver.java | 9 +- .../HaiLiangStrappingDeviceDriver.java | 26 +- .../service/impl/StageActorServiceImpl.java | 257 ++++++++++++++++++ 8 files changed, 436 insertions(+), 20 deletions(-) diff --git a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java index 3019ef5..d033d27 100644 --- a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java +++ b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java @@ -50,6 +50,7 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme int error = 0; int last_error = 0; int move = 0; + int last_move = 0; int order = 0; int last_order = 0; int order_detail = 0; @@ -84,6 +85,10 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); this.setRequireSucess(false); } + if (move != last_move) { + logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); + logServer.deviceLogToacs(this.device_code,"","","信号move:" + last_move + "->" + move); + } if (error != last_error) { logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); @@ -94,7 +99,7 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme } if (order_detail != last_order_detail) { logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail); + logServer.deviceLogToacs(this.device_code,"","","信号order_detail:" + last_order_detail + "->" + order_detail); } if (detail_qty != last_detail_qty) { logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty)); @@ -141,7 +146,7 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme } } last_mode = mode; - last_mode = mode; + last_move = move; last_error = error; last_order = order; last_order_detail = order_detail; diff --git a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/HaiLiangFeedingDeviceDriver.java b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/HaiLiangFeedingDeviceDriver.java index 028eac4..0534694 100644 --- a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/HaiLiangFeedingDeviceDriver.java +++ b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/HaiLiangFeedingDeviceDriver.java @@ -53,10 +53,15 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme int error = 0; int last_error = 0; int move = 0; + int last_move = 0; int order = 0; int last_order = 0; int order_detail = 0; int last_order_detail = 0; + int order_qty = 0; + int last_order_qty = 0; + int order_qualified_qty = 0; + int last_order_qualified_qty = 0; int detail_qty = 0; int last_detail_qty = 0; int detail_qualified_qty = 0; @@ -76,6 +81,8 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme error = this.itemProtocol.getError(); order = this.itemProtocol.getOrder(); order_detail = this.itemProtocol.getOrder_detail(); + order_qty = this.itemProtocol.getOrder_qty(); + order_qualified_qty = this.itemProtocol.getOrder_qualified_qty(); //当前工单明细号上料数量 detail_qty = this.itemProtocol.getDetail_qty(); //当前工单明细号上料合格数量 @@ -89,13 +96,25 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); } + if (move != last_move) { + logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); + logServer.deviceLogToacs(this.device_code,"","","信号move:" + last_move + "->" + move); + } if (order != last_order) { logServer.deviceLog(this.device_code,"order" ,String.valueOf(order)); logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order); } if (order_detail != last_order_detail) { logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail); + logServer.deviceLogToacs(this.device_code,"","","信号order_detail:" + last_order_detail + "->" + order_detail); + } + if (order_qty != last_order_qty) { + logServer.deviceLog(this.device_code,"order_qty" ,String.valueOf(order_qty)); + logServer.deviceLogToacs(this.device_code,"","","信号order_qty:" + last_order_qty + "->" + order_qty); + } + if (order_qualified_qty != last_order_qualified_qty) { + logServer.deviceLog(this.device_code,"order_qualified_qty" ,String.valueOf(order_qualified_qty)); + logServer.deviceLogToacs(this.device_code,"","","信号order_qualified_qty:" + last_order_qualified_qty + "->" + order_qualified_qty); } if (detail_qty != last_detail_qty) { logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty)); @@ -142,10 +161,12 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme } } last_mode = mode; - last_mode = mode; + last_move = move; last_error = error; last_order = order; last_order_detail = order_detail; + last_order_qty = order_qty; + last_order_qualified_qty = order_qualified_qty; last_detail_qty = detail_qty; last_detail_qualified_qty = detail_qualified_qty; diff --git a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java index 212fa5e..1792cfc 100644 --- a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java +++ b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java @@ -70,6 +70,17 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im int labeling_order = 0; int detail_labeling_qualified_qty = 0; int detail_labeling_qty = 0; + int line_speed = 0; + int feeding_mouth = 0; + int is_lettering = 0; + int is_risking = 0; + int is_coating = 0; + int is_strapping = 0; + int is_labeling = 0; + int delay_time = 0; + int lettering_frequency = 0; + int one_speed = 0; + int coating_frequency = 0; int last_mode = 0; int last_error = 0; @@ -93,6 +104,17 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im int last_labeling_order = 0; int last_detail_labeling_qualified_qty = 0; int last_detail_labeling_qty = 0; + int last_line_speed = 0; + int last_feeding_mouth = 0; + int last_is_lettering = 0; + int last_is_risking = 0; + int last_is_coating = 0; + int last_is_strapping = 0; + int last_is_labeling = 0; + int last_delay_time = 0; + int last_lettering_frequency = 0; + int last_one_speed = 0; + int last_coating_frequency = 0; Boolean send_letter_flag_back = false; Boolean send_letter_flag = false; @@ -138,7 +160,17 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im detail_labeling_qualified_qty = this.itemProtocol.getDetail_strapping_qty(); //当前贴标工单明细号贴标数 detail_labeling_qty = this.itemProtocol.getDetail_labeling_qty(); - + line_speed = this.itemProtocol.getLine_speed(); + feeding_mouth = this.itemProtocol.getFeeding_mouth(); + is_lettering = this.itemProtocol.getIs_lettering(); + is_labeling = this.itemProtocol.getIs_labeling(); + is_risking = this.itemProtocol.getIs_risking(); + is_coating = this.itemProtocol.getIs_coating(); + is_strapping = this.itemProtocol.getIs_strapping(); + delay_time = this.itemProtocol.getDelay_time(); + lettering_frequency = this.itemProtocol.getLettering_frequency(); + one_speed = this.itemProtocol.getOne_speed(); + coating_frequency = this.itemProtocol.getCoating_frequency(); if (mode != last_mode) { this.setRequireSucess(false); @@ -265,6 +297,66 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im logServer.deviceLog(this.device_code,"detail_labeling_qty" ,String.valueOf(detail_labeling_qty)); logServer.deviceLogToacs(this.device_code,"","","信号detail_labeling_qty:" + last_detail_labeling_qty + "->" + detail_labeling_qty); } + if(line_speed != last_line_speed) + { + logServer.deviceLog(this.device_code,"line_speed" ,String.valueOf(line_speed)); + logServer.deviceLogToacs(this.device_code,"","","信号line_speed:" + last_line_speed + "->" + line_speed); + } + if(feeding_mouth != last_feeding_mouth) + { + logServer.deviceLog(this.device_code,"feeding_mouth" ,String.valueOf(feeding_mouth)); + logServer.deviceLogToacs(this.device_code,"","","信号feeding_mouth:" + last_feeding_mouth + "->" + feeding_mouth); + } + if(is_lettering != last_is_lettering) + { + logServer.deviceLog(this.device_code,"is_lettering" ,String.valueOf(is_lettering)); + logServer.deviceLogToacs(this.device_code,"","","信号is_lettering:" + last_is_lettering + "->" + is_lettering); + } + if(is_risking != last_is_risking) + { + logServer.deviceLog(this.device_code,"is_risking" ,String.valueOf(is_risking)); + logServer.deviceLogToacs(this.device_code,"","","信号is_risking:" + last_is_risking + "->" + is_risking); + } + if(is_coating != last_is_coating) + { + logServer.deviceLog(this.device_code,"is_coating" ,String.valueOf(is_coating)); + logServer.deviceLogToacs(this.device_code,"","","信号is_coating:" + last_is_coating + "->" + is_coating); + } + if(is_strapping != last_is_strapping) + { + logServer.deviceLog(this.device_code,"is_strapping" ,String.valueOf(is_strapping)); + logServer.deviceLogToacs(this.device_code,"","","信号is_strapping:" + last_is_strapping + "->" + is_strapping); + } + if(is_labeling != last_is_labeling) + { + logServer.deviceLog(this.device_code,"is_labeling" ,String.valueOf(is_labeling)); + logServer.deviceLogToacs(this.device_code,"","","信号is_labeling:" + last_is_labeling + "->" + is_labeling); + } + if(delay_time != last_delay_time) + { + logServer.deviceLog(this.device_code,"delay_time" ,String.valueOf(delay_time)); + logServer.deviceLogToacs(this.device_code,"","","信号delay_time:" + last_delay_time + "->" + delay_time); + } + if(delay_time != last_delay_time) + { + logServer.deviceLog(this.device_code,"delay_time" ,String.valueOf(delay_time)); + logServer.deviceLogToacs(this.device_code,"","","信号delay_time:" + last_delay_time + "->" + delay_time); + } + if(lettering_frequency != last_lettering_frequency) + { + logServer.deviceLog(this.device_code,"lettering_frequency" ,String.valueOf(lettering_frequency)); + logServer.deviceLogToacs(this.device_code,"","","信号lettering_frequency:" + last_lettering_frequency + "->" + lettering_frequency); + } + if(one_speed != last_one_speed) + { + logServer.deviceLog(this.device_code,"one_speed" ,String.valueOf(one_speed)); + logServer.deviceLogToacs(this.device_code,"","","信号one_speed:" + last_one_speed + "->" + one_speed); + } + if(coating_frequency != last_coating_frequency) + { + logServer.deviceLog(this.device_code,"coating_frequency" ,String.valueOf(coating_frequency)); + logServer.deviceLogToacs(this.device_code,"","","信号coating_frequency:" + last_coating_frequency + "->" + coating_frequency); + } try{ if(order >0 && order_detail>0){ @@ -332,6 +424,17 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im last_labeling_order = labeling_order; last_detail_labeling_qualified_qty = detail_labeling_qualified_qty; last_detail_labeling_qty = detail_labeling_qty; + last_line_speed = line_speed; + last_feeding_mouth = feeding_mouth; + last_is_coating = is_coating; + last_is_labeling = is_labeling; + last_is_lettering = is_lettering; + last_is_risking = is_risking; + last_is_strapping = is_strapping; + last_delay_time = delay_time; + last_lettering_frequency = lettering_frequency; + last_one_speed = one_speed; + last_coating_frequency = coating_frequency; } public synchronized boolean update_detail(String order, String order_detail) throws Exception { diff --git a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java index 06d2066..b5689ab 100644 --- a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java +++ b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java @@ -5,8 +5,6 @@ import cn.hutool.core.util.StrUtil; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; @@ -16,7 +14,6 @@ import org.nl.acs.opc.Device; import org.nl.acs.order.service.LabelingTemplateService; import org.nl.acs.order.service.ProduceshiftorderService; import org.nl.acs.order.service.ProduceshiftorderdetailService; -import org.nl.acs.order.service.dto.LabelingTemplateDto; import org.nl.acs.order.service.dto.ProduceshiftorderDto; import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto; import org.nl.exception.BadRequestException; @@ -60,6 +57,7 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem int error = 0; int last_error = 0; int move = 0; + int last_move = 0; int order = 0; int last_order = 0; int order_detail = 0; @@ -94,6 +92,10 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); this.setRequireSucess(false); } + if (move != last_move) { + logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); + logServer.deviceLogToacs(this.device_code,"","","信号move:" + last_move + "->" + move); + } if (error != last_error) { logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); @@ -104,7 +106,7 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem } if (order_detail != last_order_detail) { logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail); + logServer.deviceLogToacs(this.device_code,"","","信号order_detail:" + last_order_detail + "->" + order_detail); } if (detail_qty != last_detail_qty) { logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty)); @@ -169,7 +171,7 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem } } last_mode = mode; - last_mode = mode; + last_move = move; last_error = error; last_order = order; last_order_detail = order_detail; diff --git a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java index 83d6544..f4c6db1 100644 --- a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java +++ b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java @@ -1,11 +1,8 @@ package org.nl.acs.device_driver.hailiang.hailiang_lettering; -import cn.hutool.core.util.ObjectUtil; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; @@ -15,7 +12,6 @@ import org.nl.acs.opc.Device; import org.nl.acs.order.service.ProduceshiftorderService; import org.nl.acs.order.service.ProduceshiftorderdetailService; import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto; -import org.nl.exception.BadRequestException; import org.nl.utils.SpringContextHolder; import org.openscada.opc.lib.da.Server; import org.springframework.beans.factory.annotation.Autowired; @@ -48,6 +44,7 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple int error = 0; int last_error = 0; int move = 0; + int last_move = 0; int order = 0; int last_order = 0; int order_detail = 0; @@ -87,6 +84,10 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); this.setRequireSucess(false); } + if (move != last_move) { + logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); + logServer.deviceLogToacs(this.device_code,"","","信号move:" + last_move + "->" + move); + } if (error != last_error) { logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); @@ -97,7 +98,7 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple } if (order_detail != last_order_detail) { logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail); + logServer.deviceLogToacs(this.device_code,"","","信号order_detail:" + last_order_detail + "->" + order_detail); } if (detail_qty != last_detail_qty) { logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty)); @@ -146,7 +147,7 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple } } last_mode = mode; - last_mode = mode; + last_move = move; last_error = error; last_order = order; last_order_detail = order_detail; diff --git a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/HaiLiangRiskingDeviceDriver.java b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/HaiLiangRiskingDeviceDriver.java index ef378ea..ccd1a23 100644 --- a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/HaiLiangRiskingDeviceDriver.java +++ b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/HaiLiangRiskingDeviceDriver.java @@ -45,6 +45,7 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme int error = 0; int last_error = 0; int move = 0; + int last_move = 0; int order = 0; int last_order = 0; int order_detail = 0; @@ -84,6 +85,10 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); this.setRequireSucess(false); } + if (move != last_move) { + logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); + logServer.deviceLogToacs(this.device_code,"","","信号move:" + last_move + "->" + move); + } if (error != last_error) { logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); @@ -94,7 +99,7 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme } if (order_detail != last_order_detail) { logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail); + logServer.deviceLogToacs(this.device_code,"","","信号order_detail:" + last_order_detail + "->" + order_detail); } if (detail_qty != last_detail_qty) { logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty)); @@ -141,7 +146,7 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme } } last_mode = mode; - last_mode = mode; + last_move = move; last_error = error; last_order = order; last_order_detail = order_detail; diff --git a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/HaiLiangStrappingDeviceDriver.java b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/HaiLiangStrappingDeviceDriver.java index 3ea0895..2d73eac 100644 --- a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/HaiLiangStrappingDeviceDriver.java +++ b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/HaiLiangStrappingDeviceDriver.java @@ -49,6 +49,7 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple int error = 0; int last_error = 0; int move = 0; + int last_move = 0; int order = 0; int last_order = 0; int order_detail = 0; @@ -57,6 +58,10 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple int last_detail_qty = 0; int detail_qualified_qty = 0; int last_detail_qualified_qty = 0; + int cache_qty = 0; + int last_cache_qty = 0; + int qty = 0; + int last_qty = 0; boolean requireSucess = false; @@ -77,11 +82,18 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple detail_qty = this.itemProtocol.getDetail_qty(); //当前工单明细号上料合格数量 detail_qualified_qty = this.itemProtocol.getDetail_qualified_qty(); + cache_qty = this.itemProtocol.getCache_qty(); + qty = this.itemProtocol.getQty(); + if (mode != last_mode) { logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); this.setRequireSucess(false); } + if (move != last_move) { + logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); + logServer.deviceLogToacs(this.device_code,"","","信号move:" + last_move + "->" + move); + } if (error != last_error) { logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); @@ -92,7 +104,7 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple } if (order_detail != last_order_detail) { logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail); + logServer.deviceLogToacs(this.device_code,"","","信号order_detail:" + last_order_detail + "->" + order_detail); } if (detail_qty != last_detail_qty) { logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty)); @@ -102,6 +114,14 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple logServer.deviceLog(this.device_code,"detail_qualified_qty" ,String.valueOf(detail_qualified_qty)); logServer.deviceLogToacs(this.device_code,"","","信号detail_qualified_qty:" + last_detail_qualified_qty + "->" + detail_qualified_qty); } + if (cache_qty != last_cache_qty) { + logServer.deviceLog(this.device_code,"cache_qty" ,String.valueOf(cache_qty)); + logServer.deviceLogToacs(this.device_code,"","","信号cache_qty:" + last_cache_qty + "->" + cache_qty); + } + if (qty != last_qty) { + logServer.deviceLog(this.device_code,"qty" ,String.valueOf(qty)); + logServer.deviceLogToacs(this.device_code,"","","信号qty:" + last_qty + "->" + qty); + } } catch (Exception var17) { return; } @@ -139,12 +159,14 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple } } last_mode = mode; - last_mode = mode; + last_move = move; last_error = error; last_order = order; last_order_detail = order_detail; last_detail_qty = detail_qty; last_detail_qualified_qty = detail_qualified_qty; + last_cache_qty = cache_qty; + last_qty = qty; } public synchronized boolean update_detail(String order, String order_detail,String status) { diff --git a/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java b/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java index 34e26d3..1731013 100644 --- a/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java +++ b/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java @@ -13,6 +13,13 @@ import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.device_driver.electric_fence.ElectricFenceDeviceDriver; +import org.nl.acs.device_driver.hailiang.hailiang_coating.HaiLiangCoatingDeviceDriver; +import org.nl.acs.device_driver.hailiang.hailiang_feeding.HaiLiangFeedingDeviceDriver; +import org.nl.acs.device_driver.hailiang.hailiang_feeding_trunk.HaiLiangFeedingTrunkDeviceDriver; +import org.nl.acs.device_driver.hailiang.hailiang_labeling.HaiLiangLabelingDeviceDriver; +import org.nl.acs.device_driver.hailiang.hailiang_lettering.HaiLiangLetteringDeviceDriver; +import org.nl.acs.device_driver.hailiang.hailiang_risking.HaiLiangRiskingDeviceDriver; +import org.nl.acs.device_driver.hailiang.hailiang_strapping.HaiLiangStrappingDeviceDriver; import org.nl.acs.device_driver.machines_site.MachinesSiteDeviceDriver; import org.nl.acs.device_driver.non_line_inspect_site.NonLineInspectSiteDeviceDriver; import org.nl.acs.device_driver.non_line_manipulator_inspect_site.NonLineManipulatorInspectSiteDeviceDriver; @@ -323,6 +330,21 @@ public class StageActorServiceImpl implements StageActorService { StandardRGVDeviceDriver standardRGVDeviceDriver; //电子围栏 ElectricFenceDeviceDriver electricFenceDeviceDriver; + //海亮包装项目-上料总线体 + HaiLiangFeedingTrunkDeviceDriver haiLiangFeedingTrunkDeviceDriver; + //海亮包装项目-上料线体 + HaiLiangFeedingDeviceDriver haiLiangFeedingDeviceDriver; + //海亮包装项目-刻字线体 + HaiLiangLetteringDeviceDriver haiLiangLetteringDeviceDriver; + //海亮包装项目-套冒线体 + HaiLiangRiskingDeviceDriver haiLiangRiskingDeviceDriver; + //海亮包装项目-捆扎线体 + HaiLiangStrappingDeviceDriver haiLiangStrappingDeviceDriver; + //海亮包装项目-裹膜线体 + HaiLiangCoatingDeviceDriver haiLiangCoatingDeviceDriver; + //海亮包装项目-贴标线体 + HaiLiangLabelingDeviceDriver haiLiangLabelingDeviceDriver; + if (device.getDeviceDriver() instanceof StandardCoveyorControlDeviceDriver) { standardCoveyorControlDeviceDriver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); @@ -914,6 +936,241 @@ public class StageActorServiceImpl implements StageActorService { jo.put("error", electricFenceDeviceDriver.getError()); jo.put("isError", electricFenceDeviceDriver.getIserror()); } + else if (device.getDeviceDriver() instanceof HaiLiangFeedingTrunkDeviceDriver) { + haiLiangFeedingTrunkDeviceDriver = (HaiLiangFeedingTrunkDeviceDriver) device.getDeviceDriver(); + if (haiLiangFeedingTrunkDeviceDriver.getMode() == 0) { + mode = "未联机"; + } else if (haiLiangFeedingTrunkDeviceDriver.getMode() == 1) { + mode = "单机"; + } else if (haiLiangFeedingTrunkDeviceDriver.getMode() == 2) { + mode = "联机"; + } else if (haiLiangFeedingTrunkDeviceDriver.getMode() == 3) { + mode = "工作中"; + } else if (haiLiangFeedingTrunkDeviceDriver.getMode() == 4) { + mode = "申请工单"; + } else if (haiLiangFeedingTrunkDeviceDriver.getMode() == 5) { + mode = "申请工单明细号"; + } else if (haiLiangFeedingTrunkDeviceDriver.getMode() == 6) { + mode = "急停"; + } + obj.put("device_name", haiLiangFeedingTrunkDeviceDriver.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("error", haiLiangFeedingTrunkDeviceDriver.getError()); + jo.put("order", haiLiangFeedingTrunkDeviceDriver.getOrder()); + jo.put("order_detail", haiLiangFeedingTrunkDeviceDriver.getOrder_detail()); + jo.put("last_order_detail", haiLiangFeedingTrunkDeviceDriver.getLast_order_detail()); + jo.put("order_feeding_qty", haiLiangFeedingTrunkDeviceDriver.getOrder_feeding_qty()); + jo.put("detail_feeding_qty", haiLiangFeedingTrunkDeviceDriver.getDetail_feeding_qty()); + jo.put("detail_feeding_qualified_qty", haiLiangFeedingTrunkDeviceDriver.getDetail_feeding_qualified_qty()); + jo.put("detail_lettering_qty", haiLiangFeedingTrunkDeviceDriver.getDetail_lettering_qty()); + jo.put("detail_lettering_qualified_qty", haiLiangFeedingTrunkDeviceDriver.getDetail_lettering_qualified_qty()); + jo.put("detail_risking_qualified_qty", haiLiangFeedingTrunkDeviceDriver.getDetail_risking_qualified_qty()); + jo.put("detail_risking_qty", haiLiangFeedingTrunkDeviceDriver.getDetail_risking_qty()); + jo.put("detail_strapping_qty", haiLiangFeedingTrunkDeviceDriver.getDetail_strapping_qty()); + jo.put("detail_strapping_oneqty", haiLiangFeedingTrunkDeviceDriver.getDetail_strapping_oneqty()); + jo.put("detail_coating_qty", haiLiangFeedingTrunkDeviceDriver.getDetail_coating_qty()); + jo.put("labeling_order", haiLiangFeedingTrunkDeviceDriver.getLabeling_order()); + jo.put("detail_labeling_qualified_qty", haiLiangFeedingTrunkDeviceDriver.getDetail_labeling_qualified_qty()); + jo.put("detail_labeling_qty", haiLiangFeedingTrunkDeviceDriver.getDetail_labeling_qty()); + jo.put("ready", haiLiangFeedingTrunkDeviceDriver.getReady()); + jo.put("clear", haiLiangFeedingTrunkDeviceDriver.getClear()); + jo.put("pause", haiLiangFeedingTrunkDeviceDriver.getPause()); + jo.put("line_speed", haiLiangFeedingTrunkDeviceDriver.getLine_speed()); + jo.put("feeding_mouth", haiLiangFeedingTrunkDeviceDriver.getFeeding_mouth()); + jo.put("is_lettering", haiLiangFeedingTrunkDeviceDriver.getIs_lettering()); + jo.put("is_risking", haiLiangFeedingTrunkDeviceDriver.getIs_risking()); + jo.put("is_coating", haiLiangFeedingTrunkDeviceDriver.getIs_coating()); + jo.put("is_strapping", haiLiangFeedingTrunkDeviceDriver.getIs_strapping()); + jo.put("is_labeling", haiLiangFeedingTrunkDeviceDriver.getIs_labeling()); + jo.put("delay_time", haiLiangFeedingTrunkDeviceDriver.getDelay_time()); + jo.put("lettering_frequency", haiLiangFeedingTrunkDeviceDriver.getLettering_frequency()); + jo.put("one_speed", haiLiangFeedingTrunkDeviceDriver.getOne_speed()); + jo.put("coating_frequency", haiLiangFeedingTrunkDeviceDriver.getCoating_frequency()); + } + //海亮包装项目-上料线体 + else if (device.getDeviceDriver() instanceof HaiLiangFeedingDeviceDriver) { + haiLiangFeedingDeviceDriver = (HaiLiangFeedingDeviceDriver) device.getDeviceDriver(); + if (haiLiangFeedingDeviceDriver.getMode() == 0) { + mode = "未联机"; + } else if (haiLiangFeedingDeviceDriver.getMode() == 1) { + mode = "单机"; + } else if (haiLiangFeedingDeviceDriver.getMode() == 2) { + mode = "联机"; + } else if (haiLiangFeedingDeviceDriver.getMode() == 3) { + mode = "工作中"; + } else if (haiLiangFeedingDeviceDriver.getMode() == 4) { + mode = "上料完成"; + } else if (haiLiangFeedingDeviceDriver.getMode() == 5) { + mode = "强制上料完成"; + } + if (haiLiangFeedingDeviceDriver.getMove() == 0) { + move = "无货"; + } else if (haiLiangFeedingDeviceDriver.getMove() == 1) { + move = "有货"; + } + obj.put("device_name", haiLiangFeedingDeviceDriver.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("error", haiLiangFeedingDeviceDriver.getError()); + jo.put("order", haiLiangFeedingDeviceDriver.getOrder()); + jo.put("order_detail", haiLiangFeedingDeviceDriver.getOrder_detail()); + jo.put("order_qty", haiLiangFeedingDeviceDriver.getOrder_qty()); + jo.put("order_qualified_qty", haiLiangFeedingDeviceDriver.getOrder_qualified_qty()); + jo.put("detail_qty", haiLiangFeedingDeviceDriver.getDetail_qty()); + jo.put("detail_qualified_qty", haiLiangFeedingDeviceDriver.getDetail_qualified_qty()); + } + //海亮包装项目-刻字线体 + else if (device.getDeviceDriver() instanceof HaiLiangLetteringDeviceDriver) { + haiLiangLetteringDeviceDriver = (HaiLiangLetteringDeviceDriver) device.getDeviceDriver(); + if (haiLiangLetteringDeviceDriver.getMode() == 0) { + mode = "未联机"; + } else if (haiLiangLetteringDeviceDriver.getMode() == 1) { + mode = "单机"; + } else if (haiLiangLetteringDeviceDriver.getMode() == 2) { + mode = "联机"; + } else if (haiLiangLetteringDeviceDriver.getMode() == 3) { + mode = "工作中"; + } else if (haiLiangLetteringDeviceDriver.getMode() == 4) { + mode = "刻字完成"; + } else if (haiLiangLetteringDeviceDriver.getMode() == 5) { + mode = "强制刻字完成"; + } + if (haiLiangLetteringDeviceDriver.getMove() == 0) { + move = "无货"; + } else if (haiLiangLetteringDeviceDriver.getMove() == 1) { + move = "有货"; + } + obj.put("device_name", haiLiangLetteringDeviceDriver.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("error", haiLiangLetteringDeviceDriver.getError()); + jo.put("order", haiLiangLetteringDeviceDriver.getOrder()); + jo.put("order_detail", haiLiangLetteringDeviceDriver.getOrder_detail()); + jo.put("detail_qty", haiLiangLetteringDeviceDriver.getDetail_qty()); + jo.put("detail_qualified_qty", haiLiangLetteringDeviceDriver.getDetail_qualified_qty()); + } + //海亮包装项目-套冒线体 + else if (device.getDeviceDriver() instanceof HaiLiangRiskingDeviceDriver) { + haiLiangRiskingDeviceDriver = (HaiLiangRiskingDeviceDriver) device.getDeviceDriver(); + if (haiLiangRiskingDeviceDriver.getMode() == 0) { + mode = "未联机"; + } else if (haiLiangRiskingDeviceDriver.getMode() == 1) { + mode = "单机"; + } else if (haiLiangRiskingDeviceDriver.getMode() == 2) { + mode = "联机"; + } else if (haiLiangRiskingDeviceDriver.getMode() == 3) { + mode = "工作中"; + } else if (haiLiangRiskingDeviceDriver.getMode() == 4) { + mode = "套冒完成"; + } else if (haiLiangRiskingDeviceDriver.getMode() == 5) { + mode = "强制套冒完成"; + } + if (haiLiangRiskingDeviceDriver.getMove() == 0) { + move = "无货"; + } else if (haiLiangRiskingDeviceDriver.getMove() == 1) { + move = "有货"; + } + obj.put("device_name", haiLiangRiskingDeviceDriver.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("error", haiLiangRiskingDeviceDriver.getError()); + jo.put("order", haiLiangRiskingDeviceDriver.getOrder()); + jo.put("order_detail", haiLiangRiskingDeviceDriver.getOrder_detail()); + jo.put("detail_qty", haiLiangRiskingDeviceDriver.getDetail_qty()); + jo.put("detail_qualified_qty", haiLiangRiskingDeviceDriver.getDetail_qualified_qty()); + } + //海亮包装项目-捆扎线体 + else if (device.getDeviceDriver() instanceof HaiLiangStrappingDeviceDriver) { + haiLiangStrappingDeviceDriver = (HaiLiangStrappingDeviceDriver) device.getDeviceDriver(); + if (haiLiangStrappingDeviceDriver.getMode() == 0) { + mode = "未联机"; + } else if (haiLiangStrappingDeviceDriver.getMode() == 1) { + mode = "单机"; + } else if (haiLiangStrappingDeviceDriver.getMode() == 2) { + mode = "联机"; + } else if (haiLiangStrappingDeviceDriver.getMode() == 3) { + mode = "工作中"; + } else if (haiLiangStrappingDeviceDriver.getMode() == 4) { + mode = "捆扎完成"; + } else if (haiLiangStrappingDeviceDriver.getMode() == 5) { + mode = "强制捆扎完成"; + } + if (haiLiangStrappingDeviceDriver.getMove() == 0) { + move = "无货"; + } else if (haiLiangStrappingDeviceDriver.getMove() == 1) { + move = "有货"; + } + obj.put("device_name", haiLiangStrappingDeviceDriver.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("error", haiLiangStrappingDeviceDriver.getError()); + jo.put("order", haiLiangStrappingDeviceDriver.getOrder()); + jo.put("order_detail", haiLiangStrappingDeviceDriver.getOrder_detail()); + jo.put("detail_qty", haiLiangStrappingDeviceDriver.getDetail_qty()); + jo.put("detail_qualified_qty", haiLiangStrappingDeviceDriver.getDetail_qualified_qty()); + jo.put("cache_qty", haiLiangStrappingDeviceDriver.getCache_qty()); + jo.put("qty", haiLiangStrappingDeviceDriver.getQty()); + } + //海亮包装项目-裹膜线体 + else if (device.getDeviceDriver() instanceof HaiLiangCoatingDeviceDriver) { + haiLiangCoatingDeviceDriver = (HaiLiangCoatingDeviceDriver) device.getDeviceDriver(); + if (haiLiangCoatingDeviceDriver.getMode() == 0) { + mode = "未联机"; + } else if (haiLiangCoatingDeviceDriver.getMode() == 1) { + mode = "单机"; + } else if (haiLiangCoatingDeviceDriver.getMode() == 2) { + mode = "联机"; + } else if (haiLiangCoatingDeviceDriver.getMode() == 3) { + mode = "工作中"; + } else if (haiLiangCoatingDeviceDriver.getMode() == 4) { + mode = "裹膜完成"; + } else if (haiLiangCoatingDeviceDriver.getMode() == 5) { + mode = "强制裹膜完成"; + } + if (haiLiangCoatingDeviceDriver.getMove() == 0) { + move = "无货"; + } else if (haiLiangCoatingDeviceDriver.getMove() == 1) { + move = "有货"; + } + obj.put("device_name", haiLiangCoatingDeviceDriver.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("error", haiLiangCoatingDeviceDriver.getError()); + jo.put("order", haiLiangCoatingDeviceDriver.getOrder()); + jo.put("order_detail", haiLiangCoatingDeviceDriver.getOrder_detail()); + jo.put("detail_qty", haiLiangCoatingDeviceDriver.getDetail_qty()); + jo.put("detail_qualified_qty", haiLiangCoatingDeviceDriver.getDetail_qualified_qty()); + } + //海亮包装项目-贴标线体 + else if (device.getDeviceDriver() instanceof HaiLiangLabelingDeviceDriver) { + haiLiangLabelingDeviceDriver = (HaiLiangLabelingDeviceDriver) device.getDeviceDriver(); + if (haiLiangLabelingDeviceDriver.getMode() == 0) { + mode = "未联机"; + } else if (haiLiangLabelingDeviceDriver.getMode() == 1) { + mode = "单机"; + } else if (haiLiangLabelingDeviceDriver.getMode() == 2) { + mode = "联机"; + } else if (haiLiangLabelingDeviceDriver.getMode() == 3) { + mode = "工作中"; + } else if (haiLiangLabelingDeviceDriver.getMode() == 4) { + mode = "工单完成"; + } else if (haiLiangLabelingDeviceDriver.getMode() == 5) { + mode = "强制工单完成"; + } + if (haiLiangLabelingDeviceDriver.getMove() == 0) { + move = "无货"; + } else if (haiLiangLabelingDeviceDriver.getMove() == 1) { + move = "有货"; + } + obj.put("device_name", haiLiangLabelingDeviceDriver.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("error", haiLiangLabelingDeviceDriver.getError()); + jo.put("order", haiLiangLabelingDeviceDriver.getOrder()); + jo.put("order_detail", haiLiangLabelingDeviceDriver.getOrder_detail()); + jo.put("detail_qty", haiLiangLabelingDeviceDriver.getDetail_qty()); + jo.put("detail_qualified_qty", haiLiangLabelingDeviceDriver.getDetail_qualified_qty()); + } obj.put("data", jo); } }