From e0298ed65f9bd4a1e7dce9a5bd09876291bf4dae Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Mon, 3 Jun 2024 16:47:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=8F=E6=84=9F=E5=8F=8A=E9=87=8D=E8=A6=81?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/dto/govern/voltage/SgEventExcel.java | 3 - .../service/impl/BpmCategoryServiceImpl.java | 1 - .../bpm/service/impl/BpmSignServiceImpl.java | 1 - .../com/njcn/autocode/utils/GenerateCode.java | 5 +- .../java/com/njcn/poi/excel/ExcelUtil.java | 20 +- .../com/njcn/device/pms/utils/PubUtil.java | 9 +- .../RGeneralSurveyPlanDetailMapper.xml | 2 +- .../mapping/RGeneralSurveyPlanPOMapper.xml | 2 +- .../enums/SupervisionResponseEnum.java | 1 + .../pojo/dto/SensitiveUserExcel.java | 106 ++++++++ .../pojo/param/survey/SurveyPlanParam.java | 100 +++++++ .../pojo/param/survey/SurveyTestParam.java | 108 ++++++++ .../pojo/po/survey/SurveyPlan.java | 83 ++++++ .../pojo/po/survey/SurveyTest.java | 87 +++++++ .../pojo/po/user/UserReportPO.java | 1 + .../pojo/po/user/UserReportSensitivePO.java | 31 +++ .../pojo/vo/survey/SurveyPlanVO.java | 88 +++++++ .../pojo/vo/survey/SurveyTestVO.java | 83 ++++++ .../device/QuitRunningDeviceController.java | 2 +- .../survey/SurveyPlanController.java | 96 +++++++ .../survey/SurveyTestController.java | 95 +++++++ .../user/UserReportManageController.java | 66 ++++- .../mapper/survey/SurveyPlanMapper.java | 21 ++ .../mapper/survey/SurveyTestMapper.java | 21 ++ ...rvisionGeneralSurveyPlanDetailPOMapper.xml | 2 +- .../survey/mapping/SurveyPlanMapper.xml | 11 + .../survey/mapping/SurveyTestMapper.xml | 11 + .../service/survey/ISurveyPlanService.java | 29 +++ .../service/survey/ISurveyTestService.java | 29 +++ .../survey/impl/SurveyPlanServiceImpl.java | 186 +++++++++++++ .../survey/impl/SurveyTestServiceImpl.java | 151 +++++++++++ .../service/user/UserReportPOService.java | 12 + .../user/impl/UserReportPOServiceImpl.java | 246 ++++++++++++++++-- .../njcn/system/enums/DicDataTypeEnum.java | 2 + 34 files changed, 1663 insertions(+), 48 deletions(-) create mode 100644 pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveUserExcel.java create mode 100644 pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/survey/SurveyPlanParam.java create mode 100644 pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/survey/SurveyTestParam.java create mode 100644 pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SurveyPlan.java create mode 100644 pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SurveyTest.java create mode 100644 pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SurveyPlanVO.java create mode 100644 pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SurveyTestVO.java create mode 100644 pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/SurveyPlanController.java create mode 100644 pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/SurveyTestController.java create mode 100644 pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SurveyPlanMapper.java create mode 100644 pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SurveyTestMapper.java create mode 100644 pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SurveyPlanMapper.xml create mode 100644 pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SurveyTestMapper.xml create mode 100644 pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/ISurveyPlanService.java create mode 100644 pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/ISurveyTestService.java create mode 100644 pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java create mode 100644 pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyTestServiceImpl.java diff --git a/pqs-advance/advance-api/src/main/java/com/njcn/advance/pojo/dto/govern/voltage/SgEventExcel.java b/pqs-advance/advance-api/src/main/java/com/njcn/advance/pojo/dto/govern/voltage/SgEventExcel.java index dee6a88d9..d0af318d1 100644 --- a/pqs-advance/advance-api/src/main/java/com/njcn/advance/pojo/dto/govern/voltage/SgEventExcel.java +++ b/pqs-advance/advance-api/src/main/java/com/njcn/advance/pojo/dto/govern/voltage/SgEventExcel.java @@ -2,7 +2,6 @@ package com.njcn.advance.pojo.dto.govern.voltage; import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.handler.inter.IExcelModel; -import com.njcn.device.pq.pojo.constant.DeviceValidMessage; import lombok.Data; import lombok.EqualsAndHashCode; @@ -25,8 +24,6 @@ public class SgEventExcel implements Serializable { private static final long serialVersionUID = 1L; - - /** * 暂降起始时间 */ diff --git a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmCategoryServiceImpl.java b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmCategoryServiceImpl.java index e8a1d08b3..a1eb7058b 100644 --- a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmCategoryServiceImpl.java +++ b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmCategoryServiceImpl.java @@ -77,7 +77,6 @@ public class BpmCategoryServiceImpl extends ServiceImpl(PageFactory.getPageNum(bpmCategoryQueryParam), PageFactory.getPageSize(bpmCategoryQueryParam)), categoryVOQueryWrapper); diff --git a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmSignServiceImpl.java b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmSignServiceImpl.java index daaf7df9b..f37961209 100644 --- a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmSignServiceImpl.java +++ b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmSignServiceImpl.java @@ -113,7 +113,6 @@ public class BpmSignServiceImpl extends ServiceImpl impl bpmSignVOQueryWrapper.like("bpm_sign.signKey", bpmSignQueryParam.getKey()); } bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode()); - bpmSignVOQueryWrapper.orderByDesc("bpm_sign.update_time"); bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort"); return this.baseMapper.page(new Page<>(PageFactory.getPageNum(bpmSignQueryParam), PageFactory.getPageSize(bpmSignQueryParam)), bpmSignVOQueryWrapper); diff --git a/pqs-common/common-autocode/src/main/java/com/njcn/autocode/utils/GenerateCode.java b/pqs-common/common-autocode/src/main/java/com/njcn/autocode/utils/GenerateCode.java index f5a235d3f..5cf8e6592 100644 --- a/pqs-common/common-autocode/src/main/java/com/njcn/autocode/utils/GenerateCode.java +++ b/pqs-common/common-autocode/src/main/java/com/njcn/autocode/utils/GenerateCode.java @@ -30,8 +30,9 @@ public class GenerateCode { public static void main(String[] args) { List modules = Stream.of( - new Module("hongawen", "com.njcn.supervision", "leaflet", Stream.of( - "supervision_warning_leaflet" + new Module("hongawen", "com.njcn.supervision", "survey", Stream.of( + "supervision_survey_plan", + "supervision_survey_test" ).collect(Collectors.toList()), "supervision_") ).collect(Collectors.toList()); generateJavaFile(modules); diff --git a/pqs-common/common-poi/src/main/java/com/njcn/poi/excel/ExcelUtil.java b/pqs-common/common-poi/src/main/java/com/njcn/poi/excel/ExcelUtil.java index 7aee7c8a2..e668b8c3d 100644 --- a/pqs-common/common-poi/src/main/java/com/njcn/poi/excel/ExcelUtil.java +++ b/pqs-common/common-poi/src/main/java/com/njcn/poi/excel/ExcelUtil.java @@ -74,6 +74,24 @@ public class ExcelUtil { } } + /** + * 处理好的表格直接下载 + * + * @param fileName 文件名 + */ + public static void exportExcelByWorkbook(String fileName, Workbook workbook) { + HttpServletResponse response = HttpServletUtil.getResponse(); + try (ServletOutputStream outputStream = response.getOutputStream()) { + fileName = URLEncoder.encode(fileName, CharsetUtil.UTF_8); + response.reset(); + response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); + response.setContentType("application/octet-stream;charset=UTF-8"); + workbook.write(outputStream); + } catch (IOException e) { + log.error(">>> 导出数据异常:{}", e.getMessage()); + } + } + /** * 指定名称、数据下载报表(带指定标题将*显示比必填信息) * @@ -203,7 +221,6 @@ public class ExcelUtil { * @param strings 下拉内容 */ public static void selectList(Workbook workbook, int firstCol, int lastCol, String[] strings) { - Sheet sheet = workbook.getSheetAt(0); // 生成下拉列表 // 只对(x,x)单元格有效 @@ -218,5 +235,4 @@ public class ExcelUtil { sheet.addValidationData(validation); } - } diff --git a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/utils/PubUtil.java b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/utils/PubUtil.java index 54c422b4d..18e0a7012 100644 --- a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/utils/PubUtil.java +++ b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/utils/PubUtil.java @@ -76,10 +76,17 @@ public class PubUtil { } public static String getDicById(String name, List dictData) { - List dictDataList = dictData.stream().filter(x -> x.getName().indexOf(name) != -1).collect(Collectors.toList()); + //先匹配有没有完全吻合的 + List compareDictDataList = dictData.stream().filter(x -> x.getName().equalsIgnoreCase(name)).collect(Collectors.toList()); + if(CollUtil.isNotEmpty(compareDictDataList)){ + return compareDictDataList.get(0).getId(); + } + //如果没有匹配到,则判断是否有包含的 + List dictDataList = dictData.stream().filter(x -> x.getName().contains(name)).collect(Collectors.toList()); if (CollUtil.isNotEmpty(dictDataList)) { return dictDataList.get(0).getId(); } + //实在没有匹配到则返回空 return ""; } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanDetailMapper.xml b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanDetailMapper.xml index 726058399..51f0656c4 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanDetailMapper.xml +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanDetailMapper.xml @@ -19,7 +19,7 @@ - plan_no, general_survey_start_time, general_survey_end_time, general_survey_time, + plan_no, general_survey_start_time, general_survey_end_time, general_survey_time, general_survey_leader, sub_id, sub_name, voltage_level, busbar_id, busbar_name, measurement_point_id, is_problem diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanPOMapper.xml b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanPOMapper.xml index 9b366b75f..f34f93bdc 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanPOMapper.xml +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanPOMapper.xml @@ -21,7 +21,7 @@ - org_no, plan_no, plan_name, plan_create_time, plan_start_time, plan_end_time, plan_complate_time, + org_no, plan_no, plan_name, plan_create_time, plan_start_time, plan_end_time, plan_complate_time, leader, `status`, description, is_file_upload, file_count, file_path, upload_time \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/SupervisionResponseEnum.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/SupervisionResponseEnum.java index fe72ce7b6..86df260fe 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/SupervisionResponseEnum.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/SupervisionResponseEnum.java @@ -16,6 +16,7 @@ public enum SupervisionResponseEnum { * A00550 ~ A00649 */ SUPERVISION_COMMON_ERROR("A00550","监督管理模块异常"), + IMPORT_SENSITIVE_USER_ERROR("A00550","导入敏感及重要用户失败"), NO_POWER("A00550","不能操作非自己创建的任务!") ; diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveUserExcel.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveUserExcel.java new file mode 100644 index 000000000..cada47699 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveUserExcel.java @@ -0,0 +1,106 @@ +package com.njcn.supervision.pojo.dto; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class SensitiveUserExcel implements Serializable { + + + /** + * 所属地市 + */ + @Excel(name = "供电单位", width = 30) + private String city; + + /** + * 用户名称 + */ + @Excel(name = "*用户名称", width = 30) + @NotBlank(message = "用户名称不能为空") + private String projectName; + + +// /** +// * 工程预期投产日期 +// */ +// @Excel(name="工程预期投产日期(yyyy-MM-dd)",format = "yyyy-MM-dd",width = 45) +// private String expectedProductionDate; + + /** + * 用户状态 + */ + @Excel(name = "用户状态", width = 20, replace = {"可研_0", "建设_1", "运行_2", "退运_3"}) + private Integer userStatus; + + /** + * 变电站 + */ + @Excel(name = "变电站", width = 30) + private String substation; + + /** + * 电压等级 + */ + @Excel(name = "电压等级(kV)", width = 20) + private String voltageLevel; + + + /** + * 行业 + */ + @Excel(name = "行业", width = 30) + private String industry; + + + /** + * 运维单位 + */ + @Excel(name = "运维单位", width = 30) + private String maintenanceUnit; + + /** + * 供电电源 + */ + @Excel(name = "供电电源", width = 40) + private String powerSupply; + + /** + * 接入电压等级 + */ + @Excel(name = "接入电压等级(kV)", width = 20) + private String supplyVoltageLevel; + + + /** + * 负荷级别 + */ + @Excel(name = "负荷级别", width = 20) + private String loadLevel; + + + /** + * 供电电源情况(单电源、双电源、多电源) + */ + @Excel(name = "供电电源情况", width = 20) + private String powerSupplyInfo; + +// /** +// * 是否覆盖 +// */ +// @Excel(name = "是否覆盖", width = 20, replace = {"否_0", "是_1"}) +// private Integer overlay = 0; + + @Data + @EqualsAndHashCode(callSuper = true) + public static class SensitiveUserExcelMsg extends SensitiveUserExcel implements Serializable { + @Excel(name = "错误信息描述") + private String msg; + + } + +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/survey/SurveyPlanParam.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/survey/SurveyPlanParam.java new file mode 100644 index 000000000..35fec375b --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/survey/SurveyPlanParam.java @@ -0,0 +1,100 @@ +package com.njcn.supervision.pojo.param.survey; + +import com.njcn.web.pojo.param.BaseParam; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.time.LocalDate; + +@Data +public class SurveyPlanParam implements Serializable { + + + private static final long serialVersionUID = 1L; + + /** + * 负责单位ID + */ + @ApiModelProperty(value = "负责单位ID") + private String deptId; + + /** + * 普测计划名称 + */ + @ApiModelProperty(value = "普测计划名称") + private String planName; + + /** + * 计划开始时间 + */ + @ApiModelProperty(value = "计划开始时间") + private LocalDate planStartTime; + + /** + * 计划结束时间 + */ + @ApiModelProperty(value = "计划结束时间") + private LocalDate planEndTime; + + /** + * 0 关联系统内变电站;1 用户手动输入变电站 + */ + @ApiModelProperty(value = "0 关联系统内变电站;1 用户手动输入变电站") + private Integer customSubstationFlag; + + /** + * 变电站台账ID或者用户手动输入的变电站名称 + */ + @ApiModelProperty(value = "变电站台账ID或者用户手动输入的变电站名称") + private String substation; + + /** + * 计划状态(1:审批中;2:审批通过;3:审批不通过;4:已取消) + */ + @ApiModelProperty(value = "计划状态") + private Integer status; + + /** + * 流程实例id + */ + @ApiModelProperty(value = "流程实例id") + private String processInstanceId; + + /** + * 历史流程实例id列表 + */ + @ApiModelProperty(value = "历史流程实例id列表") + private String historyInstanceId; + + + @Data + @EqualsAndHashCode(callSuper = true) + public static class SurveyPlanUpdateParam extends SurveyPlanParam { + + @ApiModelProperty("id") + @NotBlank(message = "索引不能为空") + private String Id; + + + + } + + + /** + * 分页查询实体 + */ + @Data + @EqualsAndHashCode(callSuper = true) + public static class SurveyPlanQueryParam extends BaseParam { + + /** + * 普测负责单位 + */ + String deptIndex; + + } + +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/survey/SurveyTestParam.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/survey/SurveyTestParam.java new file mode 100644 index 000000000..046263578 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/survey/SurveyTestParam.java @@ -0,0 +1,108 @@ +package com.njcn.supervision.pojo.param.survey; + +import com.njcn.db.bo.BaseEntity; +import com.njcn.web.pojo.param.BaseParam; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.time.LocalDate; + +/** + *

+ * 普测测试的管理表 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +@Data +public class SurveyTestParam extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 普测计划表id + */ + @ApiModelProperty(value = "普测计划表id") + private String planId; + + /** + * 负责单位id + */ + @ApiModelProperty(value = "负责单位id") + private String deptId; + + /** + * 计划完成时间 + */ + @ApiModelProperty(value = "计划完成时间") + private LocalDate completeTime; + + /** + * 测试负责人 + */ + @ApiModelProperty(value = "测试负责人") + private String completeBy; + + /** + * 测试报告 + */ + @ApiModelProperty(value = "测试报告") + private String testReport; + + /** + * 是否有问题 0 没有问题 1 有问题 + */ + @ApiModelProperty(value = "是否有问题") + private Integer problemFlag; + + /** + * 问题描述 + */ + @ApiModelProperty(value = "问题描述") + private String problemDetail; + + /** + * 测试审批状态(1:审批中;2:审批通过;3:审批不通过;4:已取消) + */ + @ApiModelProperty(value = "测试审批状态") + private Integer status; + + /** + * 流程实例id + */ + @ApiModelProperty(value = "流程实例id") + private String processInstanceId; + + /** + * 历史流程id列表 + */ + @ApiModelProperty(value = "历史流程id列表") + private String historyInstanceId; + + @Data + @EqualsAndHashCode(callSuper = true) + public static class SurveyTestUpdateParam extends SurveyTestParam { + + @ApiModelProperty("id") + @NotBlank(message = "索引不能为空") + private String Id; + + + } + + + /** + * 分页查询实体 + */ + @Data + @EqualsAndHashCode(callSuper = true) + public static class SurveyTestQueryParam extends BaseParam { + + } + +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SurveyPlan.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SurveyPlan.java new file mode 100644 index 000000000..0fb557bcd --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SurveyPlan.java @@ -0,0 +1,83 @@ +package com.njcn.supervision.pojo.po.survey; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.db.bo.BaseEntity; +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +/** + *

+ * 普测计划流程表 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +@Data +@TableName("supervision_survey_plan") +public class SurveyPlan extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 普测计划编号 + */ + private String id; + + /** + * 负责单位ID + */ + private String deptId; + + /** + * 普测计划名称 + */ + private String planName; + + /** + * 计划开始时间 + */ + private LocalDate planStartTime; + + /** + * 计划结束时间 + */ + private LocalDate planEndTime; + + /** + * 0 关联系统内变电站;1 用户手动输入变电站 + */ + private Integer customSubstationFlag; + + /** + * 变电站台账ID或者用户手动输入的变电站名称 + */ + private String substation; + + /** + * 计划状态(1:审批中;2:审批通过;3:审批不通过;4:已取消) + */ + private Integer status; + + /** + * 流程实例id + */ + private String processInstanceId; + + /** + * 历史流程实例id列表 + */ + private String historyInstanceId; + + /** + * 状态:0-删除 1-正常 + */ + private Integer state; + + +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SurveyTest.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SurveyTest.java new file mode 100644 index 000000000..a61e68724 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SurveyTest.java @@ -0,0 +1,87 @@ +package com.njcn.supervision.pojo.po.survey; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.db.bo.BaseEntity; +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +/** + *

+ * 普测测试的管理表 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +@Data +@TableName("supervision_survey_test") +public class SurveyTest extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 普测测试管理表id + */ + private String id; + + /** + * 普测计划表id + */ + private String planId; + + /** + * 负责单位id + */ + private String deptId; + + /** + * 计划完成时间 + */ + private LocalDate completeTime; + + /** + * 测试负责人 + */ + private String completeBy; + + /** + * 测试报告 + */ + private String testReport; + + /** + * 是否有问题 0 没有问题 1 有问题 + */ + private Integer problemFlag; + + /** + * 问题描述 + */ + private String problemDetail; + + /** + * 测试审批状态(1:审批中;2:审批通过;3:审批不通过;4:已取消) + */ + private Integer status; + + /** + * 流程实例id + */ + private String processInstanceId; + + /** + * 历史流程id列表 + */ + private String historyInstanceId; + + /** + * 状态:0-删除 1-正常 + */ + private Integer state; + +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/user/UserReportPO.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/user/UserReportPO.java index 7378d28d7..9849909d3 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/user/UserReportPO.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/user/UserReportPO.java @@ -135,4 +135,5 @@ public class UserReportPO extends BaseEntity { private Integer state; + } diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/user/UserReportSensitivePO.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/user/UserReportSensitivePO.java index a8fa16349..e6976a36d 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/user/UserReportSensitivePO.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/user/UserReportSensitivePO.java @@ -148,5 +148,36 @@ public class UserReportSensitivePO extends BaseEntity { @TableField(value = "`state`") private Integer state; + /** + * 供电电源 + */ + @TableField(value = "power_supply") + private String powerSupply; + + /** + * 接入电压等级 + */ + @TableField(value = "supply_voltage_level") + private String supplyVoltageLevel; + + /** + * 负荷级别 + */ + @TableField(value = "load_level") + private String loadLevel; + + + /** + * 供电电源情况(单电源、双电源、多电源) + */ + @TableField(value = "power_supply_info") + private String powerSupplyInfo; + + /** + * 运维单位 + */ + @TableField(value = "maintenance_unit") + private String maintenanceUnit; + } \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SurveyPlanVO.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SurveyPlanVO.java new file mode 100644 index 000000000..1924f279b --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SurveyPlanVO.java @@ -0,0 +1,88 @@ +package com.njcn.supervision.pojo.vo.survey; + +import com.njcn.db.bo.BaseEntity; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + *

+ * 普测计划流程表 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +@Data +public class SurveyPlanVO extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 普测计划编号 + */ + private String id; + + /** + * 负责单位ID + */ + private String deptId; + + /** + * 负责单位名称 + */ + private String deptName; + + /** + * 普测计划名称 + */ + private String planName; + + /** + * 计划开始时间 + */ + private LocalDate planStartTime; + + /** + * 计划结束时间 + */ + private LocalDate planEndTime; + + /** + * 0 关联系统内变电站;1 用户手动输入变电站 + */ + private Integer customSubstationFlag; + + /** + * 变电站台账ID或者用户手动输入的变电站名称 + */ + private String substation; + + /** + * 变电站名称 + */ + private String substationName; + + /** + * 计划状态(1:审批中;2:审批通过;3:审批不通过;4:已取消) + */ + private Integer status; + + /** + * 流程实例id + */ + private String processInstanceId; + + /** + * 历史流程实例id列表 + */ + private String historyInstanceId; + + /** + * 状态:0-删除 1-正常 + */ + private Integer state; + + +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SurveyTestVO.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SurveyTestVO.java new file mode 100644 index 000000000..bb15cc9f5 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SurveyTestVO.java @@ -0,0 +1,83 @@ +package com.njcn.supervision.pojo.vo.survey; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.db.bo.BaseEntity; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + *

+ * 普测测试的管理表 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +@Data +public class SurveyTestVO extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 普测测试管理表id + */ + private String id; + + /** + * 普测计划表id + */ + private String planId; + + /** + * 负责单位id + */ + private String deptId; + + /** + * 计划完成时间 + */ + private LocalDate completeTime; + + /** + * 测试负责人 + */ + private String completeBy; + + /** + * 测试报告 + */ + private String testReport; + + /** + * 是否有问题 0 没有问题 1 有问题 + */ + private Integer problemFlag; + + /** + * 问题描述 + */ + private String problemDetail; + + /** + * 测试审批状态(1:审批中;2:审批通过;3:审批不通过;4:已取消) + */ + private Integer status; + + /** + * 流程实例id + */ + private String processInstanceId; + + /** + * 历史流程id列表 + */ + private String historyInstanceId; + + /** + * 状态:0-删除 1-正常 + */ + private Integer state; + +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/device/QuitRunningDeviceController.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/device/QuitRunningDeviceController.java index d0db54941..69ed28edc 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/device/QuitRunningDeviceController.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/device/QuitRunningDeviceController.java @@ -61,7 +61,7 @@ public class QuitRunningDeviceController extends BaseController { @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) @PostMapping("/update") - @ApiOperation("更新设备退运") + @ApiOperation("重新发起设备退运") @ApiImplicitParam(name = "quitRunningDeviceUpdateParam", value = "实体参数", required = true) public HttpResult updateQuitRunningDevice(@RequestBody @Validated QuitRunningDeviceParam.QuitRunningDeviceUpdateParam quitRunningDeviceUpdateParam) { String methodDescribe = getMethodDescribe("quitRunningDeviceUpdateParam"); diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/SurveyPlanController.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/SurveyPlanController.java new file mode 100644 index 000000000..3fadf7fd0 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/SurveyPlanController.java @@ -0,0 +1,96 @@ +package com.njcn.supervision.controller.survey; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; +import com.njcn.common.pojo.annotation.OperateInfo; +import com.njcn.common.pojo.constant.OperateType; +import com.njcn.common.pojo.enums.common.LogEnum; +import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.common.utils.HttpResultUtil; +import com.njcn.supervision.pojo.param.survey.SurveyPlanParam; +import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO; +import com.njcn.supervision.service.survey.ISurveyPlanService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.njcn.web.controller.BaseController; + +/** + *

+ * 普测计划流程表 前端控制器 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +@RestController +@RequestMapping("/surveyPlan") +@Slf4j +@Api(tags = "普测计划流程管理") +@AllArgsConstructor +public class SurveyPlanController extends BaseController { + + private final ISurveyPlanService surveyPlanService; + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/surveyPlanPage") + @ApiOperation("分页查询当前用户能看到的普测计划") + @ApiImplicitParam(name = "surveyPlanQueryParam", value = "参数", required = true) + public HttpResult> surveyPlanPage(@RequestBody @Validated SurveyPlanParam.SurveyPlanQueryParam surveyPlanQueryParam) { + String methodDescribe = getMethodDescribe("surveyPlanPage"); + Page out = surveyPlanService.surveyPlanPage(surveyPlanQueryParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe); + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @PostMapping("/add") + @ApiOperation("新增普测计划") + @ApiImplicitParam(name = "surveyPlanParam", value = "实体参数", required = true) + public HttpResult addSurveyPlan(@RequestBody @Validated SurveyPlanParam surveyPlanParam) { + String methodDescribe = getMethodDescribe("addSurveyPlan"); + String planId = surveyPlanService.addSurveyPlan(surveyPlanParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, planId, methodDescribe); + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @PostMapping("/update") + @ApiOperation("重新发起普测计划") + @ApiImplicitParam(name = "surveyPlanUpdateParam", value = "实体参数", required = true) + public HttpResult updateSurveyPlan(@RequestBody @Validated SurveyPlanParam.SurveyPlanUpdateParam surveyPlanUpdateParam) { + String methodDescribe = getMethodDescribe("updateSurveyPlan"); + String runningDeviceId = surveyPlanService.updateSurveyPlan(surveyPlanUpdateParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runningDeviceId, methodDescribe); + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @PostMapping("/cancel") + @ApiOperation("取消普测计划") + @ApiImplicitParam(name = "cancelReqVO", value = "取消原因", required = true) + public HttpResult cancelSurveyPlan(@Validated @RequestBody BpmProcessInstanceCancelParam cancelReqVO) { + String methodDescribe = getMethodDescribe("cancelSurveyPlan"); + String runningDeviceId = surveyPlanService.cancelSurveyPlan(cancelReqVO); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runningDeviceId, methodDescribe); + } + + @GetMapping("/updateSurveyPlanStatus") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @Operation(summary = "更新普测计划流程状态") + public HttpResult updateSurveyPlanStatus(String businessKey, Integer status) { + String methodDescribe = getMethodDescribe("updateSurveyPlanStatus"); + surveyPlanService.updateSurveyPlanStatus(businessKey, status); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + + + +} + diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/SurveyTestController.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/SurveyTestController.java new file mode 100644 index 000000000..747b40203 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/SurveyTestController.java @@ -0,0 +1,95 @@ +package com.njcn.supervision.controller.survey; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; +import com.njcn.common.pojo.annotation.OperateInfo; +import com.njcn.common.pojo.constant.OperateType; +import com.njcn.common.pojo.enums.common.LogEnum; +import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.common.utils.HttpResultUtil; +import com.njcn.supervision.pojo.param.survey.SurveyTestParam; +import com.njcn.supervision.pojo.vo.survey.SurveyTestVO; +import com.njcn.supervision.service.survey.ISurveyTestService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.njcn.web.controller.BaseController; + +/** + *

+ * 普测测试的管理表 前端控制器 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +@RestController +@RequestMapping("/surveyTest") +@Slf4j +@Api(tags = "普测计划流程管理") +@AllArgsConstructor +public class SurveyTestController extends BaseController { + + private final ISurveyTestService surveyTestService; + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/surveyTestPage") + @ApiOperation("分页查询当前用户能看到的普测测试") + @ApiImplicitParam(name = "surveyTestQueryParam", value = "参数", required = true) + public HttpResult> surveyTestPage(@RequestBody @Validated SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam) { + String methodDescribe = getMethodDescribe("surveyTestPage"); + Page out = surveyTestService.surveyTestPage(surveyTestQueryParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe); + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @PostMapping("/add") + @ApiOperation("新增普测测试") + @ApiImplicitParam(name = "surveyTestParam", value = "实体参数", required = true) + public HttpResult addSurveyTest(@RequestBody @Validated SurveyTestParam surveyTestParam) { + String methodDescribe = getMethodDescribe("addSurveyTest"); + String planId = surveyTestService.addSurveyTest(surveyTestParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, planId, methodDescribe); + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @PostMapping("/update") + @ApiOperation("重新发起普测测试") + @ApiImplicitParam(name = "surveyTestUpdateParam", value = "实体参数", required = true) + public HttpResult updateSurveyTest(@RequestBody @Validated SurveyTestParam.SurveyTestUpdateParam surveyTestUpdateParam) { + String methodDescribe = getMethodDescribe("updateSurveyTest"); + String runningDeviceId = surveyTestService.updateSurveyTest(surveyTestUpdateParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runningDeviceId, methodDescribe); + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @PostMapping("/cancel") + @ApiOperation("取消普测测试") + @ApiImplicitParam(name = "cancelReqVO", value = "取消原因", required = true) + public HttpResult cancelSurveyTest(@Validated @RequestBody BpmProcessInstanceCancelParam cancelReqVO) { + String methodDescribe = getMethodDescribe("cancelSurveyTest"); + String runningDeviceId = surveyTestService.cancelSurveyTest(cancelReqVO); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runningDeviceId, methodDescribe); + } + + @GetMapping("/updateSurveyTestStatus") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @Operation(summary = "更新普测测试流程状态") + public HttpResult updateSurveyTestStatus(String businessKey, Integer status) { + String methodDescribe = getMethodDescribe("updateSurveyTestStatus"); + surveyTestService.updateSurveyTestStatus(businessKey, status); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + + +} + diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/user/UserReportManageController.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/user/UserReportManageController.java index 58e9bef38..6660ce42f 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/user/UserReportManageController.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/user/UserReportManageController.java @@ -1,13 +1,20 @@ package com.njcn.supervision.controller.user; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.constant.OperateType; import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; +import com.njcn.poi.util.PoiUtil; +import com.njcn.supervision.enums.SupervisionResponseEnum; +import com.njcn.supervision.pojo.dto.SensitiveUserExcel; import com.njcn.supervision.pojo.param.user.UserReportParam; import com.njcn.supervision.pojo.vo.user.UserReportVO; import com.njcn.supervision.service.user.UserReportPOService; @@ -20,8 +27,11 @@ import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; import java.util.List; +import java.util.Objects; /** * 干扰源用户管理 @@ -39,21 +49,21 @@ public class UserReportManageController extends BaseController { private final UserReportPOService userReportPOService; - @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD) + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) @PostMapping("/add") @ApiOperation("新增干扰源用户") @ApiImplicitParam(name = "userReportParam", value = "实体参数", required = true) - public HttpResult addUserReport(@RequestBody @Validated UserReportParam userReportParam){ + public HttpResult addUserReport(@RequestBody @Validated UserReportParam userReportParam) { String methodDescribe = getMethodDescribe("addUserReport"); String userReportId = userReportPOService.addUserReport(userReportParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportId, methodDescribe); } - @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD) + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) @PostMapping("/auditUserReport") @ApiOperation("修改干扰源用户") @ApiImplicitParam(name = "userReportUpdate", value = "实体参数", required = true) - public HttpResult auditUserReport(@RequestBody @Validated UserReportParam.UserReportUpdate userReportUpdate){ + public HttpResult auditUserReport(@RequestBody @Validated UserReportParam.UserReportUpdate userReportUpdate) { String methodDescribe = getMethodDescribe("auditUserReport"); boolean res = userReportPOService.auditUserReport(userReportUpdate); @@ -65,7 +75,7 @@ public class UserReportManageController extends BaseController { @PostMapping("/getUserReport") @ApiOperation("分页查询当前用户能看到的用户建档数据") @ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true) - public HttpResult> getUserReport(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam){ + public HttpResult> getUserReport(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam) { String methodDescribe = getMethodDescribe("getUserReport"); Page out = userReportPOService.getUserReport(userReportQueryParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe); @@ -74,7 +84,7 @@ public class UserReportManageController extends BaseController { @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("/removeUserReport") @ApiOperation("删除干扰源用户记录") - public HttpResult removeUserReport(@RequestParam("ids") List ids){ + public HttpResult removeUserReport(@RequestParam("ids") List ids) { String methodDescribe = getMethodDescribe("removeUserReport"); Boolean flag = userReportPOService.removeUserReport(ids); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe); @@ -90,29 +100,28 @@ public class UserReportManageController extends BaseController { } - @GetMapping("/updateUserReportStatus") @OperateInfo(info = LogEnum.BUSINESS_COMMON) @Operation(summary = "更新用户数据流程状态") - public HttpResult updateUserReportStatus(String businessKey,Integer status) { + public HttpResult updateUserReportStatus(String businessKey, Integer status) { String methodDescribe = getMethodDescribe("updateUserReportStatus"); - userReportPOService.updateUserReportStatus(businessKey,status); + userReportPOService.updateUserReportStatus(businessKey, status); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } @GetMapping("/updateUserStatus") @OperateInfo(info = LogEnum.BUSINESS_COMMON) @Operation(summary = "更新干扰源用户状态") - public HttpResult updateUserStatus(String lineId,Integer userStatus) { + public HttpResult updateUserStatus(String lineId, Integer userStatus) { String methodDescribe = getMethodDescribe("updateUserStatus"); - userReportPOService.updateUserStatus(lineId,userStatus); + userReportPOService.updateUserStatus(lineId, userStatus); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("/getUserReportList") @ApiOperation("查询干扰源下拉列表") - public HttpResult> getUserReportList(){ + public HttpResult> getUserReportList() { String methodDescribe = getMethodDescribe("getUserReportList"); List out = userReportPOService.getUserReportList(); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe); @@ -122,12 +131,22 @@ public class UserReportManageController extends BaseController { @PostMapping("/getInterferenceUserPage") @ApiOperation("分页查询干扰源用户台账") @ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true) - public HttpResult> getInterferenceUserPage(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam){ + public HttpResult> getInterferenceUserPage(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam) { String methodDescribe = getMethodDescribe("getInterferenceUserPage"); Page out = userReportPOService.getInterferenceUserPage(userReportQueryParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe); } + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/getSensitiveUserPage") + @ApiOperation("分页查询敏感及重要用户台账") + @ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true) + public HttpResult> getSensitiveUserPage(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam) { + String methodDescribe = getMethodDescribe("getSensitiveUserPage"); + Page out = userReportPOService.getSensitiveUserPage(userReportQueryParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe); + } + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) @PostMapping("/cancel") @ApiOperation("取消") @@ -139,4 +158,25 @@ public class UserReportManageController extends BaseController { } + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @GetMapping("/downloadSensitiveUserTemplate") + @ApiOperation("下载敏感及重要用户模板") + public void downloadSensitiveUserTemplate() { + userReportPOService.downloadSensitiveUserTemplate(); + } + + + @PostMapping(value = "/importSensitiveUserData") + @ApiOperation("批量导入敏感及重要用户") + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + public HttpResult importSensitiveUserData(@RequestParam("file") MultipartFile file, HttpServletResponse response) { + String methodDescribe = getMethodDescribe("importSensitiveUserData"); + //批量录入暂降数据 + if (Objects.isNull(userReportPOService.importSensitiveUserData(file, response))) { + return null; + } + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + } diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SurveyPlanMapper.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SurveyPlanMapper.java new file mode 100644 index 000000000..1d98f5f09 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SurveyPlanMapper.java @@ -0,0 +1,21 @@ +package com.njcn.supervision.mapper.survey; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.njcn.supervision.pojo.po.survey.SurveyPlan; +import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 普测计划流程表 Mapper 接口 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +public interface SurveyPlanMapper extends BaseMapper { + + Page surveyPlanPage(Page objectPage, @Param("ew") QueryWrapper surveyPlanVOQueryWrapper); +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SurveyTestMapper.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SurveyTestMapper.java new file mode 100644 index 000000000..6a85f4d1b --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SurveyTestMapper.java @@ -0,0 +1,21 @@ +package com.njcn.supervision.mapper.survey; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.njcn.supervision.pojo.po.survey.SurveyTest; +import com.njcn.supervision.pojo.vo.survey.SurveyTestVO; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 普测测试的管理表 Mapper 接口 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +public interface SurveyTestMapper extends BaseMapper { + + Page surveyTestPage(Page objectPage, @Param("ew")QueryWrapper surveyTestVOQueryWrapper); +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SupervisionGeneralSurveyPlanDetailPOMapper.xml b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SupervisionGeneralSurveyPlanDetailPOMapper.xml index dcf094542..71233c556 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SupervisionGeneralSurveyPlanDetailPOMapper.xml +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SupervisionGeneralSurveyPlanDetailPOMapper.xml @@ -15,7 +15,7 @@ - plan_no, sub_id, sub_name, voltage_level, capacity, measurement_point_id, is_problem, + plan_no, sub_id, sub_name, voltage_level, capacity, measurement_point_id, is_problem, is_survey \ No newline at end of file diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SurveyPlanMapper.xml b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SurveyPlanMapper.xml new file mode 100644 index 000000000..0899d7467 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SurveyPlanMapper.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SurveyTestMapper.xml b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SurveyTestMapper.xml new file mode 100644 index 000000000..0234782f8 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SurveyTestMapper.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/ISurveyPlanService.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/ISurveyPlanService.java new file mode 100644 index 000000000..dd511a410 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/ISurveyPlanService.java @@ -0,0 +1,29 @@ +package com.njcn.supervision.service.survey; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; +import com.njcn.supervision.pojo.param.survey.SurveyPlanParam; +import com.njcn.supervision.pojo.po.survey.SurveyPlan; +import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO; + +/** + *

+ * 普测计划流程表 服务类 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +public interface ISurveyPlanService extends IService { + + Page surveyPlanPage(SurveyPlanParam.SurveyPlanQueryParam surveyPlanQueryParam); + + String addSurveyPlan(SurveyPlanParam surveyPlanParam); + + String updateSurveyPlan(SurveyPlanParam.SurveyPlanUpdateParam surveyPlanUpdateParam); + + String cancelSurveyPlan(BpmProcessInstanceCancelParam cancelReqVO); + + void updateSurveyPlanStatus(String businessKey, Integer status); +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/ISurveyTestService.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/ISurveyTestService.java new file mode 100644 index 000000000..828d83daf --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/ISurveyTestService.java @@ -0,0 +1,29 @@ +package com.njcn.supervision.service.survey; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; +import com.njcn.supervision.pojo.param.survey.SurveyTestParam; +import com.njcn.supervision.pojo.po.survey.SurveyTest; +import com.njcn.supervision.pojo.vo.survey.SurveyTestVO; + +/** + *

+ * 普测测试的管理表 服务类 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +public interface ISurveyTestService extends IService { + + Page surveyTestPage(SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam); + + String addSurveyTest(SurveyTestParam surveyTestParam); + + String updateSurveyTest(SurveyTestParam.SurveyTestUpdateParam surveyTestUpdateParam); + + String cancelSurveyTest(BpmProcessInstanceCancelParam cancelReqVO); + + void updateSurveyTestStatus(String businessKey, Integer status); +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java new file mode 100644 index 000000000..36ab84b1e --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java @@ -0,0 +1,186 @@ +package com.njcn.supervision.service.survey.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.text.StrPool; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.njcn.bpm.api.BpmProcessFeignClient; +import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum; +import com.njcn.bpm.enums.BpmTaskStatusEnum; +import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; +import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; +import com.njcn.common.pojo.enums.common.DataStateEnum; +import com.njcn.device.pq.api.LineFeignClient; +import com.njcn.supervision.mapper.survey.SurveyPlanMapper; +import com.njcn.supervision.pojo.param.survey.SurveyPlanParam; +import com.njcn.supervision.pojo.po.survey.SurveyPlan; +import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO; +import com.njcn.supervision.service.survey.ISurveyPlanService; +import com.njcn.supervision.utils.InstanceUtil; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.api.UserFeignClient; +import com.njcn.web.factory.PageFactory; +import com.njcn.web.utils.RequestUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + *

+ * 普测计划流程表 服务实现类 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +@Service +@RequiredArgsConstructor +public class SurveyPlanServiceImpl extends ServiceImpl implements ISurveyPlanService { + + private final UserFeignClient userFeignClient; + + private final BpmProcessFeignClient bpmProcessFeignClient; + + private final DeptFeignClient deptFeignClient; + + private final LineFeignClient lineFeignClient; + + /** + * 预告警单的反馈单对应的流程定义 KEY + */ + public static final String PROCESS_KEY = "survey_plan"; + + @Override + public Page surveyPlanPage(SurveyPlanParam.SurveyPlanQueryParam surveyPlanQueryParam) { + QueryWrapper surveyPlanVOQueryWrapper = new QueryWrapper<>(); + if (Objects.nonNull(surveyPlanQueryParam)) { + //添加上时间范围 + surveyPlanVOQueryWrapper.between("supervision_survey_plan.Create_Time", + DateUtil.beginOfDay(DateUtil.parse(surveyPlanQueryParam.getSearchBeginTime())), + DateUtil.endOfDay(DateUtil.parse(surveyPlanQueryParam.getSearchEndTime()))); + //根据工程名称模糊搜索 + if (StrUtil.isNotBlank(surveyPlanQueryParam.getSearchValue())) { + surveyPlanVOQueryWrapper.like("supervision_survey_plan.plan_name", surveyPlanQueryParam.getSearchValue()); + } + //筛选普测负责单位 + if (StrUtil.isNotBlank(surveyPlanQueryParam.getDeptIndex())) { + List deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyPlanQueryParam.getDeptIndex()).getData(); + surveyPlanVOQueryWrapper.in("supervision_survey_plan.dept_id", deptIds); + } + + } + //获取当前用户部门所有同事的id,查看该部门下所有的数据 + List colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData(); + surveyPlanVOQueryWrapper.in("supervision_survey_plan.Create_By", colleaguesIds) + .eq("supervision_survey_plan.state", DataStateEnum.ENABLE.getCode()) + .orderByDesc("supervision_survey_plan.Update_Time"); + Page surveyPlanVOPage = this.baseMapper.surveyPlanPage(new Page<>(PageFactory.getPageNum(surveyPlanQueryParam), PageFactory.getPageSize(surveyPlanQueryParam)), surveyPlanVOQueryWrapper); + List records = surveyPlanVOPage.getRecords(); + if (CollectionUtil.isNotEmpty(records)) { + for (SurveyPlanVO record : records) { + //回显部门名称 + record.setDeptName(deptFeignClient.getDeptById(record.getDeptId()).getData().getName()); + //回显变电站名称 + if (record.getCustomSubstationFlag() == 0) { + //关联台账内的变电站名称 +// record.setSubstationName(lineFeignClient.getSubstationInfo(record.getSubstation()).getData().getName()); + String substation = record.getSubstation(); + String[] subIds = substation.split(StrPool.COMMA); + String subName = ""; + for (String subId : subIds) { + String name = lineFeignClient.getSubstationInfo(subId).getData().getName(); + subName = subName.concat(StrPool.COMMA).concat(name); + } + subName = subName.substring(1); + record.setSubstation(subName); + } else { + record.setSubstationName(record.getSubstation()); + } + } + } + return surveyPlanVOPage; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String addSurveyPlan(SurveyPlanParam surveyPlanParam) { + //排除重复计划的策略暂时未知,待后期有人提出了,再去做,todo... + SurveyPlan surveyPlan = new SurveyPlan(); + BeanUtils.copyProperties(surveyPlanParam, surveyPlan); + surveyPlan.setState(DataStateEnum.ENABLE.getCode()); + surveyPlan.setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); + this.save(surveyPlan); + // 发起 BPM 流程 + Map processInstanceVariables = new HashMap<>(); + BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO(); + bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY); + bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyPlan.getId()); + bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>()); + bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables); + String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyPlan.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData(); + // 将工作流的编号,更新到流程单中 + surveyPlan.setProcessInstanceId(processInstanceId); + this.baseMapper.updateById(surveyPlan); + return surveyPlan.getId(); + } + + @Override + public String updateSurveyPlan(SurveyPlanParam.SurveyPlanUpdateParam surveyPlanUpdateParam) { + SurveyPlan surveyPlan = this.baseMapper.selectById(surveyPlanUpdateParam.getId()); + //判断是否有权限操作 + InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(), surveyPlan.getCreateBy()); + surveyPlanUpdateParam.setStatus(surveyPlan.getStatus()); + surveyPlanUpdateParam.setProcessInstanceId(surveyPlan.getProcessInstanceId()); + surveyPlanUpdateParam.setHistoryInstanceId(surveyPlan.getHistoryInstanceId()); + BeanUtils.copyProperties(surveyPlanUpdateParam, surveyPlan); + surveyPlan.setState(DataStateEnum.ENABLE.getCode()); + surveyPlan.setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); + //处理历史流程id列表 + String historyInstanceIds = InstanceUtil.dealHistoryId(surveyPlan.getProcessInstanceId(), surveyPlan.getHistoryInstanceId()); + // 发起 BPM 流程 + Map processInstanceVariables = new HashMap<>(); + BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO(); + bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY); + bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyPlan.getId()); + bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>()); + bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables); + String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyPlan.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData(); + // 将工作流的编号,更新到流程单中 + surveyPlan.setProcessInstanceId(processInstanceId); + //保存历史流程id列表 + surveyPlan.setHistoryInstanceId(historyInstanceIds); + this.baseMapper.updateById(surveyPlan); + return surveyPlan.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String cancelSurveyPlan(BpmProcessInstanceCancelParam cancelReqVO) { + //准备取消该流程,需要远程调用接口 + SurveyPlan surveyPlan = this.baseMapper.selectById(cancelReqVO.getId()); + //判断是否有权限操作 + InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(), surveyPlan.getCreateBy()); + //取消流程 + bpmProcessFeignClient.cancelProcessInstanceByStartUser(cancelReqVO); + //更新状态 + surveyPlan.setStatus(BpmProcessInstanceStatusEnum.CANCEL.getStatus()); + this.updateById(surveyPlan); + return surveyPlan.getId(); + } + + @Override + public void updateSurveyPlanStatus(String businessKey, Integer status) { + SurveyPlan surveyPlan = this.baseMapper.selectById(businessKey); + surveyPlan.setStatus(status); + this.updateById(surveyPlan); + } +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyTestServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyTestServiceImpl.java new file mode 100644 index 000000000..15903fff0 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyTestServiceImpl.java @@ -0,0 +1,151 @@ +package com.njcn.supervision.service.survey.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.njcn.bpm.api.BpmProcessFeignClient; +import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum; +import com.njcn.bpm.enums.BpmTaskStatusEnum; +import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; +import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; +import com.njcn.common.pojo.enums.common.DataStateEnum; +import com.njcn.supervision.mapper.survey.SurveyTestMapper; +import com.njcn.supervision.pojo.param.survey.SurveyTestParam; +import com.njcn.supervision.pojo.po.survey.SurveyPlan; +import com.njcn.supervision.pojo.po.survey.SurveyTest; +import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO; +import com.njcn.supervision.pojo.vo.survey.SurveyTestVO; +import com.njcn.supervision.service.survey.ISurveyTestService; +import com.njcn.supervision.utils.InstanceUtil; +import com.njcn.user.api.UserFeignClient; +import com.njcn.web.factory.PageFactory; +import com.njcn.web.utils.RequestUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + *

+ * 普测测试的管理表 服务实现类 + *

+ * + * @author hongawen + * @since 2024-05-30 + */ +@Service +@RequiredArgsConstructor +public class SurveyTestServiceImpl extends ServiceImpl implements ISurveyTestService { + + private final UserFeignClient userFeignClient; + + private final BpmProcessFeignClient bpmProcessFeignClient; + + /** + * 预告警单的反馈单对应的流程定义 KEY + */ + public static final String PROCESS_KEY = "survey_test"; + + + @Override + public Page surveyTestPage(SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam) { + QueryWrapper surveyTestVOQueryWrapper = new QueryWrapper<>(); + if (Objects.nonNull(surveyTestQueryParam)) { + //添加上时间范围 + surveyTestVOQueryWrapper.between("supervision_survey_test.Create_Time", + DateUtil.beginOfDay(DateUtil.parse(surveyTestQueryParam.getSearchBeginTime())), + DateUtil.endOfDay(DateUtil.parse(surveyTestQueryParam.getSearchEndTime()))); + //根据工程名称模糊搜索 + if (StrUtil.isNotBlank(surveyTestQueryParam.getSearchValue())) { + surveyTestVOQueryWrapper.like("supervision_survey_test.plan_name", surveyTestQueryParam.getSearchValue()); + } + } + //获取当前用户部门所有同事的id,查看该部门下所有的数据 + List colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData(); + surveyTestVOQueryWrapper.in("supervision_survey_test.Create_By", colleaguesIds) + .eq("supervision_survey_test.state", DataStateEnum.ENABLE.getCode()) + .orderByDesc("supervision_survey_test.Update_Time"); + return this.baseMapper.surveyTestPage(new Page<>(PageFactory.getPageNum(surveyTestQueryParam), PageFactory.getPageSize(surveyTestQueryParam)), surveyTestVOQueryWrapper); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String addSurveyTest(SurveyTestParam surveyTestParam) { + SurveyTest surveyTest = new SurveyTest(); + BeanUtils.copyProperties(surveyTestParam, surveyTest); + surveyTest.setState(DataStateEnum.ENABLE.getCode()); + surveyTest.setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); + this.save(surveyTest); + // 发起 BPM 流程 + Map processInstanceVariables = new HashMap<>(); + BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO(); + bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY); + bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyTest.getId()); + bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>()); + bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables); + String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyTest.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData(); + // 将工作流的编号,更新到流程单中 + surveyTest.setProcessInstanceId(processInstanceId); + this.baseMapper.updateById(surveyTest); + return surveyTest.getId(); + } + + @Override + public String updateSurveyTest(SurveyTestParam.SurveyTestUpdateParam surveyTestUpdateParam) { + SurveyTest surveyTest = this.baseMapper.selectById(surveyTestUpdateParam.getId()); + //判断是否有权限操作 + InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),surveyTest.getCreateBy()); + surveyTestUpdateParam.setStatus(surveyTest.getStatus()); + surveyTestUpdateParam.setProcessInstanceId(surveyTest.getProcessInstanceId()); + surveyTestUpdateParam.setHistoryInstanceId(surveyTest.getHistoryInstanceId()); + BeanUtils.copyProperties(surveyTestUpdateParam, surveyTest); + surveyTest.setState(DataStateEnum.ENABLE.getCode()); + surveyTest.setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); + //处理历史流程id列表 + String historyInstanceIds = InstanceUtil.dealHistoryId(surveyTest.getProcessInstanceId(), surveyTest.getHistoryInstanceId()); + // 发起 BPM 流程 + Map processInstanceVariables = new HashMap<>(); + BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO(); + bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY); + bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyTest.getId()); + bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>()); + bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables); + String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyTest.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData(); + // 将工作流的编号,更新到流程单中 + surveyTest.setProcessInstanceId(processInstanceId); + //保存历史流程id列表 + surveyTest.setHistoryInstanceId(historyInstanceIds); + this.baseMapper.updateById(surveyTest); + return surveyTest.getId(); + } + + @Override + public String cancelSurveyTest(BpmProcessInstanceCancelParam cancelReqVO) { + //准备取消该流程,需要远程调用接口 + SurveyTest surveyTest = this.baseMapper.selectById(cancelReqVO.getId()); + //判断是否有权限操作 + InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),surveyTest.getCreateBy()); + //取消流程 + bpmProcessFeignClient.cancelProcessInstanceByStartUser(cancelReqVO); + //更新状态 + surveyTest.setStatus(BpmProcessInstanceStatusEnum.CANCEL.getStatus()); + this.updateById(surveyTest); + return surveyTest.getId(); + } + + @Override + public void updateSurveyTestStatus(String businessKey, Integer status) { + SurveyTest surveyTest = this.baseMapper.selectById(businessKey); + surveyTest.setStatus(status); + this.updateById(surveyTest); + + } +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/UserReportPOService.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/UserReportPOService.java index ef065550d..28a7c8f9a 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/UserReportPOService.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/UserReportPOService.java @@ -3,10 +3,13 @@ package com.njcn.supervision.service.user; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; +import com.njcn.supervision.pojo.dto.SensitiveUserExcel; import com.njcn.supervision.pojo.param.user.UserReportParam; import com.njcn.supervision.pojo.po.user.UserReportPO; import com.njcn.supervision.pojo.vo.user.UserReportVO; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -39,4 +42,13 @@ public interface UserReportPOService extends IService { String cancelUserReport(BpmProcessInstanceCancelParam cancelReqVO); void updateUserStatus(String lineId, Integer userStatus); + + /** + * 分页查询敏感及重要用户台账 + */ + Page getSensitiveUserPage(UserReportParam.UserReportQueryParam userReportQueryParam); + + void downloadSensitiveUserTemplate(); + + String importSensitiveUserData(MultipartFile file, HttpServletResponse response); } diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java index 67ab1b1d5..5d1b2ce61 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java @@ -1,5 +1,9 @@ package com.njcn.supervision.service.user.impl; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; @@ -13,13 +17,22 @@ import com.njcn.bpm.enums.BpmTaskStatusEnum; import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.common.pojo.enums.common.DataStateEnum; +import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.device.pms.utils.PubUtil; import com.njcn.device.pq.api.LineFeignClient; +import com.njcn.device.pq.pojo.bo.excel.OracleTerminalExcel; import com.njcn.device.pq.pojo.po.LineDetail; +import com.njcn.poi.excel.ExcelUtil; +import com.njcn.poi.excel.PullDown; +import com.njcn.poi.util.PoiUtil; import com.njcn.supervision.enums.FlowStatusEnum; +import com.njcn.supervision.enums.SupervisionResponseEnum; +import com.njcn.supervision.enums.SupervisionUserStatusEnum; import com.njcn.supervision.enums.UserNatureEnum; import com.njcn.supervision.mapper.device.SupervisionTempLineReportMapper; import com.njcn.supervision.mapper.user.UserReportPOMapper; +import com.njcn.supervision.pojo.dto.SensitiveUserExcel; import com.njcn.supervision.pojo.param.user.UserReportParam; import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport; import com.njcn.supervision.pojo.po.user.UserReportPO; @@ -32,8 +45,12 @@ import com.njcn.supervision.service.user.UserReportProjectPOService; import com.njcn.supervision.service.user.UserReportSensitivePOService; import com.njcn.supervision.service.user.UserReportSubstationPOService; import com.njcn.supervision.utils.InstanceUtil; +import com.njcn.system.api.DicDataFeignClient; +import com.njcn.system.enums.DicDataTypeEnum; +import com.njcn.system.pojo.po.DictData; import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.UserFeignClient; +import com.njcn.user.enums.UserStatusEnum; import com.njcn.user.pojo.vo.UserVO; import com.njcn.web.factory.PageFactory; import com.njcn.web.utils.RequestUtil; @@ -44,9 +61,13 @@ import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapperImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; +import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * Description: @@ -72,7 +93,7 @@ public class UserReportPOServiceImpl extends ServiceImpl getInterferenceUserPage(UserReportParam.UserReportQueryParam userReportQueryParam) { QueryWrapper userReportVOQueryWrapper = new QueryWrapper<>(); - List colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData(); - + //此处不查询敏感及重要用户 userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds) .eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode()) - .eq("supervision_user_report.status",FlowStatusEnum.APPROVE.getCode()) - ; - //TODO + .ne("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode()) + .eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode()); if (Objects.nonNull(userReportQueryParam)) { if (StrUtil.isNotBlank(userReportQueryParam.getCity())) { //查询所有区域下的数据 userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity()); } - if(Objects.nonNull(userReportQueryParam.getDataType())){ - userReportVOQueryWrapper.eq("data_type",userReportQueryParam.getDataType()); + if (Objects.nonNull(userReportQueryParam.getDataType())) { + userReportVOQueryWrapper.eq("data_type", userReportQueryParam.getDataType()); } - userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()),"supervision_user_report.project_name", userReportQueryParam.getProjectName()); + userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName()); } userReportVOQueryWrapper.orderByDesc("supervision_user_report.create_time"); @@ -304,7 +322,7 @@ public class UserReportPOServiceImpl extends ServiceImpluserStatus则不修改,如果将干扰源用户状态改为3退运,则必须其下的监测点都退运才能修改 - if(userReportPO.getUserStatus() supervisionTempLineReports = supervisionTempLineReportMapper.selectList(new QueryWrapper().lambda().eq(SupervisionTempLineReport::getUserId, userId)); List lineIds = supervisionTempLineReports.stream().map(SupervisionTempLineReport::getId).collect(Collectors.toList()); List data = lineFeignClient.getLineDetail(lineIds).getData(); @@ -329,10 +347,10 @@ public class UserReportPOServiceImpl extends ServiceImpl !Objects.equals(temp, 2)) .collect(Collectors.toList()); - if(CollectionUtil.isEmpty(data)){ + if (CollectionUtil.isEmpty(data)) { userReportPO.setUserStatus(userStatus); } - }else { + } else { userReportPO.setUserStatus(userStatus); } @@ -340,6 +358,192 @@ public class UserReportPOServiceImpl extends ServiceImpl getSensitiveUserPage(UserReportParam.UserReportQueryParam userReportQueryParam) { + QueryWrapper userReportVOQueryWrapper = new QueryWrapper<>(); + List colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData(); + //此处仅查询敏感及重要用户 + userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds) + .eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode()) + .eq("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode()) + .eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode()); + if (Objects.nonNull(userReportQueryParam)) { + if (StrUtil.isNotBlank(userReportQueryParam.getCity())) { + //查询所有区域下的数据 + userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity()); + } + if (Objects.nonNull(userReportQueryParam.getDataType())) { + userReportVOQueryWrapper.eq("data_type", userReportQueryParam.getDataType()); + } + userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName()); + + } + userReportVOQueryWrapper.orderByDesc("supervision_user_report.create_time"); + Page userReportVOPage = this.baseMapper.page(new Page<>(PageFactory.getPageNum(userReportQueryParam), PageFactory.getPageSize(userReportQueryParam)), userReportVOQueryWrapper); + List records = userReportVOPage.getRecords(); + if (CollectionUtil.isNotEmpty(records)) { + //将详细信息也查出 + for (UserReportVO record : records) { + UserReportSensitivePO userReportSensitivePO = userReportSensitivePOService.getById(record.getId()); + record.setUserReportSensitivePO(userReportSensitivePO); + } + } + return userReportVOPage; + } + + @Override + public void downloadSensitiveUserTemplate() { + ExportParams exportParams = new ExportParams("敏感及重要用户模板(带*字段均是必填,请严格按照模板标准填入数据)", "重要用户"); + + List devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData(); + List industryType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDUSTRY_TYPE_JB.getCode()).getData(); + List loadLevel = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.LOAD_LEVEL.getCode()).getData(); + List supplyCondition = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPPLY_CONDITION.getCode()).getData(); + + List pullDowns = new ArrayList<>(); + + PullDown pullDown; + pullDown = new PullDown(); + pullDown.setFirstCol(2); + pullDown.setLastCol(2); + pullDown.setStrings(Stream.of("可研", "建设", "运行", "退运").collect(Collectors.toList())); + pullDowns.add(pullDown); + + + pullDown = new PullDown(); + pullDown.setFirstCol(4); + pullDown.setLastCol(4); + pullDown.setStrings(devVoltage.stream().map(DictData::getName).collect(Collectors.toList())); + pullDowns.add(pullDown); + + pullDown = new PullDown(); + pullDown.setFirstCol(5); + pullDown.setLastCol(5); + pullDown.setStrings(industryType.stream().map(DictData::getName).collect(Collectors.toList())); + pullDowns.add(pullDown); + + pullDown = new PullDown(); + pullDown.setFirstCol(8); + pullDown.setLastCol(8); + pullDown.setStrings(devVoltage.stream().map(DictData::getName).collect(Collectors.toList())); + pullDowns.add(pullDown); + + pullDown = new PullDown(); + pullDown.setFirstCol(9); + pullDown.setLastCol(9); + pullDown.setStrings(loadLevel.stream().map(DictData::getName).collect(Collectors.toList())); + pullDowns.add(pullDown); + + + pullDown = new PullDown(); + pullDown.setFirstCol(10); + pullDown.setLastCol(10); + pullDown.setStrings(supplyCondition.stream().map(DictData::getName).collect(Collectors.toList())); + pullDowns.add(pullDown); + + ExcelUtil.exportExcelPullDown(exportParams, "敏感及重要用户模板.xlsx", pullDowns, SensitiveUserExcel.class, new ArrayList<>()); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String importSensitiveUserData(MultipartFile file, HttpServletResponse response) { + ImportParams params = new ImportParams(); + params.setHeadRows(1);//表头 + params.setTitleRows(1);//标题 + params.setNeedVerify(true); + params.setStartSheetIndex(0); + params.setSheetNum(1); + List sensitiveUserExcels; + try { + ExcelImportResult sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SensitiveUserExcel.class, params); + //如果存在非法数据,将不合格的数据导出 + if (sensitiveUserExcelExcelImportResult.isVerifyFail()) { + PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法用户数据.xlsx", response); + return null; + } else { + sensitiveUserExcels = sensitiveUserExcelExcelImportResult.getList(); + } + } catch (Exception e) { + throw new BusinessException(SupervisionResponseEnum.IMPORT_SENSITIVE_USER_ERROR); + } + List devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData(); + List industryType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDUSTRY_TYPE_JB.getCode()).getData(); + List loadLevel = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.LOAD_LEVEL.getCode()).getData(); + List supplyCondition = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPPLY_CONDITION.getCode()).getData(); + //执行批量导入敏感及重要用户,入库过程中会进行数据校验 + List sensitiveUserExcelMsgs = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(sensitiveUserExcels)) { + for (SensitiveUserExcel sensitiveUserExcel : sensitiveUserExcels) { + //先判断当前用户是否已经存在 + LambdaQueryWrapper userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>(); + userReportPOLambdaQueryWrapper.eq(UserReportPO::getProjectName, sensitiveUserExcel.getProjectName()) + .eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode()); + int count = this.count(userReportPOLambdaQueryWrapper); + if (count > 0) { +// if(sensitiveUserExcel.getOverlay() == 1){ +// +// }else{ + //该用户已经录入 + SensitiveUserExcel.SensitiveUserExcelMsg sensitiveUserExcelMsg = new SensitiveUserExcel.SensitiveUserExcelMsg(); + BeanUtils.copyProperties(sensitiveUserExcel, sensitiveUserExcelMsg); + sensitiveUserExcelMsg.setMsg("该用户已录入,请联系管理员!"); + sensitiveUserExcelMsgs.add(sensitiveUserExcelMsg); +// } + continue; + } + //处理通用信息 + UserReportPO userReportPO = new UserReportPO(); + userReportPO.setReporter(RequestUtil.getUserIndex()); + userReportPO.setReportDate(LocalDate.now()); + userReportPO.setOrgId(RequestUtil.getDeptIndex()); + userReportPO.setCity(sensitiveUserExcel.getCity()); + userReportPO.setUserType(UserNatureEnum.SENSITIVE_USER.getCode()); + if(Objects.nonNull(sensitiveUserExcel.getUserStatus())){ + userReportPO.setUserStatus(sensitiveUserExcel.getUserStatus()); + }else{ + userReportPO.setUserStatus(SupervisionUserStatusEnum.PRODUCT.getCode()); + } + userReportPO.setSubstation(sensitiveUserExcel.getSubstation()); + //电压等级需要特殊处理下 + if (StrUtil.isNotBlank(sensitiveUserExcel.getVoltageLevel())) { + userReportPO.setVoltageLevel(PubUtil.getDicById(sensitiveUserExcel.getVoltageLevel(), devVoltage)); + } + userReportPO.setProjectName(sensitiveUserExcel.getProjectName()); + userReportPO.setDataType(1); + userReportPO.setStatus(2); + userReportPO.setState(DataStateEnum.ENABLE.getCode()); + this.baseMapper.insert(userReportPO); + //处理敏感用户的信息 + UserReportSensitivePO userReportSensitivePO = new UserReportSensitivePO(); + userReportSensitivePO.setId(userReportPO.getId()); + if (StrUtil.isNotBlank(sensitiveUserExcel.getIndustry())) { + userReportSensitivePO.setIndustry(PubUtil.getDicById(sensitiveUserExcel.getIndustry(), industryType)); + } + userReportSensitivePO.setMaintenanceUnit(sensitiveUserExcel.getMaintenanceUnit()); + userReportSensitivePO.setPowerSupply(sensitiveUserExcel.getPowerSupply()); + if (StrUtil.isNotBlank(sensitiveUserExcel.getSupplyVoltageLevel())) { + userReportSensitivePO.setSupplyVoltageLevel(PubUtil.getDicById(sensitiveUserExcel.getSupplyVoltageLevel(), devVoltage)); + } + if (StrUtil.isNotBlank(sensitiveUserExcel.getLoadLevel())) { + userReportSensitivePO.setLoadLevel(PubUtil.getDicById(sensitiveUserExcel.getLoadLevel(), loadLevel)); + } + if (StrUtil.isNotBlank(sensitiveUserExcel.getPowerSupplyInfo())) { + userReportSensitivePO.setPowerSupplyInfo(PubUtil.getDicById(sensitiveUserExcel.getPowerSupplyInfo(), supplyCondition)); + } + userReportSensitivePO.setState(DataStateEnum.ENABLE.getCode()); + userReportSensitivePOService.save(userReportSensitivePO); + } + } + //判断有没有错误信息 + if (CollectionUtil.isNotEmpty(sensitiveUserExcelMsgs)) { + ExcelUtil.exportExcel("失败列表.xlsx", SensitiveUserExcel.SensitiveUserExcelMsg.class, sensitiveUserExcelMsgs); + return null; + } + return CommonResponseEnum.SUCCESS.getCode(); + + } + /** * 获取所有字段为null的属性名 @@ -373,7 +577,7 @@ public class UserReportPOServiceImpl extends ServiceImpl userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>(); userReportPOLambdaQueryWrapper .eq(UserReportPO::getProjectName, userReportParam.getProjectName()) - .in(UserReportPO::getStatus,CollectionUtil.newArrayList(BpmProcessInstanceStatusEnum.RUNNING.getStatus(),BpmProcessInstanceStatusEnum.APPROVE.getStatus())) + .in(UserReportPO::getStatus, CollectionUtil.newArrayList(BpmProcessInstanceStatusEnum.RUNNING.getStatus(), BpmProcessInstanceStatusEnum.APPROVE.getStatus())) .eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode()); //更新的时候,需排除当前记录 if (isExcludeSelf) { diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataTypeEnum.java b/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataTypeEnum.java index 0fad1f691..9327d64e4 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataTypeEnum.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataTypeEnum.java @@ -133,6 +133,8 @@ public enum DicDataTypeEnum { CARRY_CAPCITYUSER_MODE("用户模式","carry_capcity_user_mode"), LOCAL_MUNICIPALITY("所属地市","local_municipality"), INDUSTRY_TYPE_JB("行业类型-冀北","industry_type_jb"), + LOAD_LEVEL("负荷级别","load_level"), + SUPPLY_CONDITION("供电电源情况","supply_condition"), ;