diff --git a/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/param/BpmFormParam.java b/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/param/BpmFormParam.java index 54581548a..22e5b61a9 100644 --- a/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/param/BpmFormParam.java +++ b/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/param/BpmFormParam.java @@ -27,7 +27,7 @@ public class BpmFormParam implements Serializable { * 状态 */ @ApiModelProperty("表单状态") - @NotBlank(message = "表单状态不能为空") +// @NotBlank(message = "表单状态不能为空") private Integer status; /** @@ -42,7 +42,7 @@ public class BpmFormParam implements Serializable { * */ @ApiModelProperty("表单项的数组-JSON 字符串的数组") - @NotBlank(message = "表单项的数组不能为空") +// @NotBlank(message = "表单项的数组不能为空") private List fields; /** 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 d8e27c393..f5a235d3f 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 @@ -21,7 +21,7 @@ public class GenerateCode { private static final String TARGET_DIR = "D://code"; - private static final String DB_URL = "jdbc:mysql://192.168.1.24:13306/bpm"; + private static final String DB_URL = "jdbc:mysql://192.168.1.24:13306/pqsinfo_jb"; // private static final String DB_URL = "jdbc:oracle:thin:@192.168.1.170:1521:pqsbase"; private static final String USERNAME = "root"; @@ -30,9 +30,9 @@ public class GenerateCode { public static void main(String[] args) { List modules = Stream.of( - new Module("hongawen", "com.njcn.bpm", "", Stream.of( - "bpm_sign" - ).collect(Collectors.toList()), "") + new Module("hongawen", "com.njcn.supervision", "leaflet", Stream.of( + "supervision_warning_leaflet" + ).collect(Collectors.toList()), "supervision_") ).collect(Collectors.toList()); generateJavaFile(modules); } diff --git a/pqs-common/common-web/src/main/java/com/njcn/web/filter/XssRequestWrapper.java b/pqs-common/common-web/src/main/java/com/njcn/web/filter/XssRequestWrapper.java index 7b42387b2..59e8e0595 100644 --- a/pqs-common/common-web/src/main/java/com/njcn/web/filter/XssRequestWrapper.java +++ b/pqs-common/common-web/src/main/java/com/njcn/web/filter/XssRequestWrapper.java @@ -34,7 +34,7 @@ import java.util.stream.Stream; @Slf4j public class XssRequestWrapper extends HttpServletRequestWrapper { - private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent","flowableXml","bpmnXml"}; + private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent","flowableXml","bpmnXml","fields"}; public XssRequestWrapper(HttpServletRequest request) { diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/FlowStatusEnum.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/FlowStatusEnum.java index 97f18f55f..a1f2f3947 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/FlowStatusEnum.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/FlowStatusEnum.java @@ -13,7 +13,8 @@ public enum FlowStatusEnum { AUDIT(1, "审批中"), APPROVE(2, "审批通过"), OPPOSE(3, "审批不通过"), - CANCEL(4, "已取消"); + CANCEL(4, "已取消"), + NO_FEEDBACK(5, "未反馈"); private final Integer code; diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/LeafletTypeEnum.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/LeafletTypeEnum.java new file mode 100644 index 000000000..fd8a22edb --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/LeafletTypeEnum.java @@ -0,0 +1,19 @@ +package com.njcn.supervision.enums; + +import lombok.Getter; + +@Getter +public enum LeafletTypeEnum { + + WARNING(1, "预警单"), + ALARM(2, "告警单"); + + private final Integer code; + + private final String name; + + LeafletTypeEnum(Integer code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/ProblemTypeEnum.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/ProblemTypeEnum.java new file mode 100644 index 000000000..55ccc8e11 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/ProblemTypeEnum.java @@ -0,0 +1,21 @@ +package com.njcn.supervision.enums; + +import lombok.Getter; + +@Getter +public enum ProblemTypeEnum { + + PLAN(1, "技术监督计划"), + ONLINE(2, "在线监测超标问题"), + USER(3, "用户投诉问题"), + SITE_TEST(4, "现场测试超标问题"); + + private final Integer code; + + private final String name; + + ProblemTypeEnum(Integer code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/leaflet/WarningLeafletParam.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/leaflet/WarningLeafletParam.java new file mode 100644 index 000000000..4bbfb947f --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/leaflet/WarningLeafletParam.java @@ -0,0 +1,112 @@ +package com.njcn.supervision.pojo.param.leaflet; + +import com.njcn.db.bo.BaseEntity; +import com.njcn.supervision.pojo.param.device.QuitRunningDeviceParam; +import com.njcn.web.pojo.param.BaseParam; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + *

+ * 预告警单表 + *

+ * + * @author hongawen + * @since 2024-05-21 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class WarningLeafletParam extends BaseEntity implements Serializable{ + + private static final long serialVersionUID = 1L; + + /** + * 预告警单名称 + */ + @ApiModelProperty(value = "设备编号") + private String leafletName; + + /** + * 预告警编号,目前阶段不做配置 + */ + @ApiModelProperty(value = "设备编号") + private String leafletNo; + + /** + * 1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标 + */ + @ApiModelProperty(value = "设备编号") + private Integer problemType; + + /** + * 对应问题源ID,用于查询详细信息 + */ + @ApiModelProperty(value = "设备编号") + private String problemId; + + /** + * 单子类型:1:预警单;2:告警单 + */ + @ApiModelProperty(value = "设备编号") + private Integer leafletType; + + /** + * 1:审批中;2:审批通过;3:审批不通过;4:已取消;5:待反馈 + */ + @ApiModelProperty(value = "设备编号") + private Integer status; + + /** + * 流程实例的编号 + */ + @ApiModelProperty(value = "设备编号") + private String processInstanceId; + + + @Data + @EqualsAndHashCode(callSuper = true) + public static class WarningLeafletUpdateParam extends WarningLeafletParam { + + @ApiModelProperty("id") + @NotBlank(message = "索引不能为空") + private String Id; + + + /** + * 采取措施 + */ + @ApiModelProperty(value = "采取措施") + @NotBlank(message = "采取措施不能为空") + private String takeStep; + + + /** + * 处理成效报告 + */ + @ApiModelProperty(value = "处理成效报告") + @NotBlank(message = "处理成效报告不能为空") + private String reportPath; + + } + + + /** + * 分页查询实体 + */ + @Data + @EqualsAndHashCode(callSuper = true) + public static class WarningLeafletQueryParam extends BaseParam { + + + + } + + +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/leaflet/WarningLeaflet.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/leaflet/WarningLeaflet.java new file mode 100644 index 000000000..53535532a --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/leaflet/WarningLeaflet.java @@ -0,0 +1,85 @@ +package com.njcn.supervision.pojo.po.leaflet; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.db.bo.BaseEntity; +import java.io.Serializable; +import java.time.LocalDateTime; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +/** + *

+ * 预告警单表 + *

+ * + * @author hongawen + * @since 2024-05-21 + */ +@Data +@TableName("supervision_warning_leaflet") +public class WarningLeaflet extends BaseEntity implements Serializable{ + + private static final long serialVersionUID = 1L; + + /** + * 预告警单 + */ + private String id; + + /** + * 预告警单名称 + */ + private String leafletName; + + /** + * 预告警编号,目前阶段不做配置 + */ + private String leafletNo; + + /** + * 1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标 + */ + private Integer problemType; + + /** + * 对应问题源ID,用于查询详细信息 + */ + private String problemId; + + /** + * 单子类型:1:预警单;2:告警单 + */ + private Integer leafletType; + + /** + * 1:审批中;2:审批通过;3:审批不通过;4:已取消;5:待反馈 + */ + private Integer status; + + /** + * 流程实例的编号 + */ + private String processInstanceId; + + + /** + * 采取措施 + */ + private String takeStep; + + + /** + * 处理成效报告 + */ + private String reportPath; + + + /** + * 状态:0-删除 1-正常 + */ + private Integer state; + + +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SupervisionGeneralSurveyPlanDetailPO.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SupervisionGeneralSurveyPlanDetailPO.java index dca8c8362..dd38b47b9 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SupervisionGeneralSurveyPlanDetailPO.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/survey/SupervisionGeneralSurveyPlanDetailPO.java @@ -79,6 +79,14 @@ public class SupervisionGeneralSurveyPlanDetailPO extends BaseEntity { @TableField(value = "is_survey") @ApiModelProperty(value="是否实现监测(0:否 1:是)") private Integer isSurvey; + + /** + * 存在问题的普测变电站是否发起告警单,0:否,1:是 + */ + @TableField(value = "initiate_warning_flag") + @ApiModelProperty(value="是否发起告警单") + private Integer initiateWarningFlag; + /** * 状态:0-删除 1-正常 */ diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/leaflet/WarningLeafletVO.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/leaflet/WarningLeafletVO.java new file mode 100644 index 000000000..1c0423eef --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/leaflet/WarningLeafletVO.java @@ -0,0 +1,72 @@ +package com.njcn.supervision.pojo.vo.leaflet; + +import com.njcn.db.bo.BaseEntity; +import lombok.Data; + +import java.io.Serializable; + +/** + *

+ * 预告警单表 + *

+ * + * @author hongawen + * @since 2024-05-21 + */ +@Data +public class WarningLeafletVO extends BaseEntity implements Serializable{ + + private static final long serialVersionUID = 1L; + + /** + * 预告警单 + */ + private String id; + + /** + * 预告警单名称 + */ + private String leafletName; + + /** + * 预告警编号,目前阶段不做配置 + */ + private String leafletNo; + + /** + * 1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标 + */ + private Integer problemType; + + /** + * 对应问题源ID,用于查询详细信息 + */ + private String problemId; + + /** + * 单子类型:1:预警单;2:告警单 + */ + private Integer leafletType; + + /** + * 1:审批中;2:审批通过;3:审批不通过;4:已取消;5:待反馈 + */ + private Integer status; + + /** + * 采取措施 + */ + private String takeStep; + + + /** + * 处理成效报告 + */ + private String reportPath; + + /** + * 流程实例的编号 + */ + private String processInstanceId; + +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SupervisionGeneralSurveyPlanDetailVO.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SupervisionGeneralSurveyPlanDetailVO.java new file mode 100644 index 000000000..b677aecad --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/survey/SupervisionGeneralSurveyPlanDetailVO.java @@ -0,0 +1,117 @@ +package com.njcn.supervision.pojo.vo.survey; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.github.jeffreyning.mybatisplus.anno.MppMultiId; +import com.njcn.db.bo.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +/** + * + * Description: + * Date: 2024/5/13 18:35【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +@Data +public class SupervisionGeneralSurveyPlanDetailVO extends BaseEntity { + /** + * 普测计划编号 + */ + @MppMultiId(value = "plan_no") + private String planNo; + + @ApiModelProperty(value="单位Id") + private String orgNo; + + @ApiModelProperty(value="单位名称") + private String orgName; + + /** + * 普测计划名称 + */ + @ApiModelProperty(value="普测计划名称") + private String planName; + + /** + * 计划生成时间 + */ + @ApiModelProperty(value="计划生成时间") + private LocalDate planCreateTime; + + /** + * 计划开始时间 + */ + @ApiModelProperty(value="计划开始时间") + private LocalDate planStartTime; + + /** + * 计划结束时间 + */ + @ApiModelProperty(value="计划结束时间") + private LocalDate planEndTime; + + /** + * 实际完成时间 + */ + @ApiModelProperty(value="实际完成时间") + private LocalDate planComplateTime; + + /** + * 计划负责人 + */ + @ApiModelProperty(value="计划负责人") + private String leader; + + + /** + * 变电站ID + */ + @MppMultiId(value = "sub_id") + private String subId; + + /** + * 变电站名称 + */ + @TableField(value = "sub_name") + @ApiModelProperty(value="变电站名称") + private String subName; + + /** + * 变电站电压等级 + */ + @TableField(value = "voltage_level") + @ApiModelProperty(value="变电站电压等级") + private String voltageLevel; + + + /** + * 是否生成问题(0:否 1:是) + */ + @TableField(value = "is_problem") + @ApiModelProperty(value="是否生成问题(0:否 1:是)") + private Integer isProblem; + + /** + * 文件路径 + */ + @ApiModelProperty(value="文件路径") + private String filePath; + + + /** + * 是否发起告警单 + */ + @ApiModelProperty(value="是否发起告警单") + private Integer initiateWarningFlag; + + + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/leaflet/WarningLeafletController.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/leaflet/WarningLeafletController.java new file mode 100644 index 000000000..bab303148 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/leaflet/WarningLeafletController.java @@ -0,0 +1,65 @@ +package com.njcn.supervision.controller.leaflet; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.njcn.common.pojo.annotation.OperateInfo; +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.vo.leaflet.WarningLeafletVO; +import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam; +import com.njcn.supervision.service.leaflet.IWarningLeafletService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +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; + +/** + *

+ * 预告警单表 前端控制器 + *

+ * + * @author hongawen + * @since 2024-05-21 + */ +@RestController +@RequestMapping("/warningLeaflet") +@Slf4j +@Api(tags = "预告警单表") +@AllArgsConstructor +public class WarningLeafletController extends BaseController { + + private final IWarningLeafletService warningLeafletService; + + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/warningPageData") + @ApiOperation("分页查询当前用户能看到的预警单数据") + @ApiImplicitParam(name = "warningLeafletQueryParam", value = "参数", required = true) + public HttpResult> warningPageData(@RequestBody @Validated WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) { + String methodDescribe = getMethodDescribe("warningPageData"); + Page out = warningLeafletService.warningPageData(warningLeafletQueryParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe); + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/alarmPageData") + @ApiOperation("分页查询当前用户能看到的告警单数据") + @ApiImplicitParam(name = "warningLeafletQueryParam", value = "参数", required = true) + public HttpResult> alarmPageData(@RequestBody @Validated WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) { + String methodDescribe = getMethodDescribe("alarmPageData"); + Page out = warningLeafletService.alarmPageData(warningLeafletQueryParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe); + } + +} + diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/GeneralSurveyController.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/GeneralSurveyController.java index 09e6300e6..147bd445e 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/GeneralSurveyController.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/survey/GeneralSurveyController.java @@ -10,6 +10,7 @@ import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm; import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO; +import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanDetailVO; import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO; import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanPOService; import com.njcn.web.controller.BaseController; @@ -25,7 +26,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; /** - * 干扰源用户管理 + * 谐波普测计划 * * @author qijian * @version 1.0.0 @@ -64,7 +65,6 @@ public class GeneralSurveyController extends BaseController { } - @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("/removeSurvey") @ApiOperation("移除普测计划") @@ -112,7 +112,7 @@ public class GeneralSurveyController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } - @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE) @PostMapping("/cancel") @ApiOperation("取消普测计划") @ApiImplicitParam(name = "cancelReqVO", value = "取消原因", required = true) @@ -123,4 +123,25 @@ public class GeneralSurveyController extends BaseController { } + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/pageProblemSubstationBySurvey") + @ApiOperation("分页查询当前用户能看到的普测计划中存在超标问题") + @ApiImplicitParam(name = "generalSurveyPlanQueryParam", value = "参数", required = true) + public HttpResult> getPageProblemSubstationBySurvey(@RequestBody @Validated SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam ){ + String methodDescribe = getMethodDescribe("pageProblemSubstationBySurvey"); + Page out = supervisionGeneralSurveyPlanPOService.pageProblemSubstationBySurvey(generalSurveyPlanQueryParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe); + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @GetMapping("/initiateWarningLeaflet") + @ApiOperation("针对有问题的现场测试发起告警单") + public HttpResult initiateWarningLeaflet(@RequestParam("id") String id,@RequestParam("subId") String subId){ + String methodDescribe = getMethodDescribe("initiateWarningLeaflet"); + supervisionGeneralSurveyPlanPOService.initiateWarningLeaflet(id,subId); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Boolean.TRUE, methodDescribe); + } + + + } diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/leaflet/WarningLeafletMapper.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/leaflet/WarningLeafletMapper.java new file mode 100644 index 000000000..52abe7e67 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/leaflet/WarningLeafletMapper.java @@ -0,0 +1,23 @@ +package com.njcn.supervision.mapper.leaflet; + +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.leaflet.WarningLeaflet; +import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 预告警单表 Mapper 接口 + *

+ * + * @author hongawen + * @since 2024-05-21 + */ +public interface WarningLeafletMapper extends BaseMapper { + + Page warningPageData(Page objectPage, @Param("ew") QueryWrapper warningLeafletVOQueryWrapper); + + Page alarmPageData(Page objectPage, @Param("ew") QueryWrapper warningLeafletVOQueryWrapper); +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/leaflet/mapping/WarningLeafletMapper.xml b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/leaflet/mapping/WarningLeafletMapper.xml new file mode 100644 index 000000000..de4074bc6 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/leaflet/mapping/WarningLeafletMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SupervisionGeneralSurveyPlanPOMapper.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SupervisionGeneralSurveyPlanPOMapper.java index b081874d5..c4e065bc4 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SupervisionGeneralSurveyPlanPOMapper.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/SupervisionGeneralSurveyPlanPOMapper.java @@ -4,11 +4,11 @@ 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.SupervisionGeneralSurveyPlanPO; +import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanDetailVO; import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO; import org.apache.ibatis.annotations.Param; /** - * * Description: * Date: 2024/5/13 18:35【需求编号】 * @@ -17,4 +17,6 @@ import org.apache.ibatis.annotations.Param; */ public interface SupervisionGeneralSurveyPlanPOMapper extends BaseMapper { Page page(Page objectPage, @Param("ew") QueryWrapper queryWrapper); + + Page pageProblemSubstationBySurvey(Page objectPage, @Param("ew") QueryWrapper supervisionGeneralSurveyPlanDetailVOQueryWrapper); } \ No newline at end of file diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SupervisionGeneralSurveyPlanPOMapper.xml b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SupervisionGeneralSurveyPlanPOMapper.xml index 49fc5fb43..92c940373 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SupervisionGeneralSurveyPlanPOMapper.xml +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/survey/mapping/SupervisionGeneralSurveyPlanPOMapper.xml @@ -1,41 +1,59 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - plan_no, org_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, process_instance_id, - upload_time, Create_By, Create_Time, Update_By, Update_Time, `State` - + + + + + + + + + + + + + + + + + + + + + + + + + + + plan_no, org_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, process_instance_id, + upload_time, Create_By, Create_Time, Update_By, Update_Time, `State` + - + + + + \ No newline at end of file diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/IWarningLeafletService.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/IWarningLeafletService.java new file mode 100644 index 000000000..e3f137a7c --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/IWarningLeafletService.java @@ -0,0 +1,32 @@ +package com.njcn.supervision.service.leaflet; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam; +import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet; +import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO; + +/** + *

+ * 预告警单表 服务类 + *

+ * + * @author hongawen + * @since 2024-05-21 + */ +public interface IWarningLeafletService extends IService { + + /** + * 创建预告警单,此时还没有走流程,等待用户上传反馈单后,才正式进入工作流阶段 + * name:预告警单名称,此处暂时用普测计划名称+变电站名称组成预告警单名 + * code:预告警编号暂时随机by yxb + * id:对应问题源id,用于查询详细数据 + * problemType:问题类型:1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标,此处是现场测试超标 + * leaflet:单子类型:1:预警单;2:告警单 + */ + void createLeaflet(String name, String code, String id, Integer problemType, Integer leaflet); + + Page alarmPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam); + + Page warningPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam); +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java new file mode 100644 index 000000000..48b9f80e3 --- /dev/null +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java @@ -0,0 +1,90 @@ +package com.njcn.supervision.service.leaflet.impl; + +import cn.hutool.core.date.DateUtil; +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.common.pojo.enums.common.DataStateEnum; +import com.njcn.supervision.enums.FlowStatusEnum; +import com.njcn.supervision.enums.LeafletTypeEnum; +import com.njcn.supervision.mapper.leaflet.WarningLeafletMapper; +import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam; +import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet; +import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO; +import com.njcn.supervision.service.leaflet.IWarningLeafletService; +import com.njcn.user.api.UserFeignClient; +import com.njcn.web.factory.PageFactory; +import com.njcn.web.utils.RequestUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +/** + *

+ * 预告警单表 服务实现类 + *

+ * + * @author hongawen + * @since 2024-05-21 + */ +@Service +@RequiredArgsConstructor +public class WarningLeafletServiceImpl extends ServiceImpl implements IWarningLeafletService { + + private final UserFeignClient userFeignClient; + + /** + * 不创建工作流,只是创建一个告警单,需要待用户反馈后才会进入流程 + */ + @Override + public void createLeaflet(String name, String code, String id, Integer problemType, Integer leaflet) { + WarningLeaflet warningLeaflet = new WarningLeaflet(); + warningLeaflet.setLeafletName(name); + warningLeaflet.setLeafletNo(code); + warningLeaflet.setProblemType(problemType); + warningLeaflet.setProblemId(id); + warningLeaflet.setLeafletType(leaflet); + warningLeaflet.setState(DataStateEnum.ENABLE.getCode()); + warningLeaflet.setStatus(FlowStatusEnum.NO_FEEDBACK.getCode()); + this.baseMapper.insert(warningLeaflet); + } + + @Override + public Page warningPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) { + QueryWrapper warningLeafletVOQueryWrapper = new QueryWrapper<>(); + if (Objects.nonNull(warningLeafletQueryParam)) { + //添加上时间范围 + warningLeafletVOQueryWrapper.between("supervision_warning_leaflet.Create_Time", + DateUtil.beginOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchBeginTime())), + DateUtil.endOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchEndTime()))); + } + //获取当前用户部门所有同事的id,查看该部门下所有的数据 + List colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData(); + warningLeafletVOQueryWrapper.in("supervision_warning_leaflet.Create_By", colleaguesIds) + .eq("supervision_warning_leaflet.state",DataStateEnum.ENABLE.getCode()) + .eq("supervision_warning_leaflet.leaflet_type", LeafletTypeEnum.WARNING.getCode()) + .orderByDesc("supervision_warning_leaflet.Update_Time"); + return this.baseMapper.warningPageData(new Page<>(PageFactory.getPageNum(warningLeafletQueryParam), PageFactory.getPageSize(warningLeafletQueryParam)), warningLeafletVOQueryWrapper); + } + + @Override + public Page alarmPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) { + QueryWrapper warningLeafletVOQueryWrapper = new QueryWrapper<>(); + if (Objects.nonNull(warningLeafletQueryParam)) { + //添加上时间范围 + warningLeafletVOQueryWrapper.between("supervision_warning_leaflet.Create_Time", + DateUtil.beginOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchBeginTime())), + DateUtil.endOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchEndTime()))); + } + //获取当前用户部门所有同事的id,查看该部门下所有的数据 + List colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData(); + warningLeafletVOQueryWrapper.in("supervision_warning_leaflet.Create_By", colleaguesIds) + .eq("supervision_warning_leaflet.state",DataStateEnum.ENABLE.getCode()) + .eq("supervision_warning_leaflet.leaflet_type", LeafletTypeEnum.ALARM.getCode()) + .orderByDesc("supervision_warning_leaflet.Update_Time"); + return this.baseMapper.alarmPageData(new Page<>(PageFactory.getPageNum(warningLeafletQueryParam), PageFactory.getPageSize(warningLeafletQueryParam)), warningLeafletVOQueryWrapper); + + } +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/SupervisionGeneralSurveyPlanPOService.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/SupervisionGeneralSurveyPlanPOService.java index a612d7e35..7d7dcf9a4 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/SupervisionGeneralSurveyPlanPOService.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/SupervisionGeneralSurveyPlanPOService.java @@ -6,34 +6,46 @@ import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm; import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO; import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO; +import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanDetailVO; import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO; import java.util.List; /** - * * Description: * Date: 2024/5/13 18:35【需求编号】 * * @author clam * @version V1.0.0 */ -public interface SupervisionGeneralSurveyPlanPOService extends IService{ +public interface SupervisionGeneralSurveyPlanPOService extends IService { - String addDevReport(SupervisionGeneralSurveyPlanParm supervisionGeneralSurveyPlanParm); + String addDevReport(SupervisionGeneralSurveyPlanParm supervisionGeneralSurveyPlanParm); - boolean auditSurvey(SupervisionGeneralSurveyPlanParm.SupervisionGeneralSurveyPlanUpdate supervisionGeneralSurveyPlanUpdate); + boolean auditSurvey(SupervisionGeneralSurveyPlanParm.SupervisionGeneralSurveyPlanUpdate supervisionGeneralSurveyPlanUpdate); - Boolean removeSurvey(List ids); + Boolean removeSurvey(List ids); Page getSurvey(SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam); + /** + * 分页查询当前用户能看到的普测计划中存在超标问题 + */ + Page pageProblemSubstationBySurvey(SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam); + SupervisionGeneralSurveyPlanVO querySurveyDetail(String id); List initDetpStataionTree(String orgId); - void updateStatus(String businessKey, Integer status); + void updateStatus(String businessKey, Integer status); String cancelGeneralSurvey(BpmProcessInstanceCancelParam cancelReqVO); + + + /** + * 针对有问题的现场测试发起告警单 + * @param id 有问题的测试记录id + */ + void initiateWarningLeaflet(String id,String subId); } diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SupervisionGeneralSurveyPlanPOServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SupervisionGeneralSurveyPlanPOServiceImpl.java index fd5c227cd..ad25a47a5 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SupervisionGeneralSurveyPlanPOServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SupervisionGeneralSurveyPlanPOServiceImpl.java @@ -2,9 +2,13 @@ package com.njcn.supervision.service.survey.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; +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.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.bpm.api.BpmProcessFeignClient; @@ -14,6 +18,7 @@ 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.exception.BusinessException; +import com.njcn.common.pojo.response.HttpResult; import com.njcn.device.biz.commApi.CommTerminalGeneralClient; import com.njcn.device.biz.pojo.dto.SubGetBase; import com.njcn.device.biz.pojo.param.SubstationParam; @@ -21,15 +26,20 @@ import com.njcn.device.pq.api.LineFeignClient; import com.njcn.device.pq.pojo.po.Line; import com.njcn.device.pq.pojo.vo.LineDetailDataVO; import com.njcn.supervision.enums.FlowStatusEnum; +import com.njcn.supervision.enums.LeafletTypeEnum; +import com.njcn.supervision.enums.ProblemTypeEnum; import com.njcn.supervision.mapper.survey.SupervisionGeneralSurveyPlanPOMapper; import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm; import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanDetailPO; import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO; import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO; +import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanDetailVO; import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO; +import com.njcn.supervision.service.leaflet.IWarningLeafletService; import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanDetailPOService; import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanPOService; import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.api.UserFeignClient; import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.web.factory.PageFactory; import com.njcn.web.utils.RequestUtil; @@ -52,7 +62,7 @@ import java.util.stream.Collectors; */ @Service @RequiredArgsConstructor -public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl implements SupervisionGeneralSurveyPlanPOService{ +public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl implements SupervisionGeneralSurveyPlanPOService { /** * 用户信息建档对应的流程定义 KEY todo 修改成普测的key */ @@ -63,6 +73,8 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl stationList = commTerminalGeneralClient.tagOrIdGetSub(param).getData(); @@ -91,11 +103,11 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl lines= lineFeignClient.getSubIndexLineDetail(stat.getId()).getData(); - if(CollectionUtil.isEmpty(lines)){ + List lines = lineFeignClient.getSubIndexLineDetail(stat.getId()).getData(); + if (CollectionUtil.isEmpty(lines)) { supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(""); supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0); - }else { + } else { String subList = lines.stream().map(Line::getName).collect(Collectors.joining(",")); supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(subList); supervisionGeneralSurveyPlanDetailPO.setIsSurvey(1); @@ -111,19 +123,17 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl unitChildrenList = stat.getUnitChildrenList(); - if(CollectionUtil.isEmpty(unitChildrenList)){ + if (CollectionUtil.isEmpty(unitChildrenList)) { supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(""); supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0); - }else { + } else { List data = lineFeignClient.getLineDetailList(unitChildrenList).getData(); String subList = data.stream().map(LineDetailDataVO::getLineName).collect(Collectors.joining(",")); @@ -163,7 +173,7 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl().lambda().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo,planNo)); + supervisionGeneralSurveyPlanDetailPOService.remove(new QueryWrapper().lambda().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, planNo)); supervisionGeneralSurveyPlanDetailPOService.saveOrUpdateBatchByMultiId(supervisionGeneralSurveyPlanDetailPOS, 500); // 发起 BPM 流程 Map processInstanceVariables = new HashMap<>(); @@ -172,7 +182,7 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl ids) { this.lambdaUpdate().set(SupervisionGeneralSurveyPlanPO::getState, 0).in(SupervisionGeneralSurveyPlanPO::getPlanNo, ids).update(); supervisionGeneralSurveyPlanDetailPOService.remove(new QueryWrapper(). - lambda().in(SupervisionGeneralSurveyPlanDetailPO::getPlanNo,ids)); + lambda().in(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, ids)); return true; } @@ -212,7 +222,7 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(generalSurveyPlanQueryParam), PageFactory.getPageSize(generalSurveyPlanQueryParam)), queryWrapper); - page.getRecords().stream().forEach(temp->{ + page.getRecords().stream().forEach(temp -> { temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgNo()).getData().getName())); //获取普测下电站详情 List list = supervisionGeneralSurveyPlanDetailPOService.lambdaQuery().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, temp.getPlanNo()).list(); @@ -224,11 +234,31 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl pageProblemSubstationBySurvey(SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam) { + QueryWrapper supervisionGeneralSurveyPlanDetailVOQueryWrapper = new QueryWrapper<>(); + if (Objects.nonNull(generalSurveyPlanQueryParam)) { + //添加上时间范围 + supervisionGeneralSurveyPlanDetailVOQueryWrapper.between("supervision_general_survey_plan_detail.Create_Time", + DateUtil.beginOfDay(DateUtil.parse(generalSurveyPlanQueryParam.getSearchBeginTime())), + DateUtil.endOfDay(DateUtil.parse(generalSurveyPlanQueryParam.getSearchEndTime()))); + } + //获取当前用户部门所有同事的id,查看该部门下所有的数据 + List colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData(); + supervisionGeneralSurveyPlanDetailVOQueryWrapper.in("supervision_general_survey_plan_detail.Create_By", colleaguesIds) + .eq("supervision_general_survey_plan.status", BpmProcessInstanceStatusEnum.APPROVE.getStatus()) + .orderByDesc("supervision_general_survey_plan_detail.Update_Time"); + Page page = this.baseMapper.pageProblemSubstationBySurvey(new Page<>(PageFactory.getPageNum(generalSurveyPlanQueryParam), PageFactory.getPageSize(generalSurveyPlanQueryParam)), supervisionGeneralSurveyPlanDetailVOQueryWrapper); + //填充部门名称 + page.getRecords().forEach(temp -> temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgNo()).getData().getName()))); + return page; + } + @Override public SupervisionGeneralSurveyPlanVO querySurveyDetail(String id) { SupervisionGeneralSurveyPlanVO supervisionGeneralSurveyPlanVO = new SupervisionGeneralSurveyPlanVO(); SupervisionGeneralSurveyPlanPO byId = this.getById(id); - BeanUtils.copyProperties(byId,supervisionGeneralSurveyPlanVO); + BeanUtils.copyProperties(byId, supervisionGeneralSurveyPlanVO); //获取普测下电站详情 List list = supervisionGeneralSurveyPlanDetailPOService.lambdaQuery().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id).list(); supervisionGeneralSurveyPlanVO.setSupervisionGeneralSurveyPlanDetailPOS(list); @@ -282,7 +312,7 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl detailPOLambdaQueryWrapper = new LambdaQueryWrapper<>(); + detailPOLambdaQueryWrapper.eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id) + .eq(SupervisionGeneralSurveyPlanDetailPO::getSubId, subId); + SupervisionGeneralSurveyPlanDetailPO detailPlan = supervisionGeneralSurveyPlanDetailPOService.getOne(detailPOLambdaQueryWrapper); + SupervisionGeneralSurveyPlanPO generalSurveyPlan = this.getById(id); + /* + * 1、预告警单名称,此处暂时用普测计划名称+变电站名称组成预告警单名 + * 2、预告警编号暂时随机by yxb + * 3、问题类型:1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标,此处是现场测试超标 + * 4、对应问题源id,用于查询详细数据 + * 5、单子类型:1:预警单;2:告警单 + * */ + warningLeafletService.createLeaflet( + generalSurveyPlan.getPlanName().concat(StrPool.UNDERLINE).concat(detailPlan.getSubName()), + IdWorker.get32UUID(), + id, + ProblemTypeEnum.SITE_TEST.getCode(), + LeafletTypeEnum.ALARM.getCode() + ); + //将当前的问题记录是否告警修改为已告警 + LambdaUpdateWrapper detailPOLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); + detailPOLambdaUpdateWrapper.set(SupervisionGeneralSurveyPlanDetailPO::getInitiateWarningFlag, 1) + .eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id) + .eq(SupervisionGeneralSurveyPlanDetailPO::getSubId, subId); + supervisionGeneralSurveyPlanDetailPOService.update(detailPOLambdaUpdateWrapper); + } + public List recursion(DeptSubstationVO result, String orgdid) { List deptSubstationVOList = new ArrayList<>(); @@ -318,13 +378,13 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>(); userReportPOLambdaQueryWrapper diff --git a/pqs-user/user-api/src/main/java/com/njcn/user/api/UserFeignClient.java b/pqs-user/user-api/src/main/java/com/njcn/user/api/UserFeignClient.java index 54292f4f2..692dc0882 100644 --- a/pqs-user/user-api/src/main/java/com/njcn/user/api/UserFeignClient.java +++ b/pqs-user/user-api/src/main/java/com/njcn/user/api/UserFeignClient.java @@ -124,4 +124,11 @@ public interface UserFeignClient { @PostMapping("/getUserVOByIdList") HttpResult> getUserVOByIdList(@RequestBody List ids); + /** + * 根据用户id获取该用户同部门下所有的所有用户id + * @param id 用户id + */ + @GetMapping("/getColleaguesIdByUserId") + HttpResult> getColleaguesIdByUserId(@RequestParam("id") String id); + } diff --git a/pqs-user/user-api/src/main/java/com/njcn/user/api/fallback/UserFeignClientFallbackFactory.java b/pqs-user/user-api/src/main/java/com/njcn/user/api/fallback/UserFeignClientFallbackFactory.java index 6967acbf2..45f493dfb 100644 --- a/pqs-user/user-api/src/main/java/com/njcn/user/api/fallback/UserFeignClientFallbackFactory.java +++ b/pqs-user/user-api/src/main/java/com/njcn/user/api/fallback/UserFeignClientFallbackFactory.java @@ -117,6 +117,12 @@ public class UserFeignClientFallbackFactory implements FallbackFactory> getColleaguesIdByUserId(String id) { + log.error("{}异常,降级处理,异常为:{}","根据用户id获取该用户同部门下所有的所有用户id",cause.toString()); + throw new BusinessException(finalExceptionEnum); + } + }; } } diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/controller/UserController.java b/pqs-user/user-boot/src/main/java/com/njcn/user/controller/UserController.java index bd93d4282..acc45b2c5 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/controller/UserController.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/controller/UserController.java @@ -282,6 +282,24 @@ public class UserController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userVO, methodDescribe); } + + /** + * 根据用户id获取该用户同部门下所有的所有用户id + * + * @param id 用户id + */ + @ApiIgnore + @GetMapping("/getColleaguesIdByUserId") + @OperateInfo(info = LogEnum.SYSTEM_COMMON) + @ApiOperation("根据用户id获取该用户同部门下所有的所有用户id") + @ApiImplicitParam(name = "id", value = "用户id", required = true) + HttpResult> getColleaguesIdByUserId(@RequestParam("id") String id) { + String methodDescribe = getMethodDescribe("getColleaguesIdByUserId"); + LogUtil.njcnDebug(log, "{},用户id为:{}", methodDescribe, id); + List colleagueIds = userService.getColleaguesIdByUserId(id); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, colleagueIds, methodDescribe); + } + /** * 审核用户 * diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/service/IUserService.java b/pqs-user/user-boot/src/main/java/com/njcn/user/service/IUserService.java index f5bf513f7..9394f5523 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/service/IUserService.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/service/IUserService.java @@ -200,4 +200,5 @@ public interface IUserService extends IService { List simpleList(); + List getColleaguesIdByUserId(String id); } 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 ef250ab95..8c5bd7576 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 @@ -573,6 +573,19 @@ public class UserServiceImpl extends ServiceImpl implements IU return this.baseMapper.selectList(userLambdaQueryWrapper); } + @Override + public List getColleaguesIdByUserId(String id) { + User user = this.baseMapper.selectById(id); + //根据当前部门id获取所有子部门的id,包含当前用户部门 + List deptIds = deptService.getDepSonIdtByDeptId(user.getDeptId()); + //获取这些部门下所有的用户id + LambdaQueryWrapper userLambdaQueryWrapper = new LambdaQueryWrapper<>(); + userLambdaQueryWrapper.select(User::getId).in(User::getDeptId,deptIds); + List userList = this.baseMapper.selectList(userLambdaQueryWrapper); + //所有用户的id + return userList.stream().map(User::getId).collect(Collectors.toList()); + } + /** * 根据登录名查询用户 *