Merge remote-tracking branch 'origin/main'

This commit is contained in:
wr
2026-02-06 15:09:30 +08:00
21 changed files with 170 additions and 55 deletions

View File

@@ -9,8 +9,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.advance.enums.AdvanceResponseEnum;
import com.njcn.advance.mapper.govern.voltage.SgMachineMapper;
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
import com.njcn.advance.pojo.param.govern.voltage.SgUserParam;
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
import com.njcn.advance.pojo.po.govern.voltage.SgUser;
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
import com.njcn.advance.service.govern.voltage.ISgMachineService;
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
@@ -56,12 +58,34 @@ public class SgMachineServiceImpl extends ServiceImpl<SgMachineMapper, SgMachine
@Override
public String addMachine(SgMachineParam sgMachineParam) {
SgMachine sgMachine = new SgMachine();
checkMachineName(sgMachineParam, false);
BeanUtil.copyProperties(sgMachineParam, sgMachine);
//默认为正常状态
sgMachine.setState(DataStateEnum.ENABLE.getCode());
this.save(sgMachine);
return sgMachine.getId();
}
/**
* 校验参数,检查是否存在相同名称的业务用户
*/
private void checkMachineName(SgMachineParam sgMachineParam, boolean isExcludeSelf) {
LambdaQueryWrapper<SgMachine> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
sgUserLambdaQueryWrapper
.eq(SgMachine::getName, sgMachineParam.getName())
.eq(SgMachine::getState, DataStateEnum.ENABLE.getCode());
//更新的时候,需排除当前记录
if (isExcludeSelf) {
if (sgMachineParam instanceof SgMachineParam.SgMachineUpdateParam) {
sgUserLambdaQueryWrapper.ne(SgMachine::getId, ((SgMachineParam.SgMachineUpdateParam) sgMachineParam).getId());
}
}
int countByAccount = this.count(sgUserLambdaQueryWrapper);
//大于等于1个则表示重复
if (countByAccount >= 1) {
throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT);
}
}
/**
* 更新设备
@@ -70,6 +94,8 @@ public class SgMachineServiceImpl extends ServiceImpl<SgMachineMapper, SgMachine
@Override
public boolean updateSgMachine(SgMachineParam.SgMachineUpdateParam updateParam) {
SgMachine sgMachine = new SgMachine();
checkMachineName(updateParam, true);
BeanUtil.copyProperties(updateParam, sgMachine);
return this.updateById(sgMachine);
}

View File

@@ -2,12 +2,15 @@ package com.njcn.advance.service.govern.voltage.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.advance.enums.AdvanceResponseEnum;
import com.njcn.advance.mapper.govern.voltage.SgSensitiveUnitMapper;
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
import com.njcn.advance.pojo.param.govern.voltage.SgSensitiveUnitParam;
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
@@ -54,12 +57,34 @@ public class SgSensitiveUnitServiceImpl extends ServiceImpl<SgSensitiveUnitMappe
@Override
public String addSensitiveUnit(SgSensitiveUnitParam sgSensitiveUnitParam) {
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
checkSensitiveUnitName(sgSensitiveUnitParam, false);
BeanUtil.copyProperties(sgSensitiveUnitParam, sgSensitiveUnit);
//默认为正常状态
sgSensitiveUnit.setState(DataStateEnum.ENABLE.getCode());
this.save(sgSensitiveUnit);
return sgSensitiveUnit.getId();
}
/**
* 校验参数,检查是否存在相同名称的业务用户
*/
private void checkSensitiveUnitName(SgSensitiveUnitParam sgSensitiveUnitParam, boolean isExcludeSelf) {
LambdaQueryWrapper<SgSensitiveUnit> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
sgUserLambdaQueryWrapper
.eq(SgSensitiveUnit::getName, sgSensitiveUnitParam.getName())
.eq(SgSensitiveUnit::getState, DataStateEnum.ENABLE.getCode());
//更新的时候,需排除当前记录
if (isExcludeSelf) {
if (sgSensitiveUnitParam instanceof SgSensitiveUnitParam.SgSensitiveUnitUpdateParam) {
sgUserLambdaQueryWrapper.ne(SgSensitiveUnit::getId, ((SgSensitiveUnitParam.SgSensitiveUnitUpdateParam) sgSensitiveUnitParam).getId());
}
}
int countByAccount = this.count(sgUserLambdaQueryWrapper);
//大于等于1个则表示重复
if (countByAccount >= 1) {
throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT);
}
}
/**
* 更新元器件
@@ -69,6 +94,8 @@ public class SgSensitiveUnitServiceImpl extends ServiceImpl<SgSensitiveUnitMappe
@Override
public boolean updateSgSensitiveUnit(SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam) {
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
checkSensitiveUnitName(updateParam, true);
BeanUtil.copyProperties(updateParam, sgSensitiveUnit);
return this.updateById(sgSensitiveUnit);
}

View File

@@ -512,7 +512,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
lambdaQueryWrapper.like(RmpEventDetailAssPO::getContentDes, baseParam.getSearchValue());
}
lambdaQueryWrapper.between(RmpEventDetailAssPO::getTimeId, timeV.get(0), timeV.get(1))
.orderByAsc(RmpEventDetailAssPO::getTimeId);
.orderByDesc(RmpEventDetailAssPO::getTimeId);
return rmpEventDetailAssMapper.selectPage(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
}

View File

@@ -81,7 +81,13 @@ public class EventWaveAnalysisServiceImpl implements EventWaveAnalysisService {
inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG);
inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT);
} catch (Exception e) {
throw new BusinessException("暂降cfg,dat文件缺失,请联系管理员");
try {
inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG.toLowerCase());
inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT.toLowerCase());
} catch (Exception e1) {
throw new BusinessException("暂降cfg,dat文件缺失,请联系管理员");
}
}
//读取

View File

@@ -88,7 +88,7 @@ public class BpmSignParam extends BaseEntity implements Serializable {
private String name;
@ApiModelProperty("标识key")
private String key;
private String signKey;
}

View File

@@ -67,8 +67,8 @@ public class BpmCategoryServiceImpl extends ServiceImpl<BpmCategoryMapper, BpmCa
@Override
public Page<BpmCategoryVO> getCategoryPage(BpmCategoryParam.BpmCategoryQueryParam bpmCategoryQueryParam) {
QueryWrapper<BpmCategoryVO> categoryVOQueryWrapper = new QueryWrapper<>();
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getName())) {
categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getName());
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getSearchValue())) {
categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getSearchValue());
}
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getCode())) {

View File

@@ -106,8 +106,8 @@ public class BpmSignServiceImpl extends ServiceImpl<BpmSignMapper, BpmSign> impl
bpmSignVOQueryWrapper.like("bpm_sign.name", bpmSignQueryParam.getName());
}
if (StrUtil.isNotBlank(bpmSignQueryParam.getKey())) {
bpmSignVOQueryWrapper.like("bpm_sign.signKey", bpmSignQueryParam.getKey());
if (StrUtil.isNotBlank(bpmSignQueryParam.getSignKey())) {
bpmSignVOQueryWrapper.like("bpm_sign.sign_key", bpmSignQueryParam.getSignKey());
}
bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode());
bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort");

View File

@@ -258,7 +258,7 @@ public interface PatternRegex {
/**
* 任意字符长度在1-20位常用于名称、编码等常规录入
*/
String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,20}$";
String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,32}$";
String SPECIALCHARACTER ="[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html";

View File

@@ -33,6 +33,8 @@ public class PieGenerator {
Option reasonOption = new Option();
//取消渲染动画
reasonOption.setAnimation(false);
String[] colorArr = {"#526ADE", "#00BFF5","#FFBF00","#77DA63","#D5FF6B"};
reasonOption.setColor(colorArr);
//背景色
reasonOption.setBackgroundColor(PicCommonData.PIC_BACK_COLOR);
//标题

View File

@@ -15,6 +15,7 @@
STATUS = 1
</select>
<select id="sortTransformer" resultType="java.lang.Integer">
select IFNULL(max(pqs_transformer.sort),0) from pqs_transformer order by update_time desc
select IFNULL(max(pqs_transformer.sort),0) from pqs_transformer
<!-- order by update_time desc-->
</select>
</mapper>

View File

@@ -119,7 +119,7 @@ public class PqsTflgployServiceImpl extends ServiceImpl<PqsTflgployMapper, PqsTf
}
private void addList(TflgployParam param, PqsTflgploy tflgploy, boolean save, List<PqsTflgployass> info) {
if(save){
// if(save){
List<String> tfIndexs = param.getTfIndexs();
if(CollUtil.isNotEmpty(tfIndexs)){
PqsTflgployass ass;
@@ -129,7 +129,7 @@ public class PqsTflgployServiceImpl extends ServiceImpl<PqsTflgployMapper, PqsTf
ass.setTfIndex(tfIndex);
info.add(ass);
}
}
// }
}
}

View File

@@ -198,7 +198,7 @@ public class DeviceController extends BaseController {
@ApiOperation("修改装置通讯状态及时间")
public HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) {
String methodDescribe = getMethodDescribe("updateDevComFlag");
boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()),Device::getComFlag,devComFlagDTO.getStatus() ).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()),Device::getComFlag,devComFlagDTO.getStatus() ).set(Objects.nonNull(devComFlagDTO.getDate()),Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
}

View File

@@ -38,7 +38,7 @@ public class TerminalVersionServiceImpl implements TerminalVersionService {
List<TerminalVersionVO> devList = terminalVersionMapper.getTerminalVersionInfo(terminalMainQueryParam);
if(CollectionUtil.isEmpty(devList)){
throw new BusinessException(DeviceResponseEnum.DEVICE_EMPTY);
return devList;
}
List<String> subIndexes = devList.stream().map(TerminalVersionVO::getPid).collect(Collectors.toList());
List<TerminalVersionVO> subList =terminalVersionMapper.getPqLineGdAndSubList(subIndexes);

View File

@@ -43,7 +43,7 @@
a.name lineName,
c.Time_Interval,
d.Scale AS scale,
c.Obj_Id obyId,
c.Obj_Id objId,
c.Big_Obj_Type bigObjType
from pq_line a
inner join pq_line b on a.pid = b.id

View File

@@ -1269,7 +1269,8 @@
SELECT
voltage.id as id,
sub.id as pid,
concat( sub.NAME, " ", voltage.NAME ) as name,
<!-- 兼容国产数据库-->
concat( sub.NAME, ' ', voltage.NAME ) as name,
voltage.Sort as sort
FROM
pq_line voltage
@@ -1513,14 +1514,14 @@
line.id AS lineId,
CONCAT(sub.NAME, '_', vo.NAME, '_', line.NAME) AS lineName,
CONCAT(
IFNULL(CAST(detail.pt1 AS CHAR), 'N/A'),
IFNULL(CAST(detail.pt1 AS VARCHAR), 'N/A'),
':',
IFNULL(CAST(detail.pt2 AS CHAR), 'N/A')
IFNULL(CAST(detail.pt2 AS VARCHAR), 'N/A')
) AS pt,
CONCAT(
IFNULL(CAST(detail.ct1 AS CHAR), 'N/A'),
IFNULL(CAST(detail.ct1 AS VARCHAR), 'N/A'),
':',
IFNULL(CAST(detail.ct2 AS CHAR), 'N/A')
IFNULL(CAST(detail.ct2 AS VARCHAR), 'N/A')
) AS ct,
detail.Dev_Capacity AS Dev_Capacity,
detail.Short_Capacity AS Short_Capacity,

View File

@@ -747,8 +747,8 @@ public class ReportServiceImpl implements ReportService {
bodyFont.setFontHeightInPoints((short) 9);
bodyStyle.setFont(bodyFont);
sheet2(sheets, cellStyle, bodyStyle, businessParam);
sheet3(sheets, cellStyle, bodyStyle, businessParam);
sheet2(sheets, cellStyle, bodyStyle, businessParam);
sheet4(sheets, cellStyle, bodyStyle, businessParam);
sheet5(sheets, cellStyle, bodyStyle, businessParam);
sheet6(sheets, cellStyle, bodyStyle, businessParam);
@@ -909,7 +909,7 @@ public class ReportServiceImpl implements ReportService {
public void sheet2(HSSFWorkbook sheets, HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle, DeviceInfoParam.BusinessParam businessParam) {
sheets.createSheet("暂态严重度统计");
HSSFSheet sheetAt = sheets.getSheetAt(1);
HSSFSheet sheetAt = sheets.getSheetAt(2);
sheetAt.setColumnWidth(0, 24 * 256);
sheetAt.setColumnWidth(1, 24 * 256);
sheetAt.setColumnWidth(2, 24 * 256);
@@ -1001,7 +1001,7 @@ public class ReportServiceImpl implements ReportService {
public void sheet3(HSSFWorkbook sheets, HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle, DeviceInfoParam.BusinessParam businessParam) throws TemplateException, IOException {
sheets.createSheet("暂态原因统计");
HSSFSheet sheetAt = sheets.getSheetAt(2);
HSSFSheet sheetAt = sheets.getSheetAt(1);
sheetAt.setColumnWidth(0, 40 * 256);
sheetAt.setColumnWidth(1, 40 * 256);
sheetAt.setColumnWidth(2, 40 * 256);

View File

@@ -12,9 +12,9 @@ import com.njcn.echarts.pojo.constant.PicCommonData;
import com.njcn.echarts.util.DrawPicUtil;
import com.njcn.event.common.mapper.RmpEventDetailMapper;
import com.njcn.event.common.pojo.dto.LineDetailDataCommDTO;
import com.njcn.event.common.service.CommMonitorEventReportService;
import com.njcn.event.common.service.EventAnalysisService;
import com.njcn.event.common.service.EventReportService;
import com.njcn.event.common.service.CommMonitorEventReportService;
import com.njcn.event.common.utils.WordUtils;
import com.njcn.event.pojo.param.ExportParam;
import com.njcn.event.pojo.param.StatisticsParam;
@@ -218,7 +218,7 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport
EventDetail eventDetail = plot.get(j);
String s = eventDetail.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"));
insertRow(doc, table, centerParagraph, false, j + 1 + "", s, BigDecimal.valueOf(eventDetail.getFeatureAmplitude() * 100).setScale(2, RoundingMode.HALF_UP).toString(), eventDetail.getDuration() + "", eventDetail.getAdvanceType(), eventDetail.getAdvanceReason(), eventDetail.getSeverity() + "");
insertRow(doc, table, centerParagraph, false, j + 1 + "", s, BigDecimal.valueOf(eventDetail.getFeatureAmplitude() * 100).setScale(2, RoundingMode.HALF_UP).toString(), eventDetail.getDuration() + "", Objects.isNull(eventDetail.getAdvanceType())?"/":eventDetail.getAdvanceType(), Objects.isNull(eventDetail.getAdvanceReason())?"/":eventDetail.getAdvanceReason(), Objects.isNull(eventDetail.getSeverity())?"/":eventDetail.getSeverity() + "");
}
i++;
}
@@ -585,6 +585,7 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport
// .in(RmpEventDetailPO::getEventType, typeIds)
.ge(StrUtil.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime())))
.le(StrUtil.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
.orderByDesc(RmpEventDetailPO::getStartTime)
);
return BeanUtil.copyToList(info, EventDetail.class);

View File

@@ -125,6 +125,6 @@ public class ExportModelController extends BaseController {
monitorHarmonicReportService.exportWorld(response,startTime,endTime,type,lineIndex,name,reportNumber,crmName,isUrl,file, harmLineDetailDataCommDTO,overLimitInfoCommDTO,deviceUnitCommDTO);
monitorHarmonicReportService.exportWorld(response,startTime,endTime,type,lineIndex,name,reportNumber,crmName,isUrl,file, harmLineDetailDataCommDTO,overLimitInfoCommDTO,deviceUnitCommDTO,null);
}
}

View File

@@ -25,5 +25,5 @@ public interface MonitorHarmonicReportService {
String crmName,
Boolean isUrl,
MultipartFile file,
HarmLineDetailDataCommDTO lineDto, OverLimitInfoCommDTO overLimitData, DeviceUnitCommDTO deviceUnit);
HarmLineDetailDataCommDTO lineDto, OverLimitInfoCommDTO overLimitData, DeviceUnitCommDTO deviceUnit, String dataLevel);
}

View File

@@ -14,6 +14,7 @@ import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONTokener;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
@@ -157,7 +158,13 @@ public class CustomReportTableServiceImpl implements CustomReportTableService {
} else {
phase = PHASE_MAPPING.get(item.getPhase());
}
tMap.put((item.getOtherName() + phase + item.getResourcesId()).toUpperCase(), item.getPrimaryFormula());
if (ObjectUtils.isNotNull(item.getHarmStart()) && ObjectUtils.isNotNull(item.getHarmEnd())) {
for (int i = item.getHarmStart(); i <= item.getHarmEnd() + 1; i++) {
tMap.put((item.getOtherName() + "_" + i + phase + item.getResourcesId()).toUpperCase(), item.getPrimaryFormula());
}
} else {
tMap.put((item.getOtherName() + phase + item.getResourcesId()).toUpperCase(), item.getPrimaryFormula());
}
});
eleEpdPqdList = eleEpdPqdList.stream().filter(it->"T".equals(it.getPhase())||"M".equals(it.getPhase())).collect(Collectors.toList());

View File

@@ -14,15 +14,15 @@ import com.njcn.device.pms.api.MonitorClient;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pq.api.DeviceUnitClient;
import com.njcn.harmonic.common.pojo.dto.DeviceUnitCommDTO;
import com.njcn.harmonic.common.pojo.dto.HarmLineDetailDataCommDTO;
import com.njcn.harmonic.common.pojo.dto.OverLimitInfoCommDTO;
import com.njcn.harmonic.common.service.MonitorCommReportService;
import com.njcn.harmonic.common.service.MonitorHarmonicReportService;
import com.njcn.harmonic.pojo.param.ReportQueryParam;
import com.njcn.harmonic.pojo.po.report.EnumPass;
import com.njcn.harmonic.pojo.po.report.Pass;
import com.njcn.harmonic.pojo.po.report.ReportTarget;
import com.njcn.harmonic.pojo.vo.ReportValue;
import com.njcn.harmonic.common.pojo.dto.HarmLineDetailDataCommDTO;
import com.njcn.harmonic.common.pojo.dto.OverLimitInfoCommDTO;
import com.njcn.harmonic.common.service.MonitorCommReportService;
import com.njcn.harmonic.common.service.MonitorHarmonicReportService;
import com.njcn.harmonic.utils.WordUtil2;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.api.ThemeFeignClient;
@@ -114,7 +114,7 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
String crmName,
Boolean isUrl,
MultipartFile file,
HarmLineDetailDataCommDTO lineDto, OverLimitInfoCommDTO overLimit, DeviceUnitCommDTO deviceUnit) {
HarmLineDetailDataCommDTO lineDto, OverLimitInfoCommDTO overLimit, DeviceUnitCommDTO deviceUnit, String dataLevel) {
//获取监测点信息
String bdname;
Integer pttype;
@@ -122,6 +122,12 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
String atype = "";
String btype = "";
String ctype = "";
//pt
Double pt = getData(lineDto.getPt());
//ct
Double ct = getData(lineDto.getCt());
if (type == 0) {
if (ObjectUtil.isNull(lineDto)) {
throw new BusinessException(CommonResponseEnum.NO_DATA);
@@ -263,14 +269,13 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
// 基波电压最大值
reportmap.put("$B" + "V0" + "X" + "_A$", judgeNull(voltage1.getFmaxValue()));
reportmap.put("$B" + "V0" + "X" + "_B$", judgeNull(voltage2.getFmaxValue()));
reportmap.put("$B" + "V0" + "X" + "_C$", judgeNull(voltage3.getFmaxValue()));
// 基波电流最大值
reportmap.put("$B" + "I0" + "X" + "_A$", judgeNull(current1.getFmaxValue()));
reportmap.put("$B" + "I0" + "X" + "_B$", judgeNull(current2.getFmaxValue()));
reportmap.put("$B" + "I0" + "X" + "_C$", judgeNull(current3.getFmaxValue()));
reportmap.put("$B" + "I0" + "X" + "_A$", dataConversion(current1.getFmaxValue(),dataLevel,ct,true));
reportmap.put("$B" + "I0" + "X" + "_B$", dataConversion(current2.getFmaxValue(),dataLevel,ct,true));
reportmap.put("$B" + "I0" + "X" + "_C$", dataConversion(current3.getFmaxValue(),dataLevel,ct,true));
/**************************************************************
**** 三张大表基础数据幅值
@@ -291,9 +296,9 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
reportmap.put("$B" + "V0" + "N" + "_C$", judgeNull(voltage3.getMinValue()));
// 基波电流最小值
reportmap.put("$B" + "I0" + "N" + "_A$", judgeNull(current1.getMinValue()));
reportmap.put("$B" + "I0" + "N" + "_B$", judgeNull(current2.getMinValue()));
reportmap.put("$B" + "I0" + "N" + "_C$", judgeNull(current3.getMinValue()));
reportmap.put("$B" + "I0" + "N" + "_A$", dataConversion(current1.getMinValue(),dataLevel,ct,true));
reportmap.put("$B" + "I0" + "N" + "_B$", dataConversion(current2.getMinValue(),dataLevel,ct,true));
reportmap.put("$B" + "I0" + "N" + "_C$", dataConversion(current3.getMinValue(),dataLevel,ct,true));
/**************************************************************
**** 三张大表基础数据幅值
@@ -314,9 +319,9 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
reportmap.put("$B" + "V0" + "E" + "_C$", judgeNull(voltage3.getMeanValue()));
// 基波电流平均值
reportmap.put("$B" + "I0" + "E" + "_A$", judgeNull(current1.getMeanValue()));
reportmap.put("$B" + "I0" + "E" + "_B$", judgeNull(current2.getMeanValue()));
reportmap.put("$B" + "I0" + "E" + "_C$", judgeNull(current3.getMeanValue()));
reportmap.put("$B" + "I0" + "E" + "_A$", dataConversion(current1.getMeanValue(),dataLevel,ct,true));
reportmap.put("$B" + "I0" + "E" + "_B$", dataConversion(current2.getMeanValue(),dataLevel,ct,true));
reportmap.put("$B" + "I0" + "E" + "_C$", dataConversion(current3.getMeanValue(),dataLevel,ct,true));
/**************************************************************
**** 三张大表基础数据幅值
@@ -337,9 +342,9 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
reportmap.put("$B" + "V0" + "%" + "_C$", judgeNull(voltage3.getCp95Value()));
// 基波电流cp95值
reportmap.put("$B" + "I0" + "%" + "_A$", judgeNull(current1.getCp95Value()));
reportmap.put("$B" + "I0" + "%" + "_B$", judgeNull(current2.getCp95Value()));
reportmap.put("$B" + "I0" + "%" + "_C$", judgeNull(current3.getCp95Value()));
reportmap.put("$B" + "I0" + "%" + "_A$", dataConversion(current1.getCp95Value(),dataLevel,ct,true));
reportmap.put("$B" + "I0" + "%" + "_B$", dataConversion(current2.getCp95Value(),dataLevel,ct,true));
reportmap.put("$B" + "I0" + "%" + "_C$", dataConversion(current3.getCp95Value(),dataLevel,ct,true));
/**************************************************************
**** 三张大表基础数据幅值
@@ -387,10 +392,10 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
Double vaveValue = Double.parseDouble(reportmap.get("$BV0E_" + tmpstrMap + "$").toString());
Double vcp95Value = Double.parseDouble(reportmap.get("$BV0%_" + tmpstrMap + "$").toString());
// 基波电流
Double imaxValue = Double.parseDouble(reportmap.get("$BI0X_" + tmpstrMap + "$").toString());
Double iminValue = Double.parseDouble(reportmap.get("$BI0N_" + tmpstrMap + "$").toString());
Double iaveValue = Double.parseDouble(reportmap.get("$BI0E_" + tmpstrMap + "$").toString());
Double icp95Value = Double.parseDouble(reportmap.get("$BI0%_" + tmpstrMap + "$").toString());
Double imaxValue = !Objects.equals("Secondary",dataLevel) ? Double.parseDouble(reportmap.get("$BI0X_" + tmpstrMap + "$").toString()):Double.parseDouble(reportmap.get("$BI0X_" + tmpstrMap + "$").toString())*ct;
Double iminValue = !Objects.equals("Secondary",dataLevel) ? Double.parseDouble(reportmap.get("$BI0N_" + tmpstrMap + "$").toString()):Double.parseDouble(reportmap.get("$BI0N_" + tmpstrMap + "$").toString())*ct;
Double iaveValue = !Objects.equals("Secondary",dataLevel) ? Double.parseDouble(reportmap.get("$BI0E_" + tmpstrMap + "$").toString()):Double.parseDouble(reportmap.get("$BI0E_" + tmpstrMap + "$").toString())*ct;
Double icp95Value = !Objects.equals("Secondary",dataLevel) ? Double.parseDouble(reportmap.get("$BI0%_" + tmpstrMap + "$").toString()):Double.parseDouble(reportmap.get("$BI0%_" + tmpstrMap + "$").toString())*ct;
if (!(vmaxValue >= vminValue && vmaxValue >= vaveValue && vmaxValue >= vcp95Value)) {
strBaseVIResult += "注意:从上表中可以看出" + strLineBaseName
@@ -1222,9 +1227,12 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
String strCurrent = strMap + (i + 1) + "%";
// 谐波电流幅值
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());
// 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());
strCurrentA = dataConversion(this.listICurrent.get(i).getList().get(0).getCp95Value(),dataLevel,ct,true);
strCurrentB = dataConversion(this.listICurrent.get(i).getList().get(1).getCp95Value(),dataLevel,ct,true);
strCurrentC = dataConversion(this.listICurrent.get(i).getList().get(2).getCp95Value(),dataLevel,ct,true);
strLimit = judgeNull(this.listICurrent.get(i).getOverLimit());
reportmap.put(strCurrent + "_A$", strCurrentA);
@@ -1253,9 +1261,9 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
reportmap.put("$CI" + (i + 1) + "L$", strLimit);
try {
maxValue = Double.parseDouble(strCurrentA);
minValue = Double.parseDouble(strCurrentB);
aveValue = Double.parseDouble(strCurrentC);
maxValue = Objects.equals("Secondary",dataLevel) ? Double.parseDouble(strCurrentA)*ct : Double.parseDouble(strCurrentA);
minValue = Objects.equals("Secondary",dataLevel) ? Double.parseDouble(strCurrentB)*ct : Double.parseDouble(strCurrentB);
aveValue = Objects.equals("Secondary",dataLevel) ? Double.parseDouble(strCurrentC)*ct : Double.parseDouble(strCurrentC);;
limit = Double.parseDouble(strLimit);
} catch (Exception e) {
strResultCurrentValue += "注意:从上表中可以看出" + strLineBaseName +(i + 1)+ "次谐波电流幅值95%概率值数据存在异常(不是数值类型)。\r\n";
@@ -1380,6 +1388,26 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
}
}
public Double getData(String data) {
double ratio = 1.0;
if (Objects.isNull(data) || data.isEmpty()) {
return ratio;
}
String[] parts = data.split("/");
if (parts.length == 2) {
try {
Double num1 = Double.parseDouble(parts[0]);
Double num2 = Double.parseDouble(parts[1]);
ratio = num1 / num2;
} catch (NumberFormatException var7) {
System.out.println("字符串格式错误");
}
} else {
ratio = Double.parseDouble(parts[0]);
}
return ratio;
}
/**
* 数据单位信息 重组
*
@@ -1722,6 +1750,22 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe
return (result == null) ? "/" : result.toString();
}
public String dataConversion(Float result, String dataLevel, Double ratio, Boolean isI) {
if (result == null) {
return "/";
}
if (!"Secondary".equals(dataLevel)) {
return String.valueOf(result);
}
double conversionRatio = (ratio != null) ? ratio : 1.0;
double convertedValue = result * conversionRatio;
if (isI != null && Boolean.TRUE.equals(isI)) {
return String.format("%.2f", convertedValue);
} else {
return String.format("%.2f", convertedValue / 1000.0);
}
}
/**
* 谐波电流限值
*