5 Commits

Author SHA1 Message Date
caozehui
9dc8ecd873 Reapply "统一sourceId"
This reverts commit 7c6c103f17.
2026-05-25 18:41:39 +08:00
caozehui
7c6c103f17 Revert "统一sourceId"
This reverts commit 1cfea7fd6c.
2026-05-25 18:41:19 +08:00
caozehui
b113788e54 Revert "报告生成、检测结果查询调整"
This reverts commit 282f9cf4eb.
2026-05-25 18:41:15 +08:00
caozehui
599edde008 Revert "微调"
This reverts commit 6fd180b4d4.
2026-05-25 18:41:11 +08:00
caozehui
cc0b685c66 Reapply "统一sourceId"
This reverts commit c651b18e72.
2026-05-25 18:41:07 +08:00
11 changed files with 22 additions and 73 deletions

View File

@@ -33,7 +33,6 @@ import com.njcn.gather.script.pojo.param.PqScriptIssueParam;
import com.njcn.gather.script.pojo.po.SourceIssue;
import com.njcn.gather.script.service.IPqScriptCheckDataService;
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.po.SimAndDigHarmonicResult;
@@ -394,8 +393,7 @@ public class SocketDevResponseService {
if (param.getTestItemList().get(2)) {
//如果后续做正式检测
PqScriptIssueParam issueParam = new PqScriptIssueParam();
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
issueParam.setSourceId(sourceInitialize.getSourceId());
issueParam.setSourceId(param.getSourceName());
issueParam.setPlanId(param.getPlanId());
issueParam.setSourceId(param.getSourceId());
issueParam.setDevIds(param.getDevIds());
@@ -693,7 +691,7 @@ public class SocketDevResponseService {
*/
private Double reduceList(List<Double> valList) {
// valList.subList(0, 5).clear();
valList.subList(valList.size() - 2, valList.size()).clear();
valList.subList(valList.size() - 2, valList.size()).clear();
return valList.stream().mapToDouble(Double::doubleValue).average().getAsDouble();
}
@@ -898,9 +896,10 @@ public class SocketDevResponseService {
//开始下源控制脚本
PqScriptIssueParam issueParam = new PqScriptIssueParam();
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
issueParam.setSourceId(sourceInitialize.getSourceId());
issueParam.setPlanId(param.getPlanId());
issueParam.setSourceId(param.getSourceName());
issueParam.setDevIds(param.getDevIds());
issueParam.setScriptId(param.getScriptId());
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
List<SourceIssue> sourceIssues;
@@ -1166,8 +1165,7 @@ public class SocketDevResponseService {
} else if (param.getTestItemList().get(2)) {
// 后续做正式检测
PqScriptIssueParam issueParam = new PqScriptIssueParam();
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
issueParam.setSourceId(sourceInitialize.getSourceId());
issueParam.setSourceId(param.getSourceName());
issueParam.setPlanId(param.getPlanId());
issueParam.setDevIds(param.getDevIds());
issueParam.setScriptId(param.getScriptId());
@@ -1821,8 +1819,7 @@ public class SocketDevResponseService {
XiNumberManager.devParameterList.add(devParameterSmall);
PqScriptIssueParam issueParam = new PqScriptIssueParam();
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
issueParam.setSourceId(sourceInitialize.getSourceId());
issueParam.setSourceId(param.getSourceName());
issueParam.setPlanId(param.getPlanId());
issueParam.setDevIds(param.getDevIds());
issueParam.setScriptId(param.getScriptId());

View File

@@ -46,6 +46,11 @@ public class PreDetectionParam {
*/
private String sourceId;
/**
* 源名称
*/
private String sourceName;
/**
* 所属误差体系
*/

View File

@@ -135,6 +135,7 @@ public class PreDetectionServiceImpl implements PreDetectionService {
);
if (ObjectUtil.isNotNull(planSource)) {
SourceInitialize sourceParam = pqSourceService.getSourceInitializeParam(planSource.getSourceId());
param.setSourceName(sourceParam.getSourceId());
if (ObjectUtil.isNotNull(sourceParam)) {
//开始组装socket报文请求头
socketDevResponseService.initList(param);
@@ -181,6 +182,7 @@ public class PreDetectionServiceImpl implements PreDetectionService {
if (ObjectUtil.isNotNull(planSource)) {
//获取源初始化参数
SourceInitialize sourceParam = pqSourceService.getSourceInitializeParam(planSource.getSourceId());
param.setSourceName(sourceParam.getSourceId());
if (ObjectUtil.isNotNull(sourceParam)) {
//开始组装socket报文请求头
socketDevResponseService.initList(param);
@@ -243,6 +245,8 @@ public class PreDetectionServiceImpl implements PreDetectionService {
FormalTestManager.stopFlag = false;
socketDevResponseService.initRestart();
List<SourceIssue> sourceIssueList = SocketManager.getSourceList();
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
param.setSourceName(sourceInitialize.getSourceId());
if (CollUtil.isNotEmpty(sourceIssueList)) {
SourceIssue sourceIssues = SocketManager.getSourceList().get(0);
SocketMsg<String> xuMsg = new SocketMsg<>();

View File

@@ -47,7 +47,7 @@ public class CnSocketUtil {
socketMsg.setRequestId(SourceOperateCodeEnum.QUITE_SOURCE.getValue());
socketMsg.setOperateCode(SourceOperateCodeEnum.CLOSE_GATHER.getValue());
JSONObject jsonObject = new JSONObject();
jsonObject.put("sourceId", param.getSourceId());
jsonObject.put("sourceId", param.getSourceName());
socketMsg.setData(jsonObject.toJSONString());
SocketManager.sendMsg(param.getUserPageId() + SOURCE_TAG, JSON.toJSONString(socketMsg));
WebServiceManager.removePreDetectionParam(param.getUserPageId());

View File

@@ -39,9 +39,4 @@ public class DevReportParam implements Serializable {
* 批量下载时传递的被检设备id列表
*/
private List<String> devIdList;
/**
* 检测报告模板
*/
private String reportTemplateName;
}

View File

@@ -41,7 +41,6 @@ import com.njcn.gather.err.pojo.po.PqErrSys;
import com.njcn.gather.err.service.IPqErrSysService;
import com.njcn.gather.monitor.pojo.po.PqMonitor;
import com.njcn.gather.monitor.service.IPqMonitorService;
import com.njcn.gather.plan.mapper.AdPlanMapper;
import com.njcn.gather.plan.pojo.enums.DataSourceEnum;
import com.njcn.gather.plan.pojo.enums.PlanReportStateEnum;
import com.njcn.gather.plan.pojo.po.AdPlan;
@@ -176,7 +175,6 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
private final IPqDevSubService iPqDevSubService;
private final IDictDataService dictDataService;
private final IAdPlanService adPlanService;
private final AdPlanMapper pqPlanMapper;
private final IPqScriptDtlsService pqScriptDtlsService;
private final SimAndDigNonHarmonicService adNonHarmonicService;
private final SimAndDigHarmonicService adHarmonicService;
@@ -790,9 +788,6 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
* @param devReportParam 设备信息
*/
private void generateReportByPlanContrast(AdPlan plan, DevReportParam devReportParam) {
String reportTemplateName = devReportParam.getReportTemplateName();
String[] split = reportTemplateName.split("_");
String reportTemplateId = pqPlanMapper.getReportIdByNameAndVersion(split[0], split[1]);
// 支持批量生成报告
devReportParam.getDevIdList().forEach(devId -> {
// 准备被检设备的基础信息
@@ -807,7 +802,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
if (Objects.isNull(devType)) {
throw new BusinessException(ReportResponseEnum.DEVICE_TYPE_NOT_EXIST);
}
PqReport report = this.lambdaQuery().eq(PqReport::getId, reportTemplateId).eq(PqReport::getState, DataStateEnum.ENABLE.getCode()).one();
PqReport report = this.lambdaQuery().eq(PqReport::getId, plan.getReportTemplateId()).eq(PqReport::getState, DataStateEnum.ENABLE.getCode()).one();
if (Objects.isNull(report)) {
throw new BusinessException(ReportResponseEnum.REPORT_TEMPLATE_NOT_EXIST);
}
@@ -871,9 +866,6 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
* @param devReportParam 设备信息
*/
private void generateReportByPlan(AdPlan plan, DevReportParam devReportParam) {
String reportTemplateName = devReportParam.getReportTemplateName();
String[] split = reportTemplateName.split("_");
String reportTemplateId = pqPlanMapper.getReportIdByNameAndVersion(split[0], split[1]);
// 支持批量生成报告
devReportParam.getDevIdList().forEach(devId -> {
// 准备被检设备的基础信息
@@ -887,7 +879,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
if (Objects.isNull(devType)) {
throw new BusinessException(ReportResponseEnum.DEVICE_TYPE_NOT_EXIST);
}
PqReport report = this.lambdaQuery().eq(PqReport::getId, reportTemplateId).eq(PqReport::getState, DataStateEnum.ENABLE.getCode()).one();
PqReport report = this.lambdaQuery().eq(PqReport::getId, plan.getReportTemplateId()).eq(PqReport::getState, DataStateEnum.ENABLE.getCode()).one();
if (Objects.isNull(report)) {
throw new BusinessException(ReportResponseEnum.REPORT_TEMPLATE_NOT_EXIST);
}

View File

@@ -201,16 +201,4 @@ public class ResultController extends BaseController {
List<ContrastTestItemVO> result = resultService.getCheckItem(monitorQueryParam.getPlanId(), monitorQueryParam.getDevId(), monitorQueryParam.getChnNum(), monitorQueryParam.getNum(), monitorQueryParam.getCode());
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/canTest")
@ApiOperation("是否还能进行检测")
@ApiImplicitParam(name = "devIds", value = "设备id", required = true)
public HttpResult<Boolean> canTest(@RequestBody List<String> devIds) {
String methodDescribe = getMethodDescribe("canTest");
LogUtil.njcnDebug(log, "{}查询数据为devIds={}", methodDescribe, devIds);
boolean result = resultService.canTest(devIds);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
}

View File

@@ -31,9 +31,4 @@ public class FormContentVO {
* 有多少次波形录制
*/
private Integer waveNumTotal;
/**
* 报表模板
*/
private String reportTemplateName;
}

View File

@@ -138,12 +138,4 @@ public interface IResultService {
Map<Integer, List<ContrastTestResult>> getContrastResultForReport(DevReportParam devReportParam, PqDevVO pqDevVO);
ContrastTestResult getContrastResultHarm(MonitorResultVO monitorResultVO, List<String> scriptId, Integer planCode, DictTree dictTree);
/**
* 判断设备是否可以测试
*
* @param devIds
* @return
*/
boolean canTest(List<String> devIds);
}

View File

@@ -41,7 +41,6 @@ import com.njcn.gather.device.service.IPqStandardDevService;
import com.njcn.gather.err.service.IPqErrSysService;
import com.njcn.gather.monitor.pojo.po.PqMonitor;
import com.njcn.gather.monitor.service.IPqMonitorService;
import com.njcn.gather.plan.mapper.AdPlanMapper;
import com.njcn.gather.plan.pojo.enums.DataSourceEnum;
import com.njcn.gather.plan.pojo.po.AdPlan;
import com.njcn.gather.plan.pojo.po.AdPlanTestConfig;
@@ -53,7 +52,6 @@ import com.njcn.gather.report.pojo.constant.PowerConstant;
import com.njcn.gather.report.pojo.enums.AffectEnum;
import com.njcn.gather.report.pojo.enums.ItemReportKeyEnum;
import com.njcn.gather.report.pojo.enums.PowerIndexEnum;
import com.njcn.gather.report.pojo.po.PqReport;
import com.njcn.gather.report.pojo.result.ContrastTestResult;
import com.njcn.gather.report.pojo.result.SingleTestResult;
import com.njcn.gather.result.pojo.enums.ResultUnitEnum;
@@ -114,7 +112,6 @@ import static com.njcn.gather.plan.pojo.enums.DataSourceEnum.*;
public class ResultServiceImpl implements IResultService {
private final IAdPlanService adPlanService;
private final AdPlanMapper adPlanMapper;
private final IAdPlanTestConfigService adPlanTestConfigService;
private final IPqDevService pqDevService;
private final IPqStandardDevService pqStandardDevService;
@@ -130,6 +127,7 @@ public class ResultServiceImpl implements IResultService {
private final DetectionServiceImpl detectionServiceImpl;
private final IDictDataService dictDataService;
private final IPqScriptCheckDataService iPqScriptCheckDataService;
private final IPqDevService iPqDevService;
private final IAdPariService adPairService;
private final IPqMonitorService pqMonitorService;
private final IPqErrSysService pqErrSysService;
@@ -146,8 +144,6 @@ public class ResultServiceImpl implements IResultService {
FormContentVO formContentVO = new FormContentVO();
AdPlan plan = adPlanService.getById(queryParam.getPlanId());
formContentVO.setErrorSysId(plan.getErrorSysId());
PqReport report = adPlanMapper.getPqReportById(plan.getReportTemplateId());
formContentVO.setReportTemplateName(report.getName() + "_" + report.getVersion());
String scriptId = null;
if (ObjectUtil.isNotNull(plan)) {
formContentVO.setDataRule(plan.getDataRule());
@@ -2148,19 +2144,6 @@ public class ResultServiceImpl implements IResultService {
return null;
}
@Override
public boolean canTest(List<String> devIds) {
for (String devId : devIds) {
PqDevVO pqDevVO = pqDevService.getPqDevById(devId);
AdPlanTestConfig adPlanTestConfig = adPlanTestConfigService.getByPlanId(pqDevVO.getPlanId());
Integer maxTime = adPlanTestConfig.getMaxTime();
if (maxTime != null && maxTime <= pqDevVO.getRecheckNum()) {
return false;
}
}
return true;
}
/**
* 判断值是否为零
*
@@ -3157,7 +3140,7 @@ public class ResultServiceImpl implements IResultService {
checkDataParam.setIsValueTypeName(false);
List<String> valueType = iPqScriptCheckDataService.getValueType(checkDataParam);
pqDevService.updateResult(param.getDevIds(), valueType, param.getCode(), param.getUserId(), param.getTemperature(), param.getHumidity());
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(), param.getUserId(), param.getTemperature(), param.getHumidity());
}
/**

View File

@@ -34,7 +34,6 @@ import com.njcn.gather.script.service.IPqScriptCheckDataService;
import com.njcn.gather.script.service.IPqScriptDtlsService;
import com.njcn.gather.script.util.ScriptDtlsDesc;
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.service.IDictTreeService;
@@ -784,8 +783,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
@Override
public Set<String> getScriptToIcdCheckInfo(PreDetectionParam param) {
PqScriptIssueParam issueParam = new PqScriptIssueParam();
SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId());
issueParam.setSourceId(sourceInitialize.getSourceId());
issueParam.setSourceId(param.getSourceName());
issueParam.setDevIds(param.getDevIds());
issueParam.setScriptId(param.getScriptId());
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());