1.根据code获取字典树
2.解决数据中心bug 3.优化暂态报表的查询语句将influxdb转为mysql
This commit is contained in:
@@ -106,4 +106,14 @@ public interface CustomReportService {
|
||||
List<ReportTemplateVO> getTemplateByDept(String id);
|
||||
|
||||
void viewCustomReportTemplateById(String id, HttpServletResponse response);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 获取数据单位树
|
||||
* @param
|
||||
* @return: java.util.List<com.njcn.harmonic.pojo.vo.ReportTreeVO>
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/28 10:58
|
||||
*/
|
||||
List<ReportTreeVO> deviceUnitTree();
|
||||
}
|
||||
|
||||
@@ -188,6 +188,73 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportTreeVO> deviceUnitTree() {
|
||||
List<DictData> dictData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEVICE_UNIT.getCode()).getData();
|
||||
Map<String,String> unit=new HashMap<>();
|
||||
List<String> list = dictData.stream().map(DictData::getCode).collect(Collectors.toList());
|
||||
List<ReportTreeVO> info=new ArrayList<>();
|
||||
List<ReportTreeVO> treeVOS=new ArrayList<>();
|
||||
ReportTreeVO reportTreeVO;
|
||||
for (String s : list) {
|
||||
treeVOS=new ArrayList<>();
|
||||
//有效值
|
||||
if(s.equals(DicDataEnum.EFFECTIVE.getCode())){
|
||||
reportTreeVO=new ReportTreeVO();
|
||||
reportTreeVO.setName("$"+s+"#i$");
|
||||
reportTreeVO.setShowName(DicDataEnum.EFFECTIVE.getName());
|
||||
treeVOS.add(reportTreeVO);
|
||||
reportTreeVO=new ReportTreeVO();
|
||||
reportTreeVO.setName("$"+s+"#v$");
|
||||
reportTreeVO.setShowName(DicDataEnum.EFFECTIVE.getName());
|
||||
treeVOS.add(reportTreeVO);
|
||||
|
||||
reportTreeVO=new ReportTreeVO();
|
||||
reportTreeVO.setName(s);
|
||||
reportTreeVO.setShowName(DicDataEnum.EFFECTIVE.getName());
|
||||
reportTreeVO.setChildren(treeVOS);
|
||||
info.add(reportTreeVO);
|
||||
}
|
||||
//功率
|
||||
// if(s.equals(DicDataEnum.POWER.getCode())){
|
||||
// unit.put(s+"#p",deviceUnit.getTotalActiveP());
|
||||
// unit.put(s+"#q",deviceUnit.getTotalNoP());
|
||||
// unit.put(s+"#s",deviceUnit.getTotalViewP());
|
||||
// }
|
||||
// //畸变率
|
||||
// if(s.equals(DicDataEnum.DISTORTION.getCode())){
|
||||
// unit.put(s+"#v",deviceUnit.getVdistortion());
|
||||
// }
|
||||
// //电压偏差
|
||||
// if(s.equals(DicDataEnum.VOLTAGE.getCode())){
|
||||
// unit.put(s+"#v",deviceUnit.getVoltageDev());
|
||||
// }
|
||||
// //频率
|
||||
// if(s.equals(DicDataEnum.UNIT_FREQUENCY.getCode())){
|
||||
// unit.put(s+"#freq",deviceUnit.getUnitFrequency());
|
||||
// unit.put(s+"#freqDev",deviceUnit.getUnitFrequencyDev());
|
||||
// }
|
||||
// //三项不平衡度
|
||||
// if(s.equals(DicDataEnum.UNBALANCE.getCode())){
|
||||
// unit.put(s+"#v","%");
|
||||
// unit.put(s+"#vPos",deviceUnit.getPositiveV());
|
||||
// unit.put(s+"#vNeg",deviceUnit.getNoPositiveV());
|
||||
// unit.put(s+"#vZero",deviceUnit.getNoPositiveV());
|
||||
// unit.put(s+"#i","%");
|
||||
// unit.put(s+"#iPos","A");
|
||||
// unit.put(s+"#iNeg","A");
|
||||
// unit.put(s+"#iZero","A");
|
||||
// }
|
||||
// //基波
|
||||
// if(s.equals(DicDataEnum.FUND.getCode())){
|
||||
// unit.put(s+"#i",deviceUnit.getIfund());
|
||||
// unit.put(s+"#v",deviceUnit.getVfundEffective());
|
||||
//
|
||||
// }
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportTemplateVO> getTemplateList(ReportSearchParam reportSearchParam) {
|
||||
return excelRptTempMapper.getReportTemplateList(reportSearchParam);
|
||||
|
||||
Reference in New Issue
Block a user