This commit is contained in:
caozehui
2025-04-17 10:36:05 +08:00
parent d1cbfcedcc
commit 102aa504e6
3 changed files with 25 additions and 19 deletions

View File

@@ -1,8 +1,9 @@
package com.njcn.gather.plan.pojo.po; package com.njcn.gather.plan.pojo.po;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.mybatisplus.bo.BaseEntity; import com.njcn.db.mybatisplus.bo.BaseEntity;
import io.swagger.models.auth.In;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -86,6 +87,7 @@ public class AdPlan extends BaseEntity implements Serializable {
/** /**
* 报告模板ID关联PQ_Report表 * 报告模板ID关联PQ_Report表
*/ */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String reportTemplateId; private String reportTemplateId;
/** /**

View File

@@ -188,17 +188,21 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
AdPlan plan1 = this.getById(param.getId()); AdPlan plan1 = this.getById(param.getId());
AdPlan plan2 = new AdPlan(); AdPlan plan2 = new AdPlan();
if (param.getAssociateReport() != null && param.getAssociateReport() == 1) { if (param.getAssociateReport() != null) {
String reportTemplateName = param.getReportTemplateName(); if (param.getAssociateReport() == 1) {
String[] split = reportTemplateName.split("_"); String reportTemplateName = param.getReportTemplateName();
String reportId = this.baseMapper.getReportIdByNameAndVersion(split[0], split[1]); String[] split = reportTemplateName.split("_");
if (plan1.getTestState() != CheckStateEnum.UNCHECKED.getValue()) { String reportId = this.baseMapper.getReportIdByNameAndVersion(split[0], split[1]);
if (!reportId.equals(plan1.getReportTemplateId())) { // if (plan1.getTestState() != CheckStateEnum.UNCHECKED.getValue()) {
throw new BusinessException(DetectionResponseEnum.CANNOT_CHANGE_REPORT_WHEN_CHECKING); // if (!reportId.equals(plan1.getReportTemplateId())) {
// throw new BusinessException(DetectionResponseEnum.CANNOT_CHANGE_REPORT_WHEN_CHECKING);
// }
// }
if (StrUtil.isNotBlank(reportId)) {
plan2.setReportTemplateId(reportId);
} }
} } else {
if (StrUtil.isNotBlank(reportId)) { plan2.setReportTemplateId(null);
plan2.setReportTemplateId(reportId);
} }
} }
@@ -209,9 +213,9 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
if (!plan1.getErrorSysId().equals(param.getErrorSysId())) { if (!plan1.getErrorSysId().equals(param.getErrorSysId())) {
throw new BusinessException(DetectionResponseEnum.CANNOT_CHANGE_ERROR_SYS_WHEN_CHECKING); throw new BusinessException(DetectionResponseEnum.CANNOT_CHANGE_ERROR_SYS_WHEN_CHECKING);
} }
if (param.getAssociateReport() != null && param.getAssociateReport() != plan1.getAssociateReport()) { // if (param.getAssociateReport() != null && param.getAssociateReport() != plan1.getAssociateReport()) {
throw new BusinessException(DetectionResponseEnum.CANNOT_CHANGE_REPORT_WHEN_CHECKING); // throw new BusinessException(DetectionResponseEnum.CANNOT_CHANGE_REPORT_WHEN_CHECKING);
} // }
} }
BeanUtil.copyProperties(param, plan2); BeanUtil.copyProperties(param, plan2);
@@ -531,7 +535,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
List<ProvinceDevExcel> deviceExportData = BeanUtil.copyToList(pqDevs, ProvinceDevExcel.class); List<ProvinceDevExcel> deviceExportData = BeanUtil.copyToList(pqDevs, ProvinceDevExcel.class);
planExcelList.get(i).setDevices(deviceExportData); planExcelList.get(i).setDevices(deviceExportData);
} }
ExcelUtil.exportExcelPullDown(new ExportParams(), "检测计划导出数据.xlsx", 2, this.getPullDownList(SceneEnum.PROVINCE_PLATFORM,queryParam.getPatternId()), ProvincePlanExcel.class, planExcelList); ExcelUtil.exportExcelPullDown(new ExportParams(), "检测计划导出数据.xlsx", 2, this.getPullDownList(SceneEnum.PROVINCE_PLATFORM, queryParam.getPatternId()), ProvincePlanExcel.class, planExcelList);
} }
/** /**
@@ -554,7 +558,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
List<CNDevExcel> deviceExportData = BeanUtil.copyToList(pqDevs, CNDevExcel.class); List<CNDevExcel> deviceExportData = BeanUtil.copyToList(pqDevs, CNDevExcel.class);
planExcelList.get(i).setDevices(deviceExportData); planExcelList.get(i).setDevices(deviceExportData);
} }
ExcelUtil.exportExcelPullDown(new ExportParams(), "检测计划导出数据.xlsx", 2, this.getPullDownList(SceneEnum.LEAVE_FACTORY_TEST,queryParam.getPatternId()), CNPlanExcel.class, planExcelList); ExcelUtil.exportExcelPullDown(new ExportParams(), "检测计划导出数据.xlsx", 2, this.getPullDownList(SceneEnum.LEAVE_FACTORY_TEST, queryParam.getPatternId()), CNPlanExcel.class, planExcelList);
} }
@Transactional @Transactional

View File

@@ -701,12 +701,12 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue()); issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());
List<SourceIssue> sourceIssues = this.listSourceIssue(issueParam); List<SourceIssue> sourceIssues = this.listSourceIssue(issueParam);
List<String> dataTypeList = new ArrayList<>(); Set<String> dataTypeSet = new HashSet<>();
sourceIssues.forEach(x -> { sourceIssues.forEach(x -> {
dataTypeList.addAll(x.getDevValueTypeList()); dataTypeSet.addAll(x.getDevValueTypeList());
}); });
return dataTypeList; return dataTypeSet.stream().collect(Collectors.toList());
} }
@Override @Override