diff --git a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/Monitor.java b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/Monitor.java index 6e034ee0f..09b434509 100644 --- a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/Monitor.java +++ b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/Monitor.java @@ -1,6 +1,7 @@ package com.njcn.device.pms.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; import lombok.Data; @@ -24,6 +25,7 @@ public class Monitor extends BaseEntity { /** * 监测点ID */ + @TableId private String id; /** diff --git a/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/param/DimGlobalDataParam.java b/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/param/DimGlobalDataParam.java new file mode 100644 index 000000000..2e5024c84 --- /dev/null +++ b/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/param/DimGlobalDataParam.java @@ -0,0 +1,45 @@ +package com.njcn.harmonic.pojo.param; + +import com.njcn.web.pojo.param.BaseParam; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * pqs + * + * @author cdf + * @date 2023/11/27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DimGlobalDataParam extends BaseParam { + + @ApiModelProperty(name = "type",value = "大类型,与文档对应") + @NotNull(message = "大类型,与文档对应不可为空") + private Integer type; + + + @ApiModelProperty(name = "orgId",value = "单位code",required = true) + @NotBlank(message = "单位code不可为空") + private String orgId; + + @ApiModelProperty(name = "mainType",value = "电压等级/源荷类型/",required = true) + private String mainType; + + @ApiModelProperty(name = "secondType",value = "稳态指标类型id/暂态指标类型id/",required = true) + private String targetType; + + @ApiModelProperty(name = "dateType",value = "日期类型 1.年 3.月 5.天",required = true) + @NotNull(message = "日期类型不可为空") + private Integer dateType; + + @ApiModelProperty(name = "queryDate",value = "查询时间",required = true) + @NotBlank(message = "查询时间不可为空") + private String queryDate; + + +} diff --git a/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/DimGlobalDataVO.java b/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/DimGlobalDataVO.java new file mode 100644 index 000000000..312780f03 --- /dev/null +++ b/pqs-harmonic/harmonic-api/src/main/java/com/njcn/harmonic/pojo/vo/DimGlobalDataVO.java @@ -0,0 +1,23 @@ +package com.njcn.harmonic.pojo.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * pqs + * + * @author cdf + * @date 2023/11/27 + */ +@Data +public class DimGlobalDataVO { + + private String orgId; + + private String orgName; + + private String type; + + private BigDecimal value; +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/controller/dim/DimGlobalDealController.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/controller/dim/DimGlobalDealController.java new file mode 100644 index 000000000..f63be77d8 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/controller/dim/DimGlobalDealController.java @@ -0,0 +1,55 @@ +package com.njcn.harmonic.controller.dim; + +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.harmonic.pojo.param.DimGlobalDataParam; +import com.njcn.harmonic.pojo.vo.DimGlobalDataVO; +import com.njcn.harmonic.service.dim.DimGlobalDealService; +import com.njcn.web.controller.BaseController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +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 java.util.List; + +/** + * pqs + * + * @author cdf + * @date 2023/11/27 + */ +@RestController +@RequestMapping("/dimGlobal") +@Slf4j +@Api(tags = "pms电能质量指标综合") +@RequiredArgsConstructor +public class DimGlobalDealController extends BaseController { + + private final DimGlobalDealService dimGlobalDealService; + + /** + * + * @author cdf + * @date 2023/11/27 + */ + @PostMapping("/dealGlobalData") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("pms电能质量指标综合") + @ApiImplicitParam(name = "dimGlobalDataParam", value = "条件参数", required = true) + public HttpResult> dealGlobalData(@RequestBody @Validated DimGlobalDataParam dimGlobalDataParam){ + String methodDescribe = getMethodDescribe("dealGlobalData"); + Page result = dimGlobalDealService.dealGlobalData(dimGlobalDataParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); + } +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusGlobalDMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusGlobalDMapper.java new file mode 100644 index 000000000..2b5eba436 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusGlobalDMapper.java @@ -0,0 +1,18 @@ +package com.njcn.harmonic.mapper.dim; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimBusGlobalD; + +/** + *

+ * 母线监测总概览 Mapper 接口 + *

+ * + * @author hongawen + * @since 2023-11-14 + */ +public interface RDimBusGlobalDMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusGlobalMMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusGlobalMMapper.java new file mode 100644 index 000000000..371727ec5 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusGlobalMMapper.java @@ -0,0 +1,18 @@ +package com.njcn.harmonic.mapper.dim; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimBusGlobalM; + +/** + *

+ * Mapper 接口 + *

+ * + * @author hongawen + * @since 2023-11-14 + */ +public interface RDimBusGlobalMMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusGlobalYMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusGlobalYMapper.java new file mode 100644 index 000000000..d4744e9e6 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusGlobalYMapper.java @@ -0,0 +1,18 @@ +package com.njcn.harmonic.mapper.dim; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimBusGlobalY; + +/** + *

+ * Mapper 接口 + *

+ * + * @author hongawen + * @since 2023-11-14 + */ +public interface RDimBusGlobalYMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusStationEventDMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusStationEventDMapper.java new file mode 100644 index 000000000..43bcfd883 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusStationEventDMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimBusStationEventD; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-24 + */ +public interface RDimBusStationEventDMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusStationEventMMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusStationEventMMapper.java new file mode 100644 index 000000000..23f583694 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusStationEventMMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimBusStationEventM; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-24 + */ +public interface RDimBusStationEventMMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusStationEventYMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusStationEventYMapper.java new file mode 100644 index 000000000..a731e83d6 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusStationEventYMapper.java @@ -0,0 +1,16 @@ +package com.njcn.harmonic.mapper.dim; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimBusStationEventY; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-24 + */ +public interface RDimBusStationEventYMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusTargetDPOMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusTargetDPOMapper.java new file mode 100644 index 000000000..de5ca4e2b --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusTargetDPOMapper.java @@ -0,0 +1,16 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimBusTargetDPO; + +/** + * + * Description: + * Date: 2023/11/20 10:29【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +public interface RDimBusTargetDPOMapper extends MppBaseMapper { +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusTargetMPOMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusTargetMPOMapper.java new file mode 100644 index 000000000..4d1fc2a39 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusTargetMPOMapper.java @@ -0,0 +1,15 @@ +package com.njcn.harmonic.mapper.dim; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimBusTargetMPO; + +/** + * + * Description: + * Date: 2023/11/20 10:29【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +public interface RDimBusTargetMPOMapper extends MppBaseMapper { +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusTargetYPOMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusTargetYPOMapper.java new file mode 100644 index 000000000..4fdea60f5 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusTargetYPOMapper.java @@ -0,0 +1,15 @@ +package com.njcn.harmonic.mapper.dim; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimBusTargetYPO; + +/** + * + * Description: + * Date: 2023/11/20 10:29【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +public interface RDimBusTargetYPOMapper extends MppBaseMapper { +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusbarHarmnicDPOMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusbarHarmnicDPOMapper.java new file mode 100644 index 000000000..d9534daf9 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimBusbarHarmnicDPOMapper.java @@ -0,0 +1,15 @@ +package com.njcn.harmonic.mapper.dim; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimBusbarHarmnicDPO; + +/** + * + * Description: + * Date: 2023/11/21 13:45【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +public interface RDimBusbarHarmnicDPOMapper extends MppBaseMapper { +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimMonitorRateDMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimMonitorRateDMapper.java new file mode 100644 index 000000000..bfe62e4d1 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimMonitorRateDMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimMonitorRateD; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-23 + */ +public interface RDimMonitorRateDMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimMonitorRateMMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimMonitorRateMMapper.java new file mode 100644 index 000000000..c67766db0 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimMonitorRateMMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimMonitorRateM; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-23 + */ +public interface RDimMonitorRateMMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimMonitorRateYMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimMonitorRateYMapper.java new file mode 100644 index 000000000..0d34f9015 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimMonitorRateYMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimMonitorRateY; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-23 + */ +public interface RDimMonitorRateYMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjEventDMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjEventDMapper.java new file mode 100644 index 000000000..0976ce35e --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjEventDMapper.java @@ -0,0 +1,18 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjEventD; + + +/** + *

+ * 监测到暂态指标的用户-日表 Mapper 接口 + *

+ * + * @author xuyang + * @since 2023-11-23 + */ +public interface RDimObjEventDMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjEventMMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjEventMMapper.java new file mode 100644 index 000000000..d56da8cb3 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjEventMMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjEventM; + +/** + *

+ * 监测到暂态指标的用户-月表 Mapper 接口 + *

+ * + * @author xuyang + * @since 2023-11-23 + */ +public interface RDimObjEventMMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjEventYMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjEventYMapper.java new file mode 100644 index 000000000..0709df8ba --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjEventYMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjEventY; + +/** + *

+ * 监测到暂态指标的用户-年表 Mapper 接口 + *

+ * + * @author xuyang + * @since 2023-11-23 + */ +public interface RDimObjEventYMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjGlobalDMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjGlobalDMapper.java new file mode 100644 index 000000000..8940e4d46 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjGlobalDMapper.java @@ -0,0 +1,16 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjGlobalD; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-22 + */ +public interface RDimObjGlobalDMapper extends BaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjGlobalMMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjGlobalMMapper.java new file mode 100644 index 000000000..6917fa20f --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjGlobalMMapper.java @@ -0,0 +1,16 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjGlobalM; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-22 + */ +public interface RDimObjGlobalMMapper extends BaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjGlobalYMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjGlobalYMapper.java new file mode 100644 index 000000000..8cf1badc0 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjGlobalYMapper.java @@ -0,0 +1,16 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjGlobalY; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-22 + */ +public interface RDimObjGlobalYMapper extends BaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjRateDMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjRateDMapper.java new file mode 100644 index 000000000..5e8ea6abb --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjRateDMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjRateD; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-23 + */ +public interface RDimObjRateDMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjRateMMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjRateMMapper.java new file mode 100644 index 000000000..dfe17f849 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjRateMMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjRateM; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-23 + */ +public interface RDimObjRateMMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjRateYMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjRateYMapper.java new file mode 100644 index 000000000..14ab10088 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjRateYMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjRateY; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-23 + */ +public interface RDimObjRateYMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjTargetDMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjTargetDMapper.java new file mode 100644 index 000000000..42f62a887 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjTargetDMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjTargetD; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-22 + */ +public interface RDimObjTargetDMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjTargetMMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjTargetMMapper.java new file mode 100644 index 000000000..660f513ee --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjTargetMMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjTargetM; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-22 + */ +public interface RDimObjTargetMMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjTargetYMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjTargetYMapper.java new file mode 100644 index 000000000..8a6653670 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimObjTargetYMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimObjTargetY; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-22 + */ +public interface RDimObjTargetYMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationBaseDMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationBaseDMapper.java new file mode 100644 index 000000000..544008b78 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationBaseDMapper.java @@ -0,0 +1,16 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimStationBaseD; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-21 + */ +public interface RDimStationBaseDMapper extends BaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationGlobalDMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationGlobalDMapper.java new file mode 100644 index 000000000..7abedef73 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationGlobalDMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimStationGlobalD; + +/** + *

+ * Mapper 接口 + *

+ * + * @author hongawen + * @since 2023-11-14 + */ +public interface RDimStationGlobalDMapper extends BaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationGlobalMMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationGlobalMMapper.java new file mode 100644 index 000000000..058f76cc2 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationGlobalMMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimStationGlobalM; + +/** + *

+ * Mapper 接口 + *

+ * + * @author hongawen + * @since 2023-11-14 + */ +public interface RDimStationGlobalMMapper extends BaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationGlobalYMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationGlobalYMapper.java new file mode 100644 index 000000000..5d64d4862 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationGlobalYMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimStationGlobalY; + +/** + *

+ * Mapper 接口 + *

+ * + * @author hongawen + * @since 2023-11-14 + */ +public interface RDimStationGlobalYMapper extends BaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationHarmnicDPOMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationHarmnicDPOMapper.java new file mode 100644 index 000000000..9ca3db112 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationHarmnicDPOMapper.java @@ -0,0 +1,16 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimStationHarmnicDPO; + +/** + * + * Description: + * Date: 2023/11/23 9:26【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +public interface RDimStationHarmnicDPOMapper extends MppBaseMapper { +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationTargetDMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationTargetDMapper.java new file mode 100644 index 000000000..e2177cd65 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationTargetDMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimStationTargetD; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-21 + */ +public interface RDimStationTargetDMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationTargetMMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationTargetMMapper.java new file mode 100644 index 000000000..187886035 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationTargetMMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimStationTargetM; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-21 + */ +public interface RDimStationTargetMMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationTargetYMapper.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationTargetYMapper.java new file mode 100644 index 000000000..692621b93 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/RDimStationTargetYMapper.java @@ -0,0 +1,17 @@ +package com.njcn.harmonic.mapper.dim; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.harmonic.pojo.po.dim.RDimStationTargetY; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2023-11-21 + */ +public interface RDimStationTargetYMapper extends MppBaseMapper { + +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/mapping/PmsCountLedgerMapper.xml b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/mapping/PmsCountLedgerMapper.xml new file mode 100644 index 000000000..16d2f059f --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/mapping/PmsCountLedgerMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/mapping/RDimBusbarHarmnicDPOMapper.xml b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/mapping/RDimBusbarHarmnicDPOMapper.xml new file mode 100644 index 000000000..dac3a0f0d --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/mapping/RDimBusbarHarmnicDPOMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + Org_Id, Statis_Date, BusBar_Id, Target_type, Voltage_level, `Level`, `limit count`, + Statis_count, `State`, Create_By, Create_Time, Update_By, Update_Time + + diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/mapping/RDimStationHarmnicDPOMapper.xml b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/mapping/RDimStationHarmnicDPOMapper.xml new file mode 100644 index 000000000..8c05519c8 --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/mapper/dim/mapping/RDimStationHarmnicDPOMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + Org_Id, Statis_Date, `Station Id`, Target_type, `Level`, Monitor_Tag, Voltage_level, + limit_count, Statis_count + + diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/dim/DimGlobalDealService.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/dim/DimGlobalDealService.java new file mode 100644 index 000000000..c1781235d --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/dim/DimGlobalDealService.java @@ -0,0 +1,24 @@ +package com.njcn.harmonic.service.dim; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.njcn.harmonic.pojo.param.DimGlobalDataParam; +import com.njcn.harmonic.pojo.vo.DimGlobalDataVO; + +import java.util.List; + +/** + * pqs + * r_dim_xxx表全局处理 + * @author cdf + * @date 2023/11/27 + */ +public interface DimGlobalDealService { + + + /** + * + * @author cdf + * @date 2023/11/27 + */ + public Page dealGlobalData(DimGlobalDataParam dimGlobalDataParam); +} diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/dim/impl/DimGlobalDealServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/dim/impl/DimGlobalDealServiceImpl.java new file mode 100644 index 000000000..5ae6aee7d --- /dev/null +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/dim/impl/DimGlobalDealServiceImpl.java @@ -0,0 +1,2015 @@ +package com.njcn.harmonic.service.dim.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.njcn.harmonic.mapper.dim.*; +import com.njcn.harmonic.pojo.param.DimGlobalDataParam; +import com.njcn.harmonic.pojo.po.dim.*; +import com.njcn.harmonic.pojo.vo.DimGlobalDataVO; +import com.njcn.harmonic.service.dim.DimGlobalDealService; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.dto.DeptDTO; +import com.njcn.user.pojo.po.Dept; +import com.njcn.web.factory.PageFactory; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * pqs + * + * @author cdf + * @date 2023/11/27 + */ +@Service +@RequiredArgsConstructor +public class DimGlobalDealServiceImpl implements DimGlobalDealService { + + private final DeptFeignClient deptFeignClient; + + private final RDimBusGlobalDMapper rDimBusGlobalDMapper; + private final RDimBusGlobalMMapper rDimBusGlobalMMapper; + private final RDimBusGlobalYMapper rDimBusGlobalYMapper; + + private final RDimMonitorRateYMapper rDimMonitorRateYMapper; + private final RDimMonitorRateMMapper rDimMonitorRateMMapper; + private final RDimMonitorRateDMapper rDimMonitorRateDMapper; + + + private final RDimBusTargetYPOMapper rDimBusTargetYPOMapper; + private final RDimBusTargetMPOMapper rDimBusTargetMPOMapper; + private final RDimBusTargetDPOMapper rDimBusTargetDPOMapper; + + + private final RDimStationTargetYMapper rDimStationTargetYMapper; + private final RDimStationTargetMMapper rDimStationTargetMMapper; + private final RDimStationTargetDMapper rDimStationTargetDMapper; + + private final RDimBusStationEventYMapper rDimBusStationEventYMapper; + private final RDimBusStationEventMMapper rDimBusStationEventMMapper; + private final RDimBusStationEventDMapper rDimBusStationEventDMapper; + + + private final RDimObjGlobalYMapper rDimObjGlobalYMapper; + private final RDimObjGlobalMMapper rDimObjGlobalMMapper; + private final RDimObjGlobalDMapper rDimObjGlobalDMapper; + + + private final RDimObjRateYMapper rDimObjRateYMapper; + private final RDimObjRateMMapper rDimObjRateMMapper; + private final RDimObjRateDMapper rDimObjRateDMapper; + + + private final RDimObjTargetYMapper rDimObjTargetYMapper; + private final RDimObjTargetMMapper rDimObjTargetMMapper; + private final RDimObjTargetDMapper rDimObjTargetDMapper; + + + @Override + public Page dealGlobalData(DimGlobalDataParam dimGlobalDataParam) { + Page resultPage = new Page<>(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)); + List resultList = new ArrayList<>(); + Dept dept = deptFeignClient.getDeptByCode(dimGlobalDataParam.getOrgId()).getData(); + List deptList = deptFeignClient.getDirectSonSelf(dept.getId()).getData(); + List deptCodeIds = deptList.stream().map(Dept::getCode).collect(Collectors.toList()); + + switch (dimGlobalDataParam.getType()) { + case 1: + //母线监测率(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimMonitorRateY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimMonitorRateY::getOrgId, deptCodeIds); + Page yPage = rDimMonitorRateYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimMonitorRateY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getBusMonitorRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimMonitorRateM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimMonitorRateM::getOrgId, deptCodeIds); + Page mPage = rDimMonitorRateMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimMonitorRateM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getBusMonitorRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimMonitorRateD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimMonitorRateD::getOrgId, deptCodeIds); + Page dPage = rDimMonitorRateDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimMonitorRateD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getBusMonitorRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 2: + //变电站/换流站监测率(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimMonitorRateY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimMonitorRateY::getOrgId, deptCodeIds); + Page yPage = rDimMonitorRateYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimMonitorRateY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getStationMonitorRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimMonitorRateM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimMonitorRateM::getOrgId, deptCodeIds); + Page mPage = rDimMonitorRateMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimMonitorRateM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getBusMonitorRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimMonitorRateD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimMonitorRateD::getOrgId, deptCodeIds); + Page dPage = rDimMonitorRateDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimMonitorRateD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getBusMonitorRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 3: + //稳态指标超标或监测到暂态指标的变电站/换流站占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimBusGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalY::getOrgId, deptCodeIds); + Page yPage = rDimBusGlobalYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimBusGlobalY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimBusGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalM::getOrgId, deptCodeIds); + Page mPage = rDimBusGlobalMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimBusGlobalM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimBusGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalD::getOrgId, deptCodeIds); + Page dPage = rDimBusGlobalDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimBusGlobalD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 4: + //稳态指标超标或监测到暂态指标的变电站/换流站母线占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimBusGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalY::getOrgId, deptCodeIds); + Page yPage = rDimBusGlobalYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimBusGlobalY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getStationLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimBusGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalM::getOrgId, deptCodeIds); + Page mPage = rDimBusGlobalMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimBusGlobalM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getStationLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimBusGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalD::getOrgId, deptCodeIds); + Page dPage = rDimBusGlobalDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimBusGlobalD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getStationLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 5: + //稳态指标超标或监测到暂态指标的变电站/换流站平均占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimBusGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalY::getOrgId, deptCodeIds); + Page yPage = rDimBusGlobalYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimBusGlobalY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getStationLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimBusGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalM::getOrgId, deptCodeIds); + Page mPage = rDimBusGlobalMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimBusGlobalM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getStationLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimBusGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalD::getOrgId, deptCodeIds); + Page dPage = rDimBusGlobalDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimBusGlobalD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getStationLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 6: + //稳态指标超标或监测到暂态指标的变电站/换流站母线平均占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimBusGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalY::getOrgId, deptCodeIds); + Page yPage = rDimBusGlobalYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimBusGlobalY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimBusGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalM::getOrgId, deptCodeIds); + Page mPage = rDimBusGlobalMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimBusGlobalM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimBusGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusGlobalD::getOrgId, deptCodeIds); + Page dPage = rDimBusGlobalDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimBusGlobalD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + + case 7: + //母线**指标超标占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimBusTargetYPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetYPO::getOrgId, deptCodeIds).eq(RDimBusTargetYPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimBusTargetYPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimBusTargetYPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimBusTargetMPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetMPO::getOrgId, deptCodeIds).eq(RDimBusTargetMPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimBusTargetMPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimBusTargetMPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimBusTargetDPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetDPO::getOrgId, deptCodeIds).eq(RDimBusTargetDPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimBusTargetDPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimBusTargetDPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 8: + //母线**指标合格率(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimBusTargetYPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetYPO::getOrgId, deptCodeIds).eq(RDimBusTargetYPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimBusTargetYPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimBusTargetYPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getPassRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimBusTargetMPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetMPO::getOrgId, deptCodeIds).eq(RDimBusTargetMPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimBusTargetMPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimBusTargetMPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getPassRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimBusTargetDPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetDPO::getOrgId, deptCodeIds).eq(RDimBusTargetDPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimBusTargetDPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimBusTargetDPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getPassRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 9: + //母线**指标平均超标占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimBusTargetYPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetYPO::getOrgId, deptCodeIds).eq(RDimBusTargetYPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimBusTargetYPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimBusTargetYPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimBusTargetMPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetMPO::getOrgId, deptCodeIds).eq(RDimBusTargetMPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimBusTargetMPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimBusTargetMPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimBusTargetDPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetDPO::getOrgId, deptCodeIds).eq(RDimBusTargetDPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimBusTargetDPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimBusTargetDPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 10: + //母线**指标平均合格率(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimBusTargetYPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetYPO::getOrgId, deptCodeIds).eq(RDimBusTargetYPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimBusTargetYPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimBusTargetYPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimBusTargetMPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetMPO::getOrgId, deptCodeIds).eq(RDimBusTargetMPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimBusTargetMPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimBusTargetMPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimBusTargetDPO::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusTargetDPO::getOrgId, deptCodeIds).eq(RDimBusTargetDPO::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimBusTargetDPOMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimBusTargetDPO::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + + + case 11: + //**kV变电站**指标超标占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetY::getOrgId, deptCodeIds) + .eq(RDimStationTargetY::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimStationTargetYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimStationTargetY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetM::getOrgId, deptCodeIds) + .eq(RDimStationTargetM::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimStationTargetMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimStationTargetM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetD::getOrgId, deptCodeIds) + .eq(RDimStationTargetD::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimStationTargetDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimStationTargetD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 12: + //**kV变电站**指标合格率(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetY::getOrgId, deptCodeIds) + .eq(RDimStationTargetY::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimStationTargetYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimStationTargetY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getPassRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetM::getOrgId, deptCodeIds) + .eq(RDimStationTargetM::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimStationTargetMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimStationTargetM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getPassRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetD::getOrgId, deptCodeIds) + .eq(RDimStationTargetD::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimStationTargetDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimStationTargetD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getPassRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 13: + //**kV变电站**指标平均超标占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetY::getOrgId, deptCodeIds) + .eq(RDimStationTargetY::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimStationTargetYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimStationTargetY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetM::getOrgId, deptCodeIds) + .eq(RDimStationTargetM::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimStationTargetMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimStationTargetM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetD::getOrgId, deptCodeIds) + .eq(RDimStationTargetD::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimStationTargetDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimStationTargetD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 14: + //**kV变电站**指标平均合格率(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetY::getOrgId, deptCodeIds) + .eq(RDimStationTargetY::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimStationTargetYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimStationTargetY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetM::getOrgId, deptCodeIds) + .eq(RDimStationTargetM::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimStationTargetMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimStationTargetM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetD::getOrgId, deptCodeIds) + .eq(RDimStationTargetD::getVoltageLevel, dimGlobalDataParam.getMainType()) + .eq(RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimStationTargetDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimStationTargetD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + + + case 15: + //监测到暂态指标的变电站占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimBusStationEventY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusStationEventY::getOrgId, deptCodeIds); + Page yPage = rDimBusStationEventYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimBusStationEventY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimBusStationEventM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusStationEventM::getOrgId, deptCodeIds); + Page mPage = rDimBusStationEventMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimBusStationEventM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimBusStationEventD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimBusStationEventD::getOrgId, deptCodeIds); + Page dPage = rDimBusStationEventDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimBusStationEventD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 16: + //变电站暂态指标发生频次(次/站) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetY::getOrgId, deptCodeIds).eq(RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimStationTargetYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimStationTargetY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetM::getOrgId, deptCodeIds).eq(RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimStationTargetMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimStationTargetM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetD::getOrgId, deptCodeIds).eq(RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimStationTargetDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimStationTargetD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 17: + //监测到暂态指标的变电站母线占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetY::getOrgId, deptCodeIds).eq(RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimStationTargetYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimStationTargetY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetM::getOrgId, deptCodeIds).eq(RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimStationTargetMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimStationTargetM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetD::getOrgId, deptCodeIds).eq(RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimStationTargetDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimStationTargetD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 18: + //变电站母线暂态指标发生频次(次/线) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetY::getOrgId, deptCodeIds).eq(RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType()); + Page yPage = rDimStationTargetYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimStationTargetY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetM::getOrgId, deptCodeIds).eq(RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType()); + Page mPage = rDimStationTargetMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimStationTargetM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimStationTargetD::getOrgId, deptCodeIds).eq(RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType()); + Page dPage = rDimStationTargetDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimStationTargetD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + + + case 19: + //**源荷对象监测率(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimObjRateY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjRateY::getOrgId, deptCodeIds) + .eq(StrUtil.isNotBlank(dimGlobalDataParam.getMainType()), RDimObjRateY::getObjType, dimGlobalDataParam.getMainType()) + ; + Page yPage = rDimObjRateYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimObjRateY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getObjMonitorRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimObjRateM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjRateM::getOrgId, deptCodeIds) + .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjRateM::getObjType, dimGlobalDataParam.getMainType()); + Page mPage = rDimObjRateMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimObjRateM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getObjMonitorRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimObjRateD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjRateD::getOrgId, deptCodeIds) + .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjRateD::getObjType, dimGlobalDataParam.getMainType()); + Page dPage = rDimObjRateDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimObjRateD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getObjMonitorRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 20: + //**源荷对象超标占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimObjGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjGlobalY::getOrgId, deptCodeIds) + .eq(StrUtil.isNotBlank(dimGlobalDataParam.getMainType()), RDimObjGlobalY::getObjectType, dimGlobalDataParam.getMainType()) + ; + Page yPage = rDimObjGlobalYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimObjGlobalY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimObjGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjGlobalM::getOrgId, deptCodeIds) + .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjGlobalM::getObjectType, dimGlobalDataParam.getMainType()); + Page mPage = rDimObjGlobalMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimObjGlobalM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimObjGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjGlobalD::getOrgId, deptCodeIds) + .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjGlobalD::getObjectType, dimGlobalDataParam.getMainType()); + Page dPage = rDimObjGlobalDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimObjGlobalD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + case 21: + //**源荷对象平均超标占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimObjGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjGlobalY::getOrgId, deptCodeIds) + .eq(StrUtil.isNotBlank(dimGlobalDataParam.getMainType()), RDimObjGlobalY::getObjectType, dimGlobalDataParam.getMainType()) + ; + Page yPage = rDimObjGlobalYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimObjGlobalY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimObjGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjGlobalM::getOrgId, deptCodeIds) + .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjGlobalM::getObjectType, dimGlobalDataParam.getMainType()); + Page mPage = rDimObjGlobalMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimObjGlobalM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimObjGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjGlobalD::getOrgId, deptCodeIds) + .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjGlobalD::getObjectType, dimGlobalDataParam.getMainType()); + Page dPage = rDimObjGlobalDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimObjGlobalD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + + + case 22: + //**源荷对象**指标超标占比(%) + switch (dimGlobalDataParam.getDateType()) { + case 1: + LambdaQueryWrapper lambdaQueryWrapperY = new LambdaQueryWrapper<>(); + lambdaQueryWrapperY.eq(RDimObjTargetY::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjTargetY::getOrgId, deptCodeIds) + .eq(StrUtil.isNotBlank(dimGlobalDataParam.getMainType()), RDimObjTargetY::getObjectType, dimGlobalDataParam.getMainType()) + .eq(StrUtil.isNotBlank(dimGlobalDataParam.getTargetType()), RDimObjTargetY::getTargetType, dimGlobalDataParam.getTargetType()) + ; + Page yPage = rDimObjTargetYMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperY); + List yList = yPage.getRecords(); + if (CollectionUtil.isNotEmpty(yList)) { + Map mapY = yList.stream().collect(Collectors.toMap(RDimObjTargetY::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapY.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 3: + LambdaQueryWrapper lambdaQueryWrapperM = new LambdaQueryWrapper<>(); + lambdaQueryWrapperM.eq(RDimObjTargetM::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjTargetM::getOrgId, deptCodeIds) + .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjTargetM::getObjectType, dimGlobalDataParam.getMainType()) + .eq(StrUtil.isNotBlank(dimGlobalDataParam.getTargetType()), RDimObjTargetM::getTargetType, dimGlobalDataParam.getTargetType()); + + Page mPage = rDimObjTargetMMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperM); + List mList = mPage.getRecords(); + if (CollectionUtil.isNotEmpty(mList)) { + Map mapM = mList.stream().collect(Collectors.toMap(RDimObjTargetM::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapM.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + case 5: + LambdaQueryWrapper lambdaQueryWrapperD = new LambdaQueryWrapper<>(); + lambdaQueryWrapperD.eq(RDimObjTargetD::getStatisDate, dimGlobalDataParam.getQueryDate()) + .in(RDimObjTargetD::getOrgId, deptCodeIds) + .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjTargetD::getObjectType, dimGlobalDataParam.getMainType()); + Page dPage = rDimObjTargetDMapper.selectPage(new Page(PageFactory.getPageNum(dimGlobalDataParam), PageFactory.getPageSize(dimGlobalDataParam)), lambdaQueryWrapperD); + List dList = dPage.getRecords(); + if (CollectionUtil.isNotEmpty(dList)) { + Map mapD = dList.stream().collect(Collectors.toMap(RDimObjTargetD::getOrgId, Function.identity())); + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setOrgName(d.getName()); + if (mapD.containsKey(d.getCode())) { + dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP)); + } else { + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + } + resultList.add(dimGlobalDataVO); + } + } else { + for (Dept d : deptList) { + DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO(); + dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159)); + dimGlobalDataVO.setOrgName(d.getName()); + resultList.add(dimGlobalDataVO); + } + } + break; + } + + + } + + + return resultPage.setRecords(resultList); + } +}