1.技术监督试运行评估-试运行结束后生成试运行报告

2.技术监督计划管理,权限调整为负责地市进行信息修改
3.调整常态化干扰源用户信息更新逻辑
4.调整谐波报告数据请求格式
This commit is contained in:
wr
2024-07-02 16:55:08 +08:00
parent 5ca027513f
commit 50cd5d3895
27 changed files with 510 additions and 283 deletions

View File

@@ -75,18 +75,39 @@ public class ExportModelController extends BaseController {
private final ThemeFeignClient themeFeignClient;
private final ReportService reportService;
private final DeviceUnitClient deviceUnitClient;
private final WordUtil2 wordUtil2;
/**
* @param response
* @param startTime 开始时间
* @param endTime 结束时间
* @param type 区分pq:0 pms:1
* @param lineIndex 监测点id
* @param name 监测点名称
* @param reportNumber 客户编号
* @param crmName 客户名称
* @param file 接线图
* @param isUrl 是否地址栏返回
* @return
* @throws IOException
*/
@PostMapping("/exportModel")
@ApiOperation("word报告")
public HttpResult<String> exportWorld(HttpServletResponse response,
String startTime, String endTime, Integer type, String lineIndex,
String name, String reportNumber, String crmName,
MultipartFile file) throws IOException {
@RequestParam("startTime") String startTime,
@RequestParam("endTime") String endTime,
@RequestParam("type") Integer type,
@RequestParam("lineIndex") String lineIndex,
@RequestParam("name") String name,
@RequestParam("reportNumber") String reportNumber,
@RequestParam("crmName") String crmName,
@RequestParam("isUrl") Boolean isUrl,
@RequestPart("file") MultipartFile file) throws IOException {
String methodDescribe = getMethodDescribe("exportWorld");
//获取监测点信息
String bdname = "";
Integer pttype = 0;
String areaName = "";
String bdname;
Integer pttype;
String areaName;
String atype = "";
String btype = "";
String ctype = "";
@@ -163,9 +184,8 @@ public class ExportModelController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "dataFail", methodDescribe);
}
String rtfPath = "";
String rtfPath;
String picPath = "file/default.jpg";
boolean flagPath = false;
Theme theme = themeFeignClient.getTheme().getData();
if (theme.getRemark().equals("国网")) {
@@ -177,31 +197,16 @@ public class ExportModelController extends BaseController {
} else {
rtfPath = "file/reportModel.docx";
}
ClassPathResource rtfPathResource=null;
ClassPathResource picPathResource=null;
//获取图片信息
ClassPathResource picPathResource = null;
try {
rtfPathResource = new ClassPathResource(rtfPath);
picPathResource = new ClassPathResource(picPath);
rtfPath = rtfPath.replaceAll("%20", " ");
picPath = picPath.replaceAll("%20", " ");
} catch (Exception e1) {
log.info("获取报表发生异常,异常是" + e1.getMessage());
}
InputStream ins = null;
try {
ins = rtfPathResource.getInputStream();
if (null != ins) {
flagPath = true;
}
} catch (FileNotFoundException e) {
flagPath = false;
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "readError", methodDescribe);
} finally {
if (ins != null) {
ins.close();
}
}
Map<String, Object> reportmap = new HashMap<>();// 报告Map
//数据单位
@@ -214,11 +219,31 @@ public class ExportModelController extends BaseController {
Map<String, Object> header = new HashMap<String, Object>();
if (ObjectUtil.isNotEmpty(file)) {
byte[] bytes = file.getBytes();
header.put("width", 400);
header.put("height", 250);
header.put("type", file.getContentType());
header.put("content", bytes);
if(bytes.length>0){
header.put("width", 400);
header.put("height", 250);
header.put("type", file.getContentType());
header.put("content", bytes);
}else{
InputStream inStream = null;
byte[] data = null;
try {
inStream = picPathResource.getInputStream();
data = new byte[inStream.available()];
inStream.read(data);
} catch (Exception e) {
log.info("读取报表信息失败:" + e.getMessage());
} finally {
if (inStream != null) {
inStream.close();
}
}
String contentType = "application/x-jpg";
header.put("width", 400);
header.put("height", 250);
header.put("type", contentType);
header.put("content", data);
}
} else {
InputStream inStream = null;
byte[] data = null;
@@ -226,7 +251,7 @@ public class ExportModelController extends BaseController {
inStream = picPathResource.getInputStream();
data = new byte[inStream.available()];
inStream.read(data);
} catch (FileNotFoundException e) {
} catch (Exception e) {
log.info("读取报表信息失败:" + e.getMessage());
} finally {
if (inStream != null) {
@@ -243,12 +268,12 @@ public class ExportModelController extends BaseController {
reportmap.put("$image$", header);
getVirtualData(param);
ReportValue voltage1 = (ReportValue) this.listVirtual.get(0).getList().get(0);// 电压幅值
ReportValue voltage2 = (ReportValue) this.listVirtual.get(0).getList().get(1);// 电压幅值
ReportValue voltage3 = (ReportValue) this.listVirtual.get(0).getList().get(2);// 电压幅值
ReportValue current1 = (ReportValue) this.listVirtual.get(1).getList().get(0);// 电流幅值
ReportValue current2 = (ReportValue) this.listVirtual.get(1).getList().get(1);// 电流幅值
ReportValue current3 = (ReportValue) this.listVirtual.get(1).getList().get(2);// 电流幅值
ReportValue voltage1 = this.listVirtual.get(0).getList().get(0);// 电压幅值
ReportValue voltage2 = this.listVirtual.get(0).getList().get(1);// 电压幅值
ReportValue voltage3 = this.listVirtual.get(0).getList().get(2);// 电压幅值
ReportValue current1 = this.listVirtual.get(1).getList().get(0);// 电流幅值
ReportValue current2 = this.listVirtual.get(1).getList().get(1);// 电流幅值
ReportValue current3 = this.listVirtual.get(1).getList().get(2);// 电流幅值
String strLineBaseName = String.format("%s%s", new String[]{bdname + "_", name});
String strAnalysis = "";// 分析建议
@@ -366,7 +391,7 @@ public class ExportModelController extends BaseController {
iCount++;
}
// 假如所有的数据都为null,则返回(所选的时间段内未找到数据)
if (iCount == reportmap.size()){
if (iCount == reportmap.size()) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "exportWorld", methodDescribe);
}
// 基本数据判断
@@ -480,12 +505,12 @@ public class ExportModelController extends BaseController {
getVoltageRate(param, overLimit);
getCurrentRate(param, overLimit);
ReportValue pst1 = (ReportValue) this.listFlicker.get(0).getList().get(0);// 短闪
ReportValue pst2 = (ReportValue) this.listFlicker.get(0).getList().get(1);// 短闪
ReportValue pst3 = (ReportValue) this.listFlicker.get(0).getList().get(2);// 短闪
ReportValue plt1 = (ReportValue) this.listFlicker.get(1).getList().get(0);// 长闪
ReportValue plt2 = (ReportValue) this.listFlicker.get(1).getList().get(1);// 长闪
ReportValue plt3 = (ReportValue) this.listFlicker.get(1).getList().get(2);// 长闪
ReportValue pst1 = this.listFlicker.get(0).getList().get(0);// 短闪
ReportValue pst2 = this.listFlicker.get(0).getList().get(1);// 短闪
ReportValue pst3 = this.listFlicker.get(0).getList().get(2);// 短闪
ReportValue plt1 = this.listFlicker.get(1).getList().get(0);// 长闪
ReportValue plt2 = this.listFlicker.get(1).getList().get(1);// 长闪
ReportValue plt3 = this.listFlicker.get(1).getList().get(2);// 长闪
reportmap.put("$LineBase$", String.format("%s%sCT变比为%sPT变比为%s。",
new String[]{bdname, name, lineDto.getCt(), lineDto.getPt()}));// 监测点基本信息
@@ -539,9 +564,9 @@ public class ExportModelController extends BaseController {
/**************************************************************
**** 电压偏差(上偏差和下偏差)
***************************************************************/
ReportValue vdeviation1 = (ReportValue) this.listVdeviation.get(0).getList().get(0);
ReportValue vdeviation2 = (ReportValue) this.listVdeviation.get(0).getList().get(1);
ReportValue vdeviation3 = (ReportValue) this.listVdeviation.get(0).getList().get(2);
ReportValue vdeviation1 = this.listVdeviation.get(0).getList().get(0);
ReportValue vdeviation2 = this.listVdeviation.get(0).getList().get(1);
ReportValue vdeviation3 = this.listVdeviation.get(0).getList().get(2);
String vdeviationLimit = judgeNull(this.listVdeviation.get(0).getOverLimit());// 获取电压上下偏差的国标限值
reportmap.put("$VD_L$", vdeviationLimit);
String strResultVdeviationdata = "";
@@ -615,7 +640,7 @@ public class ExportModelController extends BaseController {
/**************************************************************
**** 频率偏差
***************************************************************/
ReportValue valueOfFreValue = (ReportValue) this.listFrequency.get(1).getList().get(0);
ReportValue valueOfFreValue = this.listFrequency.get(1).getList().get(0);
String valueOfFreLimit = judgeNull(this.listFrequency.get(1).getOverLimit());// 获取频率偏差国标限值
reportmap.put("$FRE_L$", valueOfFreLimit);
String strResultFre = "";
@@ -672,12 +697,12 @@ public class ExportModelController extends BaseController {
if ("".equals(tmpstrResultFre)) {
reportmap.put("$FV0R$", "合格");// 三张大表取值
strResultFre += "从上表中可以看出" + strLineBaseName + "频率偏差均满足国标限值(±" + valueOfFreLimit + deviceUnit.getUnitFrequencyDev()+")的要求。";
strResultFre += "从上表中可以看出" + strLineBaseName + "频率偏差均满足国标限值(±" + valueOfFreLimit + deviceUnit.getUnitFrequencyDev() + ")的要求。";
} else {
reportmap.put("$FV0R$", "不合格");// 三张大表取值
strAnalysis += tmpstrResultFre + ",均不满足国标限值(±" + valueOfFreLimit + deviceUnit.getUnitFrequencyDev()+")的要求。";
strAnalysis += tmpstrResultFre + ",均不满足国标限值(±" + valueOfFreLimit + deviceUnit.getUnitFrequencyDev() + ")的要求。";
strResultFre += "从上表中可以看出" + strLineBaseName + "频率偏差" + tmpstrResultFre + ",均不满足国标限值(±" + valueOfFreLimit
+ deviceUnit.getUnitFrequencyDev()+")的要求。";
+ deviceUnit.getUnitFrequencyDev() + ")的要求。";
}
reportmap.put("$ResultFre$", strResultFre);
@@ -687,7 +712,7 @@ public class ExportModelController extends BaseController {
/**************************************************************
**** 三相电压不平衡度
***************************************************************/
ReportValue valueOfThree = (ReportValue) this.listThreephase.get(0).getList().get(0);
ReportValue valueOfThree = this.listThreephase.get(0).getList().get(0);
String valueOfThreeLimit = judgeNull(this.listThreephase.get(0).getOverLimit());// 获取三相电压不平衡度国标限值
reportmap.put("$THE_L$", valueOfThreeLimit);
String strResultThree = "";
@@ -887,9 +912,9 @@ public class ExportModelController extends BaseController {
String strCurrentRate = strMap + (i + 1) + "%";
// 基波电压含有率
strCurrentA = judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(0)).getCp95Value());
strCurrentB = judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(1)).getCp95Value());
strCurrentC = judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(2)).getCp95Value());
strCurrentA = judgeNull((this.listVoltageRate.get(i).getList().get(0)).getCp95Value());
strCurrentB = judgeNull((this.listVoltageRate.get(i).getList().get(1)).getCp95Value());
strCurrentC = judgeNull((this.listVoltageRate.get(i).getList().get(2)).getCp95Value());
strLimit = judgeNull(this.listVoltageRate.get(i).getOverLimit());
reportmap.put(strCurrentRate + "_A$", strCurrentA);
@@ -905,27 +930,27 @@ public class ExportModelController extends BaseController {
**** 三张大表取值
**************************************/
reportmap.put("$CV" + (i + 1) + "X_A$",
judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(0)).getFmaxValue()));
judgeNull((this.listVoltageRate.get(i).getList().get(0)).getFmaxValue()));
reportmap.put("$CV" + (i + 1) + "X_B$",
judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(1)).getFmaxValue()));
judgeNull((this.listVoltageRate.get(i).getList().get(1)).getFmaxValue()));
reportmap.put("$CV" + (i + 1) + "N_A$",
judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(0)).getMinValue()));
judgeNull((this.listVoltageRate.get(i).getList().get(0)).getMinValue()));
reportmap.put("$CV" + (i + 1) + "N_B$",
judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(1)).getMinValue()));
judgeNull((this.listVoltageRate.get(i).getList().get(1)).getMinValue()));
reportmap.put("$CV" + (i + 1) + "E_A$",
judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(0)).getMeanValue()));
judgeNull((this.listVoltageRate.get(i).getList().get(0)).getMeanValue()));
reportmap.put("$CV" + (i + 1) + "E_B$",
judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(1)).getMeanValue()));
judgeNull((this.listVoltageRate.get(i).getList().get(1)).getMeanValue()));
if (pttype != 2) {
reportmap.put("$CV" + (i + 1) + "X_C$",
judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(2)).getFmaxValue()));
judgeNull((this.listVoltageRate.get(i).getList().get(2)).getFmaxValue()));
reportmap.put("$CV" + (i + 1) + "N_C$",
judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(2)).getMinValue()));
judgeNull((this.listVoltageRate.get(i).getList().get(2)).getMinValue()));
reportmap.put("$CV" + (i + 1) + "E_C$",
judgeNull(((ReportValue) this.listVoltageRate.get(i).getList().get(2)).getMeanValue()));
judgeNull((this.listVoltageRate.get(i).getList().get(2)).getMeanValue()));
reportmap.put("$CV" + (i + 1) + "%_C$", strCurrentC);
} else {
reportmap.put("$CV" + (i + 1) + "X_C$", "-");
@@ -986,9 +1011,9 @@ public class ExportModelController extends BaseController {
/**************************************************************
**** 电压总谐波畸变率(THD)
***************************************************************/
ReportValue distortion1 = (ReportValue) this.listDistortion.get(0).getList().get(0);
ReportValue distortion2 = (ReportValue) this.listDistortion.get(0).getList().get(1);
ReportValue distortion3 = (ReportValue) this.listDistortion.get(0).getList().get(2);
ReportValue distortion1 = this.listDistortion.get(0).getList().get(0);
ReportValue distortion2 = this.listDistortion.get(0).getList().get(1);
ReportValue distortion3 = this.listDistortion.get(0).getList().get(2);
String distortionLimit = judgeNull(this.listDistortion.get(0).getOverLimit());
reportmap.put("$DV0%_L$", distortionLimit);
@@ -1077,9 +1102,9 @@ public class ExportModelController extends BaseController {
String strCurrent = strMap + (i + 1) + "%";
// 基波电压含有率
strCurrentA = judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(0)).getCp95Value());
strCurrentB = judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(1)).getCp95Value());
strCurrentC = judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(2)).getCp95Value());
strCurrentA = judgeNull(this.listICurrent.get(i).getList().get(0).getCp95Value());
strCurrentB = judgeNull(this.listICurrent.get(i).getList().get(1).getCp95Value());
strCurrentC = judgeNull(this.listICurrent.get(i).getList().get(2).getCp95Value());
strLimit = judgeNull(this.listICurrent.get(i).getOverLimit());
reportmap.put(strCurrent + "_A$", strCurrentA);
@@ -1090,17 +1115,17 @@ public class ExportModelController extends BaseController {
/************************************
**** 三张大表取值
**************************************/
reportmap.put("$CI" + (i + 1) + "X_A$", judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(0)).getFmaxValue()));
reportmap.put("$CI" + (i + 1) + "X_B$", judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(1)).getFmaxValue()));
reportmap.put("$CI" + (i + 1) + "X_C$", judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(2)).getFmaxValue()));
reportmap.put("$CI" + (i + 1) + "X_A$", judgeNull(this.listICurrent.get(i).getList().get(0).getFmaxValue()));
reportmap.put("$CI" + (i + 1) + "X_B$", judgeNull(this.listICurrent.get(i).getList().get(1).getFmaxValue()));
reportmap.put("$CI" + (i + 1) + "X_C$", judgeNull(this.listICurrent.get(i).getList().get(2).getFmaxValue()));
reportmap.put("$CI" + (i + 1) + "N_A$", judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(0)).getMinValue()));
reportmap.put("$CI" + (i + 1) + "N_B$", judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(1)).getMinValue()));
reportmap.put("$CI" + (i + 1) + "N_C$", judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(2)).getMinValue()));
reportmap.put("$CI" + (i + 1) + "N_A$", judgeNull(this.listICurrent.get(i).getList().get(0).getMinValue()));
reportmap.put("$CI" + (i + 1) + "N_B$", judgeNull(this.listICurrent.get(i).getList().get(1).getMinValue()));
reportmap.put("$CI" + (i + 1) + "N_C$", judgeNull(this.listICurrent.get(i).getList().get(2).getMinValue()));
reportmap.put("$CI" + (i + 1) + "E_A$", judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(0)).getMeanValue()));
reportmap.put("$CI" + (i + 1) + "E_B$", judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(1)).getMeanValue()));
reportmap.put("$CI" + (i + 1) + "E_C$", judgeNull(((ReportValue) this.listICurrent.get(i).getList().get(2)).getMeanValue()));
reportmap.put("$CI" + (i + 1) + "E_A$", judgeNull(this.listICurrent.get(i).getList().get(0).getMeanValue()));
reportmap.put("$CI" + (i + 1) + "E_B$", judgeNull(this.listICurrent.get(i).getList().get(1).getMeanValue()));
reportmap.put("$CI" + (i + 1) + "E_C$", judgeNull(this.listICurrent.get(i).getList().get(2).getMeanValue()));
reportmap.put("$CI" + (i + 1) + "%_A$", strCurrentA);
reportmap.put("$CI" + (i + 1) + "%_B$", strCurrentB);
@@ -1159,7 +1184,7 @@ public class ExportModelController extends BaseController {
// 测试结果填写
reportmap.put("$ResultTitle$", String.format("通过对(%s——%s时间段内%s电能质量统计数据分析后得出以下结论",
new String[]{DateUtil.format(startDate, "yyyy年MM月dd日 HH时mm分ss秒"),
DateUtil.format(endDate, "yyyy年MM月dd日 HH时mm分ss秒"),strLineBaseName}));// 结论标题
DateUtil.format(endDate, "yyyy年MM月dd日 HH时mm分ss秒"), strLineBaseName}));// 结论标题
reportmap.put("$Result_VD$", String.format("1电压偏差%s", new String[]{strResultVdeviationdata}));// 电压偏差
reportmap.put("$Result_FRE$", String.format("2频率偏差%s", new String[]{strResultFre}));// 频率偏差
reportmap.put("$Result_THE$", String.format("3三相电压不平衡度%s", new String[]{strResultThree}));// 三相电压不平衡度
@@ -1177,10 +1202,10 @@ public class ExportModelController extends BaseController {
**** 三张大表取值 有功:0-11 无功:12-23 视在:24-31 基波有功汇总:32-35 基波无功汇总:36-39
* 基波视在汇总:40-43 功率因数:44-46
**************************************/
ReportValue powerDto1 = (ReportValue) this.listPower.get(0).getList().get(3);
ReportValue powerDto2 = (ReportValue) this.listPower.get(1).getList().get(3);
ReportValue powerDto3 = (ReportValue) this.listPower.get(2).getList().get(3);
ReportValue powerDto4 = (ReportValue) this.listPower.get(3).getList().get(3);
ReportValue powerDto1 = this.listPower.get(0).getList().get(3);
ReportValue powerDto2 = this.listPower.get(1).getList().get(3);
ReportValue powerDto3 = this.listPower.get(2).getList().get(3);
ReportValue powerDto4 = this.listPower.get(3).getList().get(3);
reportmap.put("$BF0X$", judgeNull(powerDto1.getFmaxValue()));
reportmap.put("$BF0N$", judgeNull(powerDto1.getMinValue()));
reportmap.put("$BF0E$", judgeNull(powerDto1.getMeanValue()));
@@ -1198,64 +1223,70 @@ public class ExportModelController extends BaseController {
reportmap.put("$YF0E$", judgeNull(powerDto4.getMeanValue()));
formatter = new SimpleDateFormat("yyyyMMddHHmmss");// 报告时分秒格式
WordUtil2 oRTF = new WordUtil2();
String reportFileUrl = "";
try {
oRTF.getWord(rtfPath, reportmap, name + formatter.format(currentTime) + ".docx", response);
String fileName = name + formatter.format(currentTime) + ".docx";
if (isUrl) {
reportFileUrl = wordUtil2.getReportFileUrl(rtfPath, name + formatter.format(currentTime) + ".docx", reportmap);
} else {
wordUtil2.getWord(rtfPath, reportmap, fileName, response);
}
} catch (Exception e) {
log.error("获取报告发生异常,异常是" + e.getMessage());
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, reportFileUrl, methodDescribe);
}
/**
* 数据单位信息 重组
*
* @param deviceUnit 数据单位对象
* @return
*/
private Map<String,String> unitMap(PqsDeviceUnit deviceUnit){
private Map<String, String> unitMap(PqsDeviceUnit deviceUnit) {
List<DictData> dictData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEVICE_UNIT.getCode()).getData();
Map<String,String> unit=new HashMap<>();
Map<String, String> unit = new HashMap<>();
List<String> list = dictData.stream().map(DictData::getCode).collect(Collectors.toList());
for (String s : list) {
//有效值
if(s.equals(DicDataEnum.EFFECTIVE.getCode())){
unit.put("$"+s+"_i$",deviceUnit.getIeffective());
unit.put("$"+s+"_v$",deviceUnit.getLineVoltage());
if (s.equals(DicDataEnum.EFFECTIVE.getCode())) {
unit.put("$" + s + "_i$", deviceUnit.getIeffective());
unit.put("$" + s + "_v$", deviceUnit.getLineVoltage());
}
//功率
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.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.DISTORTION.getCode())) {
unit.put("$" + s + "_v$", deviceUnit.getVdistortion());
}
//电压偏差
if(s.equals(DicDataEnum.VOLTAGE.getCode())){
unit.put("$"+s+"_v$",deviceUnit.getVoltageDev());
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.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.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());
if (s.equals(DicDataEnum.FUND.getCode())) {
unit.put("$" + s + "_i$", deviceUnit.getIfund());
unit.put("$" + s + "_v$", deviceUnit.getVfundEffective());
}
}
@@ -1485,7 +1516,7 @@ public class ExportModelController extends BaseController {
List<Float> iHarmList = getIHarmList(overLimit);
for (int i = 0; i < 50; i++) {
Pass pass;
if (i <iHarmList.size() + 1 && i > 0) {
if (i < iHarmList.size() + 1 && i > 0) {
pass = new Pass(iHarmList.get(i - 1),
EnumPass.CP95.getCode());
} else {
@@ -1497,6 +1528,7 @@ public class ExportModelController extends BaseController {
this.listICurrent = new ArrayList<>();
transformData(this.listICurrent, listICurrent, list, true);
}
// 谐波电压
public void getVoltageRate(ReportQueryParam param, Overlimit overLimit) {
List<ReportValue> listVoltageRate = reportService.getVoltageRate(param);
@@ -1523,12 +1555,14 @@ public class ExportModelController extends BaseController {
this.listVoltageRate = new ArrayList<>();
transformData(this.listVoltageRate, listVoltageRate, list, true);
}
public String judgeNull(Float result) {
return (result == null) ? "/" : result.toString();
}
/**
* 谐波电流限值
*
* @param overLimit
* @return
*/
@@ -1563,6 +1597,7 @@ public class ExportModelController extends BaseController {
/**
* 谐波电压限值
*
* @return
*/
public List<Float> getVHarmList(Overlimit overLimit) {