Quellcode durchsuchen

fix联锁编辑-查询

LLL vor 4 Monaten
Ursprung
Commit
0b68c18c34

+ 14 - 40
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/convert/InterlockDetailConvert.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.detail.convert;
 import org.jeecg.modules.detail.dto.InterlockDetailAddDTO;
 import org.jeecg.modules.detail.entity.InterlockDetail;
 import org.jeecg.modules.detail.vo.InterlockDetailEditQueryVO;
+import org.jeecg.modules.summary.constants.InterlockAllStatus;
 import org.mapstruct.*;
 import org.mapstruct.factory.Mappers;
 
@@ -25,58 +26,31 @@ public interface InterlockDetailConvert {
 
     InterlockDetailAddDTO toDTO(InterlockDetail detail);
 
-    @Mapping(target = "instrumentStatus_dictText", source = "instrumentStatus", qualifiedByName = "mapInstrumentStatus")
+
     @Mapping(target = "instrumentStatusJuge_dictText", source = "instrumentStatusJuge", qualifiedByName = "mapInstrumentStatusJuge")
-    @Mapping(target = "controlSystemStatus_dictText", source = "controlSystemStatus", qualifiedByName = "mapControlSystemStatus")
     @Mapping(target = "ifBypass_dictText", source = "ifBypass", qualifiedByName = "mapIfBypass")
-    @Mapping(target = "bypass_dictText", source = "bypass", qualifiedByName = "mapBypass")
     InterlockDetailEditQueryVO toEditVO(InterlockDetail detail);
 
-    //仪表状态
-    @Named("mapInstrumentStatus")
-    default String mapInstrumentStatus(String instrumentStatus) {
-        if ("0".equals(instrumentStatus)) {
-            return "正常";
-        } else if("1".equals(instrumentStatus)){
-            return "故障";
-        }else return null;
-    }
     //仪表状态判断方式
     @Named("mapInstrumentStatusJuge")
     default String mapInstrumentStatusJuge(String instrumentStatusJuge) {
-        if ("0".equals(instrumentStatusJuge)) {
-            return "否";
-        } else if("1".equals(instrumentStatusJuge)){
-            return "是";
-        } else if("2".equals(instrumentStatusJuge)){
-            return "突变超限判断";
+        if (InterlockAllStatus.INSTRUMENT_STATUS_JUDGE0.equals(instrumentStatusJuge)) {
+            return InterlockAllStatus.INSTRUMENT_STATUS_JUDGE0_NAME;
+        } else if(InterlockAllStatus.INSTRUMENT_STATUS_JUDGE1.equals(instrumentStatusJuge)){
+            return InterlockAllStatus.INSTRUMENT_STATUS_JUDGE1_NAME;
+        } else if(InterlockAllStatus.INSTRUMENT_STATUS_JUDGE2.equals(instrumentStatusJuge)){
+            return InterlockAllStatus.INSTRUMENT_STATUS_JUDGE2_NAME;
         }else return null;
     }
-    //控制系统状态
-    @Named("mapControlSystemStatus")
-    default String mapControlSystemStatus(String controlSystemStatus) {
-        if ("0".equals(controlSystemStatus)) {
-            return "正常";
-        } else if("1".equals(controlSystemStatus)){
-            return "非正常";
-        } else return null;
-    }
+
     //是否旁路
     @Named("mapIfBypass")
     default String mapIfBypass(String ifBypass) {
-        if ("0".equals(ifBypass)) {
-            return "否";
-        } else if("1".equals(ifBypass)){
-            return "是";
-        } else return null;
-    }
-    //旁路状态
-    @Named("mapBypass")
-    default String mapBypass(String bypass) {
-        if ("0".equals(bypass)) {
-            return "否";
-        } else if("1".equals(bypass)){
-            return "是";
+        if (InterlockAllStatus.IF_BY_PASS_NO.equals(ifBypass)) {
+            return InterlockAllStatus.IF_BY_PASS_NO_NAME;
+        } else if(InterlockAllStatus.IF_BY_PASS_YES.equals(ifBypass)){
+            return InterlockAllStatus.IF_BY_PASS_YES_NAME;
         } else return null;
     }
+
 }

+ 3 - 3
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/vo/InterlockDetailEditQueryVO.java

@@ -53,7 +53,6 @@ public class InterlockDetailEditQueryVO {
     private java.lang.String description;
     /**仪表状态(0正常1故障)*/
     @Excel(name = "仪表状态(0正常1故障)", width = 15, dicCode = "instrument_status")
-    @Dict(dicCode = "instrument_status")
     @ApiModelProperty(value = "仪表状态(0正常1故障)")
     private java.lang.String instrumentStatus;
     private java.lang.String instrumentStatus_dictText;
@@ -117,7 +116,6 @@ public class InterlockDetailEditQueryVO {
     private java.lang.String thresholdTimeUnit;
     /**控制系统状态(	0正常1非正常)*/
     @Excel(name = "控制系统状态(	0正常1非正常)", width = 15, dicCode = "control_system_status")
-    @Dict(dicCode = "control_system_status")
     @ApiModelProperty(value = "控制系统状态(	0正常1非正常)")
     private java.lang.String controlSystemStatus;
     private java.lang.String controlSystemStatus_dictText;
@@ -133,7 +131,6 @@ public class InterlockDetailEditQueryVO {
     private java.lang.String ifBypass_dictText;
     /**旁路状态(0否1是)*/
     @Excel(name = "旁路状态(0否1是)", width = 15, dicCode = "bypass")
-    @Dict(dicCode = "bypass")
     @ApiModelProperty(value = "旁路状态(0否1是)")
     private java.lang.String bypass;
     private java.lang.String bypass_dictText;
@@ -153,6 +150,7 @@ public class InterlockDetailEditQueryVO {
     @Excel(name = "输入卡件状态", width = 15)
     @ApiModelProperty(value = "输入卡件状态")
     private java.lang.String inputStatus;
+    private java.lang.String inputStatus_dictText;
     /**输入卡件状态-设备id*/
     @Excel(name = "输入卡件状态-设备id", width = 15)
     @ApiModelProperty(value = "输入卡件状态-设备id")
@@ -169,6 +167,7 @@ public class InterlockDetailEditQueryVO {
     @Excel(name = "输出卡件状态", width = 15)
     @ApiModelProperty(value = "输出卡件状态")
     private java.lang.String outputStatus;
+    private java.lang.String outputStatus_dictText;
     /**输出卡件状态-设备id*/
     @Excel(name = "输出卡件状态-设备id", width = 15)
     @ApiModelProperty(value = "输出卡件状态-设备id")
@@ -185,6 +184,7 @@ public class InterlockDetailEditQueryVO {
     @Excel(name = "MP状态", width = 15)
     @ApiModelProperty(value = "MP状态")
     private java.lang.String mpStatus;
+    private java.lang.String mpStatus_dictText;
     /**MP状态-设备id*/
     @Excel(name = "MP状态-设备id", width = 15)
     @ApiModelProperty(value = "MP状态-设备id")

+ 6 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/constants/InterlockAllStatus.java

@@ -31,6 +31,10 @@ public class InterlockAllStatus {
     public static final String INSTRUMENT_STATUS_JUDGE1 = "1"; // 仪表状态判断方式-高低限判断
     public static final String INSTRUMENT_STATUS_JUDGE2 = "2"; // 仪表状态判断方式-突变超限判断
 
+    public static final String INSTRUMENT_STATUS_JUDGE0_NAME = "直接读取位号"; // 仪表状态判断方式-直接读取位号
+    public static final String INSTRUMENT_STATUS_JUDGE1_NAME = "高低限判断"; // 仪表状态判断方式-高低限判断
+    public static final String INSTRUMENT_STATUS_JUDGE2_NAME = "突变超限判断"; // 仪表状态判断方式-突变超限判断
+
     // 仪表状态 0正常1故障
     public static final String INSTRUMENT_STATUS_NORMAL = "0"; // 仪表状态-正常
     public static final String INSTRUMENT_STATUS_GZ = "1"; // 仪表状态-故障
@@ -42,6 +46,8 @@ public class InterlockAllStatus {
     // 是否旁路 0否1是
     public static final String IF_BY_PASS_NO = "0"; // 是否旁路-否
     public static final String IF_BY_PASS_YES = "1"; // 是否旁路-是
+    public static final String IF_BY_PASS_NO_NAME = "否"; // 是否旁路-否
+    public static final String IF_BY_PASS_YES_NAME = "是"; // 是否旁路-是
 
     // 联锁状态 0未投用1投用
     public static final String INTERLOCK_STATUS_WTY = "0"; // 联锁状态-未投用

+ 1 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/dto/InterlockEditQueryVO.java

@@ -48,6 +48,7 @@ public class InterlockEditQueryVO {
     @ApiModelProperty(value = "联锁状态")
     @Dict(dicCode = "interlock_status")
     private java.lang.String interlockStatus;
+    private java.lang.String interlockStatus_dictText;
     /**回路健康级别*/
     @Excel(name = "回路健康级别", width = 15)
     @ApiModelProperty(value = "回路健康级别")

+ 44 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/service/impl/InterlockSummaryServiceImpl.java

@@ -133,15 +133,58 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
 
         InterlockSummary summary = interlockSummaryMapper.selectById(id);
 
+        InterlockBase base = interlockBaseService.getById(summary.getInterlockSystemId());
+
         LambdaQueryWrapper<InterlockDetail> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(InterlockDetail::getSummaryid,id);
         List<InterlockDetail> detailList = interlockDetailMapper.selectList(queryWrapper);
 
         List<InterlockDetailEditQueryVO> interlockDetailEditQueryVOList = detailList.stream().map(i-> {
-            return InterlockDetailConvert.INSTANCE.toEditVO(i);
+            InterlockDetailEditQueryVO vo = InterlockDetailConvert.INSTANCE.toEditVO(i);
+
+            //旁路状态
+            if (base.getBypassYes() != null){
+                if (base.getBypassYes().equals(i.getBypass())) {
+                    vo.setBypass_dictText(base.getBypassYesName());
+                } else vo.setBypass_dictText(base.getBypassNoName());
+            }
+
+            //仪表状态
+            if(base.getInstrumentStatusNormal()!=null ){
+                if (base.getInstrumentStatusNormal().equals(i.getInstrumentStatus())) {
+                    vo.setInstrumentStatus_dictText(base.getInstrumentStatusNormalName());
+                }else vo.setInstrumentStatus_dictText(base.getInstrumentStatusAbnormalName());
+            }
+            //控制系统状态、输入卡件状态、输出卡件状态、MP状态
+            if(base.getControlSystemStatusNormal()!=null){
+                if(base.getControlSystemStatusNormal().equals(i.getControlSystemStatus())) {
+                    vo.setControlSystemStatus_dictText(base.getControlSystemStatusNormalName());
+                }else vo.setControlSystemStatus_dictText(base.getControlSystemStatusAbnormalName());
+
+                if(base.getControlSystemStatusNormal().equals(i.getInputStatus())) {
+                    vo.setInputStatus_dictText(base.getControlSystemStatusNormalName());
+                }else vo.setInputStatus_dictText(base.getControlSystemStatusAbnormalName());
+
+                if(base.getControlSystemStatusNormal().equals(i.getOutputStatus())) {
+                    vo.setOutputStatus_dictText(base.getControlSystemStatusNormalName());
+                }else vo.setOutputStatus_dictText(base.getControlSystemStatusAbnormalName());
+
+                if(base.getControlSystemStatusNormal().equals(i.getMpStatus())) {
+                    vo.setMpStatus_dictText(base.getControlSystemStatusNormalName());
+                }else vo.setMpStatus_dictText(base.getControlSystemStatusAbnormalName());
+            }
+
+            return vo;
         }).collect(Collectors.toList());
 
         InterlockEditQueryVO vo = InterlockSummaryConvert.INSTANCE.toVO(summary, interlockDetailEditQueryVOList);
+
+        //旁路状态
+        if (base.getInterlockStatusTy() != null){
+            if (base.getInterlockStatusTy().equals(summary.getInterlockStatus())) {
+                summary.setInterlockStatusName(base.getInterlockStatusTyName());
+            } else summary.setInterlockStatusName(base.getInterlockStatusWtyName());
+        }
         return vo;
     }