Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -39,4 +39,9 @@ public class DevReportParam implements Serializable {
|
|||||||
* 批量下载时传递的被检设备id列表
|
* 批量下载时传递的被检设备id列表
|
||||||
*/
|
*/
|
||||||
private List<String> devIdList;
|
private List<String> devIdList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测报告模板
|
||||||
|
*/
|
||||||
|
private String reportTemplateName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import com.njcn.gather.err.pojo.po.PqErrSys;
|
|||||||
import com.njcn.gather.err.service.IPqErrSysService;
|
import com.njcn.gather.err.service.IPqErrSysService;
|
||||||
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
||||||
import com.njcn.gather.monitor.service.IPqMonitorService;
|
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.DataSourceEnum;
|
||||||
import com.njcn.gather.plan.pojo.enums.PlanReportStateEnum;
|
import com.njcn.gather.plan.pojo.enums.PlanReportStateEnum;
|
||||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||||
@@ -175,6 +176,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
private final IPqDevSubService iPqDevSubService;
|
private final IPqDevSubService iPqDevSubService;
|
||||||
private final IDictDataService dictDataService;
|
private final IDictDataService dictDataService;
|
||||||
private final IAdPlanService adPlanService;
|
private final IAdPlanService adPlanService;
|
||||||
|
private final AdPlanMapper pqPlanMapper;
|
||||||
private final IPqScriptDtlsService pqScriptDtlsService;
|
private final IPqScriptDtlsService pqScriptDtlsService;
|
||||||
private final SimAndDigNonHarmonicService adNonHarmonicService;
|
private final SimAndDigNonHarmonicService adNonHarmonicService;
|
||||||
private final SimAndDigHarmonicService adHarmonicService;
|
private final SimAndDigHarmonicService adHarmonicService;
|
||||||
@@ -788,6 +790,9 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
* @param devReportParam 设备信息
|
* @param devReportParam 设备信息
|
||||||
*/
|
*/
|
||||||
private void generateReportByPlanContrast(AdPlan plan, DevReportParam 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 -> {
|
devReportParam.getDevIdList().forEach(devId -> {
|
||||||
// 准备被检设备的基础信息
|
// 准备被检设备的基础信息
|
||||||
@@ -802,7 +807,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
if (Objects.isNull(devType)) {
|
if (Objects.isNull(devType)) {
|
||||||
throw new BusinessException(ReportResponseEnum.DEVICE_TYPE_NOT_EXIST);
|
throw new BusinessException(ReportResponseEnum.DEVICE_TYPE_NOT_EXIST);
|
||||||
}
|
}
|
||||||
PqReport report = this.lambdaQuery().eq(PqReport::getId, plan.getReportTemplateId()).eq(PqReport::getState, DataStateEnum.ENABLE.getCode()).one();
|
PqReport report = this.lambdaQuery().eq(PqReport::getId, reportTemplateId).eq(PqReport::getState, DataStateEnum.ENABLE.getCode()).one();
|
||||||
if (Objects.isNull(report)) {
|
if (Objects.isNull(report)) {
|
||||||
throw new BusinessException(ReportResponseEnum.REPORT_TEMPLATE_NOT_EXIST);
|
throw new BusinessException(ReportResponseEnum.REPORT_TEMPLATE_NOT_EXIST);
|
||||||
}
|
}
|
||||||
@@ -866,6 +871,9 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
* @param devReportParam 设备信息
|
* @param devReportParam 设备信息
|
||||||
*/
|
*/
|
||||||
private void generateReportByPlan(AdPlan plan, DevReportParam 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 -> {
|
devReportParam.getDevIdList().forEach(devId -> {
|
||||||
// 准备被检设备的基础信息
|
// 准备被检设备的基础信息
|
||||||
@@ -879,7 +887,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
if (Objects.isNull(devType)) {
|
if (Objects.isNull(devType)) {
|
||||||
throw new BusinessException(ReportResponseEnum.DEVICE_TYPE_NOT_EXIST);
|
throw new BusinessException(ReportResponseEnum.DEVICE_TYPE_NOT_EXIST);
|
||||||
}
|
}
|
||||||
PqReport report = this.lambdaQuery().eq(PqReport::getId, plan.getReportTemplateId()).eq(PqReport::getState, DataStateEnum.ENABLE.getCode()).one();
|
PqReport report = this.lambdaQuery().eq(PqReport::getId, reportTemplateId).eq(PqReport::getState, DataStateEnum.ENABLE.getCode()).one();
|
||||||
if (Objects.isNull(report)) {
|
if (Objects.isNull(report)) {
|
||||||
throw new BusinessException(ReportResponseEnum.REPORT_TEMPLATE_NOT_EXIST);
|
throw new BusinessException(ReportResponseEnum.REPORT_TEMPLATE_NOT_EXIST);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,4 +201,16 @@ public class ResultController extends BaseController {
|
|||||||
List<ContrastTestItemVO> result = resultService.getCheckItem(monitorQueryParam.getPlanId(), monitorQueryParam.getDevId(), monitorQueryParam.getChnNum(), monitorQueryParam.getNum(), monitorQueryParam.getCode());
|
List<ContrastTestItemVO> result = resultService.getCheckItem(monitorQueryParam.getPlanId(), monitorQueryParam.getDevId(), monitorQueryParam.getChnNum(), monitorQueryParam.getNum(), monitorQueryParam.getCode());
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,9 @@ public class FormContentVO {
|
|||||||
* 有多少次波形录制
|
* 有多少次波形录制
|
||||||
*/
|
*/
|
||||||
private Integer waveNumTotal;
|
private Integer waveNumTotal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报表模板
|
||||||
|
*/
|
||||||
|
private String reportTemplateName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,4 +138,12 @@ public interface IResultService {
|
|||||||
Map<Integer, List<ContrastTestResult>> getContrastResultForReport(DevReportParam devReportParam, PqDevVO pqDevVO);
|
Map<Integer, List<ContrastTestResult>> getContrastResultForReport(DevReportParam devReportParam, PqDevVO pqDevVO);
|
||||||
|
|
||||||
ContrastTestResult getContrastResultHarm(MonitorResultVO monitorResultVO, List<String> scriptId, Integer planCode, DictTree dictTree);
|
ContrastTestResult getContrastResultHarm(MonitorResultVO monitorResultVO, List<String> scriptId, Integer planCode, DictTree dictTree);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断设备是否可以测试
|
||||||
|
*
|
||||||
|
* @param devIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean canTest(List<String> devIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import com.njcn.gather.device.service.IPqStandardDevService;
|
|||||||
import com.njcn.gather.err.service.IPqErrSysService;
|
import com.njcn.gather.err.service.IPqErrSysService;
|
||||||
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
||||||
import com.njcn.gather.monitor.service.IPqMonitorService;
|
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.DataSourceEnum;
|
||||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||||
import com.njcn.gather.plan.pojo.po.AdPlanTestConfig;
|
import com.njcn.gather.plan.pojo.po.AdPlanTestConfig;
|
||||||
@@ -52,6 +53,7 @@ import com.njcn.gather.report.pojo.constant.PowerConstant;
|
|||||||
import com.njcn.gather.report.pojo.enums.AffectEnum;
|
import com.njcn.gather.report.pojo.enums.AffectEnum;
|
||||||
import com.njcn.gather.report.pojo.enums.ItemReportKeyEnum;
|
import com.njcn.gather.report.pojo.enums.ItemReportKeyEnum;
|
||||||
import com.njcn.gather.report.pojo.enums.PowerIndexEnum;
|
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.ContrastTestResult;
|
||||||
import com.njcn.gather.report.pojo.result.SingleTestResult;
|
import com.njcn.gather.report.pojo.result.SingleTestResult;
|
||||||
import com.njcn.gather.result.pojo.enums.ResultUnitEnum;
|
import com.njcn.gather.result.pojo.enums.ResultUnitEnum;
|
||||||
@@ -112,6 +114,7 @@ import static com.njcn.gather.plan.pojo.enums.DataSourceEnum.*;
|
|||||||
public class ResultServiceImpl implements IResultService {
|
public class ResultServiceImpl implements IResultService {
|
||||||
|
|
||||||
private final IAdPlanService adPlanService;
|
private final IAdPlanService adPlanService;
|
||||||
|
private final AdPlanMapper adPlanMapper;
|
||||||
private final IAdPlanTestConfigService adPlanTestConfigService;
|
private final IAdPlanTestConfigService adPlanTestConfigService;
|
||||||
private final IPqDevService pqDevService;
|
private final IPqDevService pqDevService;
|
||||||
private final IPqStandardDevService pqStandardDevService;
|
private final IPqStandardDevService pqStandardDevService;
|
||||||
@@ -127,7 +130,6 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
private final DetectionServiceImpl detectionServiceImpl;
|
private final DetectionServiceImpl detectionServiceImpl;
|
||||||
private final IDictDataService dictDataService;
|
private final IDictDataService dictDataService;
|
||||||
private final IPqScriptCheckDataService iPqScriptCheckDataService;
|
private final IPqScriptCheckDataService iPqScriptCheckDataService;
|
||||||
private final IPqDevService iPqDevService;
|
|
||||||
private final IAdPariService adPairService;
|
private final IAdPariService adPairService;
|
||||||
private final IPqMonitorService pqMonitorService;
|
private final IPqMonitorService pqMonitorService;
|
||||||
private final IPqErrSysService pqErrSysService;
|
private final IPqErrSysService pqErrSysService;
|
||||||
@@ -144,6 +146,8 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
FormContentVO formContentVO = new FormContentVO();
|
FormContentVO formContentVO = new FormContentVO();
|
||||||
AdPlan plan = adPlanService.getById(queryParam.getPlanId());
|
AdPlan plan = adPlanService.getById(queryParam.getPlanId());
|
||||||
formContentVO.setErrorSysId(plan.getErrorSysId());
|
formContentVO.setErrorSysId(plan.getErrorSysId());
|
||||||
|
PqReport report = adPlanMapper.getPqReportById(plan.getReportTemplateId());
|
||||||
|
formContentVO.setReportTemplateName(report.getName() + "_" + report.getVersion());
|
||||||
String scriptId = null;
|
String scriptId = null;
|
||||||
if (ObjectUtil.isNotNull(plan)) {
|
if (ObjectUtil.isNotNull(plan)) {
|
||||||
formContentVO.setDataRule(plan.getDataRule());
|
formContentVO.setDataRule(plan.getDataRule());
|
||||||
@@ -2144,6 +2148,19 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
return null;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断值是否为零
|
* 判断值是否为零
|
||||||
*
|
*
|
||||||
@@ -3140,7 +3157,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
checkDataParam.setIsValueTypeName(false);
|
checkDataParam.setIsValueTypeName(false);
|
||||||
List<String> valueType = iPqScriptCheckDataService.getValueType(checkDataParam);
|
List<String> valueType = iPqScriptCheckDataService.getValueType(checkDataParam);
|
||||||
|
|
||||||
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(), param.getUserId(), param.getTemperature(), param.getHumidity());
|
pqDevService.updateResult(param.getDevIds(), valueType, param.getCode(), param.getUserId(), param.getTemperature(), param.getHumidity());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user