Compare commits
11 Commits
3959b96040
...
hainan
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4afcec7fb9 | ||
|
|
a48dad40f6 | ||
|
|
c8217046c6 | ||
|
|
0a16a1fee5 | ||
|
|
391646d416 | ||
|
|
4f3f0833d5 | ||
|
|
924c2e8f45 | ||
|
|
8dca7bf537 | ||
|
|
7e6fb2d981 | ||
|
|
ec9a0ca236 | ||
|
|
7ab5b9a501 |
@@ -33,6 +33,8 @@ import com.njcn.gather.script.pojo.param.PqScriptIssueParam;
|
|||||||
import com.njcn.gather.script.pojo.po.SourceIssue;
|
import com.njcn.gather.script.pojo.po.SourceIssue;
|
||||||
import com.njcn.gather.script.service.IPqScriptCheckDataService;
|
import com.njcn.gather.script.service.IPqScriptCheckDataService;
|
||||||
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
||||||
|
import com.njcn.gather.source.pojo.po.SourceInitialize;
|
||||||
|
import com.njcn.gather.source.service.IPqSourceService;
|
||||||
import com.njcn.gather.storage.pojo.param.StorageParam;
|
import com.njcn.gather.storage.pojo.param.StorageParam;
|
||||||
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
@@ -76,6 +78,7 @@ public class SocketDevResponseService {
|
|||||||
private final SimAndDigHarmonicService adHarmonicService;
|
private final SimAndDigHarmonicService adHarmonicService;
|
||||||
private final IAdPlanService adPlanService;
|
private final IAdPlanService adPlanService;
|
||||||
private final IDictDataService dictDataService;
|
private final IDictDataService dictDataService;
|
||||||
|
private final IPqSourceService pqSourceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储的装置相序数据
|
* 存储的装置相序数据
|
||||||
@@ -391,6 +394,8 @@ public class SocketDevResponseService {
|
|||||||
if (param.getTestItemList().get(2)) {
|
if (param.getTestItemList().get(2)) {
|
||||||
//如果后续做正式检测
|
//如果后续做正式检测
|
||||||
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
|
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
|
||||||
|
issueParam.setSourceId(sourceInitialize.getSourceId());
|
||||||
issueParam.setPlanId(param.getPlanId());
|
issueParam.setPlanId(param.getPlanId());
|
||||||
issueParam.setSourceId(param.getSourceId());
|
issueParam.setSourceId(param.getSourceId());
|
||||||
issueParam.setDevIds(param.getDevIds());
|
issueParam.setDevIds(param.getDevIds());
|
||||||
@@ -893,10 +898,9 @@ public class SocketDevResponseService {
|
|||||||
|
|
||||||
//开始下源控制脚本
|
//开始下源控制脚本
|
||||||
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
|
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
|
||||||
|
issueParam.setSourceId(sourceInitialize.getSourceId());
|
||||||
issueParam.setPlanId(param.getPlanId());
|
issueParam.setPlanId(param.getPlanId());
|
||||||
issueParam.setSourceId(param.getSourceId());
|
|
||||||
issueParam.setDevIds(param.getDevIds());
|
|
||||||
issueParam.setScriptId(param.getScriptId());
|
|
||||||
|
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
List<SourceIssue> sourceIssues;
|
List<SourceIssue> sourceIssues;
|
||||||
@@ -1162,8 +1166,9 @@ public class SocketDevResponseService {
|
|||||||
} else if (param.getTestItemList().get(2)) {
|
} else if (param.getTestItemList().get(2)) {
|
||||||
// 后续做正式检测
|
// 后续做正式检测
|
||||||
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
|
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
|
||||||
|
issueParam.setSourceId(sourceInitialize.getSourceId());
|
||||||
issueParam.setPlanId(param.getPlanId());
|
issueParam.setPlanId(param.getPlanId());
|
||||||
issueParam.setSourceId(param.getSourceId());
|
|
||||||
issueParam.setDevIds(param.getDevIds());
|
issueParam.setDevIds(param.getDevIds());
|
||||||
issueParam.setScriptId(param.getScriptId());
|
issueParam.setScriptId(param.getScriptId());
|
||||||
|
|
||||||
@@ -1816,8 +1821,9 @@ public class SocketDevResponseService {
|
|||||||
XiNumberManager.devParameterList.add(devParameterSmall);
|
XiNumberManager.devParameterList.add(devParameterSmall);
|
||||||
|
|
||||||
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
|
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
|
||||||
|
issueParam.setSourceId(sourceInitialize.getSourceId());
|
||||||
issueParam.setPlanId(param.getPlanId());
|
issueParam.setPlanId(param.getPlanId());
|
||||||
issueParam.setSourceId(param.getSourceId());
|
|
||||||
issueParam.setDevIds(param.getDevIds());
|
issueParam.setDevIds(param.getDevIds());
|
||||||
issueParam.setScriptId(param.getScriptId());
|
issueParam.setScriptId(param.getScriptId());
|
||||||
issueParam.setIsPhaseSequence(CommonEnum.COEFFICIENT_TEST.getValue());
|
issueParam.setIsPhaseSequence(CommonEnum.COEFFICIENT_TEST.getValue());
|
||||||
|
|||||||
@@ -275,6 +275,9 @@ public class SocketFreqConverterDevService {
|
|||||||
|
|
||||||
if (DetectionCodeEnum.MAG.getCode().equalsIgnoreCase(sqlDataDTO.getDesc())) {
|
if (DetectionCodeEnum.MAG.getCode().equalsIgnoreCase(sqlDataDTO.getDesc())) {
|
||||||
residualVoltage = value;
|
residualVoltage = value;
|
||||||
|
if (residualVoltage <= 6) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else if (DetectionCodeEnum.DUR.getCode().equalsIgnoreCase(sqlDataDTO.getDesc())) {
|
} else if (DetectionCodeEnum.DUR.getCode().equalsIgnoreCase(sqlDataDTO.getDesc())) {
|
||||||
durationMs = (int) Math.round(value * 1000);
|
durationMs = (int) Math.round(value * 1000);
|
||||||
}
|
}
|
||||||
@@ -314,6 +317,7 @@ public class SocketFreqConverterDevService {
|
|||||||
: 0);
|
: 0);
|
||||||
testRes.setDurationMs(pqDipData.getDurationMs());
|
testRes.setDurationMs(pqDipData.getDurationMs());
|
||||||
testRes.setResidualVoltage(pqDipData.getResidualVoltage());
|
testRes.setResidualVoltage(pqDipData.getResidualVoltage());
|
||||||
|
testRes.setTime(LocalDateTime.now());
|
||||||
|
|
||||||
FormalTestManager.pendingDipTaskMap.put(testRes.getId(), new FormalTestManager.PendingDipTask(
|
FormalTestManager.pendingDipTaskMap.put(testRes.getId(), new FormalTestManager.PendingDipTask(
|
||||||
pqDipData,
|
pqDipData,
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
@@ -326,27 +327,33 @@ public class SocketFreqConverterService {
|
|||||||
socketDataMsg.setData(JSON.toJSONString(newTolerantPointVO));
|
socketDataMsg.setData(JSON.toJSONString(newTolerantPointVO));
|
||||||
WebServiceManager.sendMsg(this.userId, JSON.toJSONString(socketDataMsg));
|
WebServiceManager.sendMsg(this.userId, JSON.toJSONString(socketDataMsg));
|
||||||
|
|
||||||
if (ObjectUtil.isNotNull(this.lastTolerancePoint)) {
|
if (testRes.getTolerant() == 0) {
|
||||||
boolean isNewGroup = this.isNewGroup(this.lastTolerancePoint, newTolerantPointVO);
|
if (ObjectUtil.isNotNull(this.lastTolerancePoint) && this.lastTolerancePoint.getTolerant() == 1) {
|
||||||
if (isNewGroup) {
|
TolerantPointVO featurePointVO = new TolerantPointVO();
|
||||||
// 纵向分组
|
|
||||||
if (freqConverterConfig.getDirection() == 1) {
|
featurePointVO.setResidualVoltage(Math.round((task.getPqDipData().getResidualVoltage() + this.lastTolerancePoint.getResidualVoltage()) / 2D * 100) / 100D);
|
||||||
if (this.lastTolerancePoint.getTolerant() == 1 && testRes.getTolerant() == 1) {
|
featurePointVO.setDurationMs(Integer.valueOf((task.getPqDipData().getDurationMs().intValue() + this.lastTolerancePoint.getDurationMs().intValue()) / 2));
|
||||||
TolerantPointVO featurePointVO = new TolerantPointVO();
|
featurePointVO.setTolerant(2);
|
||||||
featurePointVO.setResidualVoltage(this.lastTolerancePoint.getResidualVoltage());
|
socketDataMsg.setData(JSON.toJSONString(featurePointVO));
|
||||||
featurePointVO.setDurationMs(this.lastTolerancePoint.getDurationMs());
|
WebServiceManager.sendMsg(this.userId, JSON.toJSONString(socketDataMsg));
|
||||||
featurePointVO.setTolerant(2);
|
|
||||||
socketDataMsg.setData(JSON.toJSONString(featurePointVO));
|
PqFreqConverterTestRes featureTestRes = new PqFreqConverterTestRes();
|
||||||
WebServiceManager.sendMsg(this.userId, JSON.toJSONString(socketDataMsg));
|
featureTestRes.setId(IdUtil.fastSimpleUUID());
|
||||||
testRes.setTolerant(2);
|
featureTestRes.setDurationMs(featurePointVO.getDurationMs());
|
||||||
}
|
featureTestRes.setResidualVoltage(featurePointVO.getResidualVoltage());
|
||||||
}
|
featureTestRes.setTolerant(2);
|
||||||
} else {
|
featureTestRes.setTime(LocalDateTime.now());
|
||||||
if (this.lastTolerancePoint.getTolerant() == 1 && testRes.getTolerant() == 0) {
|
saveTestResList.add(featureTestRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从数据库按照列查询距离该暂降点最近的一个暂降点
|
||||||
|
if (freqConverterConfig.getDirection() == 0) {
|
||||||
|
PqFreqConverterTestRes lastByDuration = pqFreqConverterTestResService.getLastByDuration(suffix, key, task.getPqDipData().getDurationMs());
|
||||||
|
if (ObjectUtil.isNotNull(lastByDuration) && lastByDuration.getTolerant() == 1) {
|
||||||
TolerantPointVO featurePointVO = new TolerantPointVO();
|
TolerantPointVO featurePointVO = new TolerantPointVO();
|
||||||
|
|
||||||
featurePointVO.setResidualVoltage((task.getPqDipData().getResidualVoltage() + this.lastTolerancePoint.getResidualVoltage()) / 2D);
|
featurePointVO.setResidualVoltage(Math.round((task.getPqDipData().getResidualVoltage() + lastByDuration.getResidualVoltage()) / 2D * 100) / 100D);
|
||||||
featurePointVO.setDurationMs(Integer.valueOf((task.getPqDipData().getDurationMs().intValue() + this.lastTolerancePoint.getDurationMs().intValue()) / 2));
|
featurePointVO.setDurationMs(Integer.valueOf((task.getPqDipData().getDurationMs().intValue() + lastByDuration.getDurationMs().intValue()) / 2));
|
||||||
featurePointVO.setTolerant(2);
|
featurePointVO.setTolerant(2);
|
||||||
socketDataMsg.setData(JSON.toJSONString(featurePointVO));
|
socketDataMsg.setData(JSON.toJSONString(featurePointVO));
|
||||||
WebServiceManager.sendMsg(this.userId, JSON.toJSONString(socketDataMsg));
|
WebServiceManager.sendMsg(this.userId, JSON.toJSONString(socketDataMsg));
|
||||||
@@ -356,6 +363,28 @@ public class SocketFreqConverterService {
|
|||||||
featureTestRes.setDurationMs(featurePointVO.getDurationMs());
|
featureTestRes.setDurationMs(featurePointVO.getDurationMs());
|
||||||
featureTestRes.setResidualVoltage(featurePointVO.getResidualVoltage());
|
featureTestRes.setResidualVoltage(featurePointVO.getResidualVoltage());
|
||||||
featureTestRes.setTolerant(2);
|
featureTestRes.setTolerant(2);
|
||||||
|
featureTestRes.setTime(LocalDateTime.now());
|
||||||
|
saveTestResList.add(featureTestRes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 从数据库按照行查询距离该暂降点最近的一个暂降点
|
||||||
|
if (freqConverterConfig.getDirection() == 1) {
|
||||||
|
PqFreqConverterTestRes lastByResidualVoltage = pqFreqConverterTestResService.getLastByResidualVoltage(suffix, key, task.getPqDipData().getResidualVoltage());
|
||||||
|
if (ObjectUtil.isNotNull(lastByResidualVoltage) && lastByResidualVoltage.getTolerant() == 1) {
|
||||||
|
TolerantPointVO featurePointVO = new TolerantPointVO();
|
||||||
|
|
||||||
|
featurePointVO.setResidualVoltage(Math.round((task.getPqDipData().getResidualVoltage() + lastByResidualVoltage.getResidualVoltage()) / 2D * 100) / 100D);
|
||||||
|
featurePointVO.setDurationMs(Integer.valueOf((task.getPqDipData().getDurationMs().intValue() + lastByResidualVoltage.getDurationMs().intValue()) / 2));
|
||||||
|
featurePointVO.setTolerant(2);
|
||||||
|
socketDataMsg.setData(JSON.toJSONString(featurePointVO));
|
||||||
|
WebServiceManager.sendMsg(this.userId, JSON.toJSONString(socketDataMsg));
|
||||||
|
|
||||||
|
PqFreqConverterTestRes featureTestRes = new PqFreqConverterTestRes();
|
||||||
|
featureTestRes.setId(IdUtil.fastSimpleUUID());
|
||||||
|
featureTestRes.setDurationMs(featurePointVO.getDurationMs());
|
||||||
|
featureTestRes.setResidualVoltage(featurePointVO.getResidualVoltage());
|
||||||
|
featureTestRes.setTolerant(2);
|
||||||
|
featureTestRes.setTime(LocalDateTime.now());
|
||||||
saveTestResList.add(featureTestRes);
|
saveTestResList.add(featureTestRes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -363,7 +392,6 @@ public class SocketFreqConverterService {
|
|||||||
this.lastTolerancePoint = newTolerantPointVO;
|
this.lastTolerancePoint = newTolerantPointVO;
|
||||||
updateTestResList.add(testRes);
|
updateTestResList.add(testRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!saveTestResList.isEmpty()) {
|
if (!saveTestResList.isEmpty()) {
|
||||||
|
|||||||
@@ -289,7 +289,8 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
}
|
}
|
||||||
//组装源控制脚本
|
//组装源控制脚本
|
||||||
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
issueParam.setSourceId(param.getSourceId());
|
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
|
||||||
|
issueParam.setSourceId(sourceInitialize.getSourceId());
|
||||||
issueParam.setScriptId(param.getScriptId());
|
issueParam.setScriptId(param.getScriptId());
|
||||||
issueParam.setType(1);
|
issueParam.setType(1);
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.SIMULATE_TEST.getValue());
|
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.SIMULATE_TEST.getValue());
|
||||||
|
|||||||
@@ -16,4 +16,6 @@ public class FreqConverterConfig {
|
|||||||
private Integer tolerant;
|
private Integer tolerant;
|
||||||
private Integer dt;
|
private Integer dt;
|
||||||
private Integer direction;
|
private Integer direction;
|
||||||
|
private Integer allowErrorDuration;
|
||||||
|
private Double allowErrorResidualVoltage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.gather.freqConverter.pojo.po;
|
package com.njcn.gather.freqConverter.pojo.po;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -31,4 +32,10 @@ public class PqFreqConverterTestRes {
|
|||||||
* 0为不耐受,1为耐受,2为特性曲线点
|
* 0为不耐受,1为耐受,2为特性曲线点
|
||||||
*/
|
*/
|
||||||
private Integer tolerant;
|
private Integer tolerant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS", timezone = "GMT+8")
|
||||||
|
private LocalDateTime time;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.njcn.gather.freqConverter.pojo.vo;
|
package com.njcn.gather.freqConverter.pojo.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author caozehui
|
* @author caozehui
|
||||||
* @data 2026-04-13
|
* @data 2026-04-13
|
||||||
@@ -22,4 +25,10 @@ public class TolerantPointVO {
|
|||||||
* 是否耐受。0-否,1-是,2-表示特性曲线点
|
* 是否耐受。0-否,1-是,2-表示特性曲线点
|
||||||
*/
|
*/
|
||||||
private Integer tolerant;
|
private Integer tolerant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS", timezone = "GMT+8")
|
||||||
|
private LocalDateTime time;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,19 +18,10 @@ public interface IPqFreqConverterTestResService extends IService<PqFreqConverter
|
|||||||
*/
|
*/
|
||||||
void clearAllData(Integer suffix);
|
void clearAllData(Integer suffix);
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存结果记录
|
|
||||||
*
|
|
||||||
* @param suffix 表后缀
|
|
||||||
* @param testResList 结果数据
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
|
||||||
boolean saveOrUpdateTestRes(Integer suffix, List<PqFreqConverterTestRes> testResList);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增结果记录
|
* 新增结果记录
|
||||||
*
|
*
|
||||||
* @param suffix 表后缀
|
* @param suffix 表后缀
|
||||||
* @param testResList 结果数据
|
* @param testResList 结果数据
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@@ -39,7 +30,7 @@ public interface IPqFreqConverterTestResService extends IService<PqFreqConverter
|
|||||||
/**
|
/**
|
||||||
* 更新结果记录
|
* 更新结果记录
|
||||||
*
|
*
|
||||||
* @param suffix 表后缀
|
* @param suffix 表后缀
|
||||||
* @param testResList 结果数据
|
* @param testResList 结果数据
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@@ -53,4 +44,7 @@ public interface IPqFreqConverterTestResService extends IService<PqFreqConverter
|
|||||||
*/
|
*/
|
||||||
List<PqFreqConverterTestRes> listTestRes(Integer suffix);
|
List<PqFreqConverterTestRes> listTestRes(Integer suffix);
|
||||||
|
|
||||||
|
PqFreqConverterTestRes getLastByDuration(Integer suffix, String id, Integer durationMs);
|
||||||
|
|
||||||
|
PqFreqConverterTestRes getLastByResidualVoltage(Integer suffix, String id, Double residualVoltage);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class FreqConverterServiceImpl extends ServiceImpl<FreqConverterStatusMap
|
|||||||
tolerantPointVO.setDurationMs(item.getDurationMs());
|
tolerantPointVO.setDurationMs(item.getDurationMs());
|
||||||
tolerantPointVO.setResidualVoltage(item.getResidualVoltage());
|
tolerantPointVO.setResidualVoltage(item.getResidualVoltage());
|
||||||
tolerantPointVO.setTolerant(item.getTolerant());
|
tolerantPointVO.setTolerant(item.getTolerant());
|
||||||
|
tolerantPointVO.setTime(item.getTime());
|
||||||
return tolerantPointVO;
|
return tolerantPointVO;
|
||||||
})
|
})
|
||||||
.sorted(Comparator.comparingInt(TolerantPointVO::getDurationMs))
|
.sorted(Comparator.comparingInt(TolerantPointVO::getDurationMs))
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ public class PqFreqConverterConfigServiceImpl extends ServiceImpl<PqFreqConverte
|
|||||||
" `residual_voltage` decimal(6,2) NOT NULL COMMENT '残余电压(%Ur)'," +
|
" `residual_voltage` decimal(6,2) NOT NULL COMMENT '残余电压(%Ur)'," +
|
||||||
" `duration_ms` int(11) NOT NULL COMMENT '持续时间(ms)'," +
|
" `duration_ms` int(11) NOT NULL COMMENT '持续时间(ms)'," +
|
||||||
" `tolerant` tinyInt(1) NOT NULL COMMENT '0为不耐受,1为耐受,2为特征点'," +
|
" `tolerant` tinyInt(1) NOT NULL COMMENT '0为不耐受,1为耐受,2为特征点'," +
|
||||||
|
" `time` datetime(3) DEFAULT NULL COMMENT '时间',"+
|
||||||
" PRIMARY KEY (`id`)" +
|
" PRIMARY KEY (`id`)" +
|
||||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='变频器耐受实验结果';";
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='变频器耐受实验结果';";
|
||||||
tableGenMapper.genTable(tableSql);
|
tableGenMapper.genTable(tableSql);
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
package com.njcn.gather.freqConverter.service.impl;
|
package com.njcn.gather.freqConverter.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
||||||
|
import com.njcn.gather.freqConverter.config.FreqConverterConfig;
|
||||||
import com.njcn.gather.freqConverter.mapper.PqFreqConverterTestResMapper;
|
import com.njcn.gather.freqConverter.mapper.PqFreqConverterTestResMapper;
|
||||||
import com.njcn.gather.freqConverter.pojo.po.PqFreqConverterTestRes;
|
import com.njcn.gather.freqConverter.pojo.po.PqFreqConverterTestRes;
|
||||||
import com.njcn.gather.freqConverter.service.IPqFreqConverterTestResService;
|
import com.njcn.gather.freqConverter.service.IPqFreqConverterTestResService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -14,7 +17,10 @@ import java.util.List;
|
|||||||
* @data 2026-04-14
|
* @data 2026-04-14
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
public class PqFreqConverterTestResServiceImpl extends ServiceImpl<PqFreqConverterTestResMapper, PqFreqConverterTestRes> implements IPqFreqConverterTestResService {
|
public class PqFreqConverterTestResServiceImpl extends ServiceImpl<PqFreqConverterTestResMapper, PqFreqConverterTestRes> implements IPqFreqConverterTestResService {
|
||||||
|
private final FreqConverterConfig freqConverterConfig;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clearAllData(Integer suffix) {
|
public void clearAllData(Integer suffix) {
|
||||||
DynamicTableNameHandler.setTableName(PqFreqConverterConfigServiceImpl.PQ_FREQ_CONVERTER_TEST_RES_TB_PREFIX + suffix);
|
DynamicTableNameHandler.setTableName(PqFreqConverterConfigServiceImpl.PQ_FREQ_CONVERTER_TEST_RES_TB_PREFIX + suffix);
|
||||||
@@ -22,10 +28,6 @@ public class PqFreqConverterTestResServiceImpl extends ServiceImpl<PqFreqConvert
|
|||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean saveOrUpdateTestRes(Integer suffix, List<PqFreqConverterTestRes> testResList) {
|
|
||||||
return this.updateTestRes(suffix, testResList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveTestRes(Integer suffix, List<PqFreqConverterTestRes> testResList) {
|
public boolean saveTestRes(Integer suffix, List<PqFreqConverterTestRes> testResList) {
|
||||||
@@ -51,4 +53,29 @@ public class PqFreqConverterTestResServiceImpl extends ServiceImpl<PqFreqConvert
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PqFreqConverterTestRes getLastByDuration(Integer suffix, String id, Integer durationMs) {
|
||||||
|
DynamicTableNameHandler.setTableName(PqFreqConverterConfigServiceImpl.PQ_FREQ_CONVERTER_TEST_RES_TB_PREFIX + suffix);
|
||||||
|
LambdaQueryWrapper<PqFreqConverterTestRes> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.between(PqFreqConverterTestRes::getDurationMs, durationMs - freqConverterConfig.getAllowErrorDuration(), durationMs + freqConverterConfig.getAllowErrorDuration())
|
||||||
|
.ne(PqFreqConverterTestRes::getId, id)
|
||||||
|
.orderByAsc(PqFreqConverterTestRes::getResidualVoltage)
|
||||||
|
.last("limit 1");
|
||||||
|
PqFreqConverterTestRes result = this.getOne(queryWrapper);
|
||||||
|
DynamicTableNameHandler.remove();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PqFreqConverterTestRes getLastByResidualVoltage(Integer suffix, String id, Double residualVoltage) {
|
||||||
|
DynamicTableNameHandler.setTableName(PqFreqConverterConfigServiceImpl.PQ_FREQ_CONVERTER_TEST_RES_TB_PREFIX + suffix);
|
||||||
|
LambdaQueryWrapper<PqFreqConverterTestRes> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.between(PqFreqConverterTestRes::getResidualVoltage, residualVoltage - freqConverterConfig.getAllowErrorResidualVoltage(), residualVoltage + freqConverterConfig.getAllowErrorResidualVoltage())
|
||||||
|
.ne(PqFreqConverterTestRes::getId, id)
|
||||||
|
.orderByDesc(PqFreqConverterTestRes::getDurationMs)
|
||||||
|
.last("limit 1");
|
||||||
|
PqFreqConverterTestRes result = this.getOne(queryWrapper);
|
||||||
|
DynamicTableNameHandler.remove();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ import com.njcn.gather.script.service.IPqScriptCheckDataService;
|
|||||||
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
||||||
import com.njcn.gather.script.util.ScriptDtlsDesc;
|
import com.njcn.gather.script.util.ScriptDtlsDesc;
|
||||||
import com.njcn.gather.script.util.ThreePhaseUnbalance;
|
import com.njcn.gather.script.util.ThreePhaseUnbalance;
|
||||||
|
import com.njcn.gather.source.pojo.po.SourceInitialize;
|
||||||
|
import com.njcn.gather.source.service.IPqSourceService;
|
||||||
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
||||||
import com.njcn.gather.system.dictionary.service.IDictTreeService;
|
import com.njcn.gather.system.dictionary.service.IDictTreeService;
|
||||||
import com.njcn.gather.system.pojo.enums.DicDataEnum;
|
import com.njcn.gather.system.pojo.enums.DicDataEnum;
|
||||||
@@ -68,13 +70,13 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
private final static String INHARM_I = "InHarm_I";
|
private final static String INHARM_I = "InHarm_I";
|
||||||
private final static String DIP = "Dip";
|
private final static String DIP = "Dip";
|
||||||
private final static String FLICKER = "Flicker";
|
private final static String FLICKER = "Flicker";
|
||||||
// @Value("${Dip.fPreTime}")
|
// @Value("${Dip.fPreTime}")
|
||||||
// private Double fPreTime;
|
// private Double fPreTime;
|
||||||
@Value("${Dip.fRampIn}")
|
@Value("${Dip.fRampIn}")
|
||||||
private Double fRampIn;
|
private Double fRampIn;
|
||||||
@Value("${Dip.fRampOut}")
|
@Value("${Dip.fRampOut}")
|
||||||
private Double fRampOut;
|
private Double fRampOut;
|
||||||
// @Value("${Dip.fAfterTime}")
|
// @Value("${Dip.fAfterTime}")
|
||||||
// private Double fAfterTime;
|
// private Double fAfterTime;
|
||||||
@Value("${Flicker.waveFluType}")
|
@Value("${Flicker.waveFluType}")
|
||||||
private String waveFluType;
|
private String waveFluType;
|
||||||
@@ -91,6 +93,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
private final IDevTypeService devTypeService;
|
private final IDevTypeService devTypeService;
|
||||||
private final IDictTreeService dictTreeService;
|
private final IDictTreeService dictTreeService;
|
||||||
private final AdPlanMapper adPlanMapper;
|
private final AdPlanMapper adPlanMapper;
|
||||||
|
private final IPqSourceService pqSourceService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -781,7 +784,8 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
@Override
|
@Override
|
||||||
public Set<String> getScriptToIcdCheckInfo(PreDetectionParam param) {
|
public Set<String> getScriptToIcdCheckInfo(PreDetectionParam param) {
|
||||||
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
issueParam.setSourceId(param.getSourceId());
|
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
|
||||||
|
issueParam.setSourceId(sourceInitialize.getSourceId());
|
||||||
issueParam.setDevIds(param.getDevIds());
|
issueParam.setDevIds(param.getDevIds());
|
||||||
issueParam.setScriptId(param.getScriptId());
|
issueParam.setScriptId(param.getScriptId());
|
||||||
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
@@ -974,7 +978,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
for (int i = 0; i < pqScriptDtls.size(); i++) {
|
for (int i = 0; i < pqScriptDtls.size(); i++) {
|
||||||
PqScriptDtls scriptDtls = pqScriptDtls.get(i);
|
PqScriptDtls scriptDtls = pqScriptDtls.get(i);
|
||||||
// 注意此处scriptDtls.getValue() < 1.0,考虑到有些已经投入运行的地方,可能没有改库,避免不必要的异常
|
// 注意此处scriptDtls.getValue() < 1.0,考虑到有些已经投入运行的地方,可能没有改库,避免不必要的异常
|
||||||
if(scriptDtls.getValueType().equalsIgnoreCase("CUR") && scriptDtls.getValue() < 1.0){
|
if (scriptDtls.getValueType().equalsIgnoreCase("CUR") && scriptDtls.getValue() < 1.0) {
|
||||||
scriptDtls.setValue(devCurr * scriptDtls.getValue());
|
scriptDtls.setValue(devCurr * scriptDtls.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
# url: jdbc:mysql://192.168.1.24:13306/pqs91002?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
|
# url: jdbc:mysql://192.168.1.24:13306/pqs91002?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
|
||||||
# username: root
|
# username: root
|
||||||
# password: njcnpqs
|
# password: njcnpqs
|
||||||
url: jdbc:mysql://192.168.1.24:13306/pqs9100?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
|
url: jdbc:mysql://192.168.1.24:13306/pqs9100_hn?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
|
||||||
username: root
|
username: root
|
||||||
password: njcnpqs
|
password: njcnpqs
|
||||||
#初始化建立物理连接的个数、最小、最大连接数
|
#初始化建立物理连接的个数、最小、最大连接数
|
||||||
@@ -131,4 +131,6 @@ freq-converter:
|
|||||||
schedule-period: 200 #定时器运行间隔
|
schedule-period: 200 #定时器运行间隔
|
||||||
tolerant: 1 #耐受状态
|
tolerant: 1 #耐受状态
|
||||||
dt: 200 #延迟时间ms
|
dt: 200 #延迟时间ms
|
||||||
direction: 1 #0为横向1为纵向
|
direction: 0 #0为横向1为纵向
|
||||||
|
allow-error-duration: 6 #暂态持续时间允许最大误差ms
|
||||||
|
allow-error-residual-voltage: 2.0 #暂态幅值允许最多误差%
|
||||||
|
|||||||
Reference in New Issue
Block a user