Bläddra i källkod

联锁总表、详细信息查询根据系统设置状态转化

LLL 8 månader sedan
förälder
incheckning
29d28e504f

+ 0 - 23
jeecg-module-interlock/src/main/java/org/jeecg/modules/base/entity/InterlockBase.java

@@ -70,29 +70,6 @@ public class InterlockBase implements Serializable {
     @ApiModelProperty(value = "所属部门")
     private java.lang.String sysOrgCode;
 
-
-    /**输入卡件状态-正常*/
-    @Excel(name = "输入卡件状态-正常", width = 15)
-    @ApiModelProperty(value = "输入卡件状态-正常")
-    @Dict(dicCode = "input_status_normal")
-    private java.lang.String inputStatusNormal;
-    private java.lang.String inputStatusNormalName;
-    private java.lang.String inputStatusAbnormalName;
-    /**输出卡件状态-正常*/
-    @Excel(name = "输出卡件状态-正常", width = 15)
-    @ApiModelProperty(value = "输出卡件状态-正常")
-    @Dict(dicCode = "output_status_normal")
-    private java.lang.String outputStatusNormal;
-    private java.lang.String outputStatusNormalName;
-    private java.lang.String outputStatusAbnormalName;
-    /**MP状态-正常*/
-    @Excel(name = "MP状态-正常", width = 15)
-    @ApiModelProperty(value = "MP状态-正常")
-    @Dict(dicCode = "mp_status_normal")
-    private java.lang.String mpStatusNormal;
-    private java.lang.String mpStatusNormalName;
-    private java.lang.String mpStatusAbnormalName;
-
     /**控制系统状态-正常*/
     @Excel(name = "控制系统状态-正常", width = 15)
     @ApiModelProperty(value = "控制系统状态-正常")

+ 56 - 2
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/service/impl/InterlockDetailServiceImpl.java

@@ -2,6 +2,8 @@ package org.jeecg.modules.detail.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.base.entity.InterlockBase;
+import org.jeecg.modules.base.mapper.InterlockBaseMapper;
 import org.jeecg.modules.detail.dto.InterlockDetailQueryDTO;
 import org.jeecg.modules.detail.entity.InterlockDetail;
 import org.jeecg.modules.detail.mapper.InterlockDetailMapper;
@@ -14,6 +16,7 @@ import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 联锁详细信息表
@@ -27,16 +30,67 @@ public class InterlockDetailServiceImpl extends ServiceImpl<InterlockDetailMappe
     @Autowired
     @SuppressWarnings("all")
     private InterlockDetailMapper interlockDetailMapper;
+    @Autowired
+    @SuppressWarnings("all")
+    private InterlockBaseMapper interlockBaseMapper;
 
     /**联锁详细信息表分页列表查询*/
     public IPage<InterlockDetailQueryVO> getPage2(Page<InterlockDetailQueryVO> page, InterlockDetailQueryDTO dto){
-        return interlockDetailMapper.getPage2(page, dto);
+        IPage<InterlockDetailQueryVO> voiPage = interlockDetailMapper.getPage2(page, dto);
+        InterlockBase base = interlockBaseMapper.selectById(dto.getInterlockSystemId());
+        if(base != null){
+            List<InterlockDetailQueryVO> list = voiPage.getRecords().stream().map(i->{
+                //旁路状态转换
+                if(i.getBypass()!=null && base.getBypassYes()!=null){
+                    if(i.getBypass().equals(base.getBypassYes())) i.setBypass_dictText(base.getBypassYesName());
+                    else i.setBypass_dictText(base.getBypassNoName());
+                }
+                //输入卡件状态转换
+                if(i.getInputStatus()!=null && base.getControlSystemStatusNormal()!=null){
+                    if(i.getInputStatus().equals(base.getControlSystemStatusNormal())) i.setInputStatus_dictText(base.getControlSystemStatusNormalName());
+                    else i.setInputStatus_dictText(base.getControlSystemStatusAbnormalName());
+                }
+                //输出卡件状态转换
+                if(i.getOutputStatus()!=null && base.getControlSystemStatusNormal()!=null){
+                    if(i.getOutputStatus().equals(base.getControlSystemStatusNormal())) i.setOutputStatus_dictText(base.getControlSystemStatusNormalName());
+                    else i.setOutputStatus_dictText(base.getControlSystemStatusAbnormalName());
+                }
+                //MP状态转换
+                if(i.getMpStatus()!=null && base.getControlSystemStatusNormal()!=null){
+                    if(i.getMpStatus().equals(base.getControlSystemStatusNormal())) i.setMpStatus_dictText(base.getControlSystemStatusNormalName());
+                    else i.setMpStatus_dictText(base.getControlSystemStatusAbnormalName());
+                }
+                return i;
+            }).collect(Collectors.toList());
+            voiPage.setRecords(list);
+        }
+        return voiPage;
     }
 
 
     /**联锁总表-分页列表查询(各种逻辑状态)*/
     public IPage<InterlockSummaryVO> getPage(Page<InterlockSummaryVO> page, InterlockSummaryVO interlockSummaryVO) {
-        return interlockDetailMapper.getPage(page, interlockSummaryVO);
+        IPage<InterlockSummaryVO> voiPage = interlockDetailMapper.getPage(page, interlockSummaryVO);
+        List<InterlockSummaryVO> list = voiPage.getRecords().stream().map(i->{
+            InterlockBase base = interlockBaseMapper.selectById(i.getInterlockSystemId());
+            if(base != null){
+                //控制系统状态转换
+                if(base.getControlSystemStatusNormal().equals(i.getControlSystemStatus())) i.setControlSystemStatus_dictText(base.getControlSystemStatusNormalName());
+                else i.setControlSystemStatus_dictText(base.getControlSystemStatusAbnormalName());
+                //联锁状态转换
+                if(base.getInterlockStatusTy().equals(i.getInterlockStatus())) i.setInterlockStatus_dictText(base.getInterlockStatusTyName());
+                else i.setInterlockStatus_dictText(base.getInterlockStatusWtyName());
+                //旁路状态转换
+                if(base.getBypassYes().equals(i.getBypass())) i.setBypass_dictText(base.getBypassYesName());
+                else i.setBypass_dictText(base.getBypassNoName());
+                //仪表状态转换
+                if(base.getInstrumentStatusNormal().equals(i.getInstrumentStatus())) i.setInstrumentStatus_dictText(base.getInstrumentStatusNormalName());
+                else i.setInstrumentStatus_dictText(base.getInstrumentStatusAbnormalName());
+            }
+            return i;
+        }).collect(Collectors.toList());
+        voiPage.setRecords(list);
+        return voiPage;
     }
 
     /**