Browse Source

预警报告修改

王波 3 weeks ago
parent
commit
f0197a792b

+ 16 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/mapper/ProEconIssPlanMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.runeconomy.mapper;
+
+import com.gyee.runeconomy.model.ProEconIssPlan;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author wang
+ * @since 2025-09-15
+ */
+public interface ProEconIssPlanMapper extends BaseMapper<ProEconIssPlan> {
+
+}

+ 65 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/model/ProEconIssPlan.java

@@ -0,0 +1,65 @@
+package com.gyee.runeconomy.model;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wang
+ * @since 2025-09-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("pro_econ_iss_plan")
+public class ProEconIssPlan extends Model<ProEconIssPlan> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 编号
+     */
+    private String id;
+
+    /**
+     * 类型
+     */
+    private String types;
+
+    /**
+     * 排查方法
+     */
+    private String troubleMethod;
+
+    /**
+     * 处理方法
+     */
+    private String processMethod;
+
+    /**
+     * 工器具
+     */
+    private String tools;
+
+    /**
+     * 备件
+     */
+    private String spareParts;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 报警明细类别
+     */
+    private String typedetails;
+
+
+}

+ 29 - 14
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/EarlyWarning/EarlyWarningReliableService.java

@@ -4,12 +4,13 @@ package com.gyee.runeconomy.service.EarlyWarning;
 
 import com.gyee.runeconomy.dto.AlarmDataParser;
 import com.gyee.runeconomy.init.CacheContext;
-import com.gyee.runeconomy.model.ProEconAlarmPlan;
 import com.gyee.runeconomy.model.ProEconAlarmReal;
+import com.gyee.runeconomy.model.ProEconIssPlan;
 import com.gyee.runeconomy.model.ReliabilityIssues;
 import com.gyee.runeconomy.model.auto.ProBasicEquipment;
 import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
 import com.gyee.runeconomy.model.auto.TurbineInfoDay;
+import com.gyee.runeconomy.service.ProEconIssPlanService;
 import com.gyee.runeconomy.service.auto.ProEconAlarmPlanService;
 import com.gyee.runeconomy.service.auto.ProEconAlarmRealService;
 import com.gyee.runeconomy.service.auto.ReliabilityIssuesService;
@@ -32,6 +33,8 @@ public class EarlyWarningReliableService {
     @Resource
     private ProEconAlarmPlanService proEconAlarmPlanService;
     @Resource
+    private ProEconIssPlanService proEconIssPlanService;
+    @Resource
     private ReliabilityIssuesService reliabilityIssuesService;
     @Resource
     private ITurbineInfoDayService turbineInfoDayService;
@@ -136,13 +139,13 @@ public class EarlyWarningReliableService {
                             .orElse("0");
 
                     // 查询预警类型和部件类型
-                    ProEconAlarmPlan alarmPlan = proEconAlarmPlanService.selectAlarmPlanByProId(planId)
+                    ProEconIssPlan alarmPlan = proEconIssPlanService.selectAlarmPlanByProId(planId)
                             .stream()
                             .findFirst()
                             .orElse(null);
 
-                    String yjType = (alarmPlan != null) ? alarmPlan.getTypedetails() : "0";
-                    String bjType = (alarmPlan != null) ? alarmPlan.getTypes() : "0";
+                    String yjType = (alarmPlan != null) ? alarmPlan.getTypedetails() : "0"; //报警明细分类
+                    String bjType = (alarmPlan != null) ? alarmPlan.getTypes() : "0"; //类型
 
                     // 提取必要字段
                     String alertText = alarmData.getAlertText();
@@ -150,9 +153,9 @@ public class EarlyWarningReliableService {
                     String relateType = alarmData.getRelateParts();
 
                     // 根据隐患类型分类处理
-                    if ("温度隐患".equals(yjType)) {
-                        processTemperatureIssues(issue, relateType, alertText, frequencyHours);
-                    } else if ("其它隐患".equals(yjType)) {
+                    if ("温度隐患".equals(yjType)) {
+                        processTemperatureIssues(issue, bjType, alertText, frequencyHours);
+                    } else if ("状态类隐患".equals(yjType)) {
                         processOtherIssues(issue, bjType, alertText, frequencyHours);
                     }
                 }
@@ -248,19 +251,19 @@ public class EarlyWarningReliableService {
      */
     private void processTemperatureIssues(ReliabilityIssues issue, String relateType, String alertText, String frequencyHours) {
         switch (relateType) {
-            case "ZZ":
+            case "主轴类":
                 issue.setMainShaftType(alertText);
                 issue.setMainShaftFrequencyHours(frequencyHours);
                 break;
-            case "FDJ":
+            case "发电机类":
                 issue.setGeneratorType(alertText);
                 issue.setGeneratorFrequencyHours(frequencyHours);
                 break;
-            case "CLX":
+            case "齿轮箱类":
                 issue.setGearboxType(alertText);
                 issue.setGearboxFrequencyHours(frequencyHours);
                 break;
-            case "BJXT":
+            case "变桨类":
                 issue.setPitchSystemType(alertText);
                 issue.setPitchSystemFrequencyHours(frequencyHours);
                 break;
@@ -276,18 +279,30 @@ public class EarlyWarningReliableService {
      */
     private void processOtherIssues(ReliabilityIssues issue, String bjType, String alertText, String frequencyHours) {
         switch (bjType) {
-            case "ZD":
+            case "振动类":
                 issue.setVibrationType(alertText);
                 issue.setVibrationFrequencyHours(frequencyHours);
                 break;
-            case "JX":
+            case "机械类":
+                issue.setMechanicalType(alertText);
+                issue.setMechanicalFrequencyHours(frequencyHours);
+                break;
+            case "电气类":
                 issue.setElectricalType(alertText);
                 issue.setElectricalFrequencyHours(frequencyHours);
                 break;
-            case "YYXT":
+            case "液压类":
+                issue.setHydraulicType(alertText);
+                issue.setHydraulicFrequencyHours(frequencyHours);
+                break;
+            case "测风类":
                 issue.setWindMeasurementType(alertText);
                 issue.setWindMeasurementFrequencyHours(frequencyHours);
                 break;
+            case "其它":
+                issue.setOtherIssues(alertText);
+                issue.setOtherFrequencyHours(frequencyHours);
+                break;
             default:
                 issue.setOtherIssues(alertText);
                 issue.setOtherFrequencyHours(frequencyHours);

+ 15 - 15
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/EarlyWarning/EarlyWarninggetService.java

@@ -1,12 +1,10 @@
 package com.gyee.runeconomy.service.EarlyWarning;
 
 import com.gyee.runeconomy.init.CacheContext;
-import com.gyee.runeconomy.model.ProEconAlarmPlan;
-import com.gyee.runeconomy.model.ProEconAlarmReal;
-import com.gyee.runeconomy.model.ProEconAlarmRule;
-import com.gyee.runeconomy.model.ReliabilityIssues;
+import com.gyee.runeconomy.model.*;
 import com.gyee.runeconomy.model.auto.ProBasicEquipment;
 import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
+import com.gyee.runeconomy.service.ProEconIssPlanService;
 import com.gyee.runeconomy.service.auto.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -28,6 +26,8 @@ public class EarlyWarninggetService {
     private ProEconAlarmRealService realService;
     @Resource
     private ProEconAlarmPlanService planService;
+    @Resource
+    private ProEconIssPlanService proEconIssPlanService;
 
     public Map Electricity(String time, String wpid) throws Exception {
 
@@ -113,7 +113,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add(mainShaftType + ":" + plans.get(0).getProcessMethod());
                             }
@@ -130,7 +130,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add( generatorType + ":" + plans.get(0).getProcessMethod());
                             }
@@ -147,7 +147,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add(gearboxType + ":" + plans.get(0).getProcessMethod());
                             }
@@ -163,7 +163,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add(pitchSystemType + ":" + plans.get(0).getProcessMethod());
                             }
@@ -180,7 +180,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add(temperatureOtherIssues + ":" + plans.get(0).getProcessMethod());
                             }
@@ -197,7 +197,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add(vibrationType + ":" + plans.get(0).getProcessMethod());
                             }
@@ -213,7 +213,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add(mechanicalType + ":" + plans.get(0).getProcessMethod());
                             }
@@ -229,7 +229,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add(electricalType + ":" + plans.get(0).getProcessMethod());
                             }
@@ -245,7 +245,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add(hydraulicType + ":" + plans.get(0).getProcessMethod());
                             }
@@ -261,7 +261,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add(windMeasurementType + ":" + plans.get(0).getProcessMethod());
                             }
@@ -277,7 +277,7 @@ public class EarlyWarninggetService {
                         List<ProEconAlarmReal> realid = realService.getProEconAlarmReal(id);
                         if (realid.size() > 0){
                             String alarmPlan = realid.get(0).getAlarmPlan();
-                            List<ProEconAlarmPlan> plans = planService.selectAlarmPlanByProId(alarmPlan);
+                            List<ProEconIssPlan> plans = proEconIssPlanService.selectAlarmPlanByProId(alarmPlan);
                             if (plans.size() > 0){
                                 jxjyls.add(otherIssues + ":"+ plans.get(0).getProcessMethod());
                             }

+ 18 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/ProEconIssPlanService.java

@@ -0,0 +1,18 @@
+package com.gyee.runeconomy.service;
+
+import com.gyee.runeconomy.model.ProEconIssPlan;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author wang
+ * @since 2025-09-15
+ */
+public interface ProEconIssPlanService extends IService<ProEconIssPlan> {
+    List<ProEconIssPlan> selectAlarmPlanByProId(String proId);
+}

+ 32 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/impl/ProEconIssPlanServiceImpl.java

@@ -0,0 +1,32 @@
+package com.gyee.runeconomy.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.runeconomy.model.ProEconAlarmPlan;
+import com.gyee.runeconomy.model.ProEconIssPlan;
+import com.gyee.runeconomy.mapper.ProEconIssPlanMapper;
+import com.gyee.runeconomy.service.ProEconIssPlanService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author wang
+ * @since 2025-09-15
+ */
+@Service
+public class ProEconIssPlanServiceImpl extends ServiceImpl<ProEconIssPlanMapper, ProEconIssPlan> implements ProEconIssPlanService {
+
+    @Override
+    public List<ProEconIssPlan> selectAlarmPlanByProId(String proId) {
+        QueryWrapper<ProEconIssPlan> qw = new QueryWrapper<>();
+        qw.lambda().eq(ProEconIssPlan::getId,proId);
+        java.util.List<ProEconIssPlan> proEconAlarmPlans = baseMapper.selectList(qw);
+        return proEconAlarmPlans;
+    }
+}