合并代码
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package com.njcn.device.pms.api;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
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.device.pms.api.fallback.DistributionMonitorClientFallbackFactory;
|
||||
import com.njcn.device.pms.api.fallback.MonitorClientFallbackFactory;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||
import com.njcn.device.pms.pojo.vo.DoubleUserVO;
|
||||
import com.njcn.device.pq.pojo.po.Overlimit;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yzh
|
||||
* @date 2022/10/18
|
||||
*/
|
||||
@FeignClient(
|
||||
value = ServerInfo.DEVICE,
|
||||
path = "/pms/distributionMonitor",
|
||||
fallbackFactory = DistributionMonitorClientFallbackFactory.class)
|
||||
public interface DistributionMonitorClient {
|
||||
|
||||
/**
|
||||
* 获取指定组织下的发电用电用户
|
||||
* @author cdf
|
||||
* @date 2022/11/15
|
||||
*/
|
||||
@PostMapping("/getDoubleUserByDept")
|
||||
HttpResult<List<DoubleUserVO>> getDoubleUserByDept(@RequestParam("orgId")String orgId);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.njcn.device.pms.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pms.api.DistributionMonitorClient;
|
||||
import com.njcn.device.pms.api.MonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||
import com.njcn.device.pms.pojo.vo.DoubleUserVO;
|
||||
import com.njcn.device.pms.utils.PmsDeviceEnumUtil;
|
||||
import com.njcn.device.pq.pojo.po.Overlimit;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yzh
|
||||
* @date 2022/10/18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DistributionMonitorClientFallbackFactory implements FallbackFactory<DistributionMonitorClient> {
|
||||
|
||||
@Override
|
||||
public DistributionMonitorClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = PmsDeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new DistributionMonitorClient()
|
||||
{
|
||||
@Override
|
||||
public HttpResult<List<DoubleUserVO>> getDoubleUserByDept(@RequestParam("orgId")String orgId) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取指定组织下的发电用电用户", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.device.pms.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 终端异常管理接收参数实体
|
||||
* @Title RMpDevAbnormalManageParam
|
||||
* @Package com.njcn.device.pms.pojo.param
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-14 19:48
|
||||
* @Version V1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RMpDevAbnormalManageParam extends StatisticsBizBaseParam {
|
||||
|
||||
@ApiModelProperty(name = "manufactureIds", value = "厂家id(仅限厂家终端消缺统计接口使用)")
|
||||
private String manufactureIds;
|
||||
|
||||
@ApiModelProperty(name = "breakDownType", value = "故障类型(仅限故障类型消缺统计接口使用)")
|
||||
private String breakDownType;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.device.pms.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @Title RMpDevEvaluateDetailParam
|
||||
* @Package com.njcn.device.pms.pojo.param
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-17 15:50
|
||||
* @Version V1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RMpDevEvaluateDetailParam extends StatisticsBizBaseParam {
|
||||
@ApiModelProperty(name = "searchType", value = "维度(1:单位,2:终端厂家,3:终端型号)")
|
||||
private String searchType;
|
||||
|
||||
@ApiModelProperty(name = "manufactureIds", value = "终端厂商ids")
|
||||
private String manufactureIds;
|
||||
|
||||
@ApiModelProperty(name = "deviceModel", value = "终端型号(可多选)")
|
||||
private String deviceModel;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.device.pms.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Title RMpDevSolveDetailParam
|
||||
* @Package com.njcn.device.pms.pojo.param
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-17 10:30
|
||||
* @Version V1.0
|
||||
*/
|
||||
@Data
|
||||
public class RMpDevSolveDetailParam extends StatisticsBizBaseParam {
|
||||
|
||||
|
||||
@ApiModelProperty(name = "manufactureIds", value = "厂家ids")
|
||||
private String manufactureIds;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.device.pms.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 终端通信管理接收参数实体类
|
||||
* @Title RStatDevSignalParam
|
||||
* @Package com.njcn.device.pms.pojo.param
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-11 16:13
|
||||
* @Version V1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RStatDevSignalParam extends StatisticsBizBaseParam {
|
||||
|
||||
@ApiModelProperty(name = "terminalName", value = "终端名称")
|
||||
private String deviceName;
|
||||
|
||||
@ApiModelProperty(name = "deviceStatus", value = "设备状态")
|
||||
private String deviceStatus;
|
||||
|
||||
@ApiModelProperty(name = "runStatus", value = "运行状态")
|
||||
private String runStatus;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.njcn.device.pms.pojo.po;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 终端评价详情表
|
||||
* @TableName r_mp_dev_evaluate_detail
|
||||
*/
|
||||
@Data
|
||||
public class RMpDevEvaluateDetail implements Serializable {
|
||||
/**
|
||||
* 生成数据的时间,每月统计一次
|
||||
*/
|
||||
private Date dataDate;
|
||||
|
||||
/**
|
||||
* 终端id
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 终端指标完整率
|
||||
*/
|
||||
private Double devTargetRate;
|
||||
|
||||
/**
|
||||
* 终端数据完整率
|
||||
*/
|
||||
private Double devDataRate;
|
||||
|
||||
/**
|
||||
* 终端故障及消缺评分
|
||||
*/
|
||||
private Double devScore;
|
||||
|
||||
/**
|
||||
* 终端有效接入率
|
||||
*/
|
||||
private Double devEffectiveRate;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.njcn.device.pms.pojo.po;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 终端消缺明细数据表
|
||||
* @TableName r_mp_dev_solve_detail
|
||||
*/
|
||||
@Data
|
||||
public class RMpDevSolveDetail implements Serializable {
|
||||
/**
|
||||
* 终端id
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 生成数据的时间,每天统计一次
|
||||
*/
|
||||
private Date dataDate;
|
||||
|
||||
/**
|
||||
* 故障时间
|
||||
*/
|
||||
private Date breakDownDate;
|
||||
|
||||
/**
|
||||
* 故障类型
|
||||
*/
|
||||
private String breakDownType;
|
||||
|
||||
/**
|
||||
* 是否消缺(0:否 1:是)
|
||||
*/
|
||||
private Integer isSolve;
|
||||
|
||||
/**
|
||||
* 消缺时间
|
||||
*/
|
||||
private Date solveDate;
|
||||
|
||||
/**
|
||||
* 消缺措施
|
||||
*/
|
||||
private String defectTreatment;
|
||||
|
||||
/**
|
||||
* 缺陷严重度(轻缺陷、较重缺陷和严重缺陷 三类缺陷对应分值为0.02,0.12和0.42,消缺为对应缺陷分值的1/3)
|
||||
*/
|
||||
private String defectSeverity;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.njcn.device.pms.pojo.po;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 终端通信管理日表
|
||||
* @TableName r_stat_dev_signal_d
|
||||
*/
|
||||
@Data
|
||||
public class RStatDevSignalD implements Serializable {
|
||||
/**
|
||||
* 终端id
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 生成数据的时间,每日统计一次
|
||||
*/
|
||||
private Date dataDate;
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
*/
|
||||
private String deviceStatus;
|
||||
|
||||
/**
|
||||
* 运行状态
|
||||
*/
|
||||
private String runStatus;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.njcn.device.pms.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Title RMpDevEvaluateDetailVO
|
||||
* @Package com.njcn.device.pms.pojo.vo
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-17 16:00
|
||||
* @Version V1.0
|
||||
*/
|
||||
@Data
|
||||
public class RMpDevEvaluateDetailVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(name = "orgId", value = "单位id")
|
||||
private String orgId; //单位id
|
||||
|
||||
@ApiModelProperty(name = "orgName", value = "单位名称")
|
||||
private String orgName; //单位名称
|
||||
|
||||
@ApiModelProperty(name = "manufactureId", value = "厂家(字典id)")
|
||||
private String manufactureId;
|
||||
|
||||
@ApiModelProperty(name = "deviceModel", value = "终端型号(字典id)")
|
||||
private String deviceModel;
|
||||
|
||||
@ApiModelProperty(name = "dataDate", value = "日期")
|
||||
private String dataDate;
|
||||
/**
|
||||
* 终端有效接入率
|
||||
*/
|
||||
@ApiModelProperty(name = "devEffectiveRate", value = "终端有效接入率")
|
||||
private Double devEffectiveRate;
|
||||
|
||||
/**
|
||||
* 终端指标完整率
|
||||
*/
|
||||
@ApiModelProperty(name = "devTargetRate", value = "终端指标完整率")
|
||||
private Double devTargetRate;
|
||||
|
||||
/**
|
||||
* 终端数据完整率
|
||||
*/
|
||||
@ApiModelProperty(name = "devDataRate", value = "终端数据完整率")
|
||||
private Double devDataRate;
|
||||
|
||||
@ApiModelProperty(name = "assessment", value = "综合评价")
|
||||
private Double assessment;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.njcn.device.pms.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 异常终端消缺明细返回实体类
|
||||
* @TableName r_mp_dev_solve_detail
|
||||
*/
|
||||
@Data
|
||||
public class RMpDevSolveDetailVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ApiModelProperty(name = "orgId", value = "单位id")
|
||||
private String orgId; //单位id
|
||||
|
||||
@ApiModelProperty(name = "orgName", value = "单位名称")
|
||||
private String orgName; //单位名称
|
||||
|
||||
@ApiModelProperty(name = "powerId", value = "变电站id")
|
||||
private String powerId;
|
||||
|
||||
@ApiModelProperty(name = "powerName", value = "变电站名称")
|
||||
private String powerName;
|
||||
|
||||
/**
|
||||
* 终端id
|
||||
*/
|
||||
@ApiModelProperty(name = "deviceId", value = "终端编号")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 故障时间
|
||||
*/
|
||||
@ApiModelProperty(name = "breakDownDate", value = "故障时间")
|
||||
private Date breakDownDate;
|
||||
|
||||
/**
|
||||
* 故障类型
|
||||
*/
|
||||
@ApiModelProperty(name = "breakDownType", value = "故障类型(字典)")
|
||||
private String breakDownType;
|
||||
|
||||
/**
|
||||
* 是否消缺(0:否 1:是)
|
||||
*/
|
||||
@ApiModelProperty(name = "isSolve", value = "是否消缺(0:否 1:是)")
|
||||
private Integer isSolve;
|
||||
|
||||
/**
|
||||
* 消缺时间
|
||||
*/
|
||||
@ApiModelProperty(name = "solveDate", value = "消缺时间")
|
||||
private Date solveDate;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.device.pms.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 终端异常管理返回实体类
|
||||
* @Title RMpDevAbnormalManageVO
|
||||
* @Package com.njcn.device.pms.pojo.vo
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-14 19:50
|
||||
* @Version V1.0
|
||||
*/
|
||||
@Data
|
||||
public class RMpDevSolveVO {
|
||||
|
||||
@ApiModelProperty(name = "dataDate", value = "时间")
|
||||
private String dataDate;
|
||||
|
||||
@ApiModelProperty(name = "orgId", value = "单位id")
|
||||
private String orgId; //单位id
|
||||
|
||||
@ApiModelProperty(name = "orgName", value = "单位名称")
|
||||
private String orgName; //单位名称
|
||||
|
||||
@ApiModelProperty(name = "manufactureId", value = "厂商id(字典)")
|
||||
private String manufactureId;
|
||||
|
||||
@ApiModelProperty(name = "breakDownType", value = "故障类型(字典id)")
|
||||
private String breakDownType;
|
||||
|
||||
@ApiModelProperty(name = "terminalCount", value = "终端数量")
|
||||
private Integer terminalCount;
|
||||
|
||||
@ApiModelProperty(name = "terminalAbnormalCount", value = "终端异常数量")
|
||||
private Integer terminalAbnormalCount;
|
||||
|
||||
@ApiModelProperty(name = "solveCount", value = "已消缺异常数量")
|
||||
private Integer solveCount;
|
||||
|
||||
@ApiModelProperty(name = "solveRate", value = "消缺率")
|
||||
private Double solveRate;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.device.pms.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 终端通信管理返回前端实体类
|
||||
* @Title RStatDevSignalVO
|
||||
* @Package com.njcn.device.pms.pojo.vo
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-11 16:16
|
||||
* @Version V1.0
|
||||
*/
|
||||
@Data
|
||||
public class RStatDevSignalVO {
|
||||
|
||||
@ApiModelProperty(name = "orgId", value = "单位id")
|
||||
private String orgId; //单位id
|
||||
|
||||
@ApiModelProperty(name = "orgName", value = "单位名称")
|
||||
private String orgName; //单位名称
|
||||
|
||||
@ApiModelProperty(name = "terminalId", value = "终端编号")
|
||||
private String terminalId; //终端编号
|
||||
|
||||
@ApiModelProperty(name = "terminalName", value = "终端名称")
|
||||
private String terminalName; //终端名称
|
||||
|
||||
@ApiModelProperty(name = "deviceStatus", value = "设备状态(字典)")
|
||||
private String deviceStatus; //设备状态
|
||||
|
||||
@ApiModelProperty(name = "runStatus", value = "运行状态(字典)")
|
||||
private String runStatus; //运行状态
|
||||
|
||||
@ApiModelProperty(name = "ip", value = "ip地址")
|
||||
private String ip; //ip地址
|
||||
|
||||
@ApiModelProperty(name = "port", value = "端口")
|
||||
private String port; //端口
|
||||
|
||||
@ApiModelProperty(name = "updateTime", value = "最后通讯时间")
|
||||
private Date updateTime; //最后通讯时间
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.njcn.device.pms.controller.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pms.pojo.param.GeneratrixWireParam;
|
||||
import com.njcn.device.pms.pojo.po.GeneratrixWire;
|
||||
import com.njcn.device.pms.service.majornetwork.IGeneratrixWireService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* pms-device
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pms/GeneratrixWireWire")
|
||||
@Slf4j
|
||||
@Api(tags = "台账-线路")
|
||||
@RequiredArgsConstructor
|
||||
public class PmsGeneratrixWireController extends BaseController {
|
||||
|
||||
private final IGeneratrixWireService iGeneratrixWireService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addGeneratrixWire")
|
||||
@ApiOperation("新增线路")
|
||||
@ApiImplicitParam(name = "generatrixWireParam", value = "线路实体", required = true)
|
||||
public HttpResult<Boolean> addGeneratrixWire(@RequestBody GeneratrixWireParam generatrixWireParam) {
|
||||
String methodDescribe = getMethodDescribe("addGeneratrixWire");
|
||||
boolean result = iGeneratrixWireService.addGeneratrixWire(generatrixWireParam);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
|
||||
@PostMapping("/updateGeneratrixWire")
|
||||
@ApiOperation("修改线路")
|
||||
@ApiImplicitParam(name = "generatrixWireParam", value = "线路实体", required = true)
|
||||
public HttpResult<Boolean> updateGeneratrixWire(@RequestBody GeneratrixWireParam generatrixWireParam) {
|
||||
String methodDescribe = getMethodDescribe("updateGeneratrixWire");
|
||||
boolean result = iGeneratrixWireService.updateGeneratrixWire(generatrixWireParam);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/delGeneratrixWire")
|
||||
@ApiOperation("删除线路")
|
||||
@ApiImplicitParam(name = "generatrixWireIds", value = "线路ids", required = true)
|
||||
public HttpResult<Boolean> delGeneratrixWire(@RequestBody @NotEmpty(message = "线路id不可为空") List<String> generatrixWireIds) {
|
||||
String methodDescribe = getMethodDescribe("delGeneratrixWire");
|
||||
boolean result = iGeneratrixWireService.delGeneratrixWire(generatrixWireIds);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getGeneratrixWireById")
|
||||
@ApiOperation("根据线路id获取线路")
|
||||
@ApiImplicitParam(name = "generatrixWireId", value = "线路id", required = true)
|
||||
public HttpResult<GeneratrixWire> getGeneratrixWireById(@RequestParam("generatrixWireId") String generatrixWireId) {
|
||||
String methodDescribe = getMethodDescribe("getGeneratrixWireById");
|
||||
GeneratrixWire result = iGeneratrixWireService.getGeneratrixWireById(generatrixWireId);
|
||||
if(Objects.nonNull(result)){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getGeneratrixWireList")
|
||||
@ApiOperation("获取所有线路下拉框使用")
|
||||
public HttpResult<List<GeneratrixWire>> getGeneratrixWireList() {
|
||||
String methodDescribe = getMethodDescribe("getGeneratrixWireList");
|
||||
List<GeneratrixWire> result = iGeneratrixWireService.getGeneratrixWireList();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getGeneratrixWirePageList")
|
||||
@ApiOperation("分页获取线路列表")
|
||||
@ApiImplicitParam(name = "baseParam", value = "基本查询体", required = true)
|
||||
public HttpResult<Page<GeneratrixWire>> getGeneratrixWirePageList(@RequestBody BaseParam baseParam) {
|
||||
String methodDescribe = getMethodDescribe("getGeneratrixWirePageList");
|
||||
Page<GeneratrixWire> result = iGeneratrixWireService.getGeneratrixWirePageList(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.njcn.device.pms.controller.majornetwork;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.pms.pojo.param.PmsTerminalParam;
|
||||
import com.njcn.device.pms.pojo.po.PmsTerminal;
|
||||
import com.njcn.device.pms.pojo.vo.PmsTerminalVO;
|
||||
import com.njcn.device.pms.service.majornetwork.ITerminalService;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
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.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 监测终端台账增删改查
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/pms/terminal")
|
||||
@Api(tags = "台账-监测终端台账")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class PmsTerminalController extends BaseController {
|
||||
|
||||
private final ITerminalService iTerminalService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("getTerminalList")
|
||||
@ApiOperation("查询监测终端台账所有信息")
|
||||
@ApiImplicitParam(name = "baseParam",value = "查询监测终端台账信息",required = true)
|
||||
public HttpResult<Page<PmsTerminal>> getTerminalList(@RequestBody @Validated BaseParam baseParam){
|
||||
String methodDescribe = getMethodDescribe("getTerminalList");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam);
|
||||
Page<PmsTerminal> res = iTerminalService.getTerminalList(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,res,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getTerminalById")
|
||||
@ApiOperation("根据ID查询监测终端台账数据")
|
||||
@ApiImplicitParam(name = "id",value = "id",required = true)
|
||||
public HttpResult<PmsTerminal> getTerminalById(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("getTerminalById");
|
||||
PmsTerminal pmsTerminal = iTerminalService.getTerminalById(id);
|
||||
if (Objects.nonNull(pmsTerminal)){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pmsTerminal, methodDescribe);
|
||||
}
|
||||
else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增监测终端台账信息
|
||||
* @author hany
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("/addTerminal")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType= OperateType.ADD)
|
||||
@ApiOperation("新增监测终端台账信息")
|
||||
@ApiImplicitParam(name = "terminalParam", value = "新增实体", required = true)
|
||||
public HttpResult<Object> add(@RequestBody @Validated PmsTerminalParam terminalParam){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
boolean result = iTerminalService.add(terminalParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监测终端台账信息
|
||||
* @author hany
|
||||
* @date 2022/10/27
|
||||
*/
|
||||
@PostMapping("/updateTerminal")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||
@ApiOperation("修改监测终端台账信息")
|
||||
@ApiImplicitParam(name = "updateParam", value = "更新实体", required = true)
|
||||
public HttpResult<Object> update(@RequestBody @Validated PmsTerminalParam updateParam){
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
boolean result = iTerminalService.update(updateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监测终端台账信息
|
||||
* @param ids id
|
||||
* @author hany
|
||||
* @date 2022/10/27
|
||||
*/
|
||||
@PostMapping("/deleteTerminal")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@ApiOperation("删除监测终端台账信息")
|
||||
@ApiImplicitParam(name = "ids", value = "ID索引", required = true)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
boolean result = iTerminalService.delete(ids);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.njcn.device.pms.controller.majornetwork;
|
||||
|
||||
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.device.pms.pojo.param.RMpDevAbnormalManageParam;
|
||||
import com.njcn.device.pms.pojo.param.RMpDevEvaluateDetailParam;
|
||||
import com.njcn.device.pms.pojo.vo.RMpDevEvaluateDetailVO;
|
||||
import com.njcn.device.pms.pojo.vo.RMpDevSolveVO;
|
||||
import com.njcn.device.pms.service.majornetwork.RMpDevEvaluateDetailService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Title RMpDevEvaluateDetailController
|
||||
* @Package com.njcn.device.pms.controller.majornetwork
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-17 15:44
|
||||
* @Version V1.0
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "终端质量评价")
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/rMpDevEvaluateDetail")
|
||||
public class RMpDevEvaluateDetailController extends BaseController {
|
||||
|
||||
private final RMpDevEvaluateDetailService rMpDevEvaluateDetailService;
|
||||
|
||||
@PostMapping("/getRMpDevEvaluateDetailList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("终端质量评价")
|
||||
public HttpResult<List<RMpDevEvaluateDetailVO>> getRMpDevEvaluateDetailList(@RequestBody RMpDevEvaluateDetailParam rMpDevEvaluateDetailParam) {
|
||||
String methodDescribe = getMethodDescribe("getRMpDevEvaluateDetailList");
|
||||
//没有携带【维度】条件
|
||||
if (StringUtils.isBlank(rMpDevEvaluateDetailParam.getSearchType())) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.METHOD_ARGUMENT_NOT_VALID_EXCEPTION, null, methodDescribe);
|
||||
}
|
||||
List<RMpDevEvaluateDetailVO> list = null;
|
||||
//单位维度
|
||||
if ("1".equals(rMpDevEvaluateDetailParam.getSearchType())) {
|
||||
list = rMpDevEvaluateDetailService.getOrgDevEvaluateDetailList(rMpDevEvaluateDetailParam);
|
||||
}
|
||||
//厂商维度
|
||||
else if ("2".equals(rMpDevEvaluateDetailParam.getSearchType())) {
|
||||
list = rMpDevEvaluateDetailService.getManufactureDevEvaluateDetailList(rMpDevEvaluateDetailParam);
|
||||
}
|
||||
//终端型号
|
||||
else if ("3".equals(rMpDevEvaluateDetailParam.getSearchType())) {
|
||||
list = rMpDevEvaluateDetailService.getModelDevEvaluateDetailList(rMpDevEvaluateDetailParam);
|
||||
} else {
|
||||
//没有对应的searchType
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.INVALID_PARAMETER, null, methodDescribe);
|
||||
}
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.njcn.device.pms.controller.majornetwork;
|
||||
|
||||
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.device.pms.pojo.param.RMpDevAbnormalManageParam;
|
||||
import com.njcn.device.pms.pojo.param.RMpDevSolveDetailParam;
|
||||
import com.njcn.device.pms.pojo.vo.RMpDevSolveDetailVO;
|
||||
import com.njcn.device.pms.pojo.vo.RMpDevSolveVO;
|
||||
import com.njcn.device.pms.service.majornetwork.RMpDevSolveDetailService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Title RMpDevSolveDetailController
|
||||
* @Package com.njcn.device.pms.controller.majornetwork
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-14 19:44
|
||||
* @Version V1.0
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "终端异常管理")
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/rMpDevSolveDetail")
|
||||
public class RMpDevSolveDetailController extends BaseController {
|
||||
|
||||
private final RMpDevSolveDetailService rMpDevSolveDetailService;
|
||||
|
||||
/***
|
||||
*
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-17 16:04
|
||||
* @param rMpDevAbnormalManageParam
|
||||
* @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RMpDevSolveVO>>
|
||||
*/
|
||||
@PostMapping("/getOrgRMpDevSolveList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("单位-终端消缺统计")
|
||||
public HttpResult<List<RMpDevSolveVO>> getOrgRMpDevSolveList(@RequestBody RMpDevAbnormalManageParam rMpDevAbnormalManageParam) {
|
||||
String methodDescribe = getMethodDescribe("getOrgRMpDevSolveList");
|
||||
List<RMpDevSolveVO> list = rMpDevSolveDetailService.getOrgRMpDevSolveList(rMpDevAbnormalManageParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-17 16:04
|
||||
* @param rMpDevAbnormalManageParam
|
||||
* @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RMpDevSolveVO>>
|
||||
*/
|
||||
@PostMapping("/getManufactureRMpDevSolveList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("厂商-终端消缺统计")
|
||||
public HttpResult<List<RMpDevSolveVO>> getManufactureRMpDevSolveList(@RequestBody RMpDevAbnormalManageParam rMpDevAbnormalManageParam) {
|
||||
String methodDescribe = getMethodDescribe("getManufactureRMpDevSolveList");
|
||||
List<RMpDevSolveVO> list = rMpDevSolveDetailService.getManufactureRMpDevSolveList(rMpDevAbnormalManageParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-17 16:04
|
||||
* @param rMpDevAbnormalManageParam
|
||||
* @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RMpDevSolveVO>>
|
||||
*/
|
||||
@PostMapping("/getTypeRMpDevSolveList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("故障类型-终端消缺统计")
|
||||
public HttpResult<List<RMpDevSolveVO>> getTypeRMpDevSolveList(@RequestBody RMpDevAbnormalManageParam rMpDevAbnormalManageParam) {
|
||||
String methodDescribe = getMethodDescribe("getTypeRMpDevSolveList");
|
||||
List<RMpDevSolveVO> list = rMpDevSolveDetailService.getTypeRMpDevSolveList(rMpDevAbnormalManageParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-17 16:04
|
||||
* @param rMpDevSolveDetailParam
|
||||
* @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RMpDevSolveDetailVO>>
|
||||
*/
|
||||
@PostMapping("/getRMpDevSolveDetailList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("终端异常清单")
|
||||
public HttpResult<List<RMpDevSolveDetailVO>> getRMpDevSolveDetailList(@RequestBody RMpDevSolveDetailParam rMpDevSolveDetailParam) {
|
||||
String methodDescribe = getMethodDescribe("getRMpDevSolveDetailList");
|
||||
List<RMpDevSolveDetailVO> list = rMpDevSolveDetailService.getRMpDevSolveDetailList(rMpDevSolveDetailParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.njcn.device.pms.controller.majornetwork;
|
||||
|
||||
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.device.pms.pojo.param.RStatDevSignalParam;
|
||||
import com.njcn.device.pms.pojo.param.RStatZwAlarmCountWParam;
|
||||
import com.njcn.device.pms.pojo.vo.RStatDevSignalVO;
|
||||
import com.njcn.device.pms.pojo.vo.RStatZwAlarmCountWVO;
|
||||
import com.njcn.device.pms.service.majornetwork.RStatDevSignalDService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Title RStatDevSignalDController
|
||||
* @Package com.njcn.device.pms.controller.majornetwork
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-11 16:04
|
||||
* @Version V1.0
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "终端通信管理")
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/rStatDevSignal")
|
||||
public class RStatDevSignalDController extends BaseController {
|
||||
|
||||
private final RStatDevSignalDService rStatDevSignalDService;
|
||||
|
||||
@PostMapping("getRStatDevSignalList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("终端通信管理台账")
|
||||
public HttpResult<List<RStatDevSignalVO>> getRStatDevSignalList(@RequestBody RStatDevSignalParam rStatDevSignalParam) {
|
||||
String methodDescribe = getMethodDescribe("getRStatDevSignalList");
|
||||
List<RStatDevSignalVO> list = rStatDevSignalDService.getRStatDevSignalList(rStatDevSignalParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.device.pms.mapper.majornetwork;
|
||||
|
||||
import com.njcn.device.pms.pojo.po.RMpDevEvaluateDetail;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_dev_evaluate_detail(终端评价详情表 )】的数据库操作Mapper
|
||||
* @createDate 2022-11-17 15:38:02
|
||||
* @Entity com.njcn.device.pms.pojo.po.RMpDevEvaluateDetail
|
||||
*/
|
||||
public interface RMpDevEvaluateDetailMapper extends BaseMapper<RMpDevEvaluateDetail> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.device.pms.mapper.majornetwork;
|
||||
|
||||
import com.njcn.device.pms.pojo.po.RMpDevSolveDetail;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_dev_solve_detail(终端消缺明细数据表)】的数据库操作Mapper
|
||||
* @createDate 2022-11-14 19:42:13
|
||||
* @Entity com.njcn.device.pms.pojo.po.RMpDevSolveDetail
|
||||
*/
|
||||
public interface RMpDevSolveDetailMapper extends BaseMapper<RMpDevSolveDetail> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.device.pms.mapper.majornetwork;
|
||||
|
||||
import com.njcn.device.pms.pojo.po.RStatDevSignalD;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_stat_dev_signal_d(终端通信管理日表)】的数据库操作Mapper
|
||||
* @createDate 2022-11-11 15:35:35
|
||||
* @Entity com.njcn.device.pms.pojo.po.RStatDevSignalD
|
||||
*/
|
||||
public interface RStatDevSignalDMapper extends BaseMapper<RStatDevSignalD> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pms.mapper.majornetwork.RMpDevEvaluateDetailMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.device.pms.pojo.po.RMpDevEvaluateDetail">
|
||||
<id property="dataDate" column="data_date" jdbcType="TIMESTAMP"/>
|
||||
<id property="deviceId" column="device_id" jdbcType="VARCHAR"/>
|
||||
<result property="devTargetRate" column="dev_target_rate" jdbcType="FLOAT"/>
|
||||
<result property="devDataRate" column="dev_data_rate" jdbcType="FLOAT"/>
|
||||
<result property="devScore" column="dev_score" jdbcType="FLOAT"/>
|
||||
<result property="devEffectiveRate" column="dev_effective_rate" jdbcType="FLOAT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
data_date,device_id,dev_target_rate,
|
||||
dev_data_rate,dev_score,dev_effective_rate
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pms.mapper.majornetwork.RMpDevSolveDetailMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.device.pms.pojo.po.RMpDevSolveDetail">
|
||||
<id property="deviceId" column="device_id" jdbcType="VARCHAR"/>
|
||||
<id property="dataDate" column="data_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="breakDownDate" column="break_down_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="breakDownType" column="break_down_type" jdbcType="VARCHAR"/>
|
||||
<result property="isSolve" column="is_solve" jdbcType="TINYINT"/>
|
||||
<result property="solveDate" column="solve_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="defectTreatment" column="defect_treatment" jdbcType="VARCHAR"/>
|
||||
<result property="defectSeverity" column="defect_severity" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
device_id,data_date,break_down_date,
|
||||
break_down_type,is_solve,solve_date,
|
||||
defect_treatment,defect_severity
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pms.mapper.majornetwork.RStatDevSignalDMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.device.pms.pojo.po.RStatDevSignalD">
|
||||
<id property="deviceId" column="device_id" jdbcType="VARCHAR"/>
|
||||
<id property="dataDate" column="data_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="deviceStatus" column="device_status" jdbcType="VARCHAR"/>
|
||||
<result property="runStatus" column="run_status" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
device_id,data_date,device_status,
|
||||
run_status,update_time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.device.pms.service.majornetwork;
|
||||
|
||||
import com.njcn.device.pms.pojo.param.RMpDevEvaluateDetailParam;
|
||||
import com.njcn.device.pms.pojo.po.RMpDevEvaluateDetail;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pms.pojo.vo.RMpDevEvaluateDetailVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_dev_evaluate_detail(终端评价详情表 )】的数据库操作Service
|
||||
* @createDate 2022-11-17 15:38:02
|
||||
*/
|
||||
public interface RMpDevEvaluateDetailService extends IService<RMpDevEvaluateDetail> {
|
||||
|
||||
List<RMpDevEvaluateDetailVO> getOrgDevEvaluateDetailList(RMpDevEvaluateDetailParam rMpDevEvaluateDetailParam);
|
||||
|
||||
List<RMpDevEvaluateDetailVO> getManufactureDevEvaluateDetailList(RMpDevEvaluateDetailParam rMpDevEvaluateDetailParam);
|
||||
|
||||
List<RMpDevEvaluateDetailVO> getModelDevEvaluateDetailList(RMpDevEvaluateDetailParam rMpDevEvaluateDetailParam);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.njcn.device.pms.service.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pms.pojo.param.RMpDevAbnormalManageParam;
|
||||
import com.njcn.device.pms.pojo.param.RMpDevSolveDetailParam;
|
||||
import com.njcn.device.pms.pojo.po.RMpDevSolveDetail;
|
||||
import com.njcn.device.pms.pojo.vo.RMpDevSolveDetailVO;
|
||||
import com.njcn.device.pms.pojo.vo.RMpDevSolveVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_dev_solve_detail(终端消缺明细数据表)】的数据库操作Service
|
||||
* @createDate 2022-11-14 19:42:13
|
||||
*/
|
||||
public interface RMpDevSolveDetailService extends IService<RMpDevSolveDetail> {
|
||||
|
||||
/**
|
||||
* 单位终端消缺统计
|
||||
* @param rMpDevAbnormalManageParam
|
||||
* @return
|
||||
*/
|
||||
List<RMpDevSolveVO> getOrgRMpDevSolveList(RMpDevAbnormalManageParam rMpDevAbnormalManageParam);
|
||||
|
||||
/**
|
||||
* 厂家终端消缺统计
|
||||
* @param rMpDevAbnormalManageParam
|
||||
* @return
|
||||
*/
|
||||
List<RMpDevSolveVO> getManufactureRMpDevSolveList(RMpDevAbnormalManageParam rMpDevAbnormalManageParam);
|
||||
|
||||
/**
|
||||
* 故障类型终端消缺统计
|
||||
* @param rMpDevAbnormalManageParam
|
||||
* @return
|
||||
*/
|
||||
List<RMpDevSolveVO> getTypeRMpDevSolveList(RMpDevAbnormalManageParam rMpDevAbnormalManageParam);
|
||||
|
||||
List<RMpDevSolveDetailVO> getRMpDevSolveDetailList(RMpDevSolveDetailParam rMpDevSolveDetailParam);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.device.pms.service.majornetwork;
|
||||
|
||||
import com.njcn.device.pms.pojo.param.RStatDevSignalParam;
|
||||
import com.njcn.device.pms.pojo.po.RStatDevSignalD;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pms.pojo.vo.RStatDevSignalVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_stat_dev_signal_d(终端通信管理日表)】的数据库操作Service
|
||||
* @createDate 2022-11-11 15:35:35
|
||||
*/
|
||||
public interface RStatDevSignalDService extends IService<RStatDevSignalD> {
|
||||
|
||||
List<RStatDevSignalVO> getRStatDevSignalList(RStatDevSignalParam rStatDevSignalParam);
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
package com.njcn.device.pms.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.RMpDevEvaluateDetailParam;
|
||||
import com.njcn.device.pms.pojo.po.PmsTerminal;
|
||||
import com.njcn.device.pms.pojo.po.RMpDevEvaluateDetail;
|
||||
import com.njcn.device.pms.pojo.po.RMpDevSolveDetail;
|
||||
import com.njcn.device.pms.pojo.vo.RMpDevEvaluateDetailVO;
|
||||
import com.njcn.device.pms.service.majornetwork.IPmsGeneralDeviceService;
|
||||
import com.njcn.device.pms.service.majornetwork.ITerminalService;
|
||||
import com.njcn.device.pms.service.majornetwork.RMpDevEvaluateDetailService;
|
||||
import com.njcn.device.pms.mapper.majornetwork.RMpDevEvaluateDetailMapper;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_dev_evaluate_detail(终端评价详情表 )】的数据库操作Service实现
|
||||
* @createDate 2022-11-17 15:38:02
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RMpDevEvaluateDetailServiceImpl extends ServiceImpl<RMpDevEvaluateDetailMapper, RMpDevEvaluateDetail>
|
||||
implements RMpDevEvaluateDetailService{
|
||||
|
||||
private final ITerminalService iTerminalService;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
/***
|
||||
* 单位维度终端质量评价
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-17 16:12
|
||||
* @param rMpDevEvaluateDetailParam
|
||||
* @return java.util.List<com.njcn.device.pms.pojo.vo.RMpDevEvaluateDetailVO>
|
||||
*/
|
||||
@Override
|
||||
public List<RMpDevEvaluateDetailVO> getOrgDevEvaluateDetailList(RMpDevEvaluateDetailParam rMpDevEvaluateDetailParam) {
|
||||
//提取参数
|
||||
String id = rMpDevEvaluateDetailParam.getId(); //单位id
|
||||
String startTime = rMpDevEvaluateDetailParam.getStartTime(); //开始时间
|
||||
String endTime = rMpDevEvaluateDetailParam.getEndTime(); //截止时间
|
||||
if (StringUtils.isBlank(id)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "单位id不可为空");
|
||||
}
|
||||
|
||||
// //查询单位下的终端信息
|
||||
// PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam();
|
||||
// pmsDeviceInfoParam.setDeptIndex(id);
|
||||
// pmsDeviceInfoParam.setStatisticalType(new SimpleDTO());
|
||||
// List<PmsGeneralDeviceDTO> pmsDeviceInfoWithInOrg = iPmsGeneralDeviceService.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam);
|
||||
// pmsDeviceInfoWithInOrg.get(0);
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
//单位id集合
|
||||
List<String> orgNoList = deptDTOList.stream().map(DeptDTO::getId).collect(Collectors.toList());
|
||||
//将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getId, deptDTO -> deptDTO));
|
||||
|
||||
//查询单位下的终端数据
|
||||
LambdaQueryWrapper<PmsTerminal> terminalWrapper = new LambdaQueryWrapper<>();
|
||||
terminalWrapper.in(PmsTerminal::getOrgId, orgNoList);
|
||||
List<PmsTerminal> terminalList = iTerminalService.list(terminalWrapper);
|
||||
if (CollUtil.isEmpty(terminalList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//提取终端id
|
||||
List<String> terminalIdList = terminalList.stream().map(PmsTerminal::getId).collect(Collectors.toList());
|
||||
//将终端信息转为map集合 key: 终端id value: 终端实体
|
||||
Map<String, PmsTerminal> terminalMap = terminalList.stream().collect(Collectors.toMap(PmsTerminal::getId, terminal -> terminal));
|
||||
//将终端信息按单位分组 key:单位id value:终端集合
|
||||
Map<String, List<PmsTerminal>> terminalListMapByOrgId = terminalList.stream().collect(Collectors.groupingBy(PmsTerminal::getOrgId));
|
||||
|
||||
//查询终端评价详情表数据【r_mp_dev_evaluate_detail】
|
||||
LambdaQueryWrapper<RMpDevEvaluateDetail> businessWrapper = new LambdaQueryWrapper<>();
|
||||
businessWrapper.in(RMpDevEvaluateDetail::getDeviceId, terminalIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpDevEvaluateDetail::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpDevEvaluateDetail::getDataDate, endTime);
|
||||
List<RMpDevEvaluateDetail> list = this.list(businessWrapper);
|
||||
|
||||
//封装返回数据
|
||||
List<RMpDevEvaluateDetailVO> resultList = new ArrayList<>();
|
||||
terminalListMapByOrgId.forEach((key, terminalListByOrg) -> {
|
||||
RMpDevEvaluateDetailVO rMpDevEvaluateDetailVO = new RMpDevEvaluateDetailVO();
|
||||
|
||||
rMpDevEvaluateDetailVO.setDataDate(startTime); //日期(前端传递的时间)
|
||||
rMpDevEvaluateDetailVO.setOrgId(key); //单位id
|
||||
rMpDevEvaluateDetailVO.setOrgName(terminalListByOrg.get(0).getOrgName()); //单位名称
|
||||
|
||||
//终端有效接入率
|
||||
double devEffectiveRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getOrgId().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevEffectiveRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevEffectiveRate(devEffectiveRate);
|
||||
//终端指标完整率
|
||||
double devTargetRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getOrgId().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevTargetRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevTargetRate(devTargetRate);
|
||||
//终端数据完整率
|
||||
double devDataRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getOrgId().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevDataRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevDataRate(devDataRate);
|
||||
//综合评价
|
||||
rMpDevEvaluateDetailVO.setAssessment((devEffectiveRate + devTargetRate + devDataRate) / 3.0);
|
||||
|
||||
resultList.add(rMpDevEvaluateDetailVO);
|
||||
});
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/***
|
||||
* 厂商维度终端质量评价
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-17 16:13
|
||||
* @param rMpDevEvaluateDetailParam
|
||||
* @return java.util.List<com.njcn.device.pms.pojo.vo.RMpDevEvaluateDetailVO>
|
||||
*/
|
||||
@Override
|
||||
public List<RMpDevEvaluateDetailVO> getManufactureDevEvaluateDetailList(RMpDevEvaluateDetailParam rMpDevEvaluateDetailParam) {
|
||||
//提取参数
|
||||
List<String> manufactureIdList = StringUtils.isNotBlank(rMpDevEvaluateDetailParam.getManufactureIds()) ?
|
||||
Arrays.asList(rMpDevEvaluateDetailParam.getManufactureIds().split(",")) : null; //厂商ids
|
||||
|
||||
List<String> deviceModelIdList = StringUtils.isNotBlank(rMpDevEvaluateDetailParam.getDeviceModel()) ?
|
||||
Arrays.asList(rMpDevEvaluateDetailParam.getDeviceModel().split(",")) : null; //终端型号
|
||||
String startTime = rMpDevEvaluateDetailParam.getStartTime(); //开始时间
|
||||
String endTime = rMpDevEvaluateDetailParam.getEndTime(); //截止时间
|
||||
|
||||
//查询终端厂商下的终端数据
|
||||
LambdaQueryWrapper<PmsTerminal> terminalWrapper = new LambdaQueryWrapper<>();
|
||||
terminalWrapper.in(CollUtil.isNotEmpty(manufactureIdList), PmsTerminal::getManufacture, manufactureIdList)
|
||||
.isNotNull(CollUtil.isEmpty(manufactureIdList), PmsTerminal::getManufacture)
|
||||
.in(CollUtil.isEmpty(deviceModelIdList), PmsTerminal::getDeviceModel, deviceModelIdList);
|
||||
List<PmsTerminal> terminalList = iTerminalService.list(terminalWrapper);
|
||||
|
||||
if (CollUtil.isEmpty(terminalList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//提取终端id
|
||||
List<String> terminalIdList = terminalList.stream().map(PmsTerminal::getId).collect(Collectors.toList());
|
||||
//将终端信息转为map集合 key: 终端id value: 终端实体
|
||||
Map<String, PmsTerminal> terminalMap = terminalList.stream().collect(Collectors.toMap(PmsTerminal::getId, terminal -> terminal));
|
||||
//将终端信息按厂商分组 key:厂商id value:终端集合
|
||||
Map<String, List<PmsTerminal>> terminalListMapByManufacture = terminalList.stream().collect(Collectors.groupingBy(PmsTerminal::getManufacture));
|
||||
|
||||
//查询终端评价详情表数据【r_mp_dev_evaluate_detail】
|
||||
LambdaQueryWrapper<RMpDevEvaluateDetail> businessWrapper = new LambdaQueryWrapper<>();
|
||||
businessWrapper.in(RMpDevEvaluateDetail::getDeviceId, terminalIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpDevEvaluateDetail::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpDevEvaluateDetail::getDataDate, endTime);
|
||||
List<RMpDevEvaluateDetail> list = this.list(businessWrapper);
|
||||
|
||||
//封装返回数据
|
||||
List<RMpDevEvaluateDetailVO> resultList = new ArrayList<>();
|
||||
terminalListMapByManufacture.forEach((key, terminalListByManufacture) -> {
|
||||
RMpDevEvaluateDetailVO rMpDevEvaluateDetailVO = new RMpDevEvaluateDetailVO();
|
||||
|
||||
rMpDevEvaluateDetailVO.setDataDate(startTime); //日期(前端传递的时间)
|
||||
rMpDevEvaluateDetailVO.setManufactureId(key); //厂商id
|
||||
|
||||
//终端有效接入率
|
||||
double devEffectiveRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getManufacture().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevEffectiveRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevEffectiveRate(devEffectiveRate);
|
||||
//终端指标完整率
|
||||
double devTargetRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getManufacture().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevTargetRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevTargetRate(devTargetRate);
|
||||
//终端数据完整率
|
||||
double devDataRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getManufacture().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevDataRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevDataRate(devDataRate);
|
||||
//综合评价
|
||||
rMpDevEvaluateDetailVO.setAssessment((devEffectiveRate + devTargetRate + devDataRate) / 3.0);
|
||||
|
||||
resultList.add(rMpDevEvaluateDetailVO);
|
||||
});
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/***
|
||||
* 终端型号维度终端质量评价
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-18 15:40
|
||||
* @param rMpDevEvaluateDetailParam
|
||||
* @return java.util.List<com.njcn.device.pms.pojo.vo.RMpDevEvaluateDetailVO>
|
||||
*/
|
||||
@Override
|
||||
public List<RMpDevEvaluateDetailVO> getModelDevEvaluateDetailList(RMpDevEvaluateDetailParam rMpDevEvaluateDetailParam) {
|
||||
//提取参数
|
||||
List<String> deviceModelIdList = StringUtils.isNotBlank(rMpDevEvaluateDetailParam.getDeviceModel()) ?
|
||||
Arrays.asList(rMpDevEvaluateDetailParam.getDeviceModel().split(",")) : null; //终端型号
|
||||
String startTime = rMpDevEvaluateDetailParam.getStartTime(); //开始时间
|
||||
String endTime = rMpDevEvaluateDetailParam.getEndTime(); //截止时间
|
||||
|
||||
//查询终端厂商下的终端数据
|
||||
LambdaQueryWrapper<PmsTerminal> terminalWrapper = new LambdaQueryWrapper<>();
|
||||
terminalWrapper.in(CollUtil.isEmpty(deviceModelIdList), PmsTerminal::getDeviceModel, deviceModelIdList);
|
||||
List<PmsTerminal> terminalList = iTerminalService.list(terminalWrapper);
|
||||
|
||||
if (CollUtil.isEmpty(terminalList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//提取终端id
|
||||
List<String> terminalIdList = terminalList.stream().map(PmsTerminal::getId).collect(Collectors.toList());
|
||||
//将终端信息转为map集合 key: 终端id value: 终端实体
|
||||
Map<String, PmsTerminal> terminalMap = terminalList.stream().collect(Collectors.toMap(PmsTerminal::getId, terminal -> terminal));
|
||||
//将终端信息按终端型号分组 key:型号 value:终端集合
|
||||
Map<String, List<PmsTerminal>> terminalListMapByModel = terminalList.stream().collect(Collectors.groupingBy(PmsTerminal::getDeviceModel));
|
||||
|
||||
//查询终端评价详情表数据【r_mp_dev_evaluate_detail】
|
||||
LambdaQueryWrapper<RMpDevEvaluateDetail> businessWrapper = new LambdaQueryWrapper<>();
|
||||
businessWrapper.in(RMpDevEvaluateDetail::getDeviceId, terminalIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpDevEvaluateDetail::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpDevEvaluateDetail::getDataDate, endTime);
|
||||
List<RMpDevEvaluateDetail> list = this.list(businessWrapper);
|
||||
|
||||
//封装返回数据
|
||||
List<RMpDevEvaluateDetailVO> resultList = new ArrayList<>();
|
||||
terminalListMapByModel.forEach((key, terminalListByModel) -> {
|
||||
RMpDevEvaluateDetailVO rMpDevEvaluateDetailVO = new RMpDevEvaluateDetailVO();
|
||||
|
||||
rMpDevEvaluateDetailVO.setDataDate(startTime); //日期(前端传递的时间)
|
||||
rMpDevEvaluateDetailVO.setDeviceModel(key); //终端型号
|
||||
|
||||
//终端有效接入率
|
||||
double devEffectiveRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getDeviceModel().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevEffectiveRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevEffectiveRate(devEffectiveRate);
|
||||
//终端指标完整率
|
||||
double devTargetRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getDeviceModel().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevTargetRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevTargetRate(devTargetRate);
|
||||
//终端数据完整率
|
||||
double devDataRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getDeviceModel().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevDataRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevDataRate(devDataRate);
|
||||
//综合评价
|
||||
rMpDevEvaluateDetailVO.setAssessment((devEffectiveRate + devTargetRate + devDataRate) / 3.0);
|
||||
|
||||
resultList.add(rMpDevEvaluateDetailVO);
|
||||
});
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,334 @@
|
||||
package com.njcn.device.pms.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.mapper.majornetwork.RMpDevSolveDetailMapper;
|
||||
import com.njcn.device.pms.pojo.param.RMpDevAbnormalManageParam;
|
||||
import com.njcn.device.pms.pojo.param.RMpDevSolveDetailParam;
|
||||
import com.njcn.device.pms.pojo.po.RMpDevSolveDetail;
|
||||
import com.njcn.device.pms.pojo.po.RStatZwAlarmCountW;
|
||||
import com.njcn.device.pms.pojo.po.PmsTerminal;
|
||||
import com.njcn.device.pms.pojo.vo.RMpDevSolveDetailVO;
|
||||
import com.njcn.device.pms.pojo.vo.RMpDevSolveVO;
|
||||
import com.njcn.device.pms.service.majornetwork.ITerminalService;
|
||||
import com.njcn.device.pms.service.majornetwork.RMpDevSolveDetailService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_dev_solve_detail(终端消缺明细数据表)】的数据库操作Service实现
|
||||
* @createDate 2022-11-14 19:42:13
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RMpDevSolveDetailServiceImpl extends ServiceImpl<RMpDevSolveDetailMapper, RMpDevSolveDetail>
|
||||
implements RMpDevSolveDetailService{
|
||||
|
||||
private final ITerminalService iTerminalService;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
/***
|
||||
* 单位终端消缺统计
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-14 19:50
|
||||
* @param rMpDevAbnormalManageParam
|
||||
*/
|
||||
@Override
|
||||
public List<RMpDevSolveVO> getOrgRMpDevSolveList(RMpDevAbnormalManageParam rMpDevAbnormalManageParam) {
|
||||
//提取参数
|
||||
String id = rMpDevAbnormalManageParam.getId(); //单位id
|
||||
String startTime = rMpDevAbnormalManageParam.getStartTime(); //开始时间
|
||||
String endTime = rMpDevAbnormalManageParam.getEndTime(); //结束时间
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
//单位id集合
|
||||
List<String> orgNoList = deptDTOList.stream().map(DeptDTO::getId).collect(Collectors.toList());
|
||||
//将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getId, deptDTO -> deptDTO));
|
||||
|
||||
//查询单位下的终端数据
|
||||
LambdaQueryWrapper<PmsTerminal> terminalWrapper = new LambdaQueryWrapper<>();
|
||||
terminalWrapper.in(PmsTerminal::getOrgId, orgNoList);
|
||||
List<PmsTerminal> terminalList = iTerminalService.list(terminalWrapper);
|
||||
//提取终端id
|
||||
List<String> terminalIdList = terminalList.stream().map(PmsTerminal::getId).collect(Collectors.toList());
|
||||
//将终端信息转为map集合 key: 终端id value: 终端实体
|
||||
Map<String, PmsTerminal> terminalMap = terminalList.stream().collect(Collectors.toMap(PmsTerminal::getId, terminal -> terminal));
|
||||
if (CollUtil.isEmpty(terminalIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//将终端信息按单位分组 key:单位id value:终端集合
|
||||
Map<String, List<PmsTerminal>> terminalListMapByOrgId = terminalList.stream().collect(Collectors.groupingBy(PmsTerminal::getOrgId));
|
||||
|
||||
//查询终端消缺数据
|
||||
LambdaQueryWrapper<RMpDevSolveDetail> solveWrapper = new LambdaQueryWrapper<>();
|
||||
solveWrapper.in(RMpDevSolveDetail::getDeviceId, terminalIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpDevSolveDetail::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpDevSolveDetail::getDataDate, endTime);
|
||||
List<RMpDevSolveDetail> solveList = this.list(solveWrapper);
|
||||
|
||||
//有异常的终端id集合(去重,一个终端即使有多次异常,也算作一个终端异常数量)
|
||||
List<String> solveDevIdList = solveList.stream().map(RMpDevSolveDetail::getDeviceId).distinct().collect(Collectors.toList());
|
||||
|
||||
//封装返回数据
|
||||
List<RMpDevSolveVO> resultList = new ArrayList<>();
|
||||
DecimalFormat df = new DecimalFormat("###.00");
|
||||
terminalListMapByOrgId.forEach((key, terminalListByOrg) -> {
|
||||
RMpDevSolveVO rMpDevSolveVO = new RMpDevSolveVO();
|
||||
|
||||
rMpDevSolveVO.setDataDate(startTime);
|
||||
rMpDevSolveVO.setOrgId(key); //单位id
|
||||
rMpDevSolveVO.setOrgName(terminalListByOrg.get(0).getOrgName()); //单位名称
|
||||
|
||||
rMpDevSolveVO.setTerminalCount(terminalListByOrg.size()); //终端数量
|
||||
|
||||
//终端异常数量 terminalAbnormalCount
|
||||
int terminalAbnormalCount = (int)solveDevIdList.stream().filter(item -> terminalMap.get(item).getOrgId().equals(key)).count();
|
||||
rMpDevSolveVO.setTerminalAbnormalCount(terminalAbnormalCount);
|
||||
|
||||
/**已消缺数量 solveCount**/
|
||||
int notSolveCount = 0, solveCount = 0;
|
||||
//当前单位未消缺的终端数量
|
||||
if (terminalAbnormalCount != 0) {
|
||||
notSolveCount = (int)solveList.stream().filter(item -> {
|
||||
return terminalMap.get(item.getDeviceId()).getOrgId().equals(key) && item.getIsSolve() == 0;
|
||||
}).map(RMpDevSolveDetail::getDeviceId).distinct().count();
|
||||
//已消缺数量
|
||||
solveCount = terminalAbnormalCount - notSolveCount;
|
||||
}
|
||||
|
||||
rMpDevSolveVO.setSolveCount(terminalAbnormalCount - notSolveCount);
|
||||
|
||||
//消缺率 solveRate
|
||||
if (terminalAbnormalCount == 0) { //防止算术异常
|
||||
rMpDevSolveVO.setSolveRate(00.00);
|
||||
} else {
|
||||
rMpDevSolveVO.setSolveRate(Double.parseDouble(df.format((solveCount * 1.0) / (terminalAbnormalCount * 1.0))) * 100);
|
||||
}
|
||||
|
||||
resultList.add(rMpDevSolveVO);
|
||||
});
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/***
|
||||
* 厂家终端消缺统计
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-14 19:50
|
||||
* @param rMpDevAbnormalManageParam
|
||||
*/
|
||||
@Override
|
||||
public List<RMpDevSolveVO> getManufactureRMpDevSolveList(RMpDevAbnormalManageParam rMpDevAbnormalManageParam) {
|
||||
//提取参数
|
||||
List<String> manufactureIdList = StringUtils.isNotBlank(rMpDevAbnormalManageParam.getManufactureIds()) ?
|
||||
Arrays.asList(rMpDevAbnormalManageParam.getManufactureIds().split(",")) : null; //厂商id
|
||||
String startTime = rMpDevAbnormalManageParam.getStartTime(); //开始时间
|
||||
String endTime = rMpDevAbnormalManageParam.getEndTime(); //结束时间
|
||||
|
||||
|
||||
//查询终端厂商下的终端数据
|
||||
LambdaQueryWrapper<PmsTerminal> terminalWrapper = new LambdaQueryWrapper<>();
|
||||
terminalWrapper.in(CollUtil.isNotEmpty(manufactureIdList), PmsTerminal::getManufacture, manufactureIdList)
|
||||
.isNotNull(CollUtil.isEmpty(manufactureIdList), PmsTerminal::getManufacture);
|
||||
List<PmsTerminal> terminalList = iTerminalService.list(terminalWrapper);
|
||||
//提取终端id
|
||||
List<String> terminalIdList = terminalList.stream().map(PmsTerminal::getId).collect(Collectors.toList());
|
||||
//将终端信息转为map集合 key: 终端id value: 终端实体
|
||||
Map<String, PmsTerminal> terminalMap = terminalList.stream().collect(Collectors.toMap(PmsTerminal::getId, terminal -> terminal));
|
||||
if (CollUtil.isEmpty(terminalIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//将终端信息按厂商分组 key:单位id value:终端集合
|
||||
Map<String, List<PmsTerminal>> terminalListMapByManufacture = terminalList.stream().collect(Collectors.groupingBy(PmsTerminal::getManufacture));
|
||||
|
||||
//查询终端消缺数据
|
||||
LambdaQueryWrapper<RMpDevSolveDetail> solveWrapper = new LambdaQueryWrapper<>();
|
||||
solveWrapper.in(RMpDevSolveDetail::getDeviceId, terminalIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpDevSolveDetail::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpDevSolveDetail::getDataDate, endTime);
|
||||
List<RMpDevSolveDetail> solveList = this.list(solveWrapper);
|
||||
|
||||
//有异常的终端id集合(去重,一个终端即使有多次异常,也算作一个终端异常数量)
|
||||
List<String> solveDevIdList = solveList.stream().map(RMpDevSolveDetail::getDeviceId).distinct().collect(Collectors.toList());
|
||||
|
||||
//封装返回数据
|
||||
List<RMpDevSolveVO> resultList = new ArrayList<>();
|
||||
DecimalFormat df = new DecimalFormat("###.00");
|
||||
terminalListMapByManufacture.forEach((key, terminalListByOrg) -> {
|
||||
RMpDevSolveVO rMpDevSolveVO = new RMpDevSolveVO();
|
||||
|
||||
rMpDevSolveVO.setDataDate(startTime);
|
||||
rMpDevSolveVO.setManufactureId(key); //厂商id
|
||||
|
||||
rMpDevSolveVO.setTerminalCount(terminalListByOrg.size()); //终端数量
|
||||
|
||||
//终端异常数量 terminalAbnormalCount
|
||||
int terminalAbnormalCount = (int)solveDevIdList.stream().filter(item -> terminalMap.get(item).getManufacture().equals(key)).count();
|
||||
rMpDevSolveVO.setTerminalAbnormalCount(terminalAbnormalCount);
|
||||
|
||||
/**已消缺数量 solveCount**/
|
||||
int notSolveCount = 0, solveCount = 0;
|
||||
//当前厂商未消缺的终端数量
|
||||
if (terminalAbnormalCount != 0) {
|
||||
notSolveCount = (int)solveList.stream().filter(item -> {
|
||||
return terminalMap.get(item.getDeviceId()).getManufacture().equals(key) && item.getIsSolve() == 0;
|
||||
}).map(RMpDevSolveDetail::getDeviceId).distinct().count();
|
||||
|
||||
//已消缺数量
|
||||
solveCount = terminalAbnormalCount - notSolveCount;
|
||||
}
|
||||
|
||||
rMpDevSolveVO.setSolveCount(solveCount);
|
||||
|
||||
//消缺率 solveRate
|
||||
if (terminalAbnormalCount == 0) { //防止算术异常
|
||||
rMpDevSolveVO.setSolveRate(00.00);
|
||||
} else {
|
||||
rMpDevSolveVO.setSolveRate(Double.parseDouble(df.format((solveCount * 1.0) / (terminalAbnormalCount * 1.0))) * 100);
|
||||
}
|
||||
|
||||
resultList.add(rMpDevSolveVO);
|
||||
});
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RMpDevSolveVO> getTypeRMpDevSolveList(RMpDevAbnormalManageParam rMpDevAbnormalManageParam) {
|
||||
//提取参数
|
||||
List<String> breakDownTypeList = StringUtils.isNotBlank(rMpDevAbnormalManageParam.getBreakDownType()) ?
|
||||
Arrays.asList(rMpDevAbnormalManageParam.getBreakDownType().split(",")) : null; //故障类型
|
||||
String startTime = rMpDevAbnormalManageParam.getStartTime(); //开始时间
|
||||
String endTime = rMpDevAbnormalManageParam.getEndTime(); //结束时间
|
||||
|
||||
//查询终端消缺数据
|
||||
LambdaQueryWrapper<RMpDevSolveDetail> solveWrapper = new LambdaQueryWrapper<>();
|
||||
solveWrapper.in(CollUtil.isNotEmpty(breakDownTypeList), RMpDevSolveDetail::getBreakDownType, breakDownTypeList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpDevSolveDetail::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpDevSolveDetail::getDataDate, endTime);
|
||||
List<RMpDevSolveDetail> solveList = this.list(solveWrapper);
|
||||
|
||||
if (CollUtil.isEmpty(solveList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//按故障类型分组
|
||||
Map<String, List<RMpDevSolveDetail>> solveMap = solveList.stream().collect(Collectors.groupingBy(RMpDevSolveDetail::getBreakDownType));
|
||||
|
||||
//封装返回数据
|
||||
List<RMpDevSolveVO> resultList = new ArrayList<>();
|
||||
DecimalFormat df = new DecimalFormat("###.00");
|
||||
solveMap.forEach((key, RMpDevSolveDetailList) -> {
|
||||
RMpDevSolveVO rMpDevSolveVO = new RMpDevSolveVO();
|
||||
|
||||
rMpDevSolveVO.setDataDate(startTime);
|
||||
rMpDevSolveVO.setBreakDownType(key); //故障类型
|
||||
|
||||
rMpDevSolveVO.setTerminalCount(null); //终端数量(故障类型的终端数量前端展示'/')
|
||||
|
||||
//终端异常数量 terminalAbnormalCount
|
||||
int terminalAbnormalCount = (int)RMpDevSolveDetailList.stream().map(RMpDevSolveDetail::getDeviceId).distinct().count();
|
||||
rMpDevSolveVO.setTerminalAbnormalCount(terminalAbnormalCount);
|
||||
|
||||
//已消缺数量 solveCount
|
||||
//未消缺数量
|
||||
int notSolveCount = 0, solveCount = 0;
|
||||
if (terminalAbnormalCount != 0) {
|
||||
notSolveCount = (int)solveList.stream().filter(item -> {
|
||||
return item.getIsSolve() == 0;
|
||||
}).map(RMpDevSolveDetail::getDeviceId).distinct().count();
|
||||
|
||||
solveCount = terminalAbnormalCount - notSolveCount;
|
||||
}
|
||||
|
||||
rMpDevSolveVO.setSolveCount(solveCount);
|
||||
|
||||
//消缺率 solveRate
|
||||
if (terminalAbnormalCount == 0) { //防止算术异常
|
||||
rMpDevSolveVO.setSolveRate(00.00);
|
||||
} else {
|
||||
rMpDevSolveVO.setSolveRate(Double.parseDouble(df.format((solveCount * 1.0) / (terminalAbnormalCount * 1.0))) * 100);
|
||||
}
|
||||
|
||||
resultList.add(rMpDevSolveVO);
|
||||
});
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RMpDevSolveDetailVO> getRMpDevSolveDetailList(RMpDevSolveDetailParam rMpDevSolveDetailParam) {
|
||||
//提取参数
|
||||
String id = rMpDevSolveDetailParam.getId(); //单位id
|
||||
List<String> manufactureIdList = StringUtils.isNotBlank(rMpDevSolveDetailParam.getManufactureIds()) ?
|
||||
Arrays.asList(rMpDevSolveDetailParam.getManufactureIds().split(",")) : null; //厂商ids
|
||||
String startTime = rMpDevSolveDetailParam.getStartTime(); //开始时间
|
||||
String endTime = rMpDevSolveDetailParam.getEndTime(); //结束时间
|
||||
|
||||
/**根据条件查询终端**/
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
//单位id集合
|
||||
List<String> orgNoList = deptDTOList.stream().map(DeptDTO::getId).collect(Collectors.toList());
|
||||
|
||||
//查询单位下的终端数据
|
||||
LambdaQueryWrapper<PmsTerminal> terminalWrapper = new LambdaQueryWrapper<>();
|
||||
terminalWrapper.in(PmsTerminal::getOrgId, orgNoList) //单位id
|
||||
.in(CollUtil.isNotEmpty(manufactureIdList), PmsTerminal::getManufacture, manufactureIdList); //厂家
|
||||
List<PmsTerminal> terminalList = iTerminalService.list(terminalWrapper);
|
||||
if (CollUtil.isEmpty(terminalList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<String> terminalIdList = terminalList.stream().map(PmsTerminal::getId).collect(Collectors.toList());
|
||||
Map<String, PmsTerminal> terminalMap = terminalList.stream().collect(Collectors.toMap(PmsTerminal::getId, terminal -> terminal));
|
||||
//查询消缺清单
|
||||
//查询终端消缺数据
|
||||
LambdaQueryWrapper<RMpDevSolveDetail> solveWrapper = new LambdaQueryWrapper<>();
|
||||
solveWrapper.in(CollUtil.isNotEmpty(terminalIdList), RMpDevSolveDetail::getDeviceId, terminalIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpDevSolveDetail::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpDevSolveDetail::getDataDate, endTime);
|
||||
List<RMpDevSolveDetail> solveList = this.list(solveWrapper);
|
||||
|
||||
//封装返回数据
|
||||
List<RMpDevSolveDetailVO> resultList = solveList.stream().map(item -> {
|
||||
RMpDevSolveDetailVO rMpDevSolveDetailVO = new RMpDevSolveDetailVO();
|
||||
BeanUtils.copyProperties(item, rMpDevSolveDetailVO); //终端id、故障时间、故障类型、是否消缺、消缺时间
|
||||
|
||||
rMpDevSolveDetailVO.setOrgId(terminalMap.get(item.getDeviceId()).getOrgId()); //单位id
|
||||
rMpDevSolveDetailVO.setOrgName(terminalMap.get(item.getDeviceId()).getOrgName()); //单位名称
|
||||
rMpDevSolveDetailVO.setPowerId(terminalMap.get(item.getDeviceId()).getPowerStationId()); //变电站id
|
||||
rMpDevSolveDetailVO.setPowerName(terminalMap.get(item.getDeviceId()).getPowerrName()); //变电站名称
|
||||
return rMpDevSolveDetailVO;
|
||||
}).collect(Collectors.toList());
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.njcn.device.pms.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.pojo.param.RStatDevSignalParam;
|
||||
import com.njcn.device.pms.pojo.po.RStatDevSignalD;
|
||||
import com.njcn.device.pms.pojo.po.PmsTerminal;
|
||||
import com.njcn.device.pms.pojo.vo.RStatDevSignalVO;
|
||||
import com.njcn.device.pms.service.majornetwork.ITerminalService;
|
||||
import com.njcn.device.pms.service.majornetwork.RStatDevSignalDService;
|
||||
import com.njcn.device.pms.mapper.majornetwork.RStatDevSignalDMapper;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_stat_dev_signal_d(终端通信管理日表)】的数据库操作Service实现
|
||||
* @createDate 2022-11-11 15:35:35
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RStatDevSignalDServiceImpl extends ServiceImpl<RStatDevSignalDMapper, RStatDevSignalD>
|
||||
implements RStatDevSignalDService{
|
||||
|
||||
private final ITerminalService iTerminalService;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
@Override
|
||||
public List<RStatDevSignalVO> getRStatDevSignalList(RStatDevSignalParam rStatDevSignalParam) {
|
||||
//提取查询条件
|
||||
String id = rStatDevSignalParam.getId(); //单位id
|
||||
String deviceName = rStatDevSignalParam.getDeviceName(); //终端名称
|
||||
String deviceStatus = rStatDevSignalParam.getDeviceStatus(); //终端状态
|
||||
String runStatus = rStatDevSignalParam.getRunStatus(); //运行状态
|
||||
|
||||
if (StringUtils.isBlank(id)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "单位id不可为空");
|
||||
}
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
//单位id集合
|
||||
List<String> orgNoList = deptDTOList.stream().map(DeptDTO::getId).collect(Collectors.toList());
|
||||
|
||||
//查询终端数据
|
||||
LambdaQueryWrapper<PmsTerminal> terminalWrapper = new LambdaQueryWrapper<>();
|
||||
terminalWrapper.in(PmsTerminal::getOrgId, orgNoList).like(StringUtils.isNotBlank(deviceName), PmsTerminal::getName, deviceName);
|
||||
List<PmsTerminal> terminalList = iTerminalService.list(terminalWrapper);
|
||||
//提取终端id
|
||||
List<String> terminalIdList = terminalList.stream().map(PmsTerminal::getId).collect(Collectors.toList());
|
||||
//将终端信息转为map集合 key: 终端id value: 终端实体
|
||||
Map<String, PmsTerminal> terminalMap = terminalList.stream().collect(Collectors.toMap(PmsTerminal::getId, terminal -> terminal));
|
||||
if (CollUtil.isEmpty(terminalIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
//查询业务数据
|
||||
LambdaQueryWrapper<RStatDevSignalD> businessWrapper = new LambdaQueryWrapper<>();
|
||||
businessWrapper.in(RStatDevSignalD::getDeviceId, terminalIdList)
|
||||
.eq(StringUtils.isNotBlank(deviceStatus), RStatDevSignalD::getDeviceStatus, deviceStatus)
|
||||
.eq(StringUtils.isNotBlank(runStatus), RStatDevSignalD::getRunStatus, runStatus);
|
||||
List<RStatDevSignalD> list = this.list(businessWrapper);
|
||||
//封装返回数据
|
||||
List<RStatDevSignalVO> resultList = list.stream().map(item -> {
|
||||
RStatDevSignalVO rStatDevSignalVO = new RStatDevSignalVO();
|
||||
BeanUtils.copyProperties(item, rStatDevSignalVO); //设备状态、运行状态、最后通讯时间(更新时间)
|
||||
rStatDevSignalVO.setTerminalId(item.getDeviceId()); //终端id(终端编号)
|
||||
|
||||
rStatDevSignalVO.setOrgId(terminalMap.get(item.getDeviceId()).getOrgId()); //单位id
|
||||
rStatDevSignalVO.setOrgName(terminalMap.get(item.getDeviceId()).getOrgName()); //单位名称
|
||||
rStatDevSignalVO.setTerminalName(terminalMap.get(item.getDeviceId()).getName()); //终端名称
|
||||
rStatDevSignalVO.setIp(terminalMap.get(item.getDeviceId()).getIp()); //ip
|
||||
rStatDevSignalVO.setPort(terminalMap.get(item.getDeviceId()).getPort()); //端口
|
||||
|
||||
return rStatDevSignalVO;
|
||||
}).collect(Collectors.toList());
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.njcn.harmonic.controller.distribution;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
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.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelMService;
|
||||
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelQService;
|
||||
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelYService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Title RMpBenchmarkLevelController
|
||||
* @Package com.njcn.device.pms.controller
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-10-11 10:34
|
||||
* @Version V1.0
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "配网-基准水平评估")
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/pwRMpBenchmarkLevel")
|
||||
public class PwRMpBenchmarkLevelController extends BaseController {
|
||||
|
||||
private final PwRMpBenchmarkLevelMService rMpBenchmarkLevelMService; //基准水平-月
|
||||
|
||||
private final PwRMpBenchmarkLevelQService rMpBenchmarkLevelQService; //基准水平-季
|
||||
|
||||
private final PwRMpBenchmarkLevelYService rMpBenchmarkLevelYService; //基准水平-年
|
||||
|
||||
@PostMapping("getPwRMpBenchmarkLevelList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("配网-全网基准水平")
|
||||
public HttpResult<Page<PwRMpBenchmarkLevelVO>> getPwRMpBenchmarkLevelList(@RequestBody RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
String methodDescribe = getMethodDescribe("getPwRMpBenchmarkLevelList");
|
||||
if (rMpBenchmarkLevelParam.getType() == null) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.METHOD_ARGUMENT_NOT_VALID_EXCEPTION, null, methodDescribe);
|
||||
}
|
||||
//获取查询条件-时间类型
|
||||
String type = rMpBenchmarkLevelParam.getType().toString();
|
||||
Page<PwRMpBenchmarkLevelVO> rMpBenchmarkLevelList;
|
||||
switch (type) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
//查询基准水平-年数据
|
||||
rMpBenchmarkLevelList = rMpBenchmarkLevelYService.getPwRMpBenchmarkLevelList(rMpBenchmarkLevelParam);
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
//查询基准水平-季数据
|
||||
rMpBenchmarkLevelList = rMpBenchmarkLevelQService.getPwRMpBenchmarkLevelList(rMpBenchmarkLevelParam);
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
//查询基准水平-月数据
|
||||
rMpBenchmarkLevelList = rMpBenchmarkLevelMService.getPwRMpBenchmarkLevelList(rMpBenchmarkLevelParam);
|
||||
break;
|
||||
default:
|
||||
//如果前端没有传type默认查询月数据
|
||||
rMpBenchmarkLevelList = rMpBenchmarkLevelMService.getPwRMpBenchmarkLevelList(rMpBenchmarkLevelParam);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rMpBenchmarkLevelList, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.njcn.harmonic.controller.distribution;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.vo.RArrayVO;
|
||||
import com.njcn.harmonic.pojo.vo.RIconVO;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicOrgMService;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicOrgQService;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicOrgYService;
|
||||
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 org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "配网指标分类概览-各单位分类总览")
|
||||
@RequestMapping("/harmonic/pwRStatHarmonicOrg")
|
||||
public class PwRStatHarmonicOrgController extends BaseController {
|
||||
|
||||
private final RStatHarmonicOrgYService rStatHarmonicOrgYService;
|
||||
private final RStatHarmonicOrgQService rStatHarmonicOrgQService;
|
||||
private final RStatHarmonicOrgMService rStatHarmonicOrgMService;
|
||||
|
||||
/**
|
||||
* 查询查询监测点稳态指标 日/月点数
|
||||
*/
|
||||
@PostMapping("/getPwRStatHarmonicOrg")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询稳态累计超标监测点数")
|
||||
@ApiImplicitParam(name = "param", value = "累计超标监测点数参数", required = true)
|
||||
public HttpResult<List<RArrayVO>> getPwRStatHarmonicOrg(@RequestBody StatisticsBizBaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("getPwRStatHarmonicOrg");
|
||||
List<RArrayVO> org = null;
|
||||
String string = param.getType().toString();
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
org = rStatHarmonicOrgYService.getPwRStatHarmonicYAll(param);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
org = rStatHarmonicOrgQService.getPwRStatHarmonicQAll(param);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
org = rStatHarmonicOrgMService.getPwRStatHarmonicMAll(param);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, org, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询查询监测点稳态指标 日/月点数
|
||||
*/
|
||||
@PostMapping("/getPwRStatHarmonicOrgIcon")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询稳态各单位超标监测统计图")
|
||||
@ApiImplicitParam(name = "param", value = "各单位超标监测统计参数", required = true)
|
||||
public HttpResult<List<RIconVO>> getPwRStatHarmonicOrgIcon(@RequestBody RStatHarmonicMParam param) {
|
||||
String methodDescribe = getMethodDescribe("getPwRStatHarmonicOrgIcon");
|
||||
List<RIconVO> icon= null;
|
||||
String string = param.getType().toString();
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数统计图-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
icon = rStatHarmonicOrgYService.getPwRStatHarmonicOrgYIcon(param);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
icon = rStatHarmonicOrgQService.getPwRStatHarmonicOrgQIcon(param);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
icon = rStatHarmonicOrgMService.getPwRStatHarmonicOrgMIcon(param);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, icon, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.harmonic.controller.distribution;
|
||||
|
||||
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.RStatPwPermeabilityMParam;
|
||||
import com.njcn.harmonic.pojo.vo.RStatPwPermeabilityMVO;
|
||||
import com.njcn.harmonic.service.distribution.RStatPwPermeabilityMService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Title RStatPwPermeabilityMController
|
||||
* @Package com.njcn.harmonic.controller
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-11-07 13:55
|
||||
* @Version V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rStatPwPermeability")
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "配网-各渗透率光伏台区基准水平")
|
||||
public class RStatPwPermeabilityMController extends BaseController {
|
||||
|
||||
private final RStatPwPermeabilityMService rStatPwPermeabilityMService;
|
||||
|
||||
@PostMapping("getPwPermeabilityList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询各渗透率光伏台区基准水平")
|
||||
public HttpResult<Page<RStatPwPermeabilityMVO>> getPwPermeabilityList(@RequestBody RStatPwPermeabilityMParam rStatPwPermeabilityMParam) {
|
||||
String methodDescribe = getMethodDescribe("getPwPermeabilityList");
|
||||
Page<RStatPwPermeabilityMVO> list = rStatPwPermeabilityMService.getPwPermeabilityList(rStatPwPermeabilityMParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.njcn.harmonic.controller.majornetwork;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
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.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.majornetwork.RMpBenchmarkLevelMService;
|
||||
import com.njcn.harmonic.service.majornetwork.RMpBenchmarkLevelQService;
|
||||
import com.njcn.harmonic.service.majornetwork.RMpBenchmarkLevelYService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Title RMpBenchmarkLevelController
|
||||
* @Package com.njcn.device.pms.controller
|
||||
* @Author jianghaifei
|
||||
* @Date 2022-10-11 10:34
|
||||
* @Version V1.0
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "主网-基准水平评估")
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/rMpBenchmarkLevel")
|
||||
public class RMpBenchmarkLevelController extends BaseController {
|
||||
|
||||
private final RMpBenchmarkLevelMService rMpBenchmarkLevelMService; //基准水平-月
|
||||
|
||||
private final RMpBenchmarkLevelQService rMpBenchmarkLevelQService; //基准水平-季
|
||||
|
||||
private final RMpBenchmarkLevelYService rMpBenchmarkLevelYService; //基准水平-年
|
||||
|
||||
|
||||
@PostMapping("getAllRMpBenchmarkLevelList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("主网-区域稳态电能质量水平评估")
|
||||
public HttpResult<List<RMpBenchmarkLevelVO>> getAllRMpBenchmarkLevelList(@RequestBody RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
String methodDescribe = getMethodDescribe("getAllRMpBenchmarkLevelList");
|
||||
//获取查询条件-时间类型
|
||||
String type = rMpBenchmarkLevelParam.getType().toString();
|
||||
List<RMpBenchmarkLevelVO> rMpBenchmarkLevelList;
|
||||
switch (type) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
//查询基准水平-年数据
|
||||
rMpBenchmarkLevelList = rMpBenchmarkLevelYService.getRMpBenchmarkLevelList(rMpBenchmarkLevelParam);
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
//查询基准水平-季数据
|
||||
rMpBenchmarkLevelList = rMpBenchmarkLevelQService.getRMpBenchmarkLevelList(rMpBenchmarkLevelParam);
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
//查询基准水平-月数据
|
||||
rMpBenchmarkLevelList = rMpBenchmarkLevelMService.getRMpBenchmarkLevelList(rMpBenchmarkLevelParam);
|
||||
break;
|
||||
default:
|
||||
//如果前端没有传type默认查询月数据
|
||||
rMpBenchmarkLevelList = rMpBenchmarkLevelMService.getRMpBenchmarkLevelList(rMpBenchmarkLevelParam);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rMpBenchmarkLevelList, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.njcn.harmonic.controller.majornetwork;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.vo.*;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicMService;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicQService;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicYService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @since 2022-10-09
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "主网指标分类概览-监测点分类总览")
|
||||
@RequestMapping("/harmonic/rStatHarmonic")
|
||||
public class RStatHarmonicController extends BaseController {
|
||||
|
||||
private final RStatHarmonicMService rStatHarmonicMService;
|
||||
private final RStatHarmonicQService rStatHarmonicQService;
|
||||
private final RStatHarmonicYService rStatHarmonicYService;
|
||||
|
||||
/**
|
||||
* 查询查询监测点稳态指标 日/月点数
|
||||
*/
|
||||
@GetMapping("/getAllRStatHarmonic")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询稳态累计超标监测点数")
|
||||
public HttpResult<List<RArrayVO>> getAllRStatHarmonic(StatisticsBizBaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("getAllRStatHarmonic");
|
||||
List<RArrayVO> rStatHarmonicMAll = null;
|
||||
String string = param.getType().toString();
|
||||
switch (string) {
|
||||
//查询超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
rStatHarmonicMAll = rStatHarmonicYService.getRStatHarmonicYAll(param);
|
||||
break;
|
||||
//查询超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
rStatHarmonicMAll = rStatHarmonicQService.getRStatHarmonicQAll(param);
|
||||
break;
|
||||
//查询超标监测点数-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
rStatHarmonicMAll = rStatHarmonicMService.getRStatHarmonicMAll(param);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rStatHarmonicMAll, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 电铁-频率偏差-电压统计图
|
||||
*/
|
||||
@GetMapping("/getRStatHarmonicIconVoltage")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("稳态电铁-频率偏差-电压统计图")
|
||||
public HttpResult<List<RIconVO>> getRStatHarmonicIconVoltage(RStatHarmonicMParam param) {
|
||||
String methodDescribe = getMethodDescribe("getRStatHarmonicIconVoltage");
|
||||
List<RIconVO> rStatHarmonicIcon = rStatHarmonicMService.getRStatHarmonicIconVoltage(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rStatHarmonicIcon, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 电铁-频率偏差-电压统计图
|
||||
*/
|
||||
@GetMapping("/getRStatHarmonicIconDate")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("稳态电铁-频率偏差-越线日期统计图")
|
||||
public HttpResult<List<RHarmonicPolylineVO>> getRStatHarmonicIconDate(RStatHarmonicMParam param) {
|
||||
String methodDescribe = getMethodDescribe("getRStatHarmonicIconDate");
|
||||
List<RHarmonicPolylineVO> rStatHarmonicIcon = rStatHarmonicMService.getRStatHarmonicIconDate(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rStatHarmonicIcon, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.njcn.harmonic.controller.majornetwork;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.vo.RArrayVO;
|
||||
import com.njcn.harmonic.pojo.vo.RIconVO;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicOrgMService;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicOrgQService;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicOrgYService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "主网指标分类概览-各单位分类总览")
|
||||
@RequestMapping("/harmonic/rStatHarmonicOrg")
|
||||
public class RStatHarmonicOrgController extends BaseController {
|
||||
|
||||
private final RStatHarmonicOrgYService rStatHarmonicOrgYService;
|
||||
private final RStatHarmonicOrgQService rStatHarmonicOrgQService;
|
||||
private final RStatHarmonicOrgMService rStatHarmonicOrgMService;
|
||||
|
||||
/**
|
||||
* 查询查询监测点稳态指标 日/月点数
|
||||
*/
|
||||
@GetMapping("/getAllRStatHarmonicOrg")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询稳态累计超标监测点数")
|
||||
public HttpResult<List<RArrayVO>> getAllRStatHarmonicOrg(StatisticsBizBaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("getAllRStatHarmonicOrg");
|
||||
List<RArrayVO> rStatHarmonicOrgMAll = null;
|
||||
String string = param.getType().toString();
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
rStatHarmonicOrgMAll = rStatHarmonicOrgYService.getRStatHarmonicYAll(param);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
rStatHarmonicOrgMAll = rStatHarmonicOrgQService.getRStatHarmonicQAll(param);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
rStatHarmonicOrgMAll = rStatHarmonicOrgMService.getRStatHarmonicMAll(param);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rStatHarmonicOrgMAll, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询查询监测点稳态指标 日/月点数
|
||||
*/
|
||||
@GetMapping("/getAllRStatHarmonicOrgIcon")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询稳态各单位超标监测统计图")
|
||||
public HttpResult<List<RIconVO>> getAllRStatHarmonicOrgIcon(RStatHarmonicMParam param) {
|
||||
String methodDescribe = getMethodDescribe("getAllRStatHarmonicOrgIcon");
|
||||
List<RIconVO> getAllRStatHarmonicOrgIcon = null;
|
||||
String string = param.getType().toString();
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数统计图-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
getAllRStatHarmonicOrgIcon = rStatHarmonicOrgYService.getRStatHarmonicOrgYIcon(param);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
getAllRStatHarmonicOrgIcon = rStatHarmonicOrgQService.getRStatHarmonicOrgQIcon(param);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
getAllRStatHarmonicOrgIcon = rStatHarmonicOrgMService.getRStatHarmonicOrgMIcon(param);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, getAllRStatHarmonicOrgIcon, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.njcn.harmonic.controller.majornetwork;
|
||||
|
||||
|
||||
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.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.vo.RSubstationIcon2VO;
|
||||
import com.njcn.harmonic.pojo.vo.RSubstationIconVO;
|
||||
import com.njcn.harmonic.pojo.vo.RVoltageIconVO;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatSubstationMService;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatSubstationVoltageMService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @since 2022-10-18
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "主网指标分类概览-变电站分类总览")
|
||||
@RequestMapping("/harmonic/rStatSubstation")
|
||||
public class RStatSubstationController extends BaseController {
|
||||
|
||||
private final RStatSubstationMService rStatSubstationMService;
|
||||
private final RStatSubstationVoltageMService rStatSubstationVoltageMService;
|
||||
|
||||
/**
|
||||
* 变电站稳态指标超标分布(按超标天数)
|
||||
*/
|
||||
@GetMapping("/getAllRStatSubstationIconDays")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("变电站稳态指标超标分布(按超标天数)")
|
||||
public HttpResult<RSubstationIconVO> getAllRStatSubstationIconDays(StatisticsBizBaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("getAllRStatSubstationIconDays");
|
||||
RSubstationIconVO statSubstationIcon = rStatSubstationMService.getStatSubstationIcon(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, statSubstationIcon, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 变电站稳态指标超标分布(按电压等级)
|
||||
*/
|
||||
@GetMapping("/getAllRStatSubstationIconVoltage")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("变电站稳态指标超标分布(按电压等级)")
|
||||
public HttpResult<List<RVoltageIconVO>> getAllRStatSubstationIconVoltage(StatisticsBizBaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("getAllRStatSubstationIconVoltage");
|
||||
List<RVoltageIconVO> statSubstationIcon = rStatSubstationVoltageMService.getStatSubstationIcon(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, statSubstationIcon, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 变电站稳态指标平均超标天数
|
||||
*/
|
||||
@GetMapping("/getAllRStatSubstationIconAvgDays")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("变电站稳态指标平均超标天数")
|
||||
public HttpResult<List<RSubstationIcon2VO>> getAllRStatSubstationIconAvgDays(StatisticsBizBaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("getAllRStatSubstationIconAvgDays");
|
||||
List<RSubstationIcon2VO> statSubstationIcon = rStatSubstationMService.getStatSubstationIcon2(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, statSubstationIcon, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.harmonic.mapper.distribution;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_m】的数据库操作Mapper
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
* @Entity com.njcn.device.pms.pojo.po.RMpBenchmarkLevelM
|
||||
*/
|
||||
public interface PwRMpBenchmarkLevelMMapper extends BaseMapper<RMpBenchmarkLevelM> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.harmonic.mapper.distribution;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_q】的数据库操作Mapper
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
* @Entity com.njcn.device.pms.pojo.po.RMpBenchmarkLevelQ
|
||||
*/
|
||||
public interface PwRMpBenchmarkLevelQMapper extends BaseMapper<RMpBenchmarkLevelQ> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.harmonic.mapper.distribution;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelY;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_y】的数据库操作Mapper
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
* @Entity com.njcn.device.pms.pojo.po.RMpBenchmarkLevelY
|
||||
*/
|
||||
public interface PwRMpBenchmarkLevelYMapper extends BaseMapper<RMpBenchmarkLevelY> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.harmonic.mapper.distribution;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.harmonic.pojo.param.RStatPwPermeabilityMParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatPwPermeabilityM;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.vo.RStatPwPermeabilityMVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_stat_pw_permeability_m】的数据库操作Mapper
|
||||
* @createDate 2022-11-07 10:35:21
|
||||
* @Entity com.njcn.harmonic.pojo.po.RStatPwPermeabilityM
|
||||
*/
|
||||
public interface RStatPwPermeabilityMMapper extends BaseMapper<RStatPwPermeabilityM> {
|
||||
|
||||
Page<RStatPwPermeabilityMVO> getPwPermeabilityList(IPage<RStatPwPermeabilityMVO> page, @Param("condMap") Map<String, Object> condMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.distribution.PwRMpBenchmarkLevelMMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM">
|
||||
<id property="measurementPointId" column="measurement_point_id" jdbcType="VARCHAR"/>
|
||||
<id property="dataDate" column="data_date" jdbcType="DATE"/>
|
||||
<result property="voltageAvg" column="voltage_avg" jdbcType="FLOAT"/>
|
||||
<result property="voltageSd" column="voltage_sd" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceAvg" column="unbalance_avg" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceSd" column="unbalance_sd" jdbcType="FLOAT"/>
|
||||
<result property="vthdAvg" column="vthd_avg" jdbcType="FLOAT"/>
|
||||
<result property="vthdSd" column="vthd_sd" jdbcType="FLOAT"/>
|
||||
<result property="flickerAvg" column="flicker_avg" jdbcType="FLOAT"/>
|
||||
<result property="flickerSd" column="flicker_sd" jdbcType="FLOAT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
measurement_point_id,data_date,voltage_avg,
|
||||
voltage_sd,unbalance_avg,unbalance_sd,
|
||||
vthd_avg,vthd_sd,flicker_avg,
|
||||
flicker_sd
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.distribution.PwRMpBenchmarkLevelQMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ">
|
||||
<id property="measurementPointId" column="measurement_point_id" jdbcType="VARCHAR"/>
|
||||
<id property="dataDate" column="data_date" jdbcType="DATE"/>
|
||||
<result property="voltageAvg" column="voltage_avg" jdbcType="FLOAT"/>
|
||||
<result property="voltageSd" column="voltage_sd" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceAvg" column="unbalance_avg" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceSd" column="unbalance_sd" jdbcType="FLOAT"/>
|
||||
<result property="vthdAvg" column="vthd_avg" jdbcType="FLOAT"/>
|
||||
<result property="vthdSd" column="vthd_sd" jdbcType="FLOAT"/>
|
||||
<result property="flickerAvg" column="flicker_avg" jdbcType="FLOAT"/>
|
||||
<result property="flickerSd" column="flicker_sd" jdbcType="FLOAT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
measurement_point_id,data_date,voltage_avg,
|
||||
voltage_sd,unbalance_avg,unbalance_sd,
|
||||
vthd_avg,vthd_sd,flicker_avg,
|
||||
flicker_sd
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.distribution.PwRMpBenchmarkLevelYMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpBenchmarkLevelY">
|
||||
<id property="measurementPointId" column="measurement_point_id" jdbcType="VARCHAR"/>
|
||||
<id property="dataDate" column="data_date" jdbcType="DATE"/>
|
||||
<result property="voltageAvg" column="voltage_avg" jdbcType="FLOAT"/>
|
||||
<result property="voltageSd" column="voltage_sd" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceAvg" column="unbalance_avg" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceSd" column="unbalance_sd" jdbcType="FLOAT"/>
|
||||
<result property="vthdAvg" column="vthd_avg" jdbcType="FLOAT"/>
|
||||
<result property="vthdSd" column="vthd_sd" jdbcType="FLOAT"/>
|
||||
<result property="flickerAvg" column="flicker_avg" jdbcType="FLOAT"/>
|
||||
<result property="flickerSd" column="flicker_sd" jdbcType="FLOAT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
measurement_point_id,data_date,voltage_avg,
|
||||
voltage_sd,unbalance_avg,unbalance_sd,
|
||||
vthd_avg,vthd_sd,flicker_avg,
|
||||
flicker_sd
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.distribution.RStatPwPermeabilityMMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RStatPwPermeabilityM">
|
||||
<id property="orgNo" column="org_no" jdbcType="VARCHAR"/>
|
||||
<id property="dataDate" column="data_date" jdbcType="DATE"/>
|
||||
<id property="psrId" column="psr_id" jdbcType="VARCHAR"/>
|
||||
<result property="voltageAvg" column="voltage_avg" jdbcType="FLOAT"/>
|
||||
<result property="voltageSd" column="voltage_sd" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceAvg" column="unbalance_avg" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceSd" column="unbalance_sd" jdbcType="FLOAT"/>
|
||||
<result property="vthdAvg" column="vthd_avg" jdbcType="FLOAT"/>
|
||||
<result property="vthdSd" column="vthd_sd" jdbcType="FLOAT"/>
|
||||
<result property="flickerAvg" column="flicker_avg" jdbcType="FLOAT"/>
|
||||
<result property="flickerSd" column="flicker_sd" jdbcType="FLOAT"/>
|
||||
<result property="permeabilityType" column="permeability_type" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
org_no,data_date,psr_id,
|
||||
voltage_avg,voltage_sd,unbalance_avg,
|
||||
unbalance_sd,vthd_avg,vthd_sd,
|
||||
flicker_avg,flicker_sd,permeability_type
|
||||
</sql>
|
||||
|
||||
<select id="getPwPermeabilityList" resultType="com.njcn.harmonic.pojo.vo.RStatPwPermeabilityMVO">
|
||||
select
|
||||
rspp25.org_no as orgNO, rspp25.psr_id as psrId,
|
||||
|
||||
rspp25.voltage_avg as voltageAvg25,rspp25.voltage_sd as voltageSd25,rspp25.unbalance_avg as unbalanceAvg25,
|
||||
rspp25.unbalance_sd as unbalanceSd25, rspp25.vthd_avg as vthdAvg25,rspp25.vthd_sd as vthdSd25,
|
||||
rspp25.flicker_avg as flickerAvg25, rspp25.flicker_sd as flickerSd25,
|
||||
|
||||
rspp50.voltage_avg as voltageAvg50,rspp50.voltage_sd as voltageSd50,rspp50.unbalance_avg as unbalanceAvg50,
|
||||
rspp50.unbalance_sd as unbalanceSd50, rspp50.vthd_avg as vthdAvg50,rspp50.vthd_sd as vthdSd50,
|
||||
rspp50.flicker_avg as flickerAvg50, rspp50.flicker_sd as flickerSd50,
|
||||
|
||||
rspp75.voltage_avg as voltageAvg75,rspp75.voltage_sd as voltageSd75,rspp75.unbalance_avg as unbalanceAvg75,
|
||||
rspp75.unbalance_sd as unbalanceSd75, rspp75.vthd_avg as vthdAvg75,rspp75.vthd_sd as vthdSd75,
|
||||
rspp75.flicker_avg as flickerAvg75, rspp75.flicker_sd as flickerSd75,
|
||||
|
||||
rspp99.voltage_avg as voltageAvg99,rspp99.voltage_sd as voltageSd99,rspp99.unbalance_avg as unbalanceAvg99,
|
||||
rspp99.unbalance_sd as unbalanceSd99, rspp99.vthd_avg as vthdAvg99,rspp99.vthd_sd as vthdSd99,
|
||||
rspp99.flicker_avg as flickerAvg99, rspp99.flicker_sd as flickerSd99,
|
||||
|
||||
rspp100.voltage_avg as voltageAvg100,rspp100.voltage_sd as voltageSd100,rspp100.unbalance_avg as unbalanceAvg100,
|
||||
rspp100.unbalance_sd as unbalanceSd100, rspp100.vthd_avg as vthdAvg100,rspp100.vthd_sd as vthdSd100,
|
||||
rspp100.flicker_avg as flickerAvg100, rspp100.flicker_sd as flickerSd100
|
||||
from
|
||||
r_stat_pw_permeability_m rspp25
|
||||
left join r_stat_pw_permeability_m rspp50 on rspp25.psr_id = rspp50.psr_id
|
||||
left join r_stat_pw_permeability_m rspp75 on rspp25.psr_id = rspp75.psr_id
|
||||
left join r_stat_pw_permeability_m rspp99 on rspp25.psr_id = rspp99.psr_id
|
||||
left join r_stat_pw_permeability_m rspp100 on rspp25.psr_id = rspp100.psr_id
|
||||
where 1 = 1
|
||||
|
||||
<if test="condMap.startTime != null and condMap.startTime != ''">
|
||||
and DATE_FORMAT(rspp25.data_date, '%Y-%m') >= DATE_FORMAT(#{condMap.startTime}, '%Y-%m')
|
||||
</if>
|
||||
<if test="condMap.endTime != null and condMap.endTime != ''">
|
||||
and DATE_FORMAT(rspp25.data_date, '%Y-%m') <= DATE_FORMAT(#{condMap.endTime}, '%Y-%m')
|
||||
</if>
|
||||
and rspp25.data_date = rspp50.data_date
|
||||
and rspp25.data_date = rspp75.data_date
|
||||
and rspp25.data_date = rspp99.data_date
|
||||
and rspp25.data_date = rspp100.data_date
|
||||
|
||||
and rspp25.permeability_type = #{condMap.Rate_0_25}
|
||||
and rspp50.permeability_type = #{condMap.Rate_25_50}
|
||||
and rspp75.permeability_type = #{condMap.Rate_50_75}
|
||||
and rspp99.permeability_type = #{condMap.Rate_75_100}
|
||||
and rspp100.permeability_type = #{condMap.Rate_100}
|
||||
|
||||
and rspp25.psr_id in
|
||||
<foreach collection="condMap.idList" open="(" close=")" separator="," item="id">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.harmonic.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_m】的数据库操作Mapper
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
* @Entity com.njcn.device.pms.pojo.po.RMpBenchmarkLevelM
|
||||
*/
|
||||
public interface RMpBenchmarkLevelMMapper extends BaseMapper<RMpBenchmarkLevelM> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.harmonic.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_q】的数据库操作Mapper
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
* @Entity com.njcn.device.pms.pojo.po.RMpBenchmarkLevelQ
|
||||
*/
|
||||
public interface RMpBenchmarkLevelQMapper extends BaseMapper<RMpBenchmarkLevelQ> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.harmonic.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelY;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_y】的数据库操作Mapper
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
* @Entity com.njcn.device.pms.pojo.po.RMpBenchmarkLevelY
|
||||
*/
|
||||
public interface RMpBenchmarkLevelYMapper extends BaseMapper<RMpBenchmarkLevelY> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.majornetwork.RMpBenchmarkLevelMMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM">
|
||||
<id property="measurementPointId" column="measurement_point_id" jdbcType="VARCHAR"/>
|
||||
<id property="dataDate" column="data_date" jdbcType="DATE"/>
|
||||
<result property="voltageAvg" column="voltage_avg" jdbcType="FLOAT"/>
|
||||
<result property="voltageSd" column="voltage_sd" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceAvg" column="unbalance_avg" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceSd" column="unbalance_sd" jdbcType="FLOAT"/>
|
||||
<result property="vthdAvg" column="vthd_avg" jdbcType="FLOAT"/>
|
||||
<result property="vthdSd" column="vthd_sd" jdbcType="FLOAT"/>
|
||||
<result property="flickerAvg" column="flicker_avg" jdbcType="FLOAT"/>
|
||||
<result property="flickerSd" column="flicker_sd" jdbcType="FLOAT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
measurement_point_id,data_date,voltage_avg,
|
||||
voltage_sd,unbalance_avg,unbalance_sd,
|
||||
vthd_avg,vthd_sd,flicker_avg,
|
||||
flicker_sd
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.majornetwork.RMpBenchmarkLevelQMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ">
|
||||
<id property="measurementPointId" column="measurement_point_id" jdbcType="VARCHAR"/>
|
||||
<id property="dataDate" column="data_date" jdbcType="DATE"/>
|
||||
<result property="voltageAvg" column="voltage_avg" jdbcType="FLOAT"/>
|
||||
<result property="voltageSd" column="voltage_sd" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceAvg" column="unbalance_avg" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceSd" column="unbalance_sd" jdbcType="FLOAT"/>
|
||||
<result property="vthdAvg" column="vthd_avg" jdbcType="FLOAT"/>
|
||||
<result property="vthdSd" column="vthd_sd" jdbcType="FLOAT"/>
|
||||
<result property="flickerAvg" column="flicker_avg" jdbcType="FLOAT"/>
|
||||
<result property="flickerSd" column="flicker_sd" jdbcType="FLOAT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
measurement_point_id,data_date,voltage_avg,
|
||||
voltage_sd,unbalance_avg,unbalance_sd,
|
||||
vthd_avg,vthd_sd,flicker_avg,
|
||||
flicker_sd
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.majornetwork.RMpBenchmarkLevelYMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpBenchmarkLevelY">
|
||||
<id property="measurementPointId" column="measurement_point_id" jdbcType="VARCHAR"/>
|
||||
<id property="dataDate" column="data_date" jdbcType="DATE"/>
|
||||
<result property="voltageAvg" column="voltage_avg" jdbcType="FLOAT"/>
|
||||
<result property="voltageSd" column="voltage_sd" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceAvg" column="unbalance_avg" jdbcType="FLOAT"/>
|
||||
<result property="unbalanceSd" column="unbalance_sd" jdbcType="FLOAT"/>
|
||||
<result property="vthdAvg" column="vthd_avg" jdbcType="FLOAT"/>
|
||||
<result property="vthdSd" column="vthd_sd" jdbcType="FLOAT"/>
|
||||
<result property="flickerAvg" column="flicker_avg" jdbcType="FLOAT"/>
|
||||
<result property="flickerSd" column="flicker_sd" jdbcType="FLOAT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
measurement_point_id,data_date,voltage_avg,
|
||||
voltage_sd,unbalance_avg,unbalance_sd,
|
||||
vthd_avg,vthd_sd,flicker_avg,
|
||||
flicker_sd
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.harmonic.service.distribution;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_m】的数据库操作Service
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
public interface PwRMpBenchmarkLevelMService extends IService<RMpBenchmarkLevelM> {
|
||||
/***
|
||||
* 配网-全网基准水平
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-04 10:30
|
||||
* @param rMpBenchmarkLevelParam
|
||||
* @return java.util.List<com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO>
|
||||
*/
|
||||
Page<PwRMpBenchmarkLevelVO> getPwRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.harmonic.service.distribution;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ;
|
||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_q】的数据库操作Service
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
public interface PwRMpBenchmarkLevelQService extends IService<RMpBenchmarkLevelQ> {
|
||||
/***
|
||||
* 配网-全网基准水平
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-04 10:31
|
||||
* @param rMpBenchmarkLevelParam
|
||||
* @return java.util.List<com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO>
|
||||
*/
|
||||
Page<PwRMpBenchmarkLevelVO> getPwRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.harmonic.service.distribution;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelY;
|
||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_y】的数据库操作Service
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
public interface PwRMpBenchmarkLevelYService extends IService<RMpBenchmarkLevelY> {
|
||||
|
||||
/***
|
||||
* 配网-全网基准水平
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-04 10:30
|
||||
* @param rMpBenchmarkLevelParam
|
||||
* @return java.util.List<com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO>
|
||||
*/
|
||||
Page<PwRMpBenchmarkLevelVO> getPwRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.harmonic.service.distribution;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.harmonic.pojo.param.RStatPwPermeabilityMParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatPwPermeabilityM;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.vo.RStatPwPermeabilityMVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 各渗透率光伏台区基准水平
|
||||
* @author jianghf
|
||||
* @description 针对表【r_stat_pw_permeability_m】的数据库操作Service
|
||||
* @createDate 2022-11-07 10:35:21
|
||||
*/
|
||||
public interface RStatPwPermeabilityMService extends IService<RStatPwPermeabilityM> {
|
||||
|
||||
/***
|
||||
* 获取各渗透率光伏台区基准水平
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-07 14:38
|
||||
* @param rStatPwPermeabilityMParam
|
||||
* @return java.util.List<com.njcn.harmonic.pojo.vo.RStatPwPermeabilityMVO>
|
||||
*/
|
||||
Page<RStatPwPermeabilityMVO> getPwPermeabilityList(RStatPwPermeabilityMParam rStatPwPermeabilityMParam);
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.njcn.harmonic.service.distribution.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.harmonic.mapper.distribution.PwRMpBenchmarkLevelMMapper;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelMService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_m】的数据库操作Service实现
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkLevelMMapper, RMpBenchmarkLevelM>
|
||||
implements PwRMpBenchmarkLevelMService {
|
||||
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
|
||||
|
||||
/***
|
||||
* 配网-全网基准水平
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-04 10:30
|
||||
* @param rMpBenchmarkLevelParam
|
||||
* @return java.util.List<com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO>
|
||||
*/
|
||||
@Override
|
||||
public Page<PwRMpBenchmarkLevelVO> getPwRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
//提取查询条件
|
||||
String id = rMpBenchmarkLevelParam.getId(); //单位id
|
||||
if (StringUtils.isBlank(id)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "单位id不可为空");
|
||||
}
|
||||
String startTime = rMpBenchmarkLevelParam.getStartTime(); //开始时间
|
||||
String endTime = rMpBenchmarkLevelParam.getEndTime(); //截止时间
|
||||
List <String> voltageLevelParamList = StringUtils.isNotBlank(rMpBenchmarkLevelParam.getVoltageLevel()) ? Arrays.asList(rMpBenchmarkLevelParam.getVoltageLevel().split(",")) : null; //电压等级
|
||||
Integer pageNum = rMpBenchmarkLevelParam.getPageNum() != null && rMpBenchmarkLevelParam.getPageNum() != 0 ? rMpBenchmarkLevelParam.getPageNum() : 1; //页码
|
||||
Integer pageSize = rMpBenchmarkLevelParam.getPageSize() != null && rMpBenchmarkLevelParam.getPageSize() != 0 ? rMpBenchmarkLevelParam.getPageSize() : 10; //页面尺寸
|
||||
|
||||
//根据条件查询单位下面的所有配网监测点
|
||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||
pwPmsMonitorParam.setOrgId(id); //单位id
|
||||
pwPmsMonitorParam.setVoltageLevels(voltageLevelParamList); //电压等级
|
||||
List<PwPmsMonitorDTO> pwMonitorList = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
if (CollUtil.isEmpty(pwMonitorList)) {
|
||||
return new Page<>();
|
||||
}
|
||||
//监测点id集合
|
||||
List<String> monitorIdList = pwMonitorList.stream().map(PwPmsMonitorDTO::getMonitorId).collect(Collectors.toList());
|
||||
//监测点map key:监测点id value:监测点实体
|
||||
Map<String, PwPmsMonitorDTO> monitorMap = pwMonitorList.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, monitor -> monitor));
|
||||
|
||||
//查询【基准水平-月】数据
|
||||
/*组装条件:where measurement_point_id in (monitorIdList) and data_date >= startTime
|
||||
and data_date <= endTime and voltage_level
|
||||
*/
|
||||
LambdaQueryWrapper<RMpBenchmarkLevelM> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(CollUtil.isNotEmpty(monitorIdList), RMpBenchmarkLevelM::getMeasurementPointId, monitorIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpBenchmarkLevelM::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpBenchmarkLevelM::getDataDate, endTime);
|
||||
Page<RMpBenchmarkLevelM> listPage = this.page(new Page<>(pageNum, pageSize), lambdaQueryWrapper);
|
||||
List<PwRMpBenchmarkLevelVO> resultList = listPage.getRecords().stream().map(item -> {
|
||||
//封装前端需要的对象
|
||||
PwRMpBenchmarkLevelVO rMpBenchmarkLevelVO = new PwRMpBenchmarkLevelVO();
|
||||
BeanUtils.copyProperties(item, rMpBenchmarkLevelVO);
|
||||
//单位信息
|
||||
rMpBenchmarkLevelVO.setOrgNo(monitorMap.get(item.getMeasurementPointId()).getOrgId()); //单位id
|
||||
rMpBenchmarkLevelVO.setOrgName(monitorMap.get(item.getMeasurementPointId()).getOrgName()); //单位名称
|
||||
//监测点信息
|
||||
rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称
|
||||
//电压等级
|
||||
rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getVoltageLevel());
|
||||
return rMpBenchmarkLevelVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
Page<PwRMpBenchmarkLevelVO> resultPage = new Page<>();
|
||||
BeanUtils.copyProperties(listPage, resultPage);
|
||||
resultPage.setRecords(resultList);
|
||||
|
||||
return resultPage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.njcn.harmonic.service.distribution.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.harmonic.mapper.distribution.PwRMpBenchmarkLevelQMapper;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ;
|
||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelQService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_q】的数据库操作Service实现
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PwRMpBenchmarkLevelQServiceImpl extends ServiceImpl<PwRMpBenchmarkLevelQMapper, RMpBenchmarkLevelQ>
|
||||
implements PwRMpBenchmarkLevelQService {
|
||||
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
|
||||
/***
|
||||
* 配网-全网基准水平
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-04 10:31
|
||||
* @param rMpBenchmarkLevelParam
|
||||
* @return java.util.List<com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO>
|
||||
*/
|
||||
@Override
|
||||
public Page<PwRMpBenchmarkLevelVO> getPwRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
//提取查询条件
|
||||
String id = rMpBenchmarkLevelParam.getId(); //单位id
|
||||
if (StringUtils.isBlank(id)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "单位id不可为空");
|
||||
}
|
||||
String startTime = rMpBenchmarkLevelParam.getStartTime(); //开始时间
|
||||
String endTime = rMpBenchmarkLevelParam.getEndTime(); //截止时间
|
||||
List <String> voltageLevelParamList = StringUtils.isNotBlank(rMpBenchmarkLevelParam.getVoltageLevel()) ? Arrays.asList(rMpBenchmarkLevelParam.getVoltageLevel().split(",")) : null; //电压等级
|
||||
Integer pageNum = rMpBenchmarkLevelParam.getPageNum() != null && rMpBenchmarkLevelParam.getPageNum() != 0 ? rMpBenchmarkLevelParam.getPageNum() : 1; //页码
|
||||
Integer pageSize = rMpBenchmarkLevelParam.getPageSize() != null && rMpBenchmarkLevelParam.getPageSize() != 0 ? rMpBenchmarkLevelParam.getPageSize() : 10; //页面尺寸
|
||||
|
||||
//根据条件查询单位下面的所有配网监测点
|
||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||
pwPmsMonitorParam.setOrgId(id); //单位id
|
||||
pwPmsMonitorParam.setVoltageLevels(voltageLevelParamList); //电压等级
|
||||
List<PwPmsMonitorDTO> pwMonitorList = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
if (CollUtil.isEmpty(pwMonitorList)) {
|
||||
return new Page<>();
|
||||
}
|
||||
//监测点id集合
|
||||
List<String> monitorIdList = pwMonitorList.stream().map(PwPmsMonitorDTO::getMonitorId).collect(Collectors.toList());
|
||||
//监测点map key:监测点id value:监测点实体
|
||||
Map<String, PwPmsMonitorDTO> monitorMap = pwMonitorList.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, monitor -> monitor));
|
||||
|
||||
//查询【基准水平-季】数据
|
||||
/*组装条件:where measurement_point_id in (monitorIdList) and data_date >= startTime
|
||||
and data_date <= endTime and voltage_level
|
||||
*/
|
||||
LambdaQueryWrapper<RMpBenchmarkLevelQ> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(CollUtil.isNotEmpty(monitorIdList), RMpBenchmarkLevelQ::getMeasurementPointId, monitorIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpBenchmarkLevelQ::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpBenchmarkLevelQ::getDataDate, endTime);
|
||||
Page<RMpBenchmarkLevelQ> listPage = this.page(new Page<>(pageNum, pageSize), lambdaQueryWrapper);
|
||||
List<PwRMpBenchmarkLevelVO> resultList = listPage.getRecords().stream().map(item -> {
|
||||
//封装前端需要的对象
|
||||
PwRMpBenchmarkLevelVO rMpBenchmarkLevelVO = new PwRMpBenchmarkLevelVO();
|
||||
BeanUtils.copyProperties(item, rMpBenchmarkLevelVO);
|
||||
//单位信息
|
||||
rMpBenchmarkLevelVO.setOrgNo(monitorMap.get(item.getMeasurementPointId()).getOrgId()); //单位id
|
||||
rMpBenchmarkLevelVO.setOrgName(monitorMap.get(item.getMeasurementPointId()).getOrgName()); //单位名称
|
||||
//监测点信息
|
||||
rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称
|
||||
//电压等级
|
||||
rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getVoltageLevel());
|
||||
return rMpBenchmarkLevelVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
Page<PwRMpBenchmarkLevelVO> resultPage = new Page<>();
|
||||
BeanUtils.copyProperties(listPage, resultPage);
|
||||
resultPage.setRecords(resultList);
|
||||
|
||||
return resultPage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.njcn.harmonic.service.distribution.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.harmonic.mapper.distribution.PwRMpBenchmarkLevelYMapper;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelY;
|
||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelYService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_y】的数据库操作Service实现
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PwRMpBenchmarkLevelYServiceImpl extends ServiceImpl<PwRMpBenchmarkLevelYMapper, RMpBenchmarkLevelY>
|
||||
implements PwRMpBenchmarkLevelYService {
|
||||
|
||||
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
|
||||
/***
|
||||
* 配网-全网基准水平
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-04 10:32
|
||||
* @param rMpBenchmarkLevelParam
|
||||
* @return java.util.List<com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO>
|
||||
*/
|
||||
@Override
|
||||
public Page<PwRMpBenchmarkLevelVO> getPwRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
//提取查询条件
|
||||
String id = rMpBenchmarkLevelParam.getId(); //单位id
|
||||
if (StringUtils.isBlank(id)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "单位id不可为空");
|
||||
}
|
||||
String startTime = rMpBenchmarkLevelParam.getStartTime(); //开始时间
|
||||
String endTime = rMpBenchmarkLevelParam.getEndTime(); //截止时间
|
||||
List <String> voltageLevelParamList = StringUtils.isNotBlank(rMpBenchmarkLevelParam.getVoltageLevel()) ? Arrays.asList(rMpBenchmarkLevelParam.getVoltageLevel().split(",")) : null; //电压等级
|
||||
Integer pageNum = rMpBenchmarkLevelParam.getPageNum() != null && rMpBenchmarkLevelParam.getPageNum() != 0 ? rMpBenchmarkLevelParam.getPageNum() : 1; //页码
|
||||
Integer pageSize = rMpBenchmarkLevelParam.getPageSize() != null && rMpBenchmarkLevelParam.getPageSize() != 0 ? rMpBenchmarkLevelParam.getPageSize() : 10; //页面尺寸
|
||||
|
||||
//根据条件查询单位下面的所有配网监测点
|
||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||
pwPmsMonitorParam.setOrgId(id); //单位id
|
||||
pwPmsMonitorParam.setVoltageLevels(voltageLevelParamList); //电压等级
|
||||
List<PwPmsMonitorDTO> pwMonitorList = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
if (CollUtil.isEmpty(pwMonitorList)) {
|
||||
return new Page<>();
|
||||
}
|
||||
//监测点id集合
|
||||
List<String> monitorIdList = pwMonitorList.stream().map(PwPmsMonitorDTO::getMonitorId).collect(Collectors.toList());
|
||||
//监测点map key:监测点id value:监测点实体
|
||||
Map<String, PwPmsMonitorDTO> monitorMap = pwMonitorList.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, monitor -> monitor));
|
||||
|
||||
//查询【基准水平-年】数据
|
||||
/*组装条件:where measurement_point_id in (monitorIdList) and data_date >= startTime
|
||||
and data_date <= endTime and voltage_level
|
||||
*/
|
||||
LambdaQueryWrapper<RMpBenchmarkLevelY> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(CollUtil.isNotEmpty(monitorIdList), RMpBenchmarkLevelY::getMeasurementPointId, monitorIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpBenchmarkLevelY::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpBenchmarkLevelY::getDataDate, endTime);
|
||||
Page<RMpBenchmarkLevelY> listPage = this.page(new Page<>(pageNum, pageSize), lambdaQueryWrapper);
|
||||
|
||||
List<PwRMpBenchmarkLevelVO> resultList = listPage.getRecords().stream().map(item -> {
|
||||
//封装前端需要的对象
|
||||
PwRMpBenchmarkLevelVO rMpBenchmarkLevelVO = new PwRMpBenchmarkLevelVO();
|
||||
BeanUtils.copyProperties(item, rMpBenchmarkLevelVO);
|
||||
//单位信息
|
||||
rMpBenchmarkLevelVO.setOrgNo(monitorMap.get(item.getMeasurementPointId()).getOrgId()); //单位id
|
||||
rMpBenchmarkLevelVO.setOrgName(monitorMap.get(item.getMeasurementPointId()).getOrgName()); //单位名称
|
||||
//监测点信息
|
||||
rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称
|
||||
//电压等级
|
||||
rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getVoltageLevel());
|
||||
return rMpBenchmarkLevelVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
Page<PwRMpBenchmarkLevelVO> resultPage = new Page<>();
|
||||
BeanUtils.copyProperties(listPage, resultPage);
|
||||
resultPage.setRecords(resultList);
|
||||
|
||||
return resultPage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.njcn.harmonic.service.distribution.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.harmonic.mapper.distribution.RStatPwPermeabilityMMapper;
|
||||
import com.njcn.harmonic.pojo.param.RStatPwPermeabilityMParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatPwPermeabilityM;
|
||||
import com.njcn.harmonic.pojo.vo.RStatPwPermeabilityMVO;
|
||||
import com.njcn.harmonic.service.distribution.RStatPwPermeabilityMService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 各渗透率光伏台区基准水平
|
||||
* @author jianghf
|
||||
* @description 针对表【r_stat_pw_permeability_m】的数据库操作Service实现
|
||||
* @createDate 2022-11-07 10:35:21
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RStatPwPermeabilityMServiceImpl extends ServiceImpl<RStatPwPermeabilityMMapper, RStatPwPermeabilityM>
|
||||
implements RStatPwPermeabilityMService{
|
||||
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
|
||||
/***
|
||||
* 获取各渗透率光伏台区基准水平
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-07 14:38
|
||||
* @param rStatPwPermeabilityMParam
|
||||
* @return java.util.List<com.njcn.harmonic.pojo.vo.RStatPwPermeabilityMVO>
|
||||
*/
|
||||
@Override
|
||||
public Page<RStatPwPermeabilityMVO> getPwPermeabilityList(RStatPwPermeabilityMParam rStatPwPermeabilityMParam) {
|
||||
//提起参数
|
||||
String id = rStatPwPermeabilityMParam.getId(); //单位id
|
||||
String psrName = rStatPwPermeabilityMParam.getPsrName(); //台区名称
|
||||
String startTime = rStatPwPermeabilityMParam.getStartTime(); //开始时间
|
||||
String endTime = rStatPwPermeabilityMParam.getEndTime(); //结束时间
|
||||
Integer pageNum = rStatPwPermeabilityMParam.getPageNum() != null && rStatPwPermeabilityMParam.getPageNum() != 0 ? rStatPwPermeabilityMParam.getPageNum() : 1; //页码
|
||||
Integer pageSize = rStatPwPermeabilityMParam.getPageSize() != null && rStatPwPermeabilityMParam.getPageSize() != 0 ? rStatPwPermeabilityMParam.getPageSize() : 10; //页面尺寸
|
||||
|
||||
//根据条件查询单位下面的所有配网监测点
|
||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||
pwPmsMonitorParam.setOrgId(id); //单位id
|
||||
pwPmsMonitorParam.setMonitorName(psrName); //台区名称(监测点名称)
|
||||
List<PwPmsMonitorDTO> pwMonitorList = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
if (CollUtil.isEmpty(pwMonitorList)) {
|
||||
return new Page<>();
|
||||
}
|
||||
//监测点id集合
|
||||
List<String> monitorIdList = pwMonitorList.stream().map(PwPmsMonitorDTO::getMonitorId).collect(Collectors.toList());
|
||||
//监测点map key:监测点id value:监测点实体
|
||||
Map<String, PwPmsMonitorDTO> monitorMap = pwMonitorList.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, monitor -> monitor));
|
||||
|
||||
//获取各渗透率字典
|
||||
List<DictData> rateList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.PERMEABILITY_TYPE.getCode()).getData();
|
||||
Map<String, Object> condMap = rateList.stream().collect(Collectors.toMap(DictData::getCode, DictData::getId));
|
||||
condMap.put("startTime", startTime);
|
||||
condMap.put("endTime", endTime);
|
||||
condMap.put("idList", monitorIdList);
|
||||
|
||||
Page<RStatPwPermeabilityMVO> listPage = this.baseMapper.getPwPermeabilityList(new Page<>(pageNum, pageSize), condMap);
|
||||
List<RStatPwPermeabilityMVO> list = listPage.getRecords().stream().peek(item -> {
|
||||
item.setOrgName(monitorMap.get(item.getPsrId()).getOrgName()); //单位名称
|
||||
item.setPsrName(monitorMap.get(item.getPsrId()).getMonitorName()); //台区名称
|
||||
}).collect(Collectors.toList());
|
||||
listPage.setRecords(list);
|
||||
|
||||
return listPage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.harmonic.service.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
||||
import com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_m】的数据库操作Service
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
public interface RMpBenchmarkLevelMService extends IService<RMpBenchmarkLevelM> {
|
||||
|
||||
/***
|
||||
* 查询区域稳态电能质量水平(月)
|
||||
* @author jianghaifei
|
||||
* @date 2022-10-11 11:26
|
||||
* @param rMpBenchmarkLevelParam
|
||||
* @return java.util.List<com.njcn.device.pms.pojo.po.RMpBenchmarkLevelM>
|
||||
*/
|
||||
List<RMpBenchmarkLevelVO> getRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.harmonic.service.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ;
|
||||
import com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_q】的数据库操作Service
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
public interface RMpBenchmarkLevelQService extends IService<RMpBenchmarkLevelQ> {
|
||||
|
||||
/***
|
||||
* 主网-区域稳态电能质量水平评估
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-04 10:30
|
||||
* @param rMpBenchmarkLevelParam
|
||||
* @return java.util.List<com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO>
|
||||
*/
|
||||
List<RMpBenchmarkLevelVO> getRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.harmonic.service.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelY;
|
||||
import com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_y】的数据库操作Service
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
public interface RMpBenchmarkLevelYService extends IService<RMpBenchmarkLevelY> {
|
||||
|
||||
/***
|
||||
* 主网-区域稳态电能质量水平评估
|
||||
* @author jianghaifei
|
||||
* @date 2022-11-04 10:30
|
||||
* @param rMpBenchmarkLevelParam
|
||||
* @return java.util.List<com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO>
|
||||
*/
|
||||
List<RMpBenchmarkLevelVO> getRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.njcn.harmonic.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorClient;
|
||||
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RMpBenchmarkLevelMMapper;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
||||
import com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.majornetwork.RMpBenchmarkLevelMService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_m】的数据库操作Service实现
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RMpBenchmarkLevelMServiceImpl extends ServiceImpl<RMpBenchmarkLevelMMapper, RMpBenchmarkLevelM>
|
||||
implements RMpBenchmarkLevelMService {
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final PmsGeneralDeviceInfoClient pmsGeneralDeviceInfoClient;
|
||||
|
||||
private final MonitorClient monitorClient;
|
||||
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
|
||||
@Override
|
||||
public List<RMpBenchmarkLevelVO> getRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
//提取查询条件
|
||||
String id = rMpBenchmarkLevelParam.getId(); //单位id
|
||||
if (StringUtils.isBlank(id)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "单位id不可为空");
|
||||
}
|
||||
String startTime = rMpBenchmarkLevelParam.getStartTime(); //开始时间
|
||||
String endTime = rMpBenchmarkLevelParam.getEndTime(); //截止时间
|
||||
String benchmarkIndicator = rMpBenchmarkLevelParam.getBenchmarkIndicator(); //评价指标
|
||||
List <String> voltageLevelParamList = StringUtils.isNotBlank(rMpBenchmarkLevelParam.getVoltageLevel()) ? Arrays.asList(rMpBenchmarkLevelParam.getVoltageLevel().split(",")) : null; //电压等级
|
||||
|
||||
//获取电压等级的字典
|
||||
List<DictData> voltageLevelList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
//将电压信息转成map,key:id value:name
|
||||
Map<String, String> voltageLevelMap = voltageLevelList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
//获取基准水平评价指标字典
|
||||
List<DictData> benchmarkIndicatorList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.BENCHMARK_INDICATORS.getCode()).getData();
|
||||
//将基准水平评价指标信息转成map,key:id value:name
|
||||
Map<String, String> benchmarkIndicatorMap = benchmarkIndicatorList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
//查询所有子单位下的所有监测点
|
||||
PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam(id);
|
||||
pmsDeviceInfoParam.setStatisticalType(new SimpleDTO());
|
||||
if (CollUtil.isNotEmpty(voltageLevelParamList)) {
|
||||
//查询条件:电压等级(筛选电压等级为voltageLevel的监测点)
|
||||
List<SimpleDTO> simpleDTOList = voltageLevelParamList.stream().map(item -> {
|
||||
SimpleDTO simpleDTO = new SimpleDTO();
|
||||
simpleDTO.setId(item);
|
||||
return simpleDTO;
|
||||
}).collect(Collectors.toList());
|
||||
pmsDeviceInfoParam.setVoltageLevel(simpleDTOList);
|
||||
}
|
||||
//获取到该部门的所有子部门的监测点idList
|
||||
List<PmsGeneralDeviceDTO> pmsDeviceInfoWithInOrg = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam).getData();
|
||||
//过滤出业务需要的监测点id集合
|
||||
List<String> firstMonitorIdList = new ArrayList<>(); //只用于合并多个部门的监测点id
|
||||
pmsDeviceInfoWithInOrg.forEach(item -> firstMonitorIdList.addAll(item.getMonitorIdList()));
|
||||
List<String> lastMonitorIdList = firstMonitorIdList.stream().distinct().collect(Collectors.toList()); //最终的监测点id集合
|
||||
//如果没有监测点id信息,直接返回空集合
|
||||
if (CollUtil.isEmpty(lastMonitorIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//查询对应的监测点完整信息 并转为key:监测点id value:监测点实体的map集合
|
||||
// LambdaQueryWrapper<Monitor> monitorWrapper = new LambdaQueryWrapper<>();
|
||||
// monitorWrapper.in(Monitor::getId, lastMonitorIdList);
|
||||
PmsMonitorInfoParam pmsMonitorInfoParam = new PmsMonitorInfoParam();
|
||||
pmsMonitorInfoParam.setMonitorIds(lastMonitorIdList);
|
||||
Map<String, PmsMonitorInfoDTO> monitorMap = monitorClient.getMonitorInfo(pmsMonitorInfoParam).getData().stream().collect(Collectors.toMap(PmsMonitorInfoDTO::getMonitorId, monitor -> monitor));
|
||||
//查询【基准水平-月】数据
|
||||
/*组装条件:where measurement_point_id in (monitorIdList) and data_date >= startTime
|
||||
and data_date <= endTime and voltage_level
|
||||
*/
|
||||
LambdaQueryWrapper<RMpBenchmarkLevelM> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lastMonitorIdList), RMpBenchmarkLevelM::getMeasurementPointId, lastMonitorIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpBenchmarkLevelM::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpBenchmarkLevelM::getDataDate, endTime);
|
||||
List<RMpBenchmarkLevelM> list = this.list(lambdaQueryWrapper);
|
||||
List<RMpBenchmarkLevelVO> resultList = list.stream().map(item -> {
|
||||
//封装前端需要的对象
|
||||
RMpBenchmarkLevelVO rMpBenchmarkLevelVO = new RMpBenchmarkLevelVO();
|
||||
BeanUtils.copyProperties(item, rMpBenchmarkLevelVO);
|
||||
PmsGeneralDeviceDTO pmsGeneralDeviceDTO = pmsDeviceInfoWithInOrg.stream().filter(dto -> dto.getMonitorIdList().contains(item.getMeasurementPointId()))
|
||||
.collect(Collectors.toList()).get(0);
|
||||
//单位信息
|
||||
rMpBenchmarkLevelVO.setOrgNo(pmsGeneralDeviceDTO.getIndex()); //单位id
|
||||
rMpBenchmarkLevelVO.setOrgName(pmsGeneralDeviceDTO.getName()); //单位名称
|
||||
//基准水平评价指标
|
||||
rMpBenchmarkLevelVO.setBenchmarkIndicator(benchmarkIndicator); //基准水平评价指标id
|
||||
rMpBenchmarkLevelVO.setBenchmarkIndicatorName(benchmarkIndicatorMap.get(benchmarkIndicator)); //基准水平评价指标
|
||||
//监测点信息
|
||||
rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称
|
||||
//电压等级
|
||||
rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getMonitorVoltageLevel());
|
||||
rMpBenchmarkLevelVO.setVoltageLevelName(voltageLevelMap.get(monitorMap.get(item.getMeasurementPointId()).getMonitorVoltageLevel()));
|
||||
return rMpBenchmarkLevelVO;
|
||||
}).collect(Collectors.toList());
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.njcn.harmonic.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorClient;
|
||||
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RMpBenchmarkLevelQMapper;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ;
|
||||
import com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.majornetwork.RMpBenchmarkLevelQService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_q】的数据库操作Service实现
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RMpBenchmarkLevelQServiceImpl extends ServiceImpl<RMpBenchmarkLevelQMapper, RMpBenchmarkLevelQ>
|
||||
implements RMpBenchmarkLevelQService {
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final PmsGeneralDeviceInfoClient pmsGeneralDeviceInfoClient;
|
||||
|
||||
private final MonitorClient monitorClient;
|
||||
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
|
||||
@Override
|
||||
public List<RMpBenchmarkLevelVO> getRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
//提取查询条件
|
||||
String id = rMpBenchmarkLevelParam.getId(); //单位id
|
||||
if (StringUtils.isBlank(id)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "单位id不可为空");
|
||||
}
|
||||
String startTime = rMpBenchmarkLevelParam.getStartTime(); //开始时间
|
||||
String endTime = rMpBenchmarkLevelParam.getEndTime(); //截止时间
|
||||
String benchmarkIndicator = rMpBenchmarkLevelParam.getBenchmarkIndicator(); //评价指标
|
||||
List <String> voltageLevelParamList = StringUtils.isNotBlank(rMpBenchmarkLevelParam.getVoltageLevel()) ? Arrays.asList(rMpBenchmarkLevelParam.getVoltageLevel().split(",")) : null; //电压等级
|
||||
|
||||
//获取电压等级的字典
|
||||
List<DictData> voltageLevelList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
//将电压信息转成map,key:id value:name
|
||||
Map<String, String> voltageLevelMap = voltageLevelList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
//获取基准水平评价指标字典
|
||||
List<DictData> benchmarkIndicatorList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.BENCHMARK_INDICATORS.getCode()).getData();
|
||||
//将基准水平评价指标信息转成map,key:id value:name
|
||||
Map<String, String> benchmarkIndicatorMap = benchmarkIndicatorList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
//查询所有子单位下的所有监测点
|
||||
PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam(id);
|
||||
pmsDeviceInfoParam.setStatisticalType(new SimpleDTO());
|
||||
if (CollUtil.isNotEmpty(voltageLevelParamList)) {
|
||||
//查询条件:电压等级(筛选电压等级为voltageLevel的监测点)
|
||||
List<SimpleDTO> simpleDTOList = voltageLevelParamList.stream().map(item -> {
|
||||
SimpleDTO simpleDTO = new SimpleDTO();
|
||||
simpleDTO.setId(item);
|
||||
return simpleDTO;
|
||||
}).collect(Collectors.toList());
|
||||
pmsDeviceInfoParam.setVoltageLevel(simpleDTOList);
|
||||
}
|
||||
//获取到该部门的所有子部门的监测点idList
|
||||
List<PmsGeneralDeviceDTO> pmsDeviceInfoWithInOrg = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam).getData();
|
||||
//过滤出业务需要的监测点id集合
|
||||
List<String> firstMonitorIdList = new ArrayList<>(); //只用于合并多个部门的监测点id
|
||||
pmsDeviceInfoWithInOrg.forEach(item -> firstMonitorIdList.addAll(item.getMonitorIdList()));
|
||||
List<String> lastMonitorIdList = firstMonitorIdList.stream().distinct().collect(Collectors.toList()); //最终的监测点id集合
|
||||
//如果没有监测点id信息,直接返回空集合
|
||||
if (CollUtil.isEmpty(lastMonitorIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//查询对应的监测点完整信息 并转为key:监测点id value:监测点实体的map集合
|
||||
// LambdaQueryWrapper<Monitor> monitorWrapper = new LambdaQueryWrapper<>();
|
||||
// monitorWrapper.in(Monitor::getId, lastMonitorIdList);
|
||||
PmsMonitorInfoParam pmsMonitorInfoParam = new PmsMonitorInfoParam();
|
||||
pmsMonitorInfoParam.setMonitorIds(lastMonitorIdList);
|
||||
Map<String, PmsMonitorInfoDTO> monitorMap = monitorClient.getMonitorInfo(pmsMonitorInfoParam).getData().stream().collect(Collectors.toMap(PmsMonitorInfoDTO::getMonitorId, monitor -> monitor));
|
||||
//查询【基准水平-月】数据
|
||||
/*组装条件:where measurement_point_id in (monitorIdList) and data_date >= startTime
|
||||
and data_date <= endTime and voltage_level
|
||||
*/
|
||||
LambdaQueryWrapper<RMpBenchmarkLevelQ> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lastMonitorIdList), RMpBenchmarkLevelQ::getMeasurementPointId, lastMonitorIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpBenchmarkLevelQ::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpBenchmarkLevelQ::getDataDate, endTime);
|
||||
List<RMpBenchmarkLevelQ> list = this.list(lambdaQueryWrapper);
|
||||
List<RMpBenchmarkLevelVO> resultList = list.stream().map(item -> {
|
||||
//封装前端需要的对象
|
||||
RMpBenchmarkLevelVO rMpBenchmarkLevelVO = new RMpBenchmarkLevelVO();
|
||||
BeanUtils.copyProperties(item, rMpBenchmarkLevelVO);
|
||||
PmsGeneralDeviceDTO pmsGeneralDeviceDTO = pmsDeviceInfoWithInOrg.stream().filter(dto -> dto.getMonitorIdList().contains(item.getMeasurementPointId()))
|
||||
.collect(Collectors.toList()).get(0);
|
||||
//单位信息
|
||||
rMpBenchmarkLevelVO.setOrgNo(pmsGeneralDeviceDTO.getIndex()); //单位id
|
||||
rMpBenchmarkLevelVO.setOrgName(pmsGeneralDeviceDTO.getName()); //单位名称
|
||||
//基准水平评价指标
|
||||
rMpBenchmarkLevelVO.setBenchmarkIndicator(benchmarkIndicator); //基准水平评价指标id
|
||||
rMpBenchmarkLevelVO.setBenchmarkIndicatorName(benchmarkIndicatorMap.get(benchmarkIndicator)); //基准水平评价指标
|
||||
//监测点信息
|
||||
rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称
|
||||
//电压等级
|
||||
rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getMonitorVoltageLevel());
|
||||
rMpBenchmarkLevelVO.setVoltageLevelName(voltageLevelMap.get(monitorMap.get(item.getMeasurementPointId()).getMonitorVoltageLevel()));
|
||||
return rMpBenchmarkLevelVO;
|
||||
}).collect(Collectors.toList());
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.njcn.harmonic.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorClient;
|
||||
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RMpBenchmarkLevelYMapper;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelY;
|
||||
import com.njcn.harmonic.pojo.vo.RMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.majornetwork.RMpBenchmarkLevelYService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
* @description 针对表【r_mp_benchmark_level_y】的数据库操作Service实现
|
||||
* @createDate 2022-10-11 10:32:18
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RMpBenchmarkLevelYServiceImpl extends ServiceImpl<RMpBenchmarkLevelYMapper, RMpBenchmarkLevelY>
|
||||
implements RMpBenchmarkLevelYService {
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final PmsGeneralDeviceInfoClient pmsGeneralDeviceInfoClient;
|
||||
|
||||
private final MonitorClient monitorClient;
|
||||
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
|
||||
@Override
|
||||
public List<RMpBenchmarkLevelVO> getRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
//提取查询条件
|
||||
String id = rMpBenchmarkLevelParam.getId(); //单位id
|
||||
if (StringUtils.isBlank(id)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "单位id不可为空");
|
||||
}
|
||||
String startTime = rMpBenchmarkLevelParam.getStartTime(); //开始时间
|
||||
String endTime = rMpBenchmarkLevelParam.getEndTime(); //截止时间
|
||||
String benchmarkIndicator = rMpBenchmarkLevelParam.getBenchmarkIndicator(); //评价指标
|
||||
List <String> voltageLevelParamList = StringUtils.isNotBlank(rMpBenchmarkLevelParam.getVoltageLevel()) ? Arrays.asList(rMpBenchmarkLevelParam.getVoltageLevel().split(",")) : null; //电压等级
|
||||
|
||||
//获取电压等级的字典
|
||||
List<DictData> voltageLevelList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
//将电压信息转成map,key:id value:name
|
||||
Map<String, String> voltageLevelMap = voltageLevelList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
//获取基准水平评价指标字典
|
||||
List<DictData> benchmarkIndicatorList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.BENCHMARK_INDICATORS.getCode()).getData();
|
||||
//将基准水平评价指标信息转成map,key:id value:name
|
||||
Map<String, String> benchmarkIndicatorMap = benchmarkIndicatorList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
//查询所有子单位下的所有监测点
|
||||
PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam(id);
|
||||
pmsDeviceInfoParam.setStatisticalType(new SimpleDTO());
|
||||
if (CollUtil.isNotEmpty(voltageLevelParamList)) {
|
||||
//查询条件:电压等级(筛选电压等级为voltageLevel的监测点)
|
||||
List<SimpleDTO> simpleDTOList = voltageLevelParamList.stream().map(item -> {
|
||||
SimpleDTO simpleDTO = new SimpleDTO();
|
||||
simpleDTO.setId(item);
|
||||
return simpleDTO;
|
||||
}).collect(Collectors.toList());
|
||||
pmsDeviceInfoParam.setVoltageLevel(simpleDTOList);
|
||||
}
|
||||
//获取到该部门的所有子部门的监测点idList
|
||||
List<PmsGeneralDeviceDTO> pmsDeviceInfoWithInOrg = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam).getData();
|
||||
//过滤出业务需要的监测点id集合
|
||||
List<String> firstMonitorIdList = new ArrayList<>(); //只用于合并多个部门的监测点id
|
||||
pmsDeviceInfoWithInOrg.forEach(item -> firstMonitorIdList.addAll(item.getMonitorIdList()));
|
||||
List<String> lastMonitorIdList = firstMonitorIdList.stream().distinct().collect(Collectors.toList()); //最终的监测点id集合
|
||||
//如果没有监测点id信息,直接返回空集合
|
||||
if (CollUtil.isEmpty(lastMonitorIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//查询对应的监测点完整信息 并转为key:监测点id value:监测点实体的map集合
|
||||
// LambdaQueryWrapper<Monitor> monitorWrapper = new LambdaQueryWrapper<>();
|
||||
// monitorWrapper.in(Monitor::getId, lastMonitorIdList); e
|
||||
PmsMonitorInfoParam pmsMonitorInfoParam = new PmsMonitorInfoParam();
|
||||
pmsMonitorInfoParam.setMonitorIds(lastMonitorIdList);
|
||||
Map<String, PmsMonitorInfoDTO> monitorMap = monitorClient.getMonitorInfo(pmsMonitorInfoParam).getData().stream().collect(Collectors.toMap(PmsMonitorInfoDTO::getMonitorId, monitor -> monitor));
|
||||
//查询【基准水平-月】数据
|
||||
/*组装条件:where measurement_point_id in (monitorIdList) and data_date >= startTime
|
||||
and data_date <= endTime and voltage_level
|
||||
*/
|
||||
LambdaQueryWrapper<RMpBenchmarkLevelY> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lastMonitorIdList), RMpBenchmarkLevelY::getMeasurementPointId, lastMonitorIdList)
|
||||
.ge(StringUtils.isNotBlank(startTime), RMpBenchmarkLevelY::getDataDate, startTime)
|
||||
.le(StringUtils.isNotBlank(endTime), RMpBenchmarkLevelY::getDataDate, endTime);
|
||||
List<RMpBenchmarkLevelY> list = this.list(lambdaQueryWrapper);
|
||||
List<RMpBenchmarkLevelVO> resultList = list.stream().map(item -> {
|
||||
//封装前端需要的对象
|
||||
RMpBenchmarkLevelVO rMpBenchmarkLevelVO = new RMpBenchmarkLevelVO();
|
||||
BeanUtils.copyProperties(item, rMpBenchmarkLevelVO);
|
||||
PmsGeneralDeviceDTO pmsGeneralDeviceDTO = pmsDeviceInfoWithInOrg.stream().filter(dto -> dto.getMonitorIdList().contains(item.getMeasurementPointId()))
|
||||
.collect(Collectors.toList()).get(0);
|
||||
//单位信息
|
||||
rMpBenchmarkLevelVO.setOrgNo(pmsGeneralDeviceDTO.getIndex()); //单位id
|
||||
rMpBenchmarkLevelVO.setOrgName(pmsGeneralDeviceDTO.getName()); //单位名称
|
||||
//基准水平评价指标
|
||||
rMpBenchmarkLevelVO.setBenchmarkIndicator(benchmarkIndicator); //基准水平评价指标id
|
||||
rMpBenchmarkLevelVO.setBenchmarkIndicatorName(benchmarkIndicatorMap.get(benchmarkIndicator)); //基准水平评价指标
|
||||
//监测点信息
|
||||
rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称
|
||||
//电压等级
|
||||
rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getMonitorVoltageLevel());
|
||||
rMpBenchmarkLevelVO.setVoltageLevelName(voltageLevelMap.get(monitorMap.get(item.getMeasurementPointId()).getMonitorVoltageLevel()));
|
||||
return rMpBenchmarkLevelVO;
|
||||
}).collect(Collectors.toList());
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user