19 Commits

Author SHA1 Message Date
caozehui
3f1ae1886a Merge remote-tracking branch 'origin/qr_branch' into qr_branch 2025-12-19 16:17:40 +08:00
caozehui
af4863af65 2楼报告封面调整:装置编码改成装置编号 2025-12-19 16:17:33 +08:00
2012221b73 河北报告定制化改动 2025-12-02 13:37:35 +08:00
caozehui
f4df52dd1c 暂态只有a项时,当a相无数据时判断为不符合 2025-11-27 18:36:38 +08:00
41c557118c Merge remote-tracking branch 'origin/qr_branch' into qr_branch 2025-11-26 10:22:15 +08:00
6596a572d6 修复数模式的相序校验电流加量问题 2025-11-26 10:17:33 +08:00
caozehui
786bd5d660 报告调整 2025-11-19 13:20:35 +08:00
caozehui
21d2c2b7a7 报告调整 2025-11-19 13:20:17 +08:00
caozehui
48fa4c2390 报告日期格式根据参数动态变化 2025-11-19 10:43:52 +08:00
caozehui
9d15351fba 微调 2025-11-06 09:25:09 +08:00
caozehui
2339a006ec 补充源未知异常推送消息 2025-11-06 08:51:54 +08:00
caozehui
7fd904ab79 系数校准接收数据个数调整 2025-11-05 16:02:53 +08:00
caozehui
40cb153656 报告模板调整 2025-11-03 08:38:57 +08:00
caozehui
f922ee97aa 报告路径,报告名称修改 2025-10-30 09:06:40 +08:00
caozehui
26c5e933f5 微调 2025-10-29 09:01:45 +08:00
caozehui
c7d8fc3168 报告封面微调 2025-10-22 11:05:21 +08:00
caozehui
bb22857fc9 报告微调 2025-10-21 15:42:22 +08:00
caozehui
6ef908ff60 微调 2025-09-03 20:32:14 +08:00
caozehui
7461801657 微调 2025-09-03 16:18:52 +08:00
25 changed files with 168 additions and 73 deletions

View File

@@ -628,7 +628,7 @@ public class SocketDevResponseService {
private void assemblyEntity(List<DevData> deList, DevXiNumData.F F, DevXiNumData.GF startF, CoefficientVO coefficientVO, CoefficientVO.DevParameter devParameter) {
//表示接收完成,必须保证3个数
if (deList.size() >= 3) {
if (deList.size() >= 7) {
List<Double> aList = deList.stream().map(it -> it.getSqlData().get(0).getList().getA()).collect(Collectors.toList());
List<Double> bList = deList.stream().map(it -> it.getSqlData().get(0).getList().getB()).collect(Collectors.toList());
List<Double> cList = deList.stream().map(it -> it.getSqlData().get(0).getList().getC()).collect(Collectors.toList());
@@ -703,7 +703,7 @@ public class SocketDevResponseService {
*/
private Double reduceList(List<Double> valList) {
// valList.subList(0, 5).clear();
// valList.subList(valList.size() - 3, valList.size() - 1).clear();
valList.subList(valList.size() - 2, valList.size()).clear();
return valList.stream().mapToDouble(Double::doubleValue).average().getAsDouble();
}

View File

@@ -1,6 +1,5 @@
package com.njcn.gather.detection.handler;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum;
@@ -135,16 +134,13 @@ public class SocketSourceResponseService {
CnSocketUtil.quitSendSource(param);
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
break;
case UNKNOWN_ERROR:
CnSocketUtil.quitSendSource(param);
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
break;
case UNABLE_TO_RESPOND:
CnSocketUtil.quitSendSource(param);
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
break;
default:
CnSocketUtil.sendUnSocket(param.getUserPageId());
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
break;
}
}
@@ -198,8 +194,10 @@ public class SocketSourceResponseService {
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
phaseSequenceParam.setMoniterIdList(monitorIdList);
phaseSequenceParam.setDataType(Arrays.asList("real$VRMS", "real$IRMS"));
phaseSequenceParam.setReadCount(3);
phaseSequenceParam.setIgnoreCount(7);
// 读取3次数据用于系数计算
phaseSequenceParam.setReadCount(7); //3
// 忽略前4次数据等待测量稳定
phaseSequenceParam.setIgnoreCount(3); //4
socketMsg.setData(JSON.toJSONString(phaseSequenceParam));
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));

View File

@@ -12,6 +12,7 @@ import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
import com.njcn.gather.detection.pojo.po.DevData;
import com.njcn.gather.detection.pojo.vo.DetectionData;
import com.njcn.gather.device.pojo.enums.CheckResultEnum;
import com.njcn.gather.err.pojo.param.PqErrSysParam;
import com.njcn.gather.err.pojo.po.PqErrSysDtls;
import com.njcn.gather.err.pojo.vo.ErrDtlsCheckDataVO;
@@ -774,6 +775,9 @@ public class DetectionServiceImpl {
))
.collect(Collectors.toList());
DetectionData a = setDetectionData(isQualified, dataRule, mag, fData, dur, magErrList, channelTypeAList, TYPE_A);
if (CollUtil.isEmpty(mag.get(TYPE_A))) {
a.setIsData(2);
}
result.setAValue(JSON.toJSONString(a));
result.setTValue(JSON.toJSONString(a));
result.setResultFlag(a.getIsData());

View File

@@ -32,7 +32,10 @@ public enum BaseReportKeyEnum {
YEAR_MONTH_DAY("year-month-day","年-月-日"),
TEMPERATURE("temp","温度"),
HUMIDITY("hum","相对湿度"),
DELEGATE("delegate","委托方");
DELEGATE("delegate","委托方"),
CREATEDATE("createDate","出厂日期"),
HW_VERSION("hardwareVersion","硬件版本"),
SW_VERSION("softwareVersion","软件版本");
private String key;

View File

@@ -100,6 +100,7 @@ import java.math.RoundingMode;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.*;
import java.util.concurrent.CompletableFuture;
@@ -157,6 +158,9 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
@Value("${qr.gcDev.path}")
private String gcDevPath;
@Value("${report.dateFormat}")
private String dateFormat;
private final IPqDevService iPqDevService;
private final PqDevMapper pqDevMapper;
@@ -1228,16 +1232,34 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
Tr existingRow = (Tr) tbl.getContent().get(rows.size() - 1);
// 获取现有样式
TrPr trPr = existingRow.getTrPr();
JAXBElement<Tc> element = (JAXBElement<Tc>) existingRow.getContent().get(0);
TcPr tcPr = element.getValue().getTcPr();
TblWidth cellWidth = factory.createTblWidth();
cellWidth.setType("dxa");
cellWidth.setW(BigInteger.valueOf(5000 / tableKeys.size()));
tcPr.setTcW(cellWidth);
// 获取每个单元格的TcPr保留各单元格独立的边框设置
List<TcPr> tcPrList = new ArrayList<>();
RPr templateRPr = null;
for (Object cellObj : existingRow.getContent()) {
if (cellObj instanceof JAXBElement) {
JAXBElement<Tc> cellElement = (JAXBElement<Tc>) cellObj;
Tc templateCell = cellElement.getValue();
TcPr tcPr = templateCell.getTcPr();
// 设置单元格宽度
if (tcPr == null) {
tcPr = factory.createTcPr();
}
TblWidth cellWidth = factory.createTblWidth();
cellWidth.setType("dxa");
cellWidth.setW(BigInteger.valueOf(5000 / tableKeys.size()));
tcPr.setTcW(cellWidth);
tcPrList.add(tcPr);
// 从第一个单元格获取字体样式
if (templateRPr == null && !templateCell.getContent().isEmpty() && templateCell.getContent().get(0) instanceof P) {
P templateP = (P) templateCell.getContent().get(0);
templateRPr = Docx4jUtil.getTcPrFromParagraph(templateP);
}
}
}
tbl.getContent().remove(existingRow);
// 迭代增加行,需要填充的表格keys在tableKeys集合中
for (Map<String, String> stringStringMap : dataList) {
Tr newRow = Docx4jUtil.createCustomRow(factory, stringStringMap, tableKeys, trPr, tcPr, true);
Tr newRow = Docx4jUtil.createCustomRow(factory, stringStringMap, tableKeys, trPr, tcPrList, templateRPr, true);
tbl.getContent().add(newRow);
}
} else {
@@ -1406,11 +1428,24 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
baseModelMap.put(prefix + BaseReportKeyEnum.DEV_TYPE.getKey() + suffix, devType.getName());
// 检测员
baseModelMap.put(prefix + BaseReportKeyEnum.INSPECTOR.getKey() + suffix, pqDevVO.getCheckBy() + "");
String datePattern = DatePattern.NORM_DATE_PATTERN;
if (DatePattern.CHINESE_DATE_PATTERN.equals(dateFormat)) {
datePattern = DatePattern.CHINESE_DATE_PATTERN;
}
// 出厂日期
baseModelMap.put(prefix + BaseReportKeyEnum.CREATEDATE.getKey() + suffix, pqDevVO.getCreateDate().format(DateTimeFormatter.ofPattern(datePattern)));
// 硬件版本
baseModelMap.put(prefix + BaseReportKeyEnum.HW_VERSION.getKey() + suffix, StrUtil.isNotBlank(pqDevVO.getHardwareVersion()) ? pqDevVO.getHardwareVersion() : StrUtil.EMPTY);
// 软件版本
baseModelMap.put(prefix + BaseReportKeyEnum.SW_VERSION.getKey() + suffix, StrUtil.isNotBlank(pqDevVO.getSoftwareVersion()) ? pqDevVO.getSoftwareVersion() : StrUtil.EMPTY);
// 调试日期
if (pqDevVO.getCheckTime() != null) {
baseModelMap.put(prefix + BaseReportKeyEnum.TEST_DATE.getKey() + suffix, DateUtil.format(pqDevVO.getCheckTime(), DatePattern.CHINESE_DATE_PATTERN));
baseModelMap.put(prefix + BaseReportKeyEnum.TEST_DATE.getKey() + suffix, DateUtil.format(pqDevVO.getCheckTime(), datePattern));
} else {
baseModelMap.put(prefix + BaseReportKeyEnum.TEST_DATE.getKey() + suffix, DateUtil.format(new Date(), DatePattern.CHINESE_DATE_PATTERN));
baseModelMap.put(prefix + BaseReportKeyEnum.TEST_DATE.getKey() + suffix, DateUtil.format(new Date(), datePattern));
}
// 装置编码
baseModelMap.put(prefix + BaseReportKeyEnum.DEV_CODE.getKey() + suffix, pqDevVO.getCreateId());
@@ -1450,15 +1485,14 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
// 样品编号
baseModelMap.put(prefix + BaseReportKeyEnum.SAMPLE_ID.getKey() + suffix, StrUtil.isEmpty(pqDevVO.getSampleId()) ? StrPool.TAB : pqDevVO.getSampleId());
// 收样日期
baseModelMap.put(prefix + BaseReportKeyEnum.ARRIVED_DATE.getKey() + suffix, Objects.isNull(pqDevVO.getArrivedDate()) ? StrPool.TAB : String.valueOf(pqDevVO.getArrivedDate()));
baseModelMap.put(prefix + BaseReportKeyEnum.ARRIVED_DATE.getKey() + suffix, Objects.isNull(pqDevVO.getArrivedDate()) ? StrPool.TAB : pqDevVO.getArrivedDate().format(DateTimeFormatter.ofPattern(datePattern)));
// 检测日期
baseModelMap.put(prefix + BaseReportKeyEnum.TEST_DATE.getKey() + suffix, Objects.isNull(pqDevVO.getCheckTime()) ? StrPool.TAB : String.valueOf(pqDevVO.getCheckTime()).substring(0, 10));
baseModelMap.put(prefix + BaseReportKeyEnum.TEMPERATURE.getKey() + suffix, Objects.isNull(pqDevVO.getTemperature()) ? StrPool.TAB : pqDevVO.getTemperature().toString());
baseModelMap.put(prefix + BaseReportKeyEnum.HUMIDITY.getKey() + suffix, Objects.isNull(pqDevVO.getHumidity()) ? StrPool.TAB : pqDevVO.getHumidity().toString());
baseModelMap.put(prefix + BaseReportKeyEnum.YEAR.getKey() + suffix, DateUtil.format(new Date(), DatePattern.NORM_YEAR_PATTERN));
baseModelMap.put(prefix + BaseReportKeyEnum.MONTH.getKey() + suffix, DateUtil.format(new Date(), DatePattern.SIMPLE_MONTH_PATTERN).substring(4));
baseModelMap.put(prefix + BaseReportKeyEnum.DAY.getKey() + suffix, DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN).substring(6));
baseModelMap.put(prefix + BaseReportKeyEnum.YEAR_MONTH_DAY.getKey() + suffix, DateUtil.format(new Date(), DatePattern.NORM_DATE_PATTERN));
baseModelMap.put(prefix + BaseReportKeyEnum.YEAR_MONTH_DAY.getKey() + suffix, DateUtil.format(new Date(), datePattern));
return baseModelMap;
}
@@ -1474,7 +1508,12 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
//String scriptId = adPlan.getScriptId();
Integer devChns = pqDevVO.getDevChns();
for (int i = 1; i <= devChns; i++) {
ClassPathResource resource = new ClassPathResource("/model/report_table.docx");
String path = "/model/report_table.docx";
DevType devType = devTypeService.getById(pqDevVO.getDevType());
if (devType.getName().equals("PQ-COM")) {
path = "/model/report_table - PQ-COM.docx";
}
ClassPathResource resource = new ClassPathResource(path);
XWPFDocument dataModelDocumentTemp = new XWPFDocument(resource.getInputStream());
SingleNonHarmParam singleNonHarmParam = new SingleNonHarmParam();
@@ -1502,11 +1541,20 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
List<AdHarmonicResult> adHarmonicResultList = adHarmonicService.listAllResultData(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + i);
// 填充数据
int finalI = i;
indexKeysMap.forEach((index, keys) -> {
String s1 = keys.stream().findFirst().get();
// 谐波类
if (DetectionCodeEnum.V2_50.getCode().equals(s1) || DetectionCodeEnum.I2_50.getCode().equals(s1) || DetectionCodeEnum.SV_1_49.getCode().equals(s1) || DetectionCodeEnum.SI_1_49.getCode().equals(s1)) {
fillMapValueHarm(adHarmonicResultList, dataModelMap, keys, index);
// 查找一下U1
double u1 = 57.74;
List<AdHarmonicResult> rawData = adHarmonicService.listAllRawData(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + finalI);
AdHarmonicResult adHarmonicResult = rawData.stream().filter(obj -> obj.getAdType().equals(DetectionCodeEnum.V2_50.getCode())).sorted((obj1, obj2) -> obj2.getTimeId().compareTo(obj1.getTimeId())).findFirst().orElse(null);
if (ObjectUtil.isNotNull(adHarmonicResult)) {
String aValue1 = adHarmonicResult.getAValue1();
u1 = Double.parseDouble(aValue1);
}
fillMapValueHarm(adHarmonicResultList, dataModelMap, keys, index, u1);
} else {
// 非谐波类
if (DetectionCodeEnum.V_UNBAN.getCode().equals(s1) || DetectionCodeEnum.FREQ.getCode().equals(s1)) {
@@ -1574,14 +1622,14 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
* @param keys
* @param index
*/
private void fillMapValueHarm(List<AdHarmonicResult> allHarmonicResultList, Map<String, String> dataModelMap, Set<String> keys, String index) {
private void fillMapValueHarm(List<AdHarmonicResult> allHarmonicResultList, Map<String, String> dataModelMap, Set<String> keys, String index, double baseValue) {
keys.forEach(key -> {
List<AdHarmonicResult> resultList = allHarmonicResultList.stream().filter(obj -> obj.getAdType().equals(key) && obj.getSort().toString().equals(index)).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(resultList)) {
AdHarmonicResult adHarmonicResult = resultList.get(0);
if (Objects.nonNull(adHarmonicResult)) {
if (DetectionCodeEnum.V2_50.getCode().equals(key) || DetectionCodeEnum.SV_1_49.getCode().equals(key)) {
fillHarm(dataModelMap, adHarmonicResult, index, key, 57.74, 100);
fillHarm(dataModelMap, adHarmonicResult, index, key, baseValue, 100);
}
if (DetectionCodeEnum.I2_50.getCode().equals(key) || DetectionCodeEnum.SI_1_49.getCode().equals(key)) {
fillHarm(dataModelMap, adHarmonicResult, index, key, 1, 1);

View File

@@ -93,18 +93,19 @@ public class BookmarkUtil {
idx = idx + 1;
parentContent.add(idx, p);
}
else if (textFromP.startsWith(PowerIndexEnum.IMBV.getDesc())
|| textFromP.startsWith(PowerIndexEnum.HV.getDesc())
|| textFromP.startsWith(PowerIndexEnum.HI.getDesc())
) {
// 另起一页
P pagePara = Docx4jUtil.getPageBreak();
idx = idx + 1;
parentContent.add(idx, pagePara);
idx = idx + 1;
parentContent.add(idx, element);
}else if(textFromP.startsWith("基波电流幅值5.000A基波频率50.0Hz,各次间谐波电流含有率均为3.0%。")){
// else if (textFromP.startsWith(PowerIndexEnum.IMBV.getDesc())
// || textFromP.startsWith(PowerIndexEnum.HV.getDesc())
// || textFromP.startsWith(PowerIndexEnum.HI.getDesc())
//
// ) {
// // 另起一页
// P pagePara = Docx4jUtil.getPageBreak();
// idx = idx + 1;
// parentContent.add(idx, pagePara);
// idx = idx + 1;
// parentContent.add(idx, element);
// }
else if(textFromP.startsWith("基波电流幅值5.000A基波频率50.0Hz,各次间谐波电流含有率均为3.0%。")){
idx = idx + 1;
parentContent.add(idx, element);
P pagePara = Docx4jUtil.getPageBreak();

View File

@@ -322,17 +322,20 @@ public class Docx4jUtil {
}
/**
* 根据已知信息创建新
* 根据已知信息创建新
*
* @param factory 工厂
* @param valueMap 数据
* @param tableKeys keys
* @param trPr 行样式
* @param tcPr 单元格样式
* @param factory 工厂
* @param valueMap 数据
* @param tableKeys keys
* @param trPr 行样式
* @param tcPrList 每个单元格样式列表(用于保留各单元格独立的边框设置)
* @param templateRPr 模板中的字体样式可为null为null时使用默认宋体10号
* @param centerFlag 是否居中
*/
public static Tr createCustomRow(ObjectFactory factory, Map<String, String> valueMap, List<String> tableKeys, TrPr trPr, TcPr tcPr, boolean centerFlag) {
public static Tr createCustomRow(ObjectFactory factory, Map<String, String> valueMap, List<String> tableKeys, TrPr trPr, List<TcPr> tcPrList, RPr templateRPr, boolean centerFlag) {
Tr row = factory.createTr();
for (String tableKey : tableKeys) {
for (int i = 0; i < tableKeys.size(); i++) {
String tableKey = tableKeys.get(i);
Tc cell = factory.createTc();
P paragraph = factory.createP();
R run = factory.createR();
@@ -341,20 +344,41 @@ public class Docx4jUtil {
text.setValue(value);
run.getContent().add(text);
paragraph.getContent().add(run);
// 字体
// 设置字体
// 从模板复制字体样式
RPr rPr = factory.createRPr();
RFonts rFonts = factory.createRFonts();
if (containsChinese(value)) {
if (templateRPr != null) {
// 复制字体
if (templateRPr.getRFonts() != null) {
RFonts rFonts = factory.createRFonts();
rFonts.setEastAsia(templateRPr.getRFonts().getEastAsia());
rFonts.setAscii(templateRPr.getRFonts().getAscii());
rFonts.setHAnsi(templateRPr.getRFonts().getHAnsi());
rPr.setRFonts(rFonts);
}
// 复制字号
if (templateRPr.getSz() != null) {
HpsMeasure sz = factory.createHpsMeasure();
sz.setVal(templateRPr.getSz().getVal());
rPr.setSz(sz);
}
if (templateRPr.getSzCs() != null) {
HpsMeasure szCs = factory.createHpsMeasure();
szCs.setVal(templateRPr.getSzCs().getVal());
rPr.setSzCs(szCs);
}
} else {
// 默认使用宋体10号
RFonts rFonts = factory.createRFonts();
rFonts.setEastAsia("宋体");
rFonts.setAscii("宋体");
rFonts.setHAnsi("宋体");
} else {
rFonts.setEastAsia("Arial");
rFonts.setAscii("Arial");
rFonts.setHAnsi("Arial");
rPr.setRFonts(rFonts);
HpsMeasure sz = factory.createHpsMeasure();
sz.setVal(new BigInteger("20"));
rPr.setSz(sz);
}
rPr.setRFonts(rFonts);
// 设置段落居中
if (centerFlag) {
PPr pPr = factory.createPPr();
@@ -363,20 +387,19 @@ public class Docx4jUtil {
pPr.setJc(jc);
paragraph.setPPr(pPr);
}
if (value.equals("不合格")) {
// 不合格标红
if (value != null && value.equals("不合格")) {
Color color = factory.createColor();
// 红色
color.setVal("FF0000");
rPr.setColor(color);
run.setRPr(rPr);
}
HpsMeasure sz = factory.createHpsMeasure();
// 10号字体 = 20 half-points
sz.setVal(new BigInteger("20"));
rPr.setSz(sz);
run.setRPr(rPr);
cell.getContent().add(paragraph);
cell.setTcPr(tcPr);
// 使用对应位置的单元格样式(保留边框设置)
if (tcPrList != null && i < tcPrList.size()) {
cell.setTcPr(tcPrList.get(i));
}
row.getContent().add(cell);
row.setTrPr(trPr);
}

View File

@@ -353,7 +353,7 @@ public class ResultServiceImpl implements IResultService {
unit = ResultUnitEnum.V_ABSOLUTELY.getUnit();
}
List<PqScriptDtls> v = scriptDtlIndexList.stream().filter(x -> "VOL".equals(x.getValueType())).collect(Collectors.toList());
dtlType.setScriptTypeName(dictTree.getName() + "=" + v.get(0).getValue().intValue() + unit);
dtlType.setScriptTypeName(dictTree.getName() + "=" + v.get(0).getValue() + unit);
break;
/**
* 电流
@@ -367,7 +367,7 @@ public class ResultServiceImpl implements IResultService {
unitI = ResultUnitEnum.I_ABSOLUTELY.getUnit();
}
List<PqScriptDtls> I = scriptDtlIndexList.stream().filter(x -> "CUR".equals(x.getValueType())).collect(Collectors.toList());
dtlType.setScriptTypeName(dictTree.getName() + "=" + I.get(0).getValue().intValue() + unitI);
dtlType.setScriptTypeName(dictTree.getName() + "=" + I.get(0).getValue() + unitI);
break;
/**
* 谐波电压
@@ -392,7 +392,7 @@ public class ResultServiceImpl implements IResultService {
+ "" + dictTree.getName()); // + "含有率为GB/T"
} else {
//叠加5%的2次谐波电压
dtlType.setScriptTypeName("叠加" + hv.get(0).getValue().intValue() + ResultUnitEnum.HV.getUnit() + "" + hv.get(0).getHarmNum().intValue() + "" + dictTree.getName());
dtlType.setScriptTypeName("叠加" + hv.get(0).getValue() + ResultUnitEnum.HV.getUnit() + "" + hv.get(0).getHarmNum().intValue() + "" + dictTree.getName());
}
break;
/**
@@ -426,7 +426,7 @@ public class ResultServiceImpl implements IResultService {
dtlType.setScriptTypeName(a.toString());
} else {
//叠加5%的2次谐波电压
dtlType.setScriptTypeName("叠加" + harmInNumList.get(0).getValue().intValue() + ResultUnitEnum.HV.getUnit() + "" + harmInNumList.get(0).getHarmNum() + "" + dictTree.getName());
dtlType.setScriptTypeName("叠加" + harmInNumList.get(0).getValue() + ResultUnitEnum.HV.getUnit() + "" + harmInNumList.get(0).getHarmNum() + "" + dictTree.getName());
}
break;
@@ -483,7 +483,7 @@ public class ResultServiceImpl implements IResultService {
});
} else {
PqScriptDtls dtls = harmNumVMap.entrySet().iterator().next().getValue().get(0);
a.append(dtls.getValue().intValue() + ResultUnitEnum.HV.getUnit() + "" + dtls.getHarmNum().intValue() + ResultUnitEnum.HV.getName());
a.append(dtls.getValue() + ResultUnitEnum.HV.getUnit() + "" + dtls.getHarmNum().intValue() + ResultUnitEnum.HV.getName());
}
a.append(",");
if (harmNumIMap.size() > 1) {
@@ -502,7 +502,7 @@ public class ResultServiceImpl implements IResultService {
});
} else {
PqScriptDtls dtls = harmNumIMap.entrySet().iterator().next().getValue().get(0);
a.append(dtls.getValue().intValue() + ResultUnitEnum.HI.getUnit() + "" + dtls.getHarmNum().intValue() + "" + ResultUnitEnum.HI.getName());
a.append(dtls.getValue() + ResultUnitEnum.HI.getUnit() + "" + dtls.getHarmNum().intValue() + "" + ResultUnitEnum.HI.getName());
}
dtlType.setScriptTypeName(a.toString());
break;

View File

@@ -14,6 +14,7 @@ import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum;
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
import com.njcn.gather.device.pojo.enums.CommonEnum;
import com.njcn.gather.device.pojo.po.PqDev;
import com.njcn.gather.device.pojo.vo.PqDevVO;
import com.njcn.gather.device.service.IPqDevService;
import com.njcn.gather.plan.mapper.AdPlanMapper;
import com.njcn.gather.plan.pojo.po.AdPlan;
@@ -886,6 +887,22 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
queryWrapper.eq(PqScriptDtls::getScriptIndex, -1)
.eq(PqScriptDtls::getEnable, 1);
pqScriptDtls = this.list(queryWrapper);
// 相序校验中电流需加量需要依据企标10650.2中章节5.5.3的描述过载能力2 倍额定电流连续10 倍额定电流持续 1 s。
// 考虑到有可能存在1A的额定电流本处做特殊处理加量分别为额定电流的0.2/0.4/0.6的标幺乘积加量
// 电压暂不做处理原因1、电压的企标描述过载能力为4倍空间较大2、额定电压比如57.74V为浮点数,存在不确定小数位,避免引起算术误差;
// 1. 获取额定电流,前端已做限制,相同额定电流才能一起检测
String deviceId = param.getDevIds().get(0);
PqDevVO pqDev = pqDevService.getPqDevById(deviceId);
String devTypeId = pqDev.getDevType();
DevType devType = devTypeService.getById(devTypeId);
Double devCurr = devType.getDevCurr();
for (int i = 0; i < pqScriptDtls.size(); i++) {
PqScriptDtls scriptDtls = pqScriptDtls.get(i);
// 注意此处scriptDtls.getValue() < 1.0,考虑到有些已经投入运行的地方,可能没有改库,避免不必要的异常
if(scriptDtls.getValueType().equalsIgnoreCase("CUR") && scriptDtls.getValue() < 1.0){
scriptDtls.setValue(devCurr * scriptDtls.getValue());
}
}
} else if (param.getIsPhaseSequence().equals(CommonEnum.COEFFICIENT_TEST.getValue())) {
//系数
queryWrapper.in(PqScriptDtls::getScriptIndex, param.getIndexList())

View File

@@ -6,7 +6,7 @@ spring:
datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.24:13306/pqs9100_2f?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://192.168.1.24:13306/pqs9100_bj?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=Asia/Shanghai
username: root
password: njcnpqs
# url: jdbc:mysql://localhost:3306/pqs91001?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=CTT
@@ -49,10 +49,10 @@ phaseAngle:
socket:
source:
ip: 192.168.1.138
ip: 192.168.1.125
port: 62000
device:
ip: 192.168.1.138
ip: 192.168.1.125
port: 61000
# source:
# ip: 192.168.1.121
@@ -87,7 +87,7 @@ log:
report:
template: D:\template
reportDir: D:\report
dateFormat: yyyy年MM月dd日
qr:
cloud: http://pqmcc.com:18082/api/file
dev:

1
license.key Normal file
View File

@@ -0,0 +1 @@
AoNUHvLQag9nPPxWDsf5EwwBqifh5wnoFjrU01w+kIA7TPdRl0AQDBSA3IU7AY28Liubt6Rl8CsDtxEDrz8L5m0FqQrmZ1TmIJtZWbBR16NxXRgf8izM5JurYEY6ZbjU021yCu0fitxB0DJZ8LB8zfUDsV1MFGHl+yPjh4ZQrYDffID4rk/mRe/EE6F7bS19upStSOnQxVQVJSXwCVVHgsuFXqiuagM21OmxpYNjqaPnvAKoHRXTTxXn9BrSgZBocxuHB/IE+a0a+Q2eQo4RZa2IQpneEA/QIKEqezqsABxmM33duQ4eKt17hAttISV1J0R1cKpwZ4tYuSoHCuMONA==