From aca47f35ffcca64bd1ad302073ccc6307e908eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E6=9C=A8c?= <857448963@qq.com> Date: Tue, 27 Jun 2023 16:47:16 +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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/device/biz/pojo/dto/DeptGetBase.java | 7 + .../impl/CommTerminalServiceImpl.java | 2 + .../{PublicDTO.java => ProcessPublicDTO.java} | 4 +- .../process/pojo/param/SupvPlanParam.java | 24 +- .../process/pojo/param/SupvProblemParam.java | 10 + .../com/njcn/process/pojo/po/SupvPlan.java | 35 +++ .../com/njcn/process/pojo/po/SupvProblem.java | 18 ++ .../com/njcn/process/pojo/po/SupvReportM.java | 207 ++++++++++++++ .../com/njcn/process/pojo/vo/SupvPlanVO.java | 38 ++- .../controller/SupvMonthStatisController.java | 37 ++- .../controller/SupvProblemController.java | 9 + .../process/mapper/SupvReportMMapper.java | 28 ++ .../mapper/mapping/SupvReportMMapper.xml | 34 +++ .../process/service/ISupvReportMService.java | 32 +++ .../service/impl/SupvPlanServiceImpl.java | 59 ++-- .../service/impl/SupvProblemServiceImpl.java | 26 +- .../service/impl/SupvReportMServiceImpl.java | 256 ++++++++++++++++++ .../com/njcn/system/enums/DicDataEnum.java | 16 +- .../njcn/system/enums/DicDataTypeEnum.java | 9 +- 19 files changed, 812 insertions(+), 39 deletions(-) rename pqs-process/process-api/src/main/java/com/njcn/process/pojo/dto/{PublicDTO.java => ProcessPublicDTO.java} (77%) create mode 100644 pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvReportM.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvReportMMapper.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvReportMMapper.xml create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvReportMService.java create mode 100644 pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvReportMServiceImpl.java diff --git a/pqs-device/common-device-biz/src/main/java/com/njcn/device/biz/pojo/dto/DeptGetBase.java b/pqs-device/common-device-biz/src/main/java/com/njcn/device/biz/pojo/dto/DeptGetBase.java index be242b28d..fb631de03 100644 --- a/pqs-device/common-device-biz/src/main/java/com/njcn/device/biz/pojo/dto/DeptGetBase.java +++ b/pqs-device/common-device-biz/src/main/java/com/njcn/device/biz/pojo/dto/DeptGetBase.java @@ -26,6 +26,13 @@ public class DeptGetBase implements Serializable { */ private String unitName; + /** + * 部门层级 1.全国 2.省级 3.市级 4.县级 (具体根据单位层级调整) + * @author cdf + * @date 2023/6/26 + */ + private Integer deptLevel; + /** * 所有子级单位索引 */ diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ledgerManger/impl/CommTerminalServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ledgerManger/impl/CommTerminalServiceImpl.java index bffc64f93..2bf0b31b5 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ledgerManger/impl/CommTerminalServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ledgerManger/impl/CommTerminalServiceImpl.java @@ -1,6 +1,7 @@ package com.njcn.device.pms.service.ledgerManger.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.njcn.common.pojo.enums.common.ServerEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum; @@ -99,6 +100,7 @@ public class CommTerminalServiceImpl implements CommTerminalService { List deptChildren = deptDTOList.stream().filter(deptDTO -> deptDTO.getPids().contains(it.getId())).map(DeptDTO::getCode).collect(Collectors.toList()); deptChildren.add(it.getId()); deptGetBase.setUnitChildrenList(deptChildren); + deptGetBase.setDeptLevel(it.getPids().split(StrUtil.COMMA).length); result.add(deptGetBase); }); //redisUtil.saveByKey(commTerminal + deptGetLineParam.getDeptId(),result); diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/dto/PublicDTO.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/dto/ProcessPublicDTO.java similarity index 77% rename from pqs-process/process-api/src/main/java/com/njcn/process/pojo/dto/PublicDTO.java rename to pqs-process/process-api/src/main/java/com/njcn/process/pojo/dto/ProcessPublicDTO.java index 9136383c7..502b68811 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/dto/PublicDTO.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/dto/ProcessPublicDTO.java @@ -10,9 +10,9 @@ import lombok.Data; * @createTime 2022/11/11 10:34 */ @Data -public class PublicDTO { +public class ProcessPublicDTO { private String id; - private String date; + private Integer value; } 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 index f698c0dfb..e9abc8b7c 100644 --- 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 @@ -92,9 +92,21 @@ public class SupvPlanParam extends BaseParam { * 关联电站 */ @ApiModelProperty(value = "关联电站") - @NotBlank(message = "关联电站不可为空") private String objRelationStation; + @ApiModelProperty(value = "关联电站电压等级") + private String substationVoltageLevel; + + + @ApiModelProperty(value = "监督对象属性") + private String objType; + + @ApiModelProperty(value = "监督对象属性名称") + private String objTypeName; + + @ApiModelProperty(value = "监督对象协议容量(MVA)") + private Double objCapacity; + /** * 计划执行开始时间 */ @@ -123,6 +135,7 @@ public class SupvPlanParam extends BaseParam { */ @ApiModelProperty(value = "电能质量问题发生时间",required = true) @DateTimeStrValid(message = "电能质量问题发生时间格式有误",format = "yyyy-MM-dd HH:mm:ss") + @NotBlank(message = "电能质量问题发生时间不可为空") private String problemOcTime; /** @@ -132,6 +145,15 @@ public class SupvPlanParam extends BaseParam { private String planRemark; + /** + * 计划编制单位id + */ + @ApiModelProperty(value = "计划编制单位id") + @NotBlank(message = "计划编制单位id不可为空") + private String planOrgId; + + + @EqualsAndHashCode(callSuper = true) @Data 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 index 3aa9cc254..07e19af1d 100644 --- 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 @@ -120,6 +120,16 @@ public class SupvProblemParam extends BaseParam { @NotBlank(message = "整改方案不可为空") private String rectificationProgramme; + @ApiModelProperty(value = "整改措施") + private String rectificationMeasure; + + /** + * 整改情况01已整改,02未整改 + */ + @ApiModelProperty(value = "整改情况",required = true) + @NotBlank(message = "整改情况不可为空") + private String rectificationStatus; + @EqualsAndHashCode(callSuper = true) @Data public static class UpdateSupvProblemParam extends SupvProblemParam{ 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 index 26c039d2b..2db4b04e8 100644 --- 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 @@ -8,6 +8,7 @@ import java.io.Serializable; import java.time.LocalDate; import java.time.LocalDateTime; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.Getter; import lombok.Setter; @@ -75,6 +76,28 @@ public class SupvPlan extends BaseEntity { */ private String objRelationStation; + + /** + * 关联电站电压等级 + */ + private String substationVoltageLevel; + + + /** + * 监督对象属性 + */ + private String objType; + + /** + * 监督对象属性名称 + */ + private String objTypeName; + + /** + * 监督对象协议容量(MVA) + */ + private Double objCapacity; + /** * 计划执行开始时间 */ @@ -104,6 +127,18 @@ public class SupvPlan extends BaseEntity { */ private String planRemark; + /** + * 计划编制人id + */ + private String planUserId; + + /** + * 计划编制单位id + */ + private String planOrgId; + + + /** * 0.未上送 1.上送 2.取消上送 */ 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 index 2796c4447..770f8054c 100644 --- 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 @@ -1,5 +1,6 @@ package com.njcn.process.pojo.po; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.njcn.db.bo.BaseEntity; @@ -7,11 +8,14 @@ import java.io.Serializable; import java.time.LocalDate; import java.time.LocalDateTime; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; +import javax.validation.constraints.NotBlank; + /** *

* @@ -40,6 +44,9 @@ public class SupvProblem extends BaseEntity { */ private String dutyOrgId; + @TableField(exist = false) + private String dutyOrgName; + /** * 监测点类型 ,仅供电电压监督计划必填 */ @@ -95,6 +102,17 @@ public class SupvProblem extends BaseEntity { */ private String rectificationProgramme; + /** + * 整改情况01已整改,02未整改 + */ + private String rectificationStatus; + + + /** + * 整改措施 + */ + private String rectificationMeasure; + } diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvReportM.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvReportM.java new file mode 100644 index 000000000..90ee90ed5 --- /dev/null +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvReportM.java @@ -0,0 +1,207 @@ +package com.njcn.process.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.github.jeffreyning.mybatisplus.anno.MppMultiId; +import com.njcn.db.bo.BaseEntity; +import java.io.Serializable; +import java.time.LocalDate; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +/** + *

+ * + *

+ * + * @author hongawen + * @since 2023-06-26 + */ +@Data +@TableName("supv_report_m") +public class SupvReportM { + + private static final long serialVersionUID = 1L; + + @TableId + private String monthReportId; + + @MppMultiId + private LocalDate statisticsDate; + + @MppMultiId + private String statisticsDept; + + private String statisticsLevel; + + private String provinceId; + + private String provinceName; + + private String cityId; + + private String cityName; + + private String countyId; + + private String countyName; + + /** + * 特高压换流站本年计划监督数量 + */ + private Integer convertYearSupvNum; + + /** + * 特高压换流站月监督数量 + */ + private Integer convertMonthSupvNum; + + /** + * 特高压换流站累计监督数量 + */ + private Integer convertTotalSupvNum; + + /** + * 特高压换流站本月问题数量 + */ + private Integer convertMonthQuesNum; + + /** + * 特高压换流站累计问题数量 + */ + private Integer convertTotalQuesNum; + + /** + * 特高压换流站本月整改问题数量 + */ + private Integer convertMonthReformNum; + + /** + * 特高压换流站累计整改问题数量 + */ + private Integer convertTotalReformNum; + + /** + * 新能源场站本年计划监督数量 + */ + private Integer energyYearSupvNum; + + /** + * 新能源场站月监督数量 + */ + private Integer energyMonthSupvNum; + + /** + * 新能源场站累计监督数量 + */ + private Integer energyTotalSupvNum; + + /** + * 新能源场站本月问题数量 + */ + private Integer energyMonthQuesNum; + + /** + * 新能源场站累计问题数量 + */ + private Integer energyTotalQuesNum; + + /** + * 新能源场站本月整改问题数量 + */ + private Integer energyMonthReformNum; + + /** + * 新能源场站累计整改问题数量 + */ + private Integer energyTotalReformNum; + + /** + * 新能源场站本年计划监督新(改扩建)数量 + */ + private Integer energyYearSupvNewNum; + + /** + * 新能源场站本月监督新(改扩建)数量 + */ + private Integer energyMonthSupvNewNum; + + /** + * 新能源场站累计监督新(改扩建)数量 + */ + private Integer energyTotalSupvNewNum; + + /** + * 新能源场站本月问题新(改扩建)数量 + */ + private Integer energyMonthQuesNewNum; + + /** + * 新能源场站累计问题新(改扩建)数量 + */ + private Integer energyTotalQuesNewNum; + + /** + * 新能源场站本月新(改扩建)整改问题数量 + */ + private Integer energyMonthReformNewNum; + + /** + * 新能源场站累计新(改扩建)整改问题数量 + */ + private Integer energyTotalReformNewNum; + + /** + * 电能质量敏感用户本年计划监督数量 + */ + private Integer sensitiveYearSupvNum; + + /** + * 电能质量敏感用户本月监督数量 + */ + private Integer sensitiveMonthSupvNum; + + /** + * 电能质量敏感 + */ + private Integer sensitiveTotalSupvNum; + + /** + * 用户累计监督数量 + */ + private Integer supvNum; + + /** + * 电能质量敏感用户本月问题数量 + */ + private Integer sensitiveMonthQuesNum; + + /** + * 电能质量敏感用户累计问题数量 + */ + private Integer sensitiveTotalQuesNum; + + /** + * 电能质量敏感用户本月整改问题数量 + */ + private Integer sensitiveMonthReformNum; + + /** + * 电能质量敏感用户累计整改问题数量 + */ + private Integer sensitiveTotalReformNum; + + /** + * 供电电压计划本月前开展数量 + */ + private Integer powerMonthPlanNum; + + /** + * 供电电压本月前已开展数量 + */ + private Integer powerTotalConductedNum; + + +} 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 index 31d14e433..d98f4d0df 100644 --- 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 @@ -1,11 +1,13 @@ package com.njcn.process.pojo.vo; +import com.fasterxml.jackson.annotation.JsonFormat; 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; +import java.time.LocalDateTime; /** * pqs @@ -34,6 +36,18 @@ public class SupvPlanVO { @ApiModelProperty(value = "监督单位名称",required = true) private String supvOrgName; + /** + * 计划编制单位id + */ + @ApiModelProperty(value = "计划编制单位id") + private String planOrgId; + + /** + * 计划编制单位名字 + */ + @ApiModelProperty(value = "计划编制单位名字") + private String planOrgName; + /** * 监督类型 */ @@ -76,6 +90,18 @@ public class SupvPlanVO { @ApiModelProperty(value = "关联电站") private String objRelationStation; + @ApiModelProperty(value = "关联电站电压等级") + private String substationVoltageLevel; + + @ApiModelProperty(value = "监督对象属性") + private String objType; + + @ApiModelProperty(value = "监督对象属性名称") + private String objTypeName; + + @ApiModelProperty(value = "监督对象协议容量(MVA)") + private Double objCapacity; + /** * 计划执行开始时间 */ @@ -92,13 +118,15 @@ public class SupvPlanVO { * 报告出具时间 */ @ApiModelProperty(value = "报告出具时间",required = true) - private String reportIssueTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime reportIssueTime; /** * 电能质量问题发生时间 */ @ApiModelProperty(value = "电能质量问题发生时间",required = true) - private String problemOcTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime problemOcTime; /** @@ -119,4 +147,10 @@ public class SupvPlanVO { @ApiModelProperty(value = "附件名称") private String attachmentName; + + /** + * 0.未上送 1.上送 2.取消上送 + */ + @ApiModelProperty(value = "0.未上送 1.上送 2.取消上送") + private Integer isUploadHead; } 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 index 26a3652c6..8b3e337d0 100644 --- 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 @@ -1,5 +1,6 @@ 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; @@ -7,7 +8,10 @@ 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.SupvReportM; +import com.njcn.process.service.ISupvReportMService; import com.njcn.web.controller.BaseController; +import com.njcn.web.pojo.param.BaseParam; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; @@ -18,6 +22,8 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import springfox.documentation.annotations.ApiIgnore; +import java.time.LocalDate; + /** * pqs * 月度统计 @@ -30,14 +36,37 @@ import springfox.documentation.annotations.ApiIgnore; @RequiredArgsConstructor public class SupvMonthStatisController extends BaseController { + private final ISupvReportMService iSupvReportMService; + + /** + * + * @author cdf + * @date 2023/6/27 + */ @PostMapping("statisticReport") @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) - @ApiIgnore - public HttpResult statisticReport(@RequestBody @Validated SupvPlanParam supvPlanParam){ + @ApiOperation("监督月报统计") + public HttpResult statisticReport(@RequestParam("timeId")String timeId){ String methodDescribe = getMethodDescribe("statisticReport"); - - return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + LocalDate localDate = LocalDate.parse(timeId); + + boolean flag = iSupvReportMService.statisticSuperviseReport(localDate); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe); + } + + /** + * 查询阅读监督报告 + * @author cdf + * @date 2023/6/27 + */ + @PostMapping("statisticReportPage") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("查询监督月报") + public HttpResult> statisticReportPage(BaseParam baseParam){ + String methodDescribe = getMethodDescribe("statisticReportPage"); + Page page = iSupvReportMService.statisticReportPage(baseParam); + 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 index 1846d9333..ea5889a6c 100644 --- 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 @@ -13,6 +13,9 @@ 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 com.njcn.system.api.DicDataFeignClient; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.vo.PvTerminalTreeVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; @@ -26,6 +29,9 @@ import org.springframework.web.bind.annotation.RestController; import com.njcn.web.controller.BaseController; import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** *

@@ -44,6 +50,8 @@ public class SupvProblemController extends BaseController { private final ISupvProblemService iSupvProblemService; + + @PostMapping("addProblem") @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) @ApiOperation("新增技术监督问题") @@ -84,6 +92,7 @@ public class SupvProblemController extends BaseController { 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/SupvReportMMapper.java b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvReportMMapper.java new file mode 100644 index 000000000..17ec7cd9b --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvReportMMapper.java @@ -0,0 +1,28 @@ +package com.njcn.process.mapper; + + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.process.pojo.dto.ProcessPublicDTO; +import com.njcn.process.pojo.po.SupvReportM; +import org.apache.ibatis.annotations.Param; + +import java.time.LocalDateTime; +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author hongawen + * @since 2023-06-26 + */ +public interface SupvReportMMapper extends MppBaseMapper { + + List statisticPlanReport(@Param("startTime")LocalDateTime startTime, @Param("endTime")LocalDateTime endTime, @Param("statisticType")String statisticType,@Param("objType")String objType); + + + List statisticQueReport(@Param("startTime")LocalDateTime startTime, @Param("endTime")LocalDateTime endTime, @Param("statisticType")String statisticType,@Param("rectificationStatus")String rectificationStatus,@Param("objType")String objType); +} diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvReportMMapper.xml b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvReportMMapper.xml new file mode 100644 index 000000000..f57c10025 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/mapping/SupvReportMMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvReportMService.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvReportMService.java new file mode 100644 index 000000000..970f95ae1 --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvReportMService.java @@ -0,0 +1,32 @@ +package com.njcn.process.service; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.process.pojo.po.SupvReportM; +import com.njcn.web.pojo.param.BaseParam; + +import java.time.LocalDate; +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author hongawen + * @since 2023-06-26 + */ +public interface ISupvReportMService extends IMppService { + + /** + * 统计监督月报 + * @author cdf + * @date 2023/6/26 + */ + boolean statisticSuperviseReport(LocalDate timeId); + + Page statisticReportPage(BaseParam baseParam); + +} 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 index 5f89e768b..1b375ccfa 100644 --- 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 @@ -24,6 +24,7 @@ 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 com.njcn.web.utils.RequestUtil; import liquibase.pro.packaged.L; import liquibase.pro.packaged.S; import lombok.RequiredArgsConstructor; @@ -65,6 +66,7 @@ public class SupvPlanServiceImpl extends ServiceImpl i supvPlan.setProblemOcTime(PubUtils.localDateTimeFormat(supvPlanParam.getProblemOcTime())); supvPlan.setReportIssueTime(PubUtils.localDateTimeFormat(supvPlanParam.getReportIssueTime())); supvPlan.setIsUploadHead(0); + supvPlan.setPlanUserId(RequestUtil.getUserIndex()); this.save(supvPlan); return true; } @@ -85,6 +87,12 @@ public class SupvPlanServiceImpl extends ServiceImpl i @Override public boolean delPlan(List planIds) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(SupvPlan::getIsUploadHead,1).eq(SupvPlan::getPlanId,planIds); + int count = this.count(lambdaQueryWrapper); + if(count > 0){ + throw new BusinessException("请选择未上送国网的删除"); + } return this.removeByIds(planIds); } @@ -92,26 +100,38 @@ public class SupvPlanServiceImpl extends ServiceImpl i public Page pagePlan(SupvPlanParam supvPlanParam) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); if(StrUtil.isNotBlank(supvPlanParam.getSupvOrgId())){ - List deptIds = deptChildrenList(supvPlanParam.getSupvOrgId()); + List deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(supvPlanParam.getSupvOrgId()).getData(); lambdaQueryWrapper.in(SupvPlan::getSupvOrgId,deptIds); } - Map mapCode = deptAllCodeList(); - Map mapList = deptAllList(); + List deptList = deptFeignClient.allDeptList().getData(); + Map mapCode = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getCode, Function.identity())); + Map mapList = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, Function.identity())); + 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 pvTerminalTreeVO = null; + if(mapCode.containsKey(item.getSupvOrgId())) { + pvTerminalTreeVO = mapCode.get(item.getSupvOrgId()); + item.setSupvOrgName(pvTerminalTreeVO.getName()); + item.setCounty(pvTerminalTreeVO.getName()); + if(mapList.containsKey(pvTerminalTreeVO.getPid())) { + PvTerminalTreeVO pvTerminalTreeOne = mapList.get(pvTerminalTreeVO.getPid()); + if (Objects.nonNull(pvTerminalTreeOne)) { + item.setCity(pvTerminalTreeOne.getName()); + if(mapList.containsKey(pvTerminalTreeOne.getPid())) { + PvTerminalTreeVO pvTerminalTreeTwo = mapList.get(pvTerminalTreeOne.getPid()); + if (Objects.nonNull(pvTerminalTreeTwo)) { + item.setProvince(pvTerminalTreeTwo.getName()); + } + } + } + } } - PvTerminalTreeVO pvTerminalTreeTwo = mapList.get(pvTerminalTreeOne.getPid()); - if(Objects.nonNull(pvTerminalTreeTwo)){ - item.setProvince(pvTerminalTreeTwo.getName()); + if(mapCode.containsKey(item.getPlanOrgId())) { + item.setPlanOrgName(mapCode.get(item.getPlanOrgId()).getName()); } SupvFile supvFile = supvFileMapper.selectOne(new LambdaQueryWrapper().eq(SupvFile::getBusiId,item.getPlanId()).eq(SupvFile::getType,0)); @@ -152,20 +172,5 @@ public class SupvPlanServiceImpl extends ServiceImpl i } - @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 index 397ad462b..ce14bf030 100644 --- 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 @@ -13,10 +13,17 @@ 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.system.api.DicDataFeignClient; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.web.factory.PageFactory; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** *

@@ -27,8 +34,13 @@ import java.util.List; * @since 2023-06-21 */ @Service +@RequiredArgsConstructor public class SupvProblemServiceImpl extends ServiceImpl implements ISupvProblemService { + private final DicDataFeignClient dicDataFeignClient; + + private final DeptFeignClient deptFeignClient; + @Override public boolean addProblem(SupvProblemParam supvProblemParam) { SupvProblem supvProblem = new SupvProblem(); @@ -56,9 +68,21 @@ public class SupvProblemServiceImpl extends ServiceImpl 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); + Page page = this.page(new Page<>(PageFactory.getPageNum(supvProblemParam), PageFactory.getPageSize(supvProblemParam)),lambdaQueryWrapper); + + List deptList = deptFeignClient.allDeptList().getData(); + Map mapCode = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getCode, Function.identity())); + + + for (SupvProblem item : page.getRecords()) { + if(mapCode.containsKey(item.getDutyOrgId())) { + item.setDutyOrgName(mapCode.get(item.getDutyOrgId()).getName()); + } + } + return page; } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvReportMServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvReportMServiceImpl.java new file mode 100644 index 000000000..5c5f7339f --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvReportMServiceImpl.java @@ -0,0 +1,256 @@ +package com.njcn.process.service.impl; + + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.util.StrUtil; +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.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.common.utils.PubUtils; +import com.njcn.device.biz.commApi.CommLedgerDeptClient; +import com.njcn.device.biz.commApi.CommTerminalGeneralClient; +import com.njcn.device.biz.pojo.dto.DeptGetBase; +import com.njcn.device.biz.pojo.param.DeptGetLineParam; +import com.njcn.process.mapper.SupvReportMMapper; +import com.njcn.process.pojo.dto.ProcessPublicDTO; +import com.njcn.process.pojo.po.SupvReportM; +import com.njcn.process.service.ISupvReportMService; +import com.njcn.system.api.DicDataFeignClient; +import com.njcn.system.enums.DicDataEnum; +import com.njcn.system.enums.DicDataTypeEnum; +import com.njcn.system.pojo.po.DictData; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.vo.PvTerminalTreeVO; +import com.njcn.web.factory.PageFactory; +import com.njcn.web.pojo.param.BaseParam; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.temporal.TemporalAdjusters; +import java.util.ArrayList; +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-26 + */ +@Service +@RequiredArgsConstructor +public class SupvReportMServiceImpl extends MppServiceImpl implements ISupvReportMService { + + private final CommTerminalGeneralClient commTerminalGeneralClient; + + private final DeptFeignClient deptFeignClient; + + private final DicDataFeignClient dicDataFeignClient; + + @Override + public boolean statisticSuperviseReport(LocalDate timeId) { + + //当月第一天 + LocalDateTime firstDay = timeId.with(TemporalAdjusters.firstDayOfMonth()).atTime(0,0,0); + + //当年第一天 + LocalDateTime firstYearDay = timeId.with(TemporalAdjusters.firstDayOfYear()).atTime(0,0,0); + + LocalDateTime endTime = timeId.atTime(23,59,59); + + List dictDataUhv = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPV_TYPE.getCode()).getData(); + Map mapStatistic = dictDataUhv.stream().collect(Collectors.toMap(DictData::getCode, Function.identity())); + DeptGetLineParam deptGetLineParam = new DeptGetLineParam(); + deptGetLineParam.setDeptId(deptFeignClient.getRootDept().getData().getId()); + List deptGetBaseList = commTerminalGeneralClient.getDeptChildrenByParent(deptGetLineParam).getData(); + + List deptList = deptFeignClient.allDeptList().getData(); + Map mapCode = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getCode, Function.identity())); + Map mapList = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, Function.identity())); + + List processPublicDTOListM = this.baseMapper.statisticPlanReport(firstDay,endTime,mapStatistic.get(DicDataEnum.UHV_Converter.getCode()).getId(),null); + List processPublicDTOListY = this.baseMapper.statisticPlanReport(firstYearDay,endTime,mapStatistic.get(DicDataEnum.UHV_Converter.getCode()).getId(),null); + List processPublicDTOListAll = this.baseMapper.statisticPlanReport(null,null,mapStatistic.get(DicDataEnum.UHV_Converter.getCode()).getId(),null); + + List processPublicDTOListNewM = this.baseMapper.statisticPlanReport(firstDay,endTime,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),null); + List processPublicDTOListNewY = this.baseMapper.statisticPlanReport(firstYearDay,endTime,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),null); + List processPublicDTOListNewAll = this.baseMapper.statisticPlanReport(null,null,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),null); + + List processPublicDTOListNewZM = this.baseMapper.statisticPlanReport(firstDay,endTime,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),"02"); + List processPublicDTOListNewZY = this.baseMapper.statisticPlanReport(firstYearDay,endTime,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),"02"); + List processPublicDTOListNewZAll = this.baseMapper.statisticPlanReport(null,null,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),"02"); + + + //换流站问题总数量 + List processPublicDTOQesM = this.baseMapper.statisticQueReport(firstDay,endTime,mapStatistic.get(DicDataEnum.UHV_Converter.getCode()).getId(),null,null); + List processPublicDTOQesAll = this.baseMapper.statisticQueReport(null,null,mapStatistic.get(DicDataEnum.UHV_Converter.getCode()).getId(),null,null); + + //换流站问题已整改数量 + List processPublicDTOQesYesM = this.baseMapper.statisticQueReport(firstDay,endTime,mapStatistic.get(DicDataEnum.UHV_Converter.getCode()).getId(),"01",null); + List processPublicDTOQesYesAll = this.baseMapper.statisticQueReport(null,null,mapStatistic.get(DicDataEnum.UHV_Converter.getCode()).getId(),"01",null); + + //新能源问题总数量 + List processPublicDTOQesNewM = this.baseMapper.statisticQueReport(firstDay,endTime,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),null,null); + List processPublicDTOQesNewAll = this.baseMapper.statisticQueReport(null,null,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),null,null); + + //新能源问题已整改数量 + List processPublicDTOQesNewYesM = this.baseMapper.statisticQueReport(firstDay,endTime,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),"01",null); + List processPublicDTOQesNewYesAll = this.baseMapper.statisticQueReport(null,null,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),"01",null); + + //新能源改扩建问题数量 + List processPublicDTOQesNewGaiM = this.baseMapper.statisticQueReport(firstDay,endTime,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),null,"02"); + List processPublicDTOQesNewGaiAll = this.baseMapper.statisticQueReport(null,null,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),null,"02"); + + List processPublicDTOQesNewGaiYesM = this.baseMapper.statisticQueReport(firstDay,endTime,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),"01","02"); + List processPublicDTOQesNewGaiYesAll = this.baseMapper.statisticQueReport(null,null,mapStatistic.get(DicDataEnum.New_Energy.getCode()).getId(),"01","02"); + + + //敏感用户 + List processPublicDTOMingGanM = this.baseMapper.statisticPlanReport(firstDay,endTime,mapStatistic.get(DicDataEnum.POWER_QUALITY.getCode()).getId(),null); + List processPublicDTOMingGanY = this.baseMapper.statisticPlanReport(firstYearDay,endTime,mapStatistic.get(DicDataEnum.POWER_QUALITY.getCode()).getId(),null); + List processPublicDTOMingGanAll = this.baseMapper.statisticPlanReport(null,null,mapStatistic.get(DicDataEnum.POWER_QUALITY.getCode()).getId(),null); + + //换流站问题总数量 + List processPublicDTOQesMingGanM = this.baseMapper.statisticQueReport(firstDay,endTime,mapStatistic.get(DicDataEnum.POWER_QUALITY.getCode()).getId(),null,null); + List processPublicDTOQesMingGanAll = this.baseMapper.statisticQueReport(null,null,mapStatistic.get(DicDataEnum.POWER_QUALITY.getCode()).getId(),null,null); + + //换流站问题已整改数量 + List processPublicDTOQesMingGanYesM = this.baseMapper.statisticQueReport(firstDay,endTime,mapStatistic.get(DicDataEnum.POWER_QUALITY.getCode()).getId(),"01",null); + List processPublicDTOQesMingGanYesAll = this.baseMapper.statisticQueReport(null,null,mapStatistic.get(DicDataEnum.POWER_QUALITY.getCode()).getId(),"01",null); + + + List supvReportMBatch = new ArrayList<>(); + for(DeptGetBase deptGetBase : deptGetBaseList){ + if(deptGetBase.getDeptLevel() !=2 && deptGetBase.getDeptLevel() !=3 && deptGetBase.getDeptLevel() !=4){ + continue; + } + SupvReportM supvReportM = new SupvReportM(); + supvReportM.setStatisticsDate(timeId.with(TemporalAdjusters.firstDayOfMonth())); + supvReportM.setStatisticsDept(deptGetBase.getUnitId()); + + List childrenDeptList = deptGetBase.getUnitChildrenList(); + if(CollUtil.isNotEmpty(childrenDeptList)){ + supvReportM.setConvertMonthSupvNum(dealData(childrenDeptList,processPublicDTOListM)); + supvReportM.setConvertYearSupvNum(dealData(childrenDeptList,processPublicDTOListY)); + supvReportM.setConvertTotalSupvNum(dealData(childrenDeptList,processPublicDTOListAll)); + + supvReportM.setEnergyMonthSupvNum(dealData(childrenDeptList,processPublicDTOListNewM)); + supvReportM.setEnergyYearSupvNum(dealData(childrenDeptList,processPublicDTOListNewY)); + supvReportM.setEnergyTotalSupvNum(dealData(childrenDeptList,processPublicDTOListNewAll)); + + supvReportM.setEnergyMonthSupvNewNum(dealData(childrenDeptList,processPublicDTOListNewZM)); + supvReportM.setEnergyYearSupvNewNum(dealData(childrenDeptList,processPublicDTOListNewZY)); + supvReportM.setEnergyTotalSupvNewNum(dealData(childrenDeptList,processPublicDTOListNewZAll)); + + + + supvReportM.setConvertMonthQuesNum(dealData(childrenDeptList,processPublicDTOQesM)); + supvReportM.setConvertTotalQuesNum(dealData(childrenDeptList,processPublicDTOQesAll)); + + supvReportM.setConvertMonthReformNum(dealData(childrenDeptList,processPublicDTOQesYesM)); + supvReportM.setConvertTotalReformNum(dealData(childrenDeptList,processPublicDTOQesYesAll)); + + supvReportM.setEnergyMonthQuesNum(dealData(childrenDeptList,processPublicDTOQesNewM)); + supvReportM.setEnergyTotalQuesNum(dealData(childrenDeptList,processPublicDTOQesNewAll)); + + supvReportM.setEnergyMonthReformNum(dealData(childrenDeptList,processPublicDTOQesNewYesM)); + supvReportM.setEnergyTotalReformNum(dealData(childrenDeptList,processPublicDTOQesNewYesAll)); + + supvReportM.setEnergyMonthQuesNewNum(dealData(childrenDeptList,processPublicDTOQesNewGaiM)); + supvReportM.setEnergyTotalQuesNewNum(dealData(childrenDeptList,processPublicDTOQesNewGaiAll)); + + supvReportM.setEnergyMonthReformNewNum(dealData(childrenDeptList,processPublicDTOQesNewGaiYesM)); + supvReportM.setEnergyTotalReformNewNum(dealData(childrenDeptList,processPublicDTOQesNewGaiYesAll)); + + //敏感用户 + supvReportM.setSensitiveMonthSupvNum(dealData(childrenDeptList,processPublicDTOMingGanM)); + supvReportM.setSensitiveYearSupvNum(dealData(childrenDeptList,processPublicDTOMingGanY)); + supvReportM.setSensitiveTotalSupvNum(dealData(childrenDeptList,processPublicDTOMingGanAll)); + + supvReportM.setSensitiveMonthQuesNum(dealData(childrenDeptList,processPublicDTOQesMingGanM)); + supvReportM.setSensitiveTotalQuesNum(dealData(childrenDeptList,processPublicDTOQesMingGanAll)); + + supvReportM.setSensitiveMonthReformNum(dealData(childrenDeptList,processPublicDTOQesMingGanYesM)); + supvReportM.setSensitiveTotalReformNum(dealData(childrenDeptList,processPublicDTOQesMingGanYesAll)); + + supvReportM.setPowerMonthPlanNum(5); + supvReportM.setPowerTotalConductedNum(10); + + } + + if(deptGetBase.getDeptLevel() == 2){ + //省级 + supvReportM.setProvinceId(deptGetBase.getUnitId()); + supvReportM.setProvinceName(deptGetBase.getUnitName()); + + + supvReportM.setStatisticsLevel("3"); + }else if(deptGetBase.getDeptLevel() == 3){ + //市 + PvTerminalTreeVO pvTerminalTreeVOOne = mapCode.get(deptGetBase.getUnitId()); + if(Objects.nonNull(pvTerminalTreeVOOne)){ + PvTerminalTreeVO pvTerminalTreeVOTwo = mapList.get(pvTerminalTreeVOOne.getPid()); + supvReportM.setCityId(deptGetBase.getUnitId()); + supvReportM.setCityName(deptGetBase.getUnitName()); + supvReportM.setProvinceName(pvTerminalTreeVOTwo.getName()); + supvReportM.setProvinceId(pvTerminalTreeVOTwo.getCode()); + } + supvReportM.setStatisticsLevel("4"); + }else if(deptGetBase.getDeptLevel() == 4){ + //县 + PvTerminalTreeVO pvTerminalTreeVOOne = mapCode.get(deptGetBase.getUnitId()); + if(Objects.nonNull(pvTerminalTreeVOOne)) { + PvTerminalTreeVO pvTerminalTreeVOTwo = mapList.get(pvTerminalTreeVOOne.getPid()); + if(Objects.nonNull(pvTerminalTreeVOTwo)){ + PvTerminalTreeVO pvTerminalTreeVOThree = mapList.get(pvTerminalTreeVOTwo.getPid()); + supvReportM.setCountyId(deptGetBase.getUnitId()); + supvReportM.setCountyName(deptGetBase.getUnitName()); + supvReportM.setCityId(pvTerminalTreeVOTwo.getCode()); + supvReportM.setCityName(pvTerminalTreeVOTwo.getName()); + supvReportM.setProvinceName(pvTerminalTreeVOThree.getName()); + supvReportM.setProvinceId(pvTerminalTreeVOThree.getCode()); + } + + } + supvReportM.setStatisticsLevel("5"); + } + supvReportM.setSupvNum(10); + supvReportMBatch.add(supvReportM); + + } + + this.saveOrUpdateBatchByMultiId(supvReportMBatch); + return true; + } + + @Override + public Page statisticReportPage(BaseParam baseParam) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(StrUtil.isNotBlank(baseParam.getSearchValue()),SupvReportM::getStatisticsDept,baseParam.getSearchValue()) + .between(StrUtil.isNotBlank(baseParam.getSearchBeginTime()),SupvReportM::getStatisticsDate,baseParam.getSearchBeginTime(),baseParam.getSearchEndTime()); + return this.page(new Page(PageFactory.getPageNum(baseParam),PageFactory.getPageSize(baseParam)),lambdaQueryWrapper); + + } + + + private Integer dealData(List childrenDeptList,List processPublicDTOList){ + Integer count = 0; + for(ProcessPublicDTO processPublicDTO :processPublicDTOList) { + if (childrenDeptList.contains(processPublicDTO.getId())) { + count += processPublicDTO.getValue(); + } + } + return count; + } + +} diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataEnum.java b/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataEnum.java index 6dfb9250e..8c7703726 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataEnum.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataEnum.java @@ -443,7 +443,21 @@ public enum DicDataEnum { * 设备使用性质代码 */ DEDICATED("专用","dedicated"), - PUBLIC("公用","public"); + PUBLIC("公用","public"), + + + /** + * 监督类型 + */ + POWER_QUALITY("电能质量敏感用户监督","Power_Quality"), + UHV_Converter("特高压换流站监督","UHV_Converter"), + New_Energy("新能源场站监督","New_Energy"), + Technical_Super("供电电压质量技术监督","Technical_Super") + + + + ; + private final String name; private final String code; diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataTypeEnum.java b/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataTypeEnum.java index 5771bdcd0..5260cac07 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataTypeEnum.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/enums/DicDataTypeEnum.java @@ -84,7 +84,14 @@ public enum DicDataTypeEnum { VOLTAGE_TRANSFORMER("电压互感器类型","Voltage_Transformer"), Neutral_Point("中性点接地方式","Neutral_Point"), DEVICE_REGIONLYPE("设备地区特征","Device_RegionLype"), - DEVICE_USERNATURE("设备使用性质代码","Device_UseNature"); + DEVICE_USERNATURE("设备使用性质代码","Device_UseNature"), + SUPV_TYPE("监督类型","supv_type") + + + + + ; +