1.解决分类指标,变电站电压等级图表的,排序问题。
2.添加台账审核属性
This commit is contained in:
@@ -25,6 +25,6 @@ public interface RStatSubstationVoltageMMapper extends BaseMapper<RStatSubstatio
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RVoltageIconVO> getStatSubstationIcon(@Param("param") StatSubstationBizBaseParam param);
|
||||
List<RVoltageIconVO> getStatSubstationIcon(@Param("param") StatSubstationBizBaseParam param,@Param("ids")List<String> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND substation_voltage IN
|
||||
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
</if>
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@@ -53,12 +54,19 @@ public class RStatSubstationVoltageMServiceImpl extends ServiceImpl<RStatSubstat
|
||||
//获取电压信息
|
||||
List<DictData> devVoltageData = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
List<String> ids = devVoltageData.stream().map(DictData::getId).collect(Collectors.toList());
|
||||
Map<String, Integer> iconVOMap = devVoltageData.stream()
|
||||
.collect(Collectors.toMap(DictData::getId,DictData::getSort ));
|
||||
|
||||
//查询数据库
|
||||
List<RVoltageIconVO> statSubstationIcon = rStatSubstationVoltageMMapper.getStatSubstationIcon(baseParam);
|
||||
List<RVoltageIconVO> statSubstationIcon = rStatSubstationVoltageMMapper.getStatSubstationIcon(baseParam,ids);
|
||||
Map<String, RVoltageIconVO> devVoltageMap = statSubstationIcon.stream()
|
||||
.collect(Collectors.toMap(RVoltageIconVO::getSubstationVoltage, Function.identity()));
|
||||
|
||||
statSubstationIcon.stream().forEach(r->{
|
||||
if(iconVOMap.containsKey(r.getSubstationVoltage())){
|
||||
r.setSort(iconVOMap.get(r.getSubstationVoltage()));
|
||||
}
|
||||
});
|
||||
//处理主节点不存在的集合
|
||||
List<DictData> notMeasurementList = devVoltageData.stream().filter(r -> !devVoltageMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
@@ -67,8 +75,10 @@ public class RStatSubstationVoltageMServiceImpl extends ServiceImpl<RStatSubstat
|
||||
iconVO.setSubstationVoltage(notData.getId());
|
||||
iconVO.setSubstationCount(0);
|
||||
iconVO.setHarmonicCount(0);
|
||||
iconVO.setSort(notData.getSort());
|
||||
statSubstationIcon.add(iconVO);
|
||||
}
|
||||
statSubstationIcon.sort(Comparator.comparing(s -> s.getSort()));
|
||||
return statSubstationIcon;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user