5 Commits

Author SHA1 Message Date
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
caozehui
4ecec5e6ef 新增PQ-COM设备类型报告模板、修改系数校准抛数据组数 2025-09-03 14:25:32 +08:00
caozehui
04a667531b 绝对值脚本-暂态bug 2025-08-04 09:56:51 +08:00
17 changed files with 26 additions and 11 deletions

View File

@@ -199,7 +199,7 @@ public class SocketSourceResponseService {
phaseSequenceParam.setMoniterIdList(monitorIdList);
phaseSequenceParam.setDataType(Arrays.asList("real$VRMS", "real$IRMS"));
phaseSequenceParam.setReadCount(3);
phaseSequenceParam.setIgnoreCount(4);
phaseSequenceParam.setIgnoreCount(8);
socketMsg.setData(JSON.toJSONString(phaseSequenceParam));
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));

View File

@@ -1474,7 +1474,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 +1507,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 +1588,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

@@ -1015,11 +1015,12 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
PqScriptDtls dip = dipList.get(0);
dipDataDTO.setFTransValue(dip.getTransValue());
if (devFly) {
if (isValueType) {
// if (isValueType) {
dipDataDTO.setFTransValue(dip.getTransValue());
} else {
dipDataDTO.setFTransValue(NumberUtil.round(dip.getTransValue() / dtls.getValue(), 4).doubleValue());
}
// }
// else {
// dipDataDTO.setFTransValue(NumberUtil.round(dip.getTransValue() / dtls.getValue(), 4).doubleValue());
// }
}
// 1.0/频率*持续时间(周波)= 暂态持续时间s
dipDataDTO.setFRetainTime(NumberUtil.round(1.0 / fFreq * dip.getRetainTime(), 3).doubleValue());

Binary file not shown.

View File

@@ -70,7 +70,7 @@ public class AuthController extends BaseController {
if (ObjectUtil.isNull(user)) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, UserValidMessage.LOGIN_FAILED);
} else {
String accessToken = JwtUtil.getAccessToken(user.getId());
String accessToken = JwtUtil.getAccessToken(user.getId(),user.getLoginName());
String refreshToken = JwtUtil.getRefreshToken(accessToken);
Token token = new Token();
token.setAccessToken(accessToken);
@@ -117,7 +117,7 @@ public class AuthController extends BaseController {
Map<String, Object> map = JwtUtil.parseToken(accessToken);
String userId = (String) map.get(SecurityConstants.USER_ID);
SysUser user = sysUserService.getById(userId);
String accessTokenNew = JwtUtil.getAccessToken(userId);
String accessTokenNew = JwtUtil.getAccessToken(userId,user.getLoginName());
request.setAttribute(SecurityConstants.AUTHENTICATE_USERNAME, user.getLoginName());
// String refreshTokenNew = JwtUtil.getRefreshToken(accessTokenNew);