From c4cc262964ff242513b347b2f4f969e64f3172c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E6=9C=A8c?= <857448963@qq.com> Date: Mon, 26 Jun 2023 09:14:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E6=9C=AF=E7=9B=91=E7=9D=A3=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E7=94=A8=E6=88=B7=E9=83=A8=E9=97=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9C=81=E7=BA=A7=EF=BC=8C=E5=B8=82=EF=BC=8C=E5=8E=BF?= =?UTF-8?q?=E5=B1=82=E7=BA=A7=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/pojo/constant/PatternRegex.java | 2 +- .../java/com/njcn/oss/constant/OssPath.java | 2 + .../process/enums/ProcessResponseEnum.java | 2 + .../process/pojo/param/SupvFileParam.java | 43 +++++ .../process/pojo/param/SupvPlanParam.java | 145 +++++++++++++++ .../process/pojo/param/SupvProblemParam.java | 132 ++++++++++++++ .../com/njcn/process/pojo/po/SupvFile.java | 51 ++++++ .../com/njcn/process/pojo/po/SupvPlan.java | 115 ++++++++++++ .../com/njcn/process/pojo/po/SupvProblem.java | 100 ++++++++++ .../com/njcn/process/pojo/vo/SupvPlanVO.java | 122 +++++++++++++ .../controller/SupvFileController.java | 57 ++++++ .../controller/SupvMonthStatisController.java | 43 +++++ .../controller/SupvPlanController.java | 91 ++++++++++ .../controller/SupvProblemController.java | 90 +++++++++ .../njcn/process/mapper/SupvFileMapper.java | 17 ++ .../njcn/process/mapper/SupvPlanMapper.java | 21 +++ .../process/mapper/SupvProblemMapper.java | 17 ++ .../process/mapper/mapping/SupvFileMapper.xml | 5 + .../process/mapper/mapping/SupvPlanMapper.xml | 6 + .../mapper/mapping/SupvProblemMapper.xml | 5 + .../process/service/ISupvFileService.java | 30 +++ .../process/service/ISupvPlanService.java | 58 ++++++ .../process/service/ISupvProblemService.java | 51 ++++++ .../service/impl/SupvFileServiceImpl.java | 64 +++++++ .../service/impl/SupvPlanServiceImpl.java | 171 ++++++++++++++++++ .../service/impl/SupvProblemServiceImpl.java | 66 +++++++ .../java/com/njcn/user/pojo/vo/UserVO.java | 3 + .../user/service/impl/UserServiceImpl.java | 1 + 28 files changed, 1509 insertions(+), 1 deletion(-) create mode 100644 pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvFileParam.java create mode 100644 pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvPlanParam.java create mode 100644 pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvProblemParam.java create mode 100644 pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvFile.java create mode 100644 pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java create mode 100644 pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java create mode 100644 pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvPlanVO.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvFileController.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvMonthStatisController.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvPlanController.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvProblemController.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvFileMapper.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvPlanMapper.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvProblemMapper.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvFileMapper.xml create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvPlanMapper.xml create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvProblemMapper.xml create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvFileService.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvPlanService.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvProblemService.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvFileServiceImpl.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java diff --git a/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/PatternRegex.java b/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/PatternRegex.java index 087ad961a..f0c354577 100644 --- a/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/PatternRegex.java +++ b/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/PatternRegex.java @@ -75,7 +75,7 @@ public interface PatternRegex { /** * 字典名称包括中文、数字、字母、罗马数字、括号以及点号 */ - String DIC_REGEX = "^[\\w\\u4E00-\\u9FA5()()_/、\\- ]+\\.?[\\w\\u4E00-\\u9FA5()()I II III IV V /]{0,125}$"; + String DIC_REGEX = "^[\\w\\u4E00-\\u9FA5()()_/、/, /,\\- ]+\\.?[\\w\\u4E00-\\u9FA5()()I II III IV V /]{0,125}$"; /** * 密码有效期(月)1-3月 diff --git a/pqs-common/common-oss/src/main/java/com/njcn/oss/constant/OssPath.java b/pqs-common/common-oss/src/main/java/com/njcn/oss/constant/OssPath.java index 5c82243c3..18bc54487 100644 --- a/pqs-common/common-oss/src/main/java/com/njcn/oss/constant/OssPath.java +++ b/pqs-common/common-oss/src/main/java/com/njcn/oss/constant/OssPath.java @@ -94,4 +94,6 @@ public interface OssPath { String WIRING_DIAGRAM = "wiringDiagram/"; + + } diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/enums/ProcessResponseEnum.java b/pqs-process/process-api/src/main/java/com/njcn/process/enums/ProcessResponseEnum.java index 727065796..fc4a2bf11 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/enums/ProcessResponseEnum.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/enums/ProcessResponseEnum.java @@ -22,6 +22,8 @@ public enum ProcessResponseEnum { ENABLED_CANNOT_BE_DELETED("A00555","策略为启用状态不能删除!"), THERE_IS_ONLY_ONE_STRATEGY("A00556","各个策略等级,通用策略只能有一条!"), TERMINAL_ID_REPEAT("A00351","终端编号已存在"), + + SUPV_PLAN_REPEAT("A00568","监督计划名称已存在") ; private final String code; diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvFileParam.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvFileParam.java new file mode 100644 index 000000000..2fdb34826 --- /dev/null +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvFileParam.java @@ -0,0 +1,43 @@ +package com.njcn.process.pojo.param; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.db.bo.BaseEntity; +import lombok.Getter; +import lombok.Setter; + +/** + *

+ * + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@Getter +@Setter +@TableName("supv_file") +public class SupvFileParam { + + + + private String id; + + /** + * 附件路径 + */ + private String file; + + /** + * 附件名称 + */ + private String attachmentName; + + private String attachmentType; + + /** + * 计划问题id + */ + private String busiId; + + +} diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvPlanParam.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvPlanParam.java new file mode 100644 index 000000000..f698c0dfb --- /dev/null +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvPlanParam.java @@ -0,0 +1,145 @@ +package com.njcn.process.pojo.param; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.db.bo.BaseEntity; +import com.njcn.web.pojo.annotation.DateTimeStrValid; +import com.njcn.web.pojo.param.BaseParam; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@Data +@TableName("supv_plan") +public class SupvPlanParam extends BaseParam { + + + + + /** + * 计划名称 + */ + @ApiModelProperty(value = "计划名称",required = true) + @NotBlank(message = "计划名称不可为空") + private String workPlanName; + + /** + * 监督单位 + */ + @ApiModelProperty(value = "监督单位",required = true) + @NotBlank(message = "监督单位不可为空") + private String supvOrgId; + + /** + * 监督类型 + */ + @ApiModelProperty(value = "监督类型",required = true) + @NotBlank(message = "监督类型不可为空") + private String supvType; + + /** + * 监督阶段 + */ + @ApiModelProperty(value = "监督阶段",required = true) + @NotBlank(message = "监督阶段不可为空") + private String supvStage; + + /** + * 计划监督时间 + */ + @ApiModelProperty(value = "计划监督时间",required = true) + @NotNull(message = "计划监督时间不可为空") + @DateTimeStrValid(message = "计划监督时间格式有误") + private String planSupvDate; + + /** + * 监督对象名称 + */ + @ApiModelProperty(value = "监督对象名称") + @NotBlank(message = "监督对象名称不可为空") + private String supvObjName; + + /** + * 对象类型 + */ + @ApiModelProperty(value = "对象类型") + @NotBlank(message = "对象类型不可为空") + private String supvObjType; + + /** + * 对象电压等级 + */ + @ApiModelProperty(value = "对象电压等级") + @NotBlank(message = "对象电压等级不可为空") + private String objVoltageLevel; + + /** + * 关联电站 + */ + @ApiModelProperty(value = "关联电站") + @NotBlank(message = "关联电站不可为空") + private String objRelationStation; + + /** + * 计划执行开始时间 + */ + @ApiModelProperty(value = "计划执行开始时间",required = true) + @NotNull(message = "计划执行开始时间不可为空") + @DateTimeStrValid(message = "计划执行开始时间格式有误") + private String supvStartTime; + + /** + * 计划执行结束时间 + */ + @ApiModelProperty(value = "计划执行结束时间",required = true) + @NotNull(message = "计划执行结束时间不可为空") + @DateTimeStrValid(message = "计划执行结束时间格式有误") + private String supvEndTime; + + /** + * 报告出具时间 + */ + @ApiModelProperty(value = "报告出具时间",required = true) + @DateTimeStrValid(message = "报告出具时间格式有误",format = "yyyy-MM-dd HH:mm:ss") + private String reportIssueTime; + + /** + * 电能质量问题发生时间 + */ + @ApiModelProperty(value = "电能质量问题发生时间",required = true) + @DateTimeStrValid(message = "电能质量问题发生时间格式有误",format = "yyyy-MM-dd HH:mm:ss") + private String problemOcTime; + + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + private String planRemark; + + + + @EqualsAndHashCode(callSuper = true) + @Data + public static class UpdateSupvPlanParam extends SupvPlanParam{ + + @ApiModelProperty(value = "索引",required = true) + @NotBlank(message = "计划索引不可为空") + private String planId; + } + +} diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvProblemParam.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvProblemParam.java new file mode 100644 index 000000000..3aa9cc254 --- /dev/null +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvProblemParam.java @@ -0,0 +1,132 @@ +package com.njcn.process.pojo.param; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.db.bo.BaseEntity; +import com.njcn.web.pojo.annotation.DateTimeStrValid; +import com.njcn.web.pojo.param.BaseParam; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("supv_problem") +public class SupvProblemParam extends BaseParam { + + + + /** + * 关联计划表 + */ + @ApiModelProperty(value = "关联计划表id",required = true) + @NotBlank(message = "关联计划表不可为空") + private String planId; + + /** + * 责任单位id,取ISC平台上的组织id + */ + @ApiModelProperty(value = "责任单位id,取ISC平台上的组织id",required = true) + @NotBlank(message = "责任单位id不可为空") + private String dutyOrgId; + + /** + * 监测点类型 ,仅供电电压监督计划必填 + */ + @ApiModelProperty(value = "监测点类型 ,仅供电电压监督计划必填") + private String monitorType; + + /** + * 整改时间 + */ + @ApiModelProperty(value = "整改时间",required = true) + @NotNull(message = "整改时间不可为空") + @DateTimeStrValid(message = "整改时间格式有误") + private String rectificationTime; + + /** + * 计划整改时间 + */ + @ApiModelProperty(value = "计划整改时间",required = true) + @NotNull(message = "计划整改时间不可为空") + @DateTimeStrValid(message = "计划整改时间格式有误") + private String planRectificationTime; + + /** + * 是否发布预告警 + */ + @ApiModelProperty(value = "是否发布预告警",required = true) + @NotNull(message = "是否发布预告警不可为空") + private Integer ifReleaseWarning; + + /** + * 问题描述 + */ + @ApiModelProperty(value = "问题描述") + private String simpleProblemDesc; + + /** + * 监督标准 + */ + @ApiModelProperty(value = "监督标准",required = true) + @NotBlank(message = "监督标准不可为空") + private String supvStandard; + + /** + * 标准出处 + */ + @ApiModelProperty(value = "标准出处",required = true) + @NotBlank(message = "标准出处不可为空") + private String supvResouce; + + /** + * 问题等级 01 一般,02 较大 + */ + @ApiModelProperty(value = "问题等级",required = true) + @NotBlank(message = "问题等级不可为空") + private String problemLevel; + + /** + * 定级依据 + */ + @ApiModelProperty(value = "定级依据",required = true) + @NotBlank(message = "定级依据不可为空") + private String problemLevelReason; + + /** + * 问题类型 + */ + @ApiModelProperty(value = "问题类型",required = true) + @NotBlank(message = "问题类型不可为空") + private String problemType; + + /** + * 整改方案 + */ + @ApiModelProperty(value = "整改方案",required = true) + @NotBlank(message = "整改方案不可为空") + private String rectificationProgramme; + + @EqualsAndHashCode(callSuper = true) + @Data + public static class UpdateSupvProblemParam extends SupvProblemParam{ + + @ApiModelProperty(value = "索引",required = true) + @NotBlank(message = "问题索引不可为空") + private String problemId; + } + +} diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvFile.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvFile.java new file mode 100644 index 000000000..f6fd80b11 --- /dev/null +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvFile.java @@ -0,0 +1,51 @@ +package com.njcn.process.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.db.bo.BaseEntity; +import java.io.Serializable; +import java.time.LocalDateTime; +import lombok.Getter; +import lombok.Setter; + +/** + *

+ * + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@Getter +@Setter +@TableName("supv_file") +public class SupvFile extends BaseEntity { + + private static final long serialVersionUID = 1L; + + private String id; + + /** + * 附件路径 + */ + private String file; + + /** + * 附件名称 + */ + private String attachmentName; + + /** + * 0.计划 1.问题 + */ + private Integer type; + + + private String attachmentType; + + /** + * 计划问题id + */ + private String busiId; + + +} diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java new file mode 100644 index 000000000..26c039d2b --- /dev/null +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java @@ -0,0 +1,115 @@ +package com.njcn.process.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +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 2023-06-21 + */ +@Data +@TableName("supv_plan") +public class SupvPlan extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @TableId + private String planId; + + /** + * 计划名称 + */ + private String workPlanName; + + /** + * 监督单位 + */ + private String supvOrgId; + + /** + * 监督类型 + */ + private String supvType; + + /** + * 监督阶段 + */ + private String supvStage; + + /** + * 计划监督时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate planSupvDate; + + /** + * 监督对象名称 + */ + private String supvObjName; + + /** + * 对象类型 + */ + private String supvObjType; + + /** + * 对象电压等级 + */ + private String objVoltageLevel; + + /** + * 关联电站 + */ + private String objRelationStation; + + /** + * 计划执行开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate supvStartTime; + + /** + * 计划执行结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate supvEndTime; + + /** + * 报告出具时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime reportIssueTime; + + /** + * 电能质量问题发生时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime problemOcTime; + + /** + * 备注 + */ + private String planRemark; + + /** + * 0.未上送 1.上送 2.取消上送 + */ + private Integer isUploadHead; + + + + +} diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java new file mode 100644 index 000000000..2796c4447 --- /dev/null +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java @@ -0,0 +1,100 @@ +package com.njcn.process.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableId; +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.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + *

+ * + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("supv_problem") +public class SupvProblem extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @TableId + private String problemId; + + /** + * 关联计划表 + */ + private String planId; + + /** + * 责任单位id,取ISC平台上的组织id + */ + private String dutyOrgId; + + /** + * 监测点类型 ,仅供电电压监督计划必填 + */ + private String monitorType; + + /** + * 整改时间 + */ + private LocalDate rectificationTime; + + /** + * 计划整改时间 + */ + private LocalDate planRectificationTime; + + /** + * 是否发布预告警 + */ + private Integer ifReleaseWarning; + + /** + * 问题描述 + */ + private String simpleProblemDesc; + + /** + * 监督标准 + */ + private String supvStandard; + + /** + * 标准出处 + */ + private String supvResouce; + + /** + * 问题等级 01 一般,02 较大 + */ + private String problemLevel; + + /** + * 定级依据 + */ + private String problemLevelReason; + + /** + * 问题类型 + */ + private String problemType; + + /** + * 整改方案 + */ + private String rectificationProgramme; + + + +} diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvPlanVO.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvPlanVO.java new file mode 100644 index 000000000..31d14e433 --- /dev/null +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvPlanVO.java @@ -0,0 +1,122 @@ +package com.njcn.process.pojo.vo; + +import com.njcn.web.pojo.annotation.DateTimeStrValid; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * pqs + * + * @author cdf + * @date 2023/6/25 + */ +@Data +public class SupvPlanVO { + + @ApiModelProperty(value = "索引",required = true) + private String planId; + + /** + * 计划名称 + */ + @ApiModelProperty(value = "计划名称",required = true) + private String workPlanName; + + /** + * 监督单位 + */ + @ApiModelProperty(value = "监督单位",required = true) + private String supvOrgId; + + @ApiModelProperty(value = "监督单位名称",required = true) + private String supvOrgName; + + /** + * 监督类型 + */ + @ApiModelProperty(value = "监督类型",required = true) + private String supvType; + + /** + * 监督阶段 + */ + @ApiModelProperty(value = "监督阶段",required = true) + private String supvStage; + + /** + * 计划监督时间 + */ + @ApiModelProperty(value = "计划监督时间",required = true) + private String planSupvDate; + + /** + * 监督对象名称 + */ + @ApiModelProperty(value = "监督对象名称") + private String supvObjName; + + /** + * 对象类型 + */ + @ApiModelProperty(value = "对象类型") + private String supvObjType; + + /** + * 对象电压等级 + */ + @ApiModelProperty(value = "对象电压等级") + private String objVoltageLevel; + + /** + * 关联电站 + */ + @ApiModelProperty(value = "关联电站") + private String objRelationStation; + + /** + * 计划执行开始时间 + */ + @ApiModelProperty(value = "计划执行开始时间",required = true) + private String supvStartTime; + + /** + * 计划执行结束时间 + */ + @ApiModelProperty(value = "计划执行结束时间",required = true) + private String supvEndTime; + + /** + * 报告出具时间 + */ + @ApiModelProperty(value = "报告出具时间",required = true) + private String reportIssueTime; + + /** + * 电能质量问题发生时间 + */ + @ApiModelProperty(value = "电能质量问题发生时间",required = true) + private String problemOcTime; + + + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + private String planRemark; + + @ApiModelProperty(value = "省部门") + private String province; + + @ApiModelProperty(value = "市部门") + private String city; + + @ApiModelProperty(value = "县部门") + private String county; + + + @ApiModelProperty(value = "附件名称") + private String attachmentName; +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvFileController.java b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvFileController.java new file mode 100644 index 000000000..626ecdc2e --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvFileController.java @@ -0,0 +1,57 @@ +package com.njcn.process.controller; + + +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.process.service.ISupvFileService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import com.njcn.web.controller.BaseController; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; + +/** + *

+ * 前端控制器 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@RestController +@RequestMapping("/supv/file") +@Api(tags = "技术监督附件控制器") +@RequiredArgsConstructor +public class SupvFileController extends BaseController { + + private final ISupvFileService iSupvFileService; + + + @PostMapping("planUpload") + @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPLOAD) + @ApiOperation("监督计划问题附件上传") + public HttpResult planUpload(@ApiParam(value = "文件", required = true) @RequestPart("files") MultipartFile file, @RequestParam("planId") String planId, @RequestParam("type") Integer type){ + String methodDescribe = getMethodDescribe("planUpload"); + iSupvFileService.planUpload(file,planId,type); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + @PostMapping("detail") + @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DOWNLOAD) + @ApiOperation("监督计划问题附件下载") + public HttpResult detail(HttpServletResponse response, @RequestParam("busId") String busId, @RequestParam("type") Integer type){ + String methodDescribe = getMethodDescribe("detail"); + iSupvFileService.detail(response,busId,type); + return null; + } +} + diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvMonthStatisController.java b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvMonthStatisController.java new file mode 100644 index 000000000..26a3652c6 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvMonthStatisController.java @@ -0,0 +1,43 @@ +package com.njcn.process.controller; + +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.process.pojo.param.SupvPlanParam; +import com.njcn.web.controller.BaseController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import springfox.documentation.annotations.ApiIgnore; + +/** + * pqs + * 月度统计 + * @author cdf + * @date 2023/6/26 + */ +@RestController +@RequestMapping("/supv/report") +@Api(tags = "技术监督月统计控制器") +@RequiredArgsConstructor +public class SupvMonthStatisController extends BaseController { + + + @PostMapping("statisticReport") + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @ApiIgnore + public HttpResult statisticReport(@RequestBody @Validated SupvPlanParam supvPlanParam){ + String methodDescribe = getMethodDescribe("statisticReport"); + + + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvPlanController.java b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvPlanController.java new file mode 100644 index 000000000..992d73f03 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvPlanController.java @@ -0,0 +1,91 @@ +package com.njcn.process.controller; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +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.process.pojo.param.SupvPlanParam; +import com.njcn.process.pojo.po.SupvPlan; +import com.njcn.process.pojo.vo.SupvPlanVO; +import com.njcn.process.service.ISupvPlanService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import liquibase.pro.packaged.S; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.njcn.web.controller.BaseController; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + *

+ * 前端控制器 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@RestController +@RequestMapping("/supv/plan") +@Api(tags = "技术监督计划控制器") +@RequiredArgsConstructor +public class SupvPlanController extends BaseController { + + private final ISupvPlanService iSupvPlanService; + + + @PostMapping("addPlan") + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @ApiOperation("新增技术监督计划") + @ApiImplicitParam(name = "supvPlanParam",value = "请求体",required = true) + public HttpResult addPlan(@RequestBody @Validated SupvPlanParam supvPlanParam){ + String methodDescribe = getMethodDescribe("addPlan"); + iSupvPlanService.addPlan(supvPlanParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + @PostMapping("updatePlan") + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @ApiOperation("修改技术监督计划") + @ApiImplicitParam(name = "supvPlanParam",value = "请求体",required = true) + public HttpResult updatePlan(@RequestBody @Validated SupvPlanParam.UpdateSupvPlanParam supvPlanParam){ + String methodDescribe = getMethodDescribe("updatePlan"); + iSupvPlanService.updatePlan(supvPlanParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + @PostMapping("delPlan") + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @ApiOperation("删除监督计划") + @ApiImplicitParam(name = "planIds",value = "监督计划索引集合",required = true) + public HttpResult delPlan(@RequestBody List planIds){ + String methodDescribe = getMethodDescribe("delPlan"); + iSupvPlanService.delPlan(planIds); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + @PostMapping("pagePlan") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("分页查询监督计划") + @ApiImplicitParam(name = "supvPlanParam",value = "请求体",required = true) + public HttpResult> pagePlan(@RequestBody SupvPlanParam supvPlanParam){ + String methodDescribe = getMethodDescribe("pagePlan"); + Page page = iSupvPlanService.pagePlan(supvPlanParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); + } + + + + +} + diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvProblemController.java b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvProblemController.java new file mode 100644 index 000000000..1846d9333 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvProblemController.java @@ -0,0 +1,90 @@ +package com.njcn.process.controller; + + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +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.process.pojo.param.SupvProblemParam; +import com.njcn.process.pojo.po.SupvProblem; +import com.njcn.process.service.ISupvProblemService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import com.njcn.web.controller.BaseController; + +import java.util.List; + +/** + *

+ * 前端控制器 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@RestController +@RequestMapping("/supv/problem") +@Api(tags = "技术监督实施问题控制器") +@RequiredArgsConstructor +public class SupvProblemController extends BaseController { + + private final ISupvProblemService iSupvProblemService; + + + @PostMapping("addProblem") + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @ApiOperation("新增技术监督问题") + @ApiImplicitParam(name = "supvProblemParam",value = "请求体",required = true) + public HttpResult addProblem(@RequestBody @Validated SupvProblemParam supvProblemParam){ + String methodDescribe = getMethodDescribe("addProblem"); + iSupvProblemService.addProblem(supvProblemParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + @PostMapping("updateProblem") + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @ApiOperation("修改技术监督问题") + @ApiImplicitParam(name = "supvProblemParam",value = "请求体",required = true) + public HttpResult updateProblem(@RequestBody @Validated SupvProblemParam.UpdateSupvProblemParam supvProblemParam){ + String methodDescribe = getMethodDescribe("updateProblem"); + iSupvProblemService.updateProblem(supvProblemParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + @PostMapping("delProblem") + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @ApiOperation("删除监督问题") + @ApiImplicitParam(name = "problemIds",value = "监督问题计划索引集合",required = true) + public HttpResult delProblem(@RequestBody List problemIds){ + String methodDescribe = getMethodDescribe("delProblem"); + iSupvProblemService.delProblem(problemIds); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + @PostMapping("pageProblem") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("分页查询监督问题") + @ApiImplicitParam(name = "supvProblemParam",value = "请求体",required = true) + public HttpResult> pageProblem(@RequestBody SupvProblemParam supvProblemParam){ + String methodDescribe = getMethodDescribe("pageProblem"); + if(StrUtil.isBlank(supvProblemParam.getPlanId())){ + throw new BusinessException("监督计划索引不可为空"); + } + Page page = iSupvProblemService.pageProblem(supvProblemParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); + } +} + diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvFileMapper.java b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvFileMapper.java new file mode 100644 index 000000000..bab6b74cc --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvFileMapper.java @@ -0,0 +1,17 @@ +package com.njcn.process.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.process.pojo.po.SupvFile; + +/** + *

+ * Mapper 接口 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +public interface SupvFileMapper extends BaseMapper { + +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvPlanMapper.java b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvPlanMapper.java new file mode 100644 index 000000000..3dbd7d3fb --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvPlanMapper.java @@ -0,0 +1,21 @@ +package com.njcn.process.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.njcn.process.pojo.param.SupvPlanParam; +import com.njcn.process.pojo.po.SupvPlan; +import com.njcn.process.pojo.vo.SupvPlanVO; + +/** + *

+ * Mapper 接口 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +public interface SupvPlanMapper extends BaseMapper { + + +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvProblemMapper.java b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvProblemMapper.java new file mode 100644 index 000000000..150059d97 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvProblemMapper.java @@ -0,0 +1,17 @@ +package com.njcn.process.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.process.pojo.po.SupvProblem; + +/** + *

+ * Mapper 接口 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +public interface SupvProblemMapper extends BaseMapper { + +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvFileMapper.xml b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvFileMapper.xml new file mode 100644 index 000000000..c7d249cb6 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvFileMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvPlanMapper.xml b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvPlanMapper.xml new file mode 100644 index 000000000..5edf428b3 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvPlanMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvProblemMapper.xml b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvProblemMapper.xml new file mode 100644 index 000000000..014adbe49 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvProblemMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvFileService.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvFileService.java new file mode 100644 index 000000000..5b67ee097 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvFileService.java @@ -0,0 +1,30 @@ +package com.njcn.process.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.process.pojo.po.SupvFile; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; + +/** + *

+ * 服务类 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +public interface ISupvFileService extends IService { + + /** + * + * @author cdf + * @date 2023/6/25 + */ + boolean planUpload(MultipartFile file,String planId, Integer type); + + + String detail(HttpServletResponse response,String busId,Integer type); + +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvPlanService.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvPlanService.java new file mode 100644 index 000000000..a662c1999 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvPlanService.java @@ -0,0 +1,58 @@ +package com.njcn.process.service; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.process.pojo.param.SupvPlanParam; +import com.njcn.process.pojo.po.SupvPlan; +import com.njcn.process.pojo.vo.SupvPlanVO; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +public interface ISupvPlanService extends IService { + + /** + * 新增技术监督 + * @author cdf + * @date 2023/6/21 + */ + boolean addPlan(SupvPlanParam supvPlanParam); + + /** + * 修改技术监督 + * @author cdf + * @date 2023/6/21 + */ + boolean updatePlan(SupvPlanParam supvPlanParam); + + /** + * 删除技术监督 + * @author cdf + * @date 2023/6/21 + */ + boolean delPlan(List planIds); + + /** + * 分页查询技术监督 + * @author cdf + * @date 2023/6/21 + */ + Page pagePlan(SupvPlanParam supvPlanParam); + + + + +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvProblemService.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvProblemService.java new file mode 100644 index 000000000..c40e1c800 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvProblemService.java @@ -0,0 +1,51 @@ +package com.njcn.process.service; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.process.pojo.param.SupvProblemParam; +import com.njcn.process.pojo.po.SupvProblem; +import com.njcn.process.pojo.po.SupvProblem; + +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +public interface ISupvProblemService extends IService { + + + /** + * 新增技术监督问题 + * @author cdf + * @date 2023/6/21 + */ + boolean addProblem(SupvProblemParam supvProblemParam); + + /** + * 修改技术监督问题 + * @author cdf + * @date 2023/6/21 + */ + boolean updateProblem(SupvProblemParam supvProblemParam); + + /** + * 删除技术监督问题 + * @author cdf + * @date 2023/6/21 + */ + boolean delProblem(List problemIds); + + /** + * 分页查询技术监督问题 + * @author cdf + * @date 2023/6/21 + */ + Page pageProblem(SupvProblemParam supvProblemParam); + +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvFileServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvFileServiceImpl.java new file mode 100644 index 000000000..d84eb3164 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvFileServiceImpl.java @@ -0,0 +1,64 @@ +package com.njcn.process.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.oss.constant.OssPath; +import com.njcn.oss.utils.FileStorageUtil; +import com.njcn.process.mapper.SupvFileMapper; +import com.njcn.process.pojo.po.SupvFile; +import com.njcn.process.service.ISupvFileService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.Objects; + +/** + *

+ * 服务实现类 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@Service +@RequiredArgsConstructor +public class SupvFileServiceImpl extends ServiceImpl implements ISupvFileService { + + + private final FileStorageUtil fileStorageUtil; + + private final SupvFileMapper supvFileMapper; + + @Override + public boolean planUpload(MultipartFile file, String planId, Integer type) { + SupvFile supvFile = this.getOne(new LambdaQueryWrapper().eq(SupvFile::getBusiId,planId).eq(SupvFile::getType,type)); + String url = fileStorageUtil.uploadMultipart(file, OssPath.SURVEY_RESULT); + SupvFile supvFilePO = new SupvFile(); + supvFilePO.setAttachmentName(file.getOriginalFilename()); + supvFilePO.setFile(url); + if(Objects.nonNull(supvFile)){ + fileStorageUtil.deleteFile(supvFile.getFile()); + supvFilePO.setId(supvFile.getId()); + return this.updateById(supvFilePO); + } + supvFilePO.setAttachmentType("01"); + supvFilePO.setBusiId(planId); + supvFilePO.setType(type); + return this.save(supvFilePO); + } + + @Override + public String detail(HttpServletResponse response,String busId, Integer type) { + SupvFile supvFile = this.getOne(new LambdaQueryWrapper().eq(SupvFile::getBusiId,busId).eq(SupvFile::getType,type)); + if(Objects.nonNull(supvFile)){ + fileStorageUtil.downloadStream(response,supvFile.getFile()); + return null; + }else { + throw new BusinessException("不存在附件"); + } + } +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java new file mode 100644 index 000000000..5f89e768b --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java @@ -0,0 +1,171 @@ +package com.njcn.process.service.impl; + + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.common.utils.PubUtils; +import com.njcn.oss.constant.OssPath; +import com.njcn.oss.utils.FileStorageUtil; +import com.njcn.process.enums.ProcessResponseEnum; +import com.njcn.process.mapper.SupvFileMapper; +import com.njcn.process.mapper.SupvPlanMapper; +import com.njcn.process.pojo.param.SupvPlanParam; +import com.njcn.process.pojo.po.SupvFile; +import com.njcn.process.pojo.po.SupvPlan; +import com.njcn.process.pojo.vo.SupvPlanVO; +import com.njcn.process.service.ISupvFileService; +import com.njcn.process.service.ISupvPlanService; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.vo.PvTerminalTreeVO; +import com.njcn.web.factory.PageFactory; +import liquibase.pro.packaged.L; +import liquibase.pro.packaged.S; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + *

+ * 服务实现类 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@Service +@RequiredArgsConstructor +public class SupvPlanServiceImpl extends ServiceImpl implements ISupvPlanService { + + private final DeptFeignClient deptFeignClient; + + private final SupvFileMapper supvFileMapper; + + + @Override + public boolean addPlan(SupvPlanParam supvPlanParam) { + checkParam(supvPlanParam,false); + SupvPlan supvPlan = new SupvPlan(); + BeanUtil.copyProperties(supvPlanParam,supvPlan); + supvPlan.setPlanSupvDate(PubUtils.localDateFormat(supvPlanParam.getPlanSupvDate())); + supvPlan.setSupvEndTime(PubUtils.localDateFormat(supvPlanParam.getSupvEndTime())); + supvPlan.setSupvStartTime(PubUtils.localDateFormat(supvPlanParam.getSupvStartTime())); + supvPlan.setProblemOcTime(PubUtils.localDateTimeFormat(supvPlanParam.getProblemOcTime())); + supvPlan.setReportIssueTime(PubUtils.localDateTimeFormat(supvPlanParam.getReportIssueTime())); + supvPlan.setIsUploadHead(0); + this.save(supvPlan); + return true; + } + + @Override + public boolean updatePlan(SupvPlanParam supvPlanParam) { + checkParam(supvPlanParam,true); + SupvPlan supvPlan = new SupvPlan(); + BeanUtil.copyProperties(supvPlanParam,supvPlan); + supvPlan.setPlanSupvDate(PubUtils.localDateFormat(supvPlanParam.getPlanSupvDate())); + supvPlan.setSupvEndTime(PubUtils.localDateFormat(supvPlanParam.getSupvEndTime())); + supvPlan.setSupvStartTime(PubUtils.localDateFormat(supvPlanParam.getSupvStartTime())); + supvPlan.setProblemOcTime(PubUtils.localDateTimeFormat(supvPlanParam.getProblemOcTime())); + supvPlan.setReportIssueTime(PubUtils.localDateTimeFormat(supvPlanParam.getReportIssueTime())); + this.updateById(supvPlan); + return true; + } + + @Override + public boolean delPlan(List planIds) { + return this.removeByIds(planIds); + } + + @Override + public Page pagePlan(SupvPlanParam supvPlanParam) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + if(StrUtil.isNotBlank(supvPlanParam.getSupvOrgId())){ + List deptIds = deptChildrenList(supvPlanParam.getSupvOrgId()); + lambdaQueryWrapper.in(SupvPlan::getSupvOrgId,deptIds); + } + Map mapCode = deptAllCodeList(); + Map mapList = deptAllList(); + + Page page = this.page(new Page<>(PageFactory.getPageNum(supvPlanParam), PageFactory.getPageSize(supvPlanParam)),lambdaQueryWrapper); + List supvPlanVOList = BeanUtil.copyToList(page.getRecords(),SupvPlanVO.class); + supvPlanVOList.forEach(item->{ + PvTerminalTreeVO pvTerminalTreeVO = mapCode.get(item.getSupvOrgId()); + item.setSupvOrgName(pvTerminalTreeVO.getName()); + item.setCounty(pvTerminalTreeVO.getName()); + PvTerminalTreeVO pvTerminalTreeOne = mapList.get(pvTerminalTreeVO.getPid()); + if(Objects.nonNull(pvTerminalTreeOne)){ + item.setCity(pvTerminalTreeOne.getName()); + } + + PvTerminalTreeVO pvTerminalTreeTwo = mapList.get(pvTerminalTreeOne.getPid()); + if(Objects.nonNull(pvTerminalTreeTwo)){ + item.setProvince(pvTerminalTreeTwo.getName()); + } + + SupvFile supvFile = supvFileMapper.selectOne(new LambdaQueryWrapper().eq(SupvFile::getBusiId,item.getPlanId()).eq(SupvFile::getType,0)); + if(Objects.nonNull(supvFile)){ + item.setAttachmentName(supvFile.getAttachmentName()); + } + }); + Page pageVo = new Page<>(); + pageVo.setTotal(page.getTotal()); + pageVo.setPages(page.getPages()); + pageVo.setSize(page.getSize()); + pageVo.setRecords(supvPlanVOList); + return pageVo; + } + + + + + private void checkParam(SupvPlanParam supvPlanParam,Boolean updateFlag){ + + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(SupvPlan::getWorkPlanName,supvPlanParam.getWorkPlanName()); + + if(updateFlag) { + if (supvPlanParam instanceof SupvPlanParam.UpdateSupvPlanParam) { + //修改 + lambdaQueryWrapper.ne(SupvPlan::getPlanId, ((SupvPlanParam.UpdateSupvPlanParam) supvPlanParam).getPlanId()); + } + } + + int count = this.count(lambdaQueryWrapper); + if(count>0){ + throw new BusinessException(ProcessResponseEnum.SUPV_PLAN_REPEAT); + } + + //判断监督对象类型 + + + } + + @DS("pms") + private List deptChildrenList(String deptId){ + return deptFeignClient.getDepSonSelfCodetByDeptId(deptId).getData(); + } + @DS("pms") + private Map deptAllList(){ + List deptList = deptFeignClient.allDeptList().getData(); + return deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, Function.identity())); + } + + @DS("pms") + private Map deptAllCodeList(){ + List deptList = deptFeignClient.allDeptList().getData(); + return deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getCode, Function.identity())); + } + +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java new file mode 100644 index 000000000..397ad462b --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java @@ -0,0 +1,66 @@ +package com.njcn.process.service.impl; + + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.common.utils.PubUtils; +import com.njcn.process.enums.ProcessResponseEnum; +import com.njcn.process.mapper.SupvProblemMapper; +import com.njcn.process.pojo.param.SupvProblemParam; +import com.njcn.process.pojo.po.SupvProblem; +import com.njcn.process.pojo.po.SupvProblem; +import com.njcn.process.service.ISupvProblemService; +import com.njcn.web.factory.PageFactory; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 服务实现类 + *

+ * + * @author hongawen + * @since 2023-06-21 + */ +@Service +public class SupvProblemServiceImpl extends ServiceImpl implements ISupvProblemService { + + @Override + public boolean addProblem(SupvProblemParam supvProblemParam) { + SupvProblem supvProblem = new SupvProblem(); + BeanUtil.copyProperties(supvProblemParam,supvProblem); + supvProblem.setPlanRectificationTime(PubUtils.localDateFormat(supvProblemParam.getPlanRectificationTime())); + supvProblem.setRectificationTime(PubUtils.localDateFormat(supvProblemParam.getRectificationTime())); + this.save(supvProblem); + return true; + } + + @Override + public boolean updateProblem(SupvProblemParam supvProblemParam) { + SupvProblem supvProblem = new SupvProblem(); + BeanUtil.copyProperties(supvProblemParam,supvProblem); + supvProblem.setPlanRectificationTime(PubUtils.localDateFormat(supvProblemParam.getPlanRectificationTime())); + supvProblem.setRectificationTime(PubUtils.localDateFormat(supvProblemParam.getRectificationTime())); + this.updateById(supvProblem); + return true; + } + + @Override + public boolean delProblem(List problemIds) { + return this.removeByIds(problemIds); + } + + @Override + public Page pageProblem(SupvProblemParam supvProblemParam) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(SupvProblem::getPlanId,supvProblemParam.getPlanId()); + return this.page(new Page<>(PageFactory.getPageNum(supvProblemParam), PageFactory.getPageSize(supvProblemParam)),lambdaQueryWrapper); + } + + + +} diff --git a/pqs-user/user-api/src/main/java/com/njcn/user/pojo/vo/UserVO.java b/pqs-user/user-api/src/main/java/com/njcn/user/pojo/vo/UserVO.java index eacb4b07a..2fe121809 100644 --- a/pqs-user/user-api/src/main/java/com/njcn/user/pojo/vo/UserVO.java +++ b/pqs-user/user-api/src/main/java/com/njcn/user/pojo/vo/UserVO.java @@ -43,6 +43,9 @@ public class UserVO extends UserParam implements Serializable { @ApiModelProperty("区域名称") private String areaName; + @ApiModelProperty("部门层级") + private Integer deptLevel; + @ApiModelProperty("角色id") private List roleList; diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/UserServiceImpl.java b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/UserServiceImpl.java index d6de41c26..4cf06ddf1 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/UserServiceImpl.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/UserServiceImpl.java @@ -263,6 +263,7 @@ public class UserServiceImpl extends ServiceImpl implements IU userVO.setDeptName(deptService.getNameByDeptId(user.getDeptId())); userVO.setRoleList(roleService.getIdByUserId(id)); userVO.setRole(roleService.getNameByUserId(id)); + userVO.setDeptLevel(dept.getPids().split(StrUtil.COMMA).length); return userVO; }