diff --git a/detection/src/main/java/com/njcn/gather/plan/pojo/vo/AdPlanExcel.java b/detection/src/main/java/com/njcn/gather/plan/pojo/vo/AdPlanExcel.java index 1b8348bf..ed7cd045 100644 --- a/detection/src/main/java/com/njcn/gather/plan/pojo/vo/AdPlanExcel.java +++ b/detection/src/main/java/com/njcn/gather/plan/pojo/vo/AdPlanExcel.java @@ -48,15 +48,15 @@ public class AdPlanExcel { @Excel(name = "报告模版(当关联报告模版为是时必填)", width = 40, needMerge = true, orderNum = "8") private String reportTemplateId; - @Excel(name = "检测状态*", width = 10, replace = {"未检_0", "检测中_1", "检测完成_2"}, needMerge = true, orderNum = "9") - @NotNull(message = DetectionValidMessage.TEST_STATE_NOT_NULL) - private Integer testState; - - @Excel(name = "报告生成状态*", width = 15, replace = {"未生成_0", "部分生成_1", "全部生成_2"}, needMerge = true, orderNum = "10") - @NotNull(message = DetectionValidMessage.REPORT_STATE_NOT_NULL) - private Integer reportState; - - @Excel(name = "检测结果*", width = 10, replace = {"不符合_0", "符合_1", "未检_2"}, needMerge = true, orderNum = "11") - @NotNull(message = DetectionValidMessage.CHECK_RESULT_STATE_NOT_NULL) - private Integer result; +// @Excel(name = "检测状态*", width = 10, replace = {"未检_0", "检测中_1", "检测完成_2"}, needMerge = true, orderNum = "9") +// @NotNull(message = DetectionValidMessage.TEST_STATE_NOT_NULL) +// private Integer testState; +// +// @Excel(name = "报告生成状态*", width = 15, replace = {"未生成_0", "部分生成_1", "全部生成_2"}, needMerge = true, orderNum = "10") +// @NotNull(message = DetectionValidMessage.REPORT_STATE_NOT_NULL) +// private Integer reportState; +// +// @Excel(name = "检测结果*", width = 10, replace = {"不符合_0", "符合_1", "未检_2"}, needMerge = true, orderNum = "11") +// @NotNull(message = DetectionValidMessage.CHECK_RESULT_STATE_NOT_NULL) +// private Integer result; } diff --git a/detection/src/main/java/com/njcn/gather/plan/pojo/vo/CNPlanExcel.java b/detection/src/main/java/com/njcn/gather/plan/pojo/vo/CNPlanExcel.java index ee6133e3..02674991 100644 --- a/detection/src/main/java/com/njcn/gather/plan/pojo/vo/CNPlanExcel.java +++ b/detection/src/main/java/com/njcn/gather/plan/pojo/vo/CNPlanExcel.java @@ -14,6 +14,6 @@ import java.util.List; public class CNPlanExcel extends AdPlanExcel { - @ExcelCollection(name = "绑定的设备", orderNum = "12") + @ExcelCollection(name = "绑定的设备", orderNum = "9") private List devices; } diff --git a/detection/src/main/java/com/njcn/gather/plan/pojo/vo/ProvincePlanExcel.java b/detection/src/main/java/com/njcn/gather/plan/pojo/vo/ProvincePlanExcel.java index 4a2f87cb..7f5de043 100644 --- a/detection/src/main/java/com/njcn/gather/plan/pojo/vo/ProvincePlanExcel.java +++ b/detection/src/main/java/com/njcn/gather/plan/pojo/vo/ProvincePlanExcel.java @@ -14,6 +14,6 @@ import java.util.List; @Data public class ProvincePlanExcel extends AdPlanExcel { - @ExcelCollection(name = "绑定的设备", orderNum = "12") + @ExcelCollection(name = "绑定的设备", orderNum = "9") private List devices; } diff --git a/detection/src/main/java/com/njcn/gather/plan/service/impl/AdPlanServiceImpl.java b/detection/src/main/java/com/njcn/gather/plan/service/impl/AdPlanServiceImpl.java index f9c97413..ef00a06a 100644 --- a/detection/src/main/java/com/njcn/gather/plan/service/impl/AdPlanServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/plan/service/impl/AdPlanServiceImpl.java @@ -729,6 +729,10 @@ public class AdPlanServiceImpl extends ServiceImpl impleme adPlanSourceService.addAdPlanSource(planId, sourceIds); List cnDevExcelList = planExcel.getDevices(); + ProvinceDevExcel provinceDevExcel = cnDevExcelList.get(0); + if (ObjectUtil.isNull(provinceDevExcel.getName())) { + cnDevExcelList.remove(0); + } pqDevService.importProvinceDev(cnDevExcelList, patternId, planId); } // 逆向可视化 @@ -867,8 +871,9 @@ public class AdPlanServiceImpl extends ServiceImpl impleme } else { adPlan.setDataRule(dataRuleDictData.getId()); } - - if (StrUtil.isNotBlank(adPlan.getReportTemplateId())) { + if (adPlan.getAssociateReport().equals(0)) { + adPlan.setReportTemplateId(null); + }else if (StrUtil.isNotBlank(adPlan.getReportTemplateId())) { String[] split = adPlan.getReportTemplateId().split("_"); String reportId = this.baseMapper.getReportIdByNameAndVersion(split[0], split[1]); if (ObjectUtil.isNull(reportId)) { @@ -876,6 +881,8 @@ public class AdPlanServiceImpl extends ServiceImpl impleme } else { adPlan.setReportTemplateId(reportId); } + } else { + throw new BusinessException(DetectionResponseEnum.LACK_REPORT_TEMPLATE_ID); } adPlan.setCode(this.generateCode()); adPlan.setState(DataStateEnum.ENABLE.getCode()); @@ -1150,33 +1157,33 @@ public class AdPlanServiceImpl extends ServiceImpl impleme pullDowns.add(pullDown); // 检测状态 - pullDown = new PullDown(); - pullDown.setFirstCol(9); - pullDown.setLastCol(9); - pullDown.setStrings(Arrays.asList(CheckStateEnum.UNCHECKED.getMsg(), CheckStateEnum.CHECKING.getMsg(), CheckStateEnum.CHECKED.getMsg())); - pullDowns.add(pullDown); +// pullDown = new PullDown(); +// pullDown.setFirstCol(9); +// pullDown.setLastCol(9); +// pullDown.setStrings(Arrays.asList(CheckStateEnum.UNCHECKED.getMsg(), CheckStateEnum.CHECKING.getMsg(), CheckStateEnum.CHECKED.getMsg())); +// pullDowns.add(pullDown); // 报告生成状态 - pullDown = new PullDown(); - pullDown.setFirstCol(10); - pullDown.setLastCol(10); - pullDown.setStrings(Arrays.asList(PlanReportStateEnum.REPORT_STATE_NOT_GENERATED.getMsg(), PlanReportStateEnum.REPORT_STATE_PARTIALLY_GENERATED.getMsg(), PlanReportStateEnum.REPORT_STATE_ALL_GENERATED.getMsg())); - pullDowns.add(pullDown); +// pullDown = new PullDown(); +// pullDown.setFirstCol(10); +// pullDown.setLastCol(10); +// pullDown.setStrings(Arrays.asList(PlanReportStateEnum.REPORT_STATE_NOT_GENERATED.getMsg(), PlanReportStateEnum.REPORT_STATE_PARTIALLY_GENERATED.getMsg(), PlanReportStateEnum.REPORT_STATE_ALL_GENERATED.getMsg())); +// pullDowns.add(pullDown); //检测结果 - pullDown = new PullDown(); - pullDown.setFirstCol(11); - pullDown.setLastCol(11); - pullDown.setStrings(Arrays.asList(CheckResultEnum.UNCHECKED.getMsg(), CheckResultEnum.ACCORD.getMsg(), CheckResultEnum.UNCHECKED.getMsg())); - pullDowns.add(pullDown); +// pullDown = new PullDown(); +// pullDown.setFirstCol(11); +// pullDown.setLastCol(11); +// pullDown.setStrings(Arrays.asList(CheckResultEnum.UNCHECKED.getMsg(), CheckResultEnum.ACCORD.getMsg(), CheckResultEnum.UNCHECKED.getMsg())); +// pullDowns.add(pullDown); switch (scene) { case PROVINCE_PLATFORM: - List provinceDevPullDownList = pqDevService.getProvinceDevPullDownList(12); + List provinceDevPullDownList = pqDevService.getProvinceDevPullDownList(9); pullDowns.addAll(provinceDevPullDownList); break; case LEAVE_FACTORY_TEST: - List cnDevPullDownList = pqDevService.getCNDevPullDownList(12); + List cnDevPullDownList = pqDevService.getCNDevPullDownList(9); pullDowns.addAll(cnDevPullDownList); break; case SELF_TEST: diff --git a/detection/src/main/java/com/njcn/gather/pojo/enums/DetectionResponseEnum.java b/detection/src/main/java/com/njcn/gather/pojo/enums/DetectionResponseEnum.java index 614b6a47..80c83434 100644 --- a/detection/src/main/java/com/njcn/gather/pojo/enums/DetectionResponseEnum.java +++ b/detection/src/main/java/com/njcn/gather/pojo/enums/DetectionResponseEnum.java @@ -60,7 +60,8 @@ public enum DetectionResponseEnum { SCRIPT_NOT_EXIST("A02068", "该脚本不存在,请先添加该脚本"), ERROR_SYSTEM_NOT_EXIST("A02069", "该误差体系不存在,请先添加该误差体系"), DATA_RULE_NOT_EXIST("A02070", "该数据处理原则不存在,请先在\"数据处理原则\"字典中添加"), - REPORT_TEMPLATE_NOT_EXIST("A02071", "该报告模板不存在,请先添加该报告模板"); + REPORT_TEMPLATE_NOT_EXIST("A02071", "该报告模板不存在,请先添加该报告模板"), + LACK_REPORT_TEMPLATE_ID("A02072","当关联报告模板为\"是\"时,报告模板不能为空" ); private final String code;