|
@@ -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;
|
|
|
}
|
|
|
|
|
|
/**
|