فهرست منبع

1.添加实时数据采集出铁量、开始结束时间
2.采集点添加唯一名称作为上下文参数
3.添加堵口的剩余时间计算

wangxiaofei 1 روز پیش
والد
کامیت
daf75d179f

+ 33 - 0
taphole-iron/src/main/java/com/sckj/iron/constant/StepConstans.java

@@ -0,0 +1,33 @@
+package com.sckj.iron.constant;
+
+/***
+ * 炼铁步骤标志名常量
+ */
+public class StepConstans {
+    //炉前申请出铁
+    public static final String STEP_LQSQCT = "lqsqct";
+
+    //预判和确认出铁
+    public static final String STEP_YPQRCT = "ypqrct";
+
+    //铁量差
+    public static final String STEP_TLC = "tlc";
+
+    //上次铁量差
+    public static final String sctlc = "sctlc";
+
+    //上上次铁量差
+    public static final String ssctlc = "ssctlc";
+
+    //上次理论铁量
+    public static final String scll = "scll";
+
+    //上上次理论铁量
+    public static final String sscll = "sscll";
+
+    //上次实际铁量
+    public static final String scsj = "scsj";
+
+    //上上次实际铁量
+    public static final String sscsj = "sscsj";
+}

+ 3 - 0
taphole-iron/src/main/java/com/sckj/iron/constant/TaskNameConstants.java

@@ -27,4 +27,7 @@ public class TaskNameConstants {
     //L1订阅
     public static final String TASKNAME_OPCDASUBSCRIBE = "opcdasubscribe";
 
+    //
+    public static final String TASKNAME_CLOSETIME = "closetime_suppose";
+
 }

+ 2 - 4
taphole-iron/src/main/java/com/sckj/iron/controller/TIronVisualScreenController.java

@@ -54,9 +54,6 @@ public class TIronVisualScreenController {
     IronLoginServiceImpl ironLoginService;
 
     @Resource
-    TIronDataServiceImpl tIronDataService;
-
-    @Resource
     private TCameraServiceImpl cameraService;
 
     @Resource
@@ -273,7 +270,8 @@ public class TIronVisualScreenController {
         return AjaxResult.success(mapList);
     }
 
-    @PostMapping("/getLatest")
+    @NotPower
+    @PostMapping("/getIronTestLatest")
     @ApiOperation(value = "最新出铁诊断")
     public AjaxResult<TIronTest> getLatest() {
         TIronTest one = iTIronTestService.getLatest();

+ 2 - 29
taphole-iron/src/main/java/com/sckj/iron/entity/TIronData.java

@@ -31,10 +31,10 @@ public class TIronData implements Serializable {
     @ExcelIgnore
     private Date createTime;
 
-    @TableId(value="id", type= IdType.AUTO)
+    @TableId(value="id", type= IdType.INPUT)
     @ApiModelProperty(value = "id")
     @ExcelIgnore
-    private Long id;
+    private String id;
 
     @ApiModelProperty(value = "高炉编号")
     @ExcelIgnore
@@ -81,10 +81,6 @@ public class TIronData implements Serializable {
     @ExcelIgnore
     private String openDepth;
 
-    @ApiModelProperty(value = "上料总干量")
-    @ExcelIgnore
-    private Double totalDry;
-
     @ApiModelProperty(value = "开始时间")
     @ExcelProperty("开始时间")
     @ColumnWidth(25)
@@ -95,28 +91,5 @@ public class TIronData implements Serializable {
     @ApiModelProperty(value = "结束时间")
     private String ironEndtime;
 
-    @ApiModelProperty(value = "碳")
-    @ExcelIgnore
-    private String elementC;
-
-    @ExcelIgnore
-    @ApiModelProperty(value = "硅")
-    private String elementSi;
-
-    @ExcelIgnore
-    @ApiModelProperty(value = "锰")
-    private String elementMn;
-
-    @ExcelIgnore
-    @ApiModelProperty(value = "磷")
-    private String elementP;
-
-    @ExcelIgnore
-    @ApiModelProperty(value = "硫")
-    private String elementS;
-
-    @ExcelIgnore
-    @ApiModelProperty(value = "钛")
-    private String elementTi;
 
 }

+ 108 - 94
taphole-iron/src/main/java/com/sckj/iron/socketio/DeviceEventListener.java

@@ -10,10 +10,8 @@ import com.sckj.common.eventbus.EventListener;
 import com.sckj.common.manager.ScheduledTaskManager;
 import com.sckj.common.socketio.SocketUtil;
 import com.sckj.common.util.RedisUtils;
-import com.sckj.iron.constant.ExpressionConstants;
-import com.sckj.iron.constant.ParamsConstants;
-import com.sckj.iron.constant.SubscribeTagConstants;
-import com.sckj.iron.constant.TaskNameConstants;
+import com.sckj.common.util.ToolUtils;
+import com.sckj.iron.constant.*;
 import com.sckj.iron.dto.IronStepDTO;
 import com.sckj.iron.dto.IronTimeNoDTO;
 import com.sckj.iron.dto.RealtimeData;
@@ -36,7 +34,6 @@ import com.sckj.warn.service.impl.TExceptionLogServiceImpl;
 import com.sckj.warn.validate.TExceptionLogCreateValidate;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.expression.Expression;
@@ -122,14 +119,6 @@ public class DeviceEventListener extends EventListener { //
     @Resource
     TIronTestServiceImpl iTIronTestService;
 
-    //炉前申请出铁
-    private static final String STEP_LQSQCT = "lqsqct";
-
-    //预判和确认出铁
-    private static final String STEP_YPQRCT = "ypqrct";
-
-    //铁量差计算
-    private static final String STEP_TLC = "tlc";
 
     //铁水成分
     private static final String IRON_ELEMENT = "ironElement";
@@ -240,6 +229,9 @@ public class DeviceEventListener extends EventListener { //
     //上次出铁量
     private OPCData mIronOPCData;
 
+    //实时出铁数据
+    private TIronData mTIronData;
+
     @PostConstruct
     public void init() {
         taskExecutor.submit(() -> {
@@ -257,9 +249,9 @@ public class DeviceEventListener extends EventListener { //
         taskExecutor.submit(() -> {
             getModels();
         });
-        taskExecutor.submit(() -> {
-            getIronTimeNo();
-        });
+//        taskExecutor.submit(() -> {
+//            getIronTimeNo();
+//        });
         taskExecutor.submit(() -> {
             getSchedules();
             if ("1".equals(scheduleOpcdasubscribe.getStatus())) {
@@ -410,9 +402,19 @@ public class DeviceEventListener extends EventListener { //
      */
     @Subscribe
     public void onMessageEvent(OPCData opcData) {
-        log.debug("subscribe info:{}",opcData);
+        log.debug("subscribe info:{}", opcData);
+
+        if (ObjectUtils.isNotEmpty(opcData) && ObjectUtils.isNotEmpty(opcData.getIdentifier())) {
+            //将每一个opc配置的唯一编号添加到环境变量中
+            mContext.setVariable(opcData.getIdentifier(), opcData.getData());
+        }
+
         //异步保存OPC数据
         taskExecutor.submit(() -> {
+            if (ObjectUtils.isNotEmpty(mTIronData)) {
+                //关联实时出铁信息
+                opcData.setIronDataId(mTIronData.getId());
+            }
             opcDataService.save(opcData);
         });
         //出铁操作
@@ -425,33 +427,11 @@ public class DeviceEventListener extends EventListener { //
 
     }
 
-    //出铁次数编号
-    private String mIronNo;
-
-//    /***
-//     * L2数据项
-//     * @param l2Data
-//     */
-//    @Subscribe
-//    public void onL2DataMessageEvent(L2Data l2Data) {
-//        if (ObjectUtils.isNotEmpty(l2Data.getIronNo())) {
-//            //只要是新的出铁次数编号,后续都一直用这个编号,直到有新的出铁编号
-//            mIronNo = l2Data.getIronNo();
-//        }
-//
-//        taskExecutor.submit(() -> {
-//            getIronTimeNo();
-//        });
-//
-//
-//        //推送实时数据
-//        taskExecutor.submit(() -> {
-//            setRealtimeDataAndStatus(null, l2Data);
-//        });
-//    }
+    private double mLastSpeed;
+
 
     /***
-     * 记录出铁日期和次数,并返回给前端
+     * 记录出铁次数,并返回给前端
      */
     private void getIronTimeNo() {
         IronTimeNoDTO ironTimeNoDTO = new IronTimeNoDTO();
@@ -461,7 +441,7 @@ public class DeviceEventListener extends EventListener { //
         if (ObjectUtils.isNotEmpty(latestData)) {
             ironTimeNoDTO.setIronNo(latestData.getIronNo());
         }
-        ironTimeNoDTO.setDesc(String.format("第%s次出铁", ironTimeNoDTO.getIronNo()));
+        ironTimeNoDTO.setDesc(String.format("四高炉第%s次出铁(1号铁口)", ironTimeNoDTO.getIronNo()));
         PushData.send2IronTimeNo(ironTimeNoDTO);
     }
 
@@ -475,54 +455,38 @@ public class DeviceEventListener extends EventListener { //
                 if (NODE.equalsIgnoreCase(stepDTO.getNodeType())) {
                     //处理子项
                     for (IronStepVO child : stepDTO.getChilds()) {
-                        if (STEP_TLC.equals(child.getIdentifier())) {
+                        if (StepConstans.STEP_TLC.equals(child.getIdentifier())) {
                             if (latest2DataList.size() >= 2) {
                                 HashMap[] hashMaps = new HashMap[6];
                                 child.setExtraInfo(hashMaps);
                                 //理论出铁量 = 矿批 × 综合品位 × 1.06
                                 //铁量差 = 理论出铁量 - 实际出铁量
                                 TL2Data tl2Data1Last = latest2DataList.get(0);
-                                BigDecimal llLast = new BigDecimal(tl2Data1Last.getCalcWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
+                                BigDecimal theoryWeightLast = new BigDecimal(tl2Data1Last.getTheoryWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
                                 BigDecimal ironWeightLast = new BigDecimal(tl2Data1Last.getIronWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
-                                BigDecimal tlcLast = llLast.subtract(ironWeightLast).setScale(2, BigDecimal.ROUND_HALF_UP);
-
-                                TL2Data tl2Data1GrandLast = latest2DataList.get(1);
-                                BigDecimal llGrandLast = new BigDecimal(tl2Data1GrandLast.getCalcWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
-                                BigDecimal ironWeightGrandLast = new BigDecimal(tl2Data1GrandLast.getIronWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
-                                BigDecimal tlcGrandLast = llGrandLast.subtract(ironWeightGrandLast).setScale(2, BigDecimal.ROUND_HALF_UP);
-
-                                //铁量差在合理范围内
-                                // 上一次铁量差:-30       上上次铁量差:20 t
-                                // 理论出铁量:1500 t      理论出铁量:1400 t
-                                // 实际出铁量:1530 t      实际出铁量: 1380 t
-                                final String sctlc = "sctlc";
-                                final String ssctlc = "ssctlc";
-                                final String scll = "scll";
-                                final String sscll = "sscll";
-                                final String scsj = "scsj";
-                                final String sscsj = "sscsj";
+                                BigDecimal tlcLast = theoryWeightLast.subtract(ironWeightLast).setScale(2, BigDecimal.ROUND_HALF_UP);
+
+                                TL2Data tl2Data1Grand = latest2DataList.get(1);
+                                BigDecimal theoryWeightGrand = new BigDecimal(tl2Data1Grand.getTheoryWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
+                                BigDecimal ironWeightGrand = new BigDecimal(tl2Data1Grand.getIronWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
+                                BigDecimal tlcGrand = theoryWeightGrand.subtract(ironWeightGrand).setScale(2, BigDecimal.ROUND_HALF_UP);
 
                                 for (IronStepVO grandChild : child.getChilds()) {
-                                    if (sctlc.equals(grandChild.getIdentifier())) {
+                                    if (StepConstans.sctlc.equals(grandChild.getIdentifier())) {
                                         grandChild.setData(tlcLast);
-                                        grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
-                                    } else if (ssctlc.equals(grandChild.getIdentifier())) {
-                                        grandChild.setData(tlcGrandLast);
-                                        grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
-                                    } else if (scll.equals(grandChild.getIdentifier())) {
-                                        grandChild.setData(llLast);
-                                        grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
-                                    } else if (sscll.equals(grandChild.getIdentifier())) {
-                                        grandChild.setData(llGrandLast);
-                                        grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
-                                    } else if (scsj.equals(grandChild.getIdentifier())) {
+                                    } else if (StepConstans.ssctlc.equals(grandChild.getIdentifier())) {
+                                        grandChild.setData(tlcGrand);
+                                    } else if (StepConstans.scll.equals(grandChild.getIdentifier())) {
+                                        grandChild.setData(theoryWeightLast);
+                                    } else if (StepConstans.sscll.equals(grandChild.getIdentifier())) {
+                                        grandChild.setData(theoryWeightGrand);
+                                    } else if (StepConstans.scsj.equals(grandChild.getIdentifier())) {
                                         grandChild.setData(ironWeightLast);
-                                        grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
-                                    } else if (sscsj.equals(grandChild.getIdentifier())) {
-                                        grandChild.setData(ironWeightGrandLast);
-                                        grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
+                                    } else if (StepConstans.sscsj.equals(grandChild.getIdentifier())) {
+                                        grandChild.setData(ironWeightGrand);
                                     }
                                 }
+
                             }
                         }
                     }
@@ -562,14 +526,31 @@ public class DeviceEventListener extends EventListener { //
 
     }
 
+    //代表要减去的时间,非剩余时间
+    private AtomicInteger mDiffCloseTime = new AtomicInteger(0);
+
+    private void getCloseTime() {
+        RealtimeData realtimeData = new RealtimeData();
+        realtimeData.setValue(200 - getIronElapsedMinute() - mDiffCloseTime.get());
+        realtimeData.setDesc("距离堵口预计还剩");
+        realtimeData.setUnit("分钟");
+        PushData.send2CloseTime(realtimeData);
+    }
+
     //1号铁口正在出铁的操作项目
     private void taphole1Start() {
         //关闭定时任务:出铁预警、开口预警
         //开启定时任务:出铁超时报警、堵口预警、打泥量选择计算、
 
+        mTIronData = new TIronData();
+        mTIronData.setId(ToolUtils.makeUUID());
+        mTIronData.setIronStarttime(LocalDateUtils.formatDate(new Date()));
+        ironDataService.saveOrUpdate(mTIronData);
+
         //清空出铁总量、出铁计时
         mTotalWeight = BigDecimal.ZERO;
         mSecondsElapsed.set(0);
+        //生成 170 到 210 的随机数
 
         scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_WARN);
         scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_TIMEOUT_WARN);
@@ -579,6 +560,8 @@ public class DeviceEventListener extends EventListener { //
             scheduledTaskManager.addTask(scheduleTappingConsttime.getName(), scheduleTappingConsttime.getDelay(), scheduleTappingConsttime.getPeriod(), TimeUnit.SECONDS, () -> {
                 getIronTime();
                 mSecondsElapsed.incrementAndGet();
+
+                getCloseTime();
             });
 
         }
@@ -691,22 +674,38 @@ public class DeviceEventListener extends EventListener { //
             });
         }
 
+        scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_CLOSETIME, 0, 1 * 60, TimeUnit.SECONDS, () -> {
+            // log.info("已出铁时间(秒):{},标准出铁时间(秒):{}", seconds, STANDARD_IRON_TIME.get());
+
+        });
+
     }
 
 
     //1号铁口结束出铁的操作项目
     private void taphole1End() {
         //由 1-> 0 表明1号铁口结束出铁
+        if (null != mTIronData) {
+            mTIronData.setIronCosttime(getIronElapsedMinute());
+            mTIronData.setIronWeight(mTotalWeight.doubleValue());
+            mTIronData.setIronEndtime(LocalDateUtils.formatDate(new Date()));
+            ironDataService.saveOrUpdate(mTIronData);
+        }
 
         scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_CLOSURE_WARN);
         scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_HIT_MUD);
         scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_CONSTTIME);
         scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_TIMEOUT_WARN);
+        scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_CLOSETIME);
+
+        PushData.send2CostTime(new RealtimeData());
+        PushData.send2CloseTime(new RealtimeData());
 
-        getIronTime();
+        //尝试重新获取一次新的铁次号码
         getIronTimeNo();
         mSteps = ironStepService.getTreeSteps();
 
+
         //开口
 //        PushData.send2CancelWarn(WarnData.warnOpen("", ""));
         //堵口
@@ -744,30 +743,30 @@ public class DeviceEventListener extends EventListener { //
                         boolean ironTimeBool = mParser.parseExpression(split[0]).getValue(mContext, Boolean.class);
 
                         if (ironTimeBool) {
-                            testResultStr += "出铁时间正常,";
+                            testResultStr += "出铁时间符合预期,";
                         } else {
-                            testResultStr += "出铁时间异常,";
+                            testResultStr += "出铁时间不符合预期,";
                         }
 
                         boolean ironWeightBool = mParser.parseExpression(split[1]).getValue(mContext, Boolean.class);
                         if (ironWeightBool) {
-                            testResultStr += "出铁量正常,";
+                            testResultStr += "出铁量符合预期,";
                         } else {
-                            testResultStr += "出铁量异常,";
+                            testResultStr += "出铁量不符合预期,";
                         }
 
                         boolean ironSpeedBool = mParser.parseExpression(split[2]).getValue(mContext, Boolean.class);
                         if (ironSpeedBool) {
-                            testResultStr += "出铁流速正常,";
+                            testResultStr += "出铁流速符合预期,";
                         } else {
-                            testResultStr += "出铁流速异常,";
+                            testResultStr += "出铁流速不符合预期,";
                         }
 
                         boolean ironTempChangeBool = mParser.parseExpression(split[3]).getValue(mContext, Boolean.class);
                         if (ironTempChangeBool) {
-                            testResultStr += "铁水温度变化正常。";
+                            testResultStr += "铁水温度变化符合预期。";
                         } else {
-                            testResultStr += "铁水温度变化异常。";
+                            testResultStr += "铁水温度变化不符合预期。";
                         }
                         TIronTest ironTest = new TIronTest();
                         String testStatus = (ironTimeBool && ironWeightBool && ironSpeedBool && ironTempChangeBool) ? "1" : "0";
@@ -875,7 +874,22 @@ public class DeviceEventListener extends EventListener { //
                     speeds[1] = realtimeData;
                     speed2 = new AtomicDouble(Double.parseDouble(opcData.getData().toString()));
                 }
-                mContext.setVariable(ExpressionConstants.rtIronSpeed, speed1.get() > speed2.get() ? speed1.get() : speed2.get());
+                double maxSpeed = Math.max(speed1.get(), speed2.get());
+                mContext.setVariable(ExpressionConstants.rtIronSpeed, maxSpeed);
+
+                if (maxSpeed != 0 && ironLoading1.get() > 0) {
+                    if (this.mLastSpeed == 0) {
+                        this.mLastSpeed = maxSpeed;
+                    } else if (maxSpeed > this.mLastSpeed) {
+                        mDiffCloseTime.set(Math.max(mDiffCloseTime.get() + 1, 0));
+                        this.mLastSpeed = maxSpeed;
+                    } else if (maxSpeed < this.mLastSpeed) {
+                        mDiffCloseTime.set(Math.max(mDiffCloseTime.get() - 1, 0));
+                        this.mLastSpeed = maxSpeed;
+                    }
+                    getCloseTime();
+                }
+
 
                 //只在两个都有数据的时候才添加
                 if (ObjectUtils.isNotEmpty(speeds)
@@ -884,6 +898,8 @@ public class DeviceEventListener extends EventListener { //
                 ) {
                     ironSpeed.setTime(LocalDateUtils.formatDate(opcData.getServerTime()));
                 }
+
+
             } else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_TAPHOLE1_STATUS(opcData.getServerType()))) {
                 RealtimeData realtimeData = new RealtimeData();
                 realtimeData.setValue(opcData.getData());
@@ -915,7 +931,7 @@ public class DeviceEventListener extends EventListener { //
                 RealtimeData ironWeight = new RealtimeData();
                 ironWeight.setDesc("铁水流量");
                 ironWeight.setUnit("t");
-                if(ObjectUtils.isEmpty(mIronOPCData) || !opcData.getData().equals(mIronOPCData.getData())){
+                if (ObjectUtils.isEmpty(mIronOPCData) || !opcData.getData().equals(mIronOPCData.getData())) {
                     mIronOPCData = opcData;
                 }
                 BigDecimal bigDecimalNew = new BigDecimal(mIronOPCData.getData().toString());
@@ -926,7 +942,6 @@ public class DeviceEventListener extends EventListener { //
                 ironWeight.setTime(LocalDateUtils.formatDate(opcData.getServerTime()));
 
 
-
                 mContext.setVariable(ExpressionConstants.rtIronWeight, mTotalWeight.doubleValue());
 
             } else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_FLUSH_STATUS(opcData.getServerType()))) {
@@ -986,13 +1001,11 @@ public class DeviceEventListener extends EventListener { //
         String pointName = mOPCData.getPointName();
         Object data = mOPCData.getData();
         for (IronStepVO stepDTO : mSteps) {
-            //log.info("nodetype:{},pointname:{},opc pointname:{}",stepDTO.getNodeType(),stepDTO.getPointName(),pointName);
             if (NODE.equalsIgnoreCase(stepDTO.getNodeType())) {
                 //处理子项
                 for (IronStepVO child : stepDTO.getChilds()) {
                     for (IronStepVO childchild : child.getChilds()) {
 
-
                         //plc的point和step的point一致
                         String newPointName = childchild.getPointName();
 
@@ -1168,11 +1181,11 @@ public class DeviceEventListener extends EventListener { //
         PushData.send2Operation(mSteps, ironLoading1.get());
 
         for (IronStepVO stepDTO : mSteps) {
-            if (STEP_LQSQCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
+            if (StepConstans.STEP_LQSQCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
                 //
                 List<TL2Data> tl2DataList = tl2DataService.getTappedLatest2Datas();
                 getTheoryWeight(tl2DataList);
-            } else if (STEP_YPQRCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
+            } else if (StepConstans.STEP_YPQRCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
                 //炉前在接受到炉内出铁要求后,10分钟内打开铁口,未打开系统告警并记录
 
                 if ("1".equals(scheduleOpenWarn.getStatus())) {
@@ -1277,6 +1290,7 @@ public class DeviceEventListener extends EventListener { //
             return;
         }
         setStepResult(mSteps);
+        //推送炼铁步骤
         PushData.send2Operation(mSteps, ironLoading1.get());
         //推送实时数据
         PushData.send2RealtimeData(mRealtimeData);

+ 22 - 0
taphole-iron/src/main/java/com/sckj/iron/socketio/PushData.java

@@ -78,6 +78,12 @@ public class PushData {
      */
     public static final String IRON_TAPPING_TEST = "IRON_TAPPING_TEST";
 
+    /***
+     * 距离堵口预计还剩:xxxx分钟
+     */
+    public static final String IRON_CLOSETTIME = "IRON_CLOSETTIME";
+
+
     /**
      * 出铁操作
      *
@@ -246,5 +252,21 @@ public class PushData {
         }
     }
 
+    /**
+     * 预计堵口时间
+     *
+     * @return
+     * @Param
+     **/
+    public static void send2CloseTime(Object message) {
+        if (SocketUtil.connectMap.isEmpty()) {
+            return;
+        }
+        //
+        for (Map.Entry<String, SocketIOClient> entry : SocketUtil.connectMap.entrySet()) {
+            entry.getValue().sendEvent(PushData.IRON_CLOSETTIME, AjaxResult.success(message));
+        }
+    }
+
 
 }

+ 4 - 0
taphole-l2/src/main/java/com/sckj/l2/entity/TL2Data.java

@@ -117,4 +117,8 @@ public class TL2Data implements Serializable {
     @ExcelIgnore
     private Double calcWeight;
 
+    @ApiModelProperty(value = "理论铁量")
+    @ExcelIgnore
+    private Double theoryWeight;
+
 }

+ 8 - 5
taphole-opc/src/main/java/com/sckj/opc/dataservice/HDServiceImpl.java

@@ -68,7 +68,7 @@ public class HDServiceImpl {
     static {
         boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows");
 
-        System.setProperty("java.library.path", isWindows ? "D:\\project\\xiha\\iron\\ihd\\win64_3.9.2_hdSDK3\\hdsdk\\executable_x64" : "/home/taphole/hdsdk/linux");
+        System.setProperty("java.library.path", isWindows ? "D:\\project\\xiha\\iron\\doc\\ihd\\win64_3.9.2_hdSDK3\\hdsdk\\executable_x64" : "/home/taphole/hdsdk/linux");
         try {
             java.lang.reflect.Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");
             fieldSysPath.setAccessible(true);
@@ -178,12 +178,13 @@ public class HDServiceImpl {
         }
 
         scheduledTaskManager.addTask(hdTag.getTagName(), 0, hdTag.getPeriod(), TimeUnit.SECONDS, () -> {
+            Object data = null;
             try {
                 final HDDataConnection connection = createConnection(opcServer);
                 HDDataProvider dp = new HDDataProvider(connection);
                 HDRecord record = dp.querySnapshotByTagID(hdTag.getTagId());
                 if (record != null) {
-                    Object data = record.getValueStr();
+                    data = record.getValueStr();
                     if (NumberUtils.isCreatable(data.toString())) {
                         // 如果 digits 为 null,默认设为 0
                         int decimalDigits = (hdTag.getDigits() != null) ? hdTag.getDigits() : 0;
@@ -196,7 +197,8 @@ public class HDServiceImpl {
                             }
                         }
                         DecimalFormat decimalFormat = new DecimalFormat(pattern);
-                        String formatString = decimalFormat.format(record.getValueStr());
+                        double doubleNumber = Double.parseDouble(data.toString());
+                        String formatString = decimalFormat.format(doubleNumber);
                         if (formatString.contains(".")) {
                             data = Double.parseDouble(formatString);
                         } else {
@@ -213,13 +215,14 @@ public class HDServiceImpl {
                             .serverTime(new Date(record.getSecond() * 1000))
                             .serverType(opcServer.getType())
                             .dataType(hdTag.getTagType())
+                            .identifier(hdTag.getIdentifier())
                             .build();
                     asyncEventBus.post(build);
                     log.info("{}({})当前数据:{}", hdTag.getTagName(), hdTag.getTagDesc(), record.getValueStr());
                 }
             } catch (Exception e) {
-                // e.printStackTrace();
-                log.error("{}({})获取数据异常:{}", hdTag.getTagName(), hdTag.getTagDesc(), e.getMessage());
+                e.printStackTrace();
+                log.error("{}({})获取数据({})异常:{}", hdTag.getTagName(), hdTag.getTagDesc(), data, e.getMessage());
             }
         });
     }

+ 1 - 0
taphole-opc/src/main/java/com/sckj/opc/dataservice/OPCDAServiceImpl.java

@@ -136,6 +136,7 @@ public class OPCDAServiceImpl {
                                         .statusCode((long) errorCode)
                                         .pointName(pointName)
                                         .dataType(opcPoint.getDataType())
+                                        .identifier(opcPoint.getIdentifier())
                                         .build();
                                 //post给其他模块使用
                                 asyncEventBus.post(opcData);

+ 6 - 0
taphole-opc/src/main/java/com/sckj/opc/entity/OPCData.java

@@ -52,4 +52,10 @@ public class OPCData {
     @TableField(exist = false)
     private String dataType;
 
+    @TableField(exist = false)
+    private String identifier;
+
+    @ApiModelProperty(value = "实时出铁编号")
+    private String ironDataId;
+
 }

+ 3 - 0
taphole-opc/src/main/java/com/sckj/opc/entity/OPCPoint.java

@@ -60,4 +60,7 @@ public class OPCPoint {
     @ApiModelProperty(value = "小数位")
     private Integer digits;
 
+    @ApiModelProperty(value = "唯一名称")
+    private String identifier;
+
 }

+ 3 - 0
taphole-opc/src/main/java/com/sckj/opc/entity/THdTag.java

@@ -66,4 +66,7 @@ public class THdTag implements Serializable {
     @ApiModelProperty(value = "小数位")
     private Integer digits;
 
+    @ApiModelProperty(value = "唯一名称")
+    private String identifier;
+
 }