1.调整河北pms国网上送主配网逻辑

2.技术监督调整
This commit is contained in:
2024-03-12 10:38:55 +08:00
parent af4600f0e9
commit 4b09070081
50 changed files with 1058 additions and 564 deletions

View File

@@ -1,36 +1,36 @@
package com.njcn.prepare.harmonic.api.line;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.prepare.harmonic.api.line.fallback.ThsSuperviseClientFallbackFactory;
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(
value = ServerInfo.PREPARE_BOOT,//对应模块名
path = "/thsSupervise",//对应controller请求类
fallbackFactory = ThsSuperviseClientFallbackFactory.class//服务降级处理类
)
public interface ThsSuperviseClient {
/**
* 预警/告警事务的初始化
*
* @param superviseParam
* @return
*/
@PostMapping("/initSupervise")
HttpResult<String> initSupervise(@RequestBody @Validated SuperviseParam superviseParam);
/**
* 预警/告警事务的生成
*
* @param superviseParam
* @return
*/
@PostMapping("/creatSupervise")
HttpResult<String> creatSupervise(@RequestBody @Validated SuperviseParam superviseParam);
}
//package com.njcn.prepare.harmonic.api.line;
//
//import com.njcn.common.pojo.constant.ServerInfo;
//import com.njcn.common.pojo.response.HttpResult;
//import com.njcn.prepare.harmonic.api.line.fallback.ThsSuperviseClientFallbackFactory;
//import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
//import org.springframework.cloud.openfeign.FeignClient;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//
//@FeignClient(
// value = ServerInfo.PREPARE_BOOT,//对应模块名
// path = "/thsSupervise",//对应controller请求类
// fallbackFactory = ThsSuperviseClientFallbackFactory.class//服务降级处理类
//)
//public interface ThsSuperviseClient {
// /**
// * 预警/告警事务的初始化
// *
// * @param superviseParam
// * @return
// */
// @PostMapping("/initSupervise")
// HttpResult<String> initSupervise(@RequestBody @Validated SuperviseParam superviseParam);
//
//
// /**
// * 预警/告警事务的生成
// *
// * @param superviseParam
// * @return
// */
// @PostMapping("/creatSupervise")
// HttpResult<String> creatSupervise(@RequestBody @Validated SuperviseParam superviseParam);
//}

View File

@@ -1,41 +1,40 @@
package com.njcn.prepare.harmonic.api.line.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.prepare.harmonic.api.line.ThsSuperviseClient;
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
import com.njcn.prepare.harmonic.utils.PrepareEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
@Slf4j
@Component
public class ThsSuperviseClientFallbackFactory implements FallbackFactory<ThsSuperviseClient> {
@Override
public ThsSuperviseClient create(Throwable throwable) {
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (throwable.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) throwable.getCause();
exceptionEnum = PrepareEnumUtil.getExceptionEnum(businessException.getResult());
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new ThsSuperviseClient() {
@Override
public HttpResult<String> initSupervise(@RequestBody @Validated SuperviseParam superviseParam) {
log.error("{}异常,降级处理,异常为:{}", "预警/告警事务的初始化: ", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<String> creatSupervise(SuperviseParam superviseParam) {
log.error("{}异常,降级处理,异常为:{}", "预警/告警事务的生成: ", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}
//package com.njcn.prepare.harmonic.api.line.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.prepare.harmonic.api.line.ThsSuperviseClient;
//import com.njcn.prepare.harmonic.utils.PrepareEnumUtil;
//import feign.hystrix.FallbackFactory;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Component;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.RequestBody;
//
//@Slf4j
//@Component
//public class ThsSuperviseClientFallbackFactory implements FallbackFactory<ThsSuperviseClient> {
// @Override
// public ThsSuperviseClient create(Throwable throwable) {
// Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
// if (throwable.getCause() instanceof BusinessException) {
// BusinessException businessException = (BusinessException) throwable.getCause();
// exceptionEnum = PrepareEnumUtil.getExceptionEnum(businessException.getResult());
// }
// Enum<?> finalExceptionEnum = exceptionEnum;
// return new ThsSuperviseClient() {
// @Override
// public HttpResult<String> initSupervise(@RequestBody @Validated SuperviseParam superviseParam) {
// log.error("{}异常,降级处理,异常为:{}", "预警/告警事务的初始化: ", throwable.toString());
// throw new BusinessException(finalExceptionEnum);
// }
//
// @Override
// public HttpResult<String> creatSupervise(SuperviseParam superviseParam) {
// log.error("{}异常,降级处理,异常为:{}", "预警/告警事务的生成: ", throwable.toString());
// throw new BusinessException(finalExceptionEnum);
// }
// };
// }
//}

View File

@@ -1,31 +0,0 @@
package com.njcn.prepare.harmonic.pojo.param;
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
import com.njcn.prepare.harmonic.pojo.po.ThsSupervise;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class SuperviseParam {
@ApiModelProperty(name = "initType", value = "创建类型: 0自动1手动", required = true)
@NotNull(message = "创建类型不可为空")
private Integer initType;
@ApiModelProperty(name = "deptId", value = "部门id")
private String deptId;
@ApiModelProperty(name = "overRunLog", value = "监测点集合")
private List<ThsOverRunLog> overRunLog;
@ApiModelProperty(name = "supIndex", value = "技术监督Guid")
private String supIndex;
@ApiModelProperty(name = "name", value = "技术监督名称")
private String name;
@ApiModelProperty(name = "description", value = "描述")
private String description;
@ApiModelProperty(name = "thsSupervise", value = "技术监督参数")
private ThsSupervise thsSupervise;
@ApiModelProperty(name = "type", value = "类型0预警1告警")
private Integer type;
}

View File

@@ -1,124 +0,0 @@
package com.njcn.prepare.harmonic.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* <p>
* 告警/预警监测点列表
* </p>
*
* @author lxp
* @since 2023-03-16
*/
@Data
@TableName("ths_over_run_log")
public class ThsOverRunLog {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@ApiModelProperty(name = "id", value = "主键", required = true)
private String id;
/**
* 监测点ID
*/
@ApiModelProperty(name = "lineIndex", value = "监测点ID", required = true)
private String lineIndex;
/**
* 名称变电站_监测点_日期_id
*/
@ApiModelProperty(name = "name", value = "名称", required = true)
private String name;
/**
* 技术监督Guid
*/
@ApiModelProperty(name = "supIndex", value = "技术监督Guid", required = true)
private String supIndex;
/**
* 描述
*/
@ApiModelProperty(name = "description", value = "描述")
private String description;
/**
* 预/告警单
*/
@ApiModelProperty(name = "alarmTicket", value = "预/告警单")
private String alarmTicket;
@TableField(exist = false)
private String alarmTicketName;
/**
* 反馈单
*/
@ApiModelProperty(name = "feedback", value = "反馈单")
private String feedback;
@TableField(exist = false)
private String feedbackName;
/**
* 测试报告
*/
@ApiModelProperty(name = "testReport", value = "测试报告")
private String testReport;
@TableField(exist = false)
private String ftestReportName;
/**
* 整改通知单
*/
@ApiModelProperty(name = "reviseNotice", value = "整改通知单")
private String reviseNotice;
@TableField(exist = false)
private String reviseNoticeName;
/**
* 整改通知反馈单
*/
@ApiModelProperty(name = "reviseFeedback", value = "整改通知反馈单")
private String reviseFeedback;
@TableField(exist = false)
private String reviseFeedbackName;
/**
* 越限时间yyyy-MM-dd
*/
@ApiModelProperty(name = "updateTime", value = "越限时间", required = true)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
/**
* 创建时间
*/
@ApiModelProperty(name = "createTime", value = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty(name = "companyName", value = "供电公司")
@TableField(exist = false)
private String companyName;
@ApiModelProperty(name = "lineIndexName", value = "监测点名称")
@TableField(exist = false)
private String lineIndexName;
@ApiModelProperty(name = "fileName", value = "文件名")
@TableField(exist = false)
private String fileName;
@ApiModelProperty(name = "overTime", value = "越限次数")
private Integer overTime;
}

View File

@@ -1,94 +0,0 @@
package com.njcn.prepare.harmonic.pojo.po;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author lxp
* @since 2023-03-16
*/
@Data
@TableName("ths_supervise")
public class ThsSupervise {
private static final long serialVersionUID = 1L;
/**
* 技术监督Guid
*/
@ApiModelProperty(name = "supIndex", value = "技术监督Guid", required = true)
@TableId
private String supIndex;
/**
* 部门id
*/
@ApiModelProperty(name = "deptId", value = "部门id", required = true)
private String deptId;
/**
* 技术监督名称
*/
@ApiModelProperty(name = "name", value = "技术监督名称", required = true)
private String name;
/**
* 创建用户(pqs_user外键)
*/
private String createUser;
/**
* 处理用户
*/
private String modifyUser;
/**
* 处理时间
*/
private Date modifyTime;
/**
* 类型0预警1告警
*/
@ApiModelProperty(name = "type", value = "类型0预警1告警", required = true)
private Integer type;
/**
* 上一级处理处理人员
*/
private String upUser;
/**
* 下一级处理人员
*/
private String nextUser;
/**
* 进度0开始1预/告警单下发2反馈单上传3现场测试4整改通知单下发:5整改通知反馈单6完结默认进度为开始
*/
@ApiModelProperty(name = "progress", value = "进度0开始1预/告警单下发2反馈单上传3现场测试4整改通知单下发:5整改通知反馈单6完结默认进度为开始", required = true)
private Integer progress;
/**
* 描述
*/
@ApiModelProperty(name = "description", value = "描述")
private String description;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建类型(0自动1 手动)
*/
private Integer createType;
}

View File

@@ -1,24 +0,0 @@
package com.njcn.prepare.harmonic.pojo.vo;
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
import com.njcn.prepare.harmonic.pojo.po.ThsSupervise;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.util.List;
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class SuperviceRunLogVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(name = "thsSupervise", value = "技术监督参数", required = true)
private ThsSupervise thsSupervise;
@ApiModelProperty(name = "overRunLog", value = "监测点集合", required = true)
private List<ThsOverRunLog> overRunLog;
}

View File

@@ -1,126 +0,0 @@
package com.njcn.prepare.harmonic.pojo.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class SuperviseVo {
private static final long serialVersionUID = 1L;
/**
* 技术监督Guid
*/
@ApiModelProperty(name = "supIndex", value = "技术监督Guid")
private String supIndex;
/**
* 部门id
*/
@ApiModelProperty(name = "deptId", value = "部门id")
private String deptId;
/**
* 技术监督名称
*/
@ApiModelProperty(name = "name", value = "技术监督名称")
private String name;
/**
* 创建用户(pqs_user外键)
*/
@ApiModelProperty(name = "createUser", value = "创建用户")
private String createUser;
/**
* 处理用户
*/
@ApiModelProperty(name = "modifyUser", value = "处理用户")
private String modifyUser;
/**
* 处理时间
*/
@ApiModelProperty(name = "modifyTime", value = "处理时间")
private Date modifyTime;
/**
* 类型0预警1告警
*/
@ApiModelProperty(name = "type", value = "类型0预警1告警")
private Integer type;
/**
* 上一级处理处理人员
*/
@ApiModelProperty(name = "upUser", value = "上一级处理处理人员")
private String upUser;
/**
* 下一级处理人员
*/
@ApiModelProperty(name = "nextUser", value = "下一级处理人员")
private String nextUser;
/**
* 进度0开始1预/告警单下发2反馈单上传3现场测试4整改通知单下发:5整改通知反馈单6完结默认进度为开始
*/
@ApiModelProperty(name = "progress", value = "进度0开始1预/告警单下发2反馈单上传3现场测试4整改通知单下发:5整改通知反馈单6完结默认进度为开始")
private Integer progress;
/**
* 描述
*/
@ApiModelProperty(name = "description", value = "描述")
private String description;
/**
* 创建时间
*/
@ApiModelProperty(name = "createTime", value = "创建时间")
private Date createTime;
/**
* 创建类型(0自动1 手动)
*/
private Integer createType;
/**
* 是否已经上传 预/告警单
*/
@ApiModelProperty(name = "haveAlarmticket", value = "是否已经上传 预/告警单")
private boolean haveAlarmticket;
/**
* 反馈单
*/
@ApiModelProperty(name = "haveFeedback", value = "是否已经上传 反馈单")
private boolean haveFeedback;
/**
* 测试报告
*/
@ApiModelProperty(name = "haveTestReport", value = "是否已经上传 测试报告")
private boolean haveTestReport;
/**
* 整改通知单
*/
@ApiModelProperty(name = "haveReviseNotice", value = "是否已经上传 整改通知单")
private boolean haveReviseNotice;
/**
* 整改通知反馈单
*/
@ApiModelProperty(name = "haveReviseFeedback", value = "是否已经上传 整改通知反馈单")
private boolean haveReviseFeedback;
@ApiModelProperty(name = "companyName", value = "部门名称")
private String companyName;
@ApiModelProperty(name = "alertType", value = "预警类型0 无预警1 一级预警 2 二级预警 3 超时")
private Integer alertType;
@ApiModelProperty(name = "progressTime", value = "进行时间(天)")
private Integer progressTime;
private String deploymentId;
private String execId;
}

View File

@@ -1,30 +0,0 @@
package com.njcn.prepare.harmonic.pojo.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class ThsSuperviseVo {
@ApiModelProperty(name = "superviseVoList", value = "技术监督列表")
private List<SuperviseVo> superviseVoList;
@ApiModelProperty(name = "progressTime", value = "开始数量")
private Integer startNum;
@ApiModelProperty(name = "alarmTicketIssueNum", value = "预/告警单下发数量")
private Integer alarmTicketIssueNum;
@ApiModelProperty(name = "feedbackUploadNum", value = "预/告警单反馈数量")
private Integer feedbackUploadNum;
@ApiModelProperty(name = "testReportNum", value = "现场测试数量")
private Integer testReportNum;
@ApiModelProperty(name = "reviseNoticeIssueNum", value = "整改通知单下发数量")
private Integer reviseNoticeIssueNum;
@ApiModelProperty(name = "reviseFeedbackNum", value = "整改通知单反馈数量")
private Integer reviseFeedbackNum;
@ApiModelProperty(name = "endNum", value = "完结数量")
private Integer endNum;
@ApiModelProperty(name = "earlyWarnNum", value = "预警单数量")
private Integer earlyWarnNum;
@ApiModelProperty(name = "reportWarnNum", value = "告警单数量")
private Integer reportWarnNum;
}

View File

@@ -142,7 +142,7 @@ public class SubStationExecutor extends BaseExecutor{
String tag = bindCmp.getTag();
CalculatedParam<DeptGetChildrenMoreDTO> calculatedParam = bindCmp.getRequestData();
if (tag.equalsIgnoreCase("r_upload_substation_statistical_data_d")) {
//
//
rUploadSubstationStatisticalDataDService.insertSubStatisticalDataDay(bindCmp.getRequestData());
} else if (tag.equalsIgnoreCase("r_upload_substation_statistical_data_m")) {
//数据补招不执行非日表算法

View File

@@ -4,7 +4,7 @@
//import com.njcn.common.pojo.enums.response.CommonResponseEnum;
//import com.njcn.common.pojo.response.HttpResult;
//import com.njcn.common.utils.HttpResultUtil;
//import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
//import com.njcn.process.pojo.param.SuperviseParam;
//
//import com.njcn.web.controller.BaseController;
//import io.swagger.annotations.Api;

View File

@@ -18,7 +18,8 @@
round(avg(coverage_rate),4) coverageRate,
case when avg(run_substation_num) = 0 then 0 else round(avg(monitor_substaion_num)/avg(run_substation_num)*100,4) end monitoringRate,
#{monthDate} statisticalDate,
'02' statisticalType,
#{monthDate} statisticalMonth,
'01' statisticalType,
0 uploadStatus
from
r_upload_substation_statistical_data_d
@@ -33,4 +34,4 @@
</select>
</mapper>
</mapper>

View File

@@ -1,71 +1,70 @@
package com.njcn.prepare.harmonic.service.mysql.Impl.line;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.dynamic.datasource.annotation.DS;
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.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.prepare.harmonic.mapper.mysql.line.ThsOverRunLogMapper;
import com.njcn.prepare.harmonic.mapper.mysql.line.ThsSuperviseMapper;
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
import com.njcn.prepare.harmonic.pojo.po.ThsSupervise;
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
import com.njcn.prepare.harmonic.service.mysql.line.ThsOverRunLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 告警/预警监测点列表 服务实现类
* </p>
*
* @author lxp
* @since 2023-03-16
*/
@Service
@Slf4j
@DS("process")
public class ThsOverRunLogServiceImpl extends ServiceImpl<ThsOverRunLogMapper, ThsOverRunLog> implements ThsOverRunLogService {
@Autowired
private ThsOverRunLogMapper thsOverRunLogMapper;
@Autowired
private ThsSuperviseMapper thsSuperviseMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public void saveOverRunLog(SuperviseParam superviseParam) {
this.saveBatch(superviseParam.getOverRunLog());
}
@Override
public SuperviceRunLogVo superviseDetail(String supIndex) {
ThsSupervise thsSupervise = thsSuperviseMapper.selectOne(new LambdaQueryWrapper<ThsSupervise>().eq(ThsSupervise::getSupIndex, supIndex));
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, supIndex));
SuperviceRunLogVo superviceRunLogVo = new SuperviceRunLogVo();
superviceRunLogVo.setThsSupervise(thsSupervise);
superviceRunLogVo.setOverRunLog(thsOverRunLogs);
return superviceRunLogVo;
}
@Override
public HttpResult updateSupervise(SuperviseParam superviseParam) {
List<ThsOverRunLog> overRunLog = superviseParam.getOverRunLog();
if (CollectionUtil.isEmpty(overRunLog)) {
HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "监测点不能为空", null);
}
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, superviseParam.getSupIndex()));
List<String> saveIds = superviseParam.getOverRunLog().stream().map(ThsOverRunLog::getId).collect(Collectors.toList());
List<String> allIds = thsOverRunLogs.stream().map(ThsOverRunLog::getId).collect(Collectors.toList());
allIds.removeAll(saveIds);
thsOverRunLogMapper.delete(new LambdaQueryWrapper<ThsOverRunLog>().in(ThsOverRunLog::getId, allIds));
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, null);
}
}
//package com.njcn.prepare.harmonic.service.mysql.Impl.line;
//
//import cn.hutool.core.collection.CollectionUtil;
//import com.baomidou.dynamic.datasource.annotation.DS;
//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.response.HttpResult;
//import com.njcn.common.utils.HttpResultUtil;
//import com.njcn.prepare.harmonic.mapper.mysql.line.ThsOverRunLogMapper;
//import com.njcn.prepare.harmonic.mapper.mysql.line.ThsSuperviseMapper;
//import com.njcn.process.pojo.param.SuperviseParam;
//import com.njcn.process.pojo.po.ThsOverRunLog;
//import com.njcn.process.pojo.po.ThsSupervise;
//import com.njcn.prepare.harmonic.service.mysql.line.ThsOverRunLogService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.Transactional;
//
//import java.util.List;
//import java.util.stream.Collectors;
//
///**
// * <p>
// * 告警/预警监测点列表 服务实现类
// * </p>
// *
// * @author lxp
// * @since 2023-03-16
// */
//@Service
//@Slf4j
//@DS("process")
//public class ThsOverRunLogServiceImpl extends ServiceImpl<ThsOverRunLogMapper, ThsOverRunLog> implements ThsOverRunLogService {
// @Autowired
// private ThsOverRunLogMapper thsOverRunLogMapper;
// @Autowired
// private ThsSuperviseMapper thsSuperviseMapper;
//
// @Override
// @Transactional(rollbackFor = Exception.class)
// public void saveOverRunLog(SuperviseParam superviseParam) {
// this.saveBatch(superviseParam.getOverRunLog());
// }
//
// @Override
// public SuperviceRunLogVo superviseDetail(String supIndex) {
// ThsSupervise thsSupervise = thsSuperviseMapper.selectOne(new LambdaQueryWrapper<ThsSupervise>().eq(ThsSupervise::getSupIndex, supIndex));
// List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, supIndex));
// SuperviceRunLogVo superviceRunLogVo = new SuperviceRunLogVo();
// superviceRunLogVo.setThsSupervise(thsSupervise);
// superviceRunLogVo.setOverRunLog(thsOverRunLogs);
// return superviceRunLogVo;
// }
//
// @Override
// public HttpResult updateSupervise(SuperviseParam superviseParam) {
// List<ThsOverRunLog> overRunLog = superviseParam.getOverRunLog();
// if (CollectionUtil.isEmpty(overRunLog)) {
// HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "监测点不能为空", null);
// }
// List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, superviseParam.getSupIndex()));
// List<String> saveIds = superviseParam.getOverRunLog().stream().map(ThsOverRunLog::getId).collect(Collectors.toList());
// List<String> allIds = thsOverRunLogs.stream().map(ThsOverRunLog::getId).collect(Collectors.toList());
// allIds.removeAll(saveIds);
// thsOverRunLogMapper.delete(new LambdaQueryWrapper<ThsOverRunLog>().in(ThsOverRunLog::getId, allIds));
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, null);
// }
//}

View File

@@ -17,9 +17,9 @@
//import com.njcn.oss.utils.FileStorageUtil;
//import com.njcn.prepare.enums.*;
//import com.njcn.prepare.harmonic.mapper.mysql.line.*;
//import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
//import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
//import com.njcn.prepare.harmonic.pojo.po.ThsSupervise;
//import com.njcn.process.pojo.param.SuperviseParam;
//import com.njcn.process.pojo.po.ThsOverRunLog;
//import com.njcn.process.pojo.po.ThsSupervise;
//import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
//import com.njcn.prepare.harmonic.service.mysql.day.IRStatLimitRateDService;
//import com.njcn.prepare.harmonic.service.mysql.line.ThsSuperviseService;

View File

@@ -63,9 +63,9 @@ public class StationBusBarReportServiceImpl extends MppServiceImpl<StationBusBar
Map<String, List<RStatDataVDPO>> vMap = rStatDataVDPOList.stream().collect(Collectors.groupingBy(RStatDataVDPO::getValueType));
if (vMap.containsKey("MAX")) {
List<RStatDataVDPO> maxList = vMap.get("MAX");
Double rms = maxList.stream().filter(item -> !item.getPhasicType().equals("T")).map(RStatDataVDPO::getRms).max(Comparator.comparing(Function.identity())).orElse(3.14159);
Double thd = maxList.stream().filter(item -> item.getPhasicType().equals("T")).map(RStatDataVDPO::getVThd).max(Comparator.comparing(Function.identity())).orElse(3.14159);
Double un = maxList.stream().filter(item -> item.getPhasicType().equals("T")).map(RStatDataVDPO::getVUnbalance).max(Comparator.comparing(Function.identity())).orElse(3.14159);
Double rms = maxList.stream().filter(item -> !item.getPhasicType().equals("A")).map(RStatDataVDPO::getRms).max(Comparator.comparing(Function.identity())).orElse(3.14159);
Double thd = maxList.stream().filter(item -> item.getPhasicType().equals("A")).map(RStatDataVDPO::getVThd).max(Comparator.comparing(Function.identity())).orElse(3.14159);
Double un = maxList.stream().filter(item -> item.getPhasicType().equals("A")).map(RStatDataVDPO::getVUnbalance).max(Comparator.comparing(Function.identity())).orElse(3.14159);
rStatBusbarHarmonicYPO.setVEffectiveMax(rms);
rStatBusbarHarmonicYPO.setVThdMax(thd);
rStatBusbarHarmonicYPO.setUnbalanceMax(un);
@@ -77,9 +77,9 @@ public class StationBusBarReportServiceImpl extends MppServiceImpl<StationBusBar
if (vMap.containsKey("MIN")) {
List<RStatDataVDPO> maxList = vMap.get("MIN");
Double rms = maxList.stream().filter(item -> !item.getPhasicType().equals("T")).map(RStatDataVDPO::getRms).min(Comparator.comparing(Function.identity())).orElse(3.14159);
Double thd = maxList.stream().filter(item -> item.getPhasicType().equals("T")).map(RStatDataVDPO::getVThd).min(Comparator.comparing(Function.identity())).orElse(3.14159);
Double un = maxList.stream().filter(item -> item.getPhasicType().equals("T")).map(RStatDataVDPO::getVUnbalance).min(Comparator.comparing(Function.identity())).orElse(3.14159);
Double rms = maxList.stream().filter(item -> !item.getPhasicType().equals("A")).map(RStatDataVDPO::getRms).min(Comparator.comparing(Function.identity())).orElse(3.14159);
Double thd = maxList.stream().filter(item -> item.getPhasicType().equals("A")).map(RStatDataVDPO::getVThd).min(Comparator.comparing(Function.identity())).orElse(3.14159);
Double un = maxList.stream().filter(item -> item.getPhasicType().equals("A")).map(RStatDataVDPO::getVUnbalance).min(Comparator.comparing(Function.identity())).orElse(3.14159);
rStatBusbarHarmonicYPO.setVEffectiveMin(rms);
rStatBusbarHarmonicYPO.setVThdMin(thd);
rStatBusbarHarmonicYPO.setUnbalanceMin(un);
@@ -91,9 +91,9 @@ public class StationBusBarReportServiceImpl extends MppServiceImpl<StationBusBar
if (vMap.containsKey("AVG")) {
List<RStatDataVDPO> maxList = vMap.get("AVG");
Double rms = maxList.stream().filter(item -> !item.getPhasicType().equals("T")).mapToDouble(RStatDataVDPO::getRms).average().orElse(3.14159);
Double thd = maxList.stream().filter(item -> item.getPhasicType().equals("T")).mapToDouble(RStatDataVDPO::getVThd).average().orElse(3.14159);
Double un = maxList.stream().filter(item -> item.getPhasicType().equals("T")).mapToDouble(RStatDataVDPO::getVUnbalance).average().orElse(3.14159);
Double rms = maxList.stream().filter(item -> !item.getPhasicType().equals("A")).mapToDouble(RStatDataVDPO::getRms).average().orElse(3.14159);
Double thd = maxList.stream().filter(item -> item.getPhasicType().equals("A")).mapToDouble(RStatDataVDPO::getVThd).average().orElse(3.14159);
Double un = maxList.stream().filter(item -> item.getPhasicType().equals("A")).mapToDouble(RStatDataVDPO::getVUnbalance).average().orElse(3.14159);
rStatBusbarHarmonicYPO.setVEffectiveAvg(rms);
rStatBusbarHarmonicYPO.setVThdAvg(thd);
rStatBusbarHarmonicYPO.setUnbalanceAvg(un);
@@ -105,9 +105,9 @@ public class StationBusBarReportServiceImpl extends MppServiceImpl<StationBusBar
if (vMap.containsKey("CP95")) {
List<RStatDataVDPO> cp95List = vMap.get("CP95");
Double rms = cp95List.stream().filter(item -> !item.getPhasicType().equals("T")).map(RStatDataVDPO::getRms).max(Comparator.comparing(Function.identity())).orElse(3.14159);
Double thd = cp95List.stream().filter(item -> item.getPhasicType().equals("T")).map(RStatDataVDPO::getVThd).max(Comparator.comparing(Function.identity())).orElse(3.14159);
Double un = cp95List.stream().filter(item -> item.getPhasicType().equals("T")).map(RStatDataVDPO::getVUnbalance).max(Comparator.comparing(Function.identity())).orElse(3.14159);
Double rms = cp95List.stream().filter(item -> !item.getPhasicType().equals("A")).map(RStatDataVDPO::getRms).max(Comparator.comparing(Function.identity())).orElse(3.14159);
Double thd = cp95List.stream().filter(item -> item.getPhasicType().equals("A")).map(RStatDataVDPO::getVThd).max(Comparator.comparing(Function.identity())).orElse(3.14159);
Double un = cp95List.stream().filter(item -> item.getPhasicType().equals("A")).map(RStatDataVDPO::getVUnbalance).max(Comparator.comparing(Function.identity())).orElse(3.14159);
rStatBusbarHarmonicYPO.setVEffective95(rms);
rStatBusbarHarmonicYPO.setVThd95(thd);
rStatBusbarHarmonicYPO.setUnbalance95(un);

View File

@@ -1,43 +1,40 @@
package com.njcn.prepare.harmonic.service.mysql.line;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
import java.util.List;
/**
* <p>
* 告警/预警监测点列表 服务类
* </p>
*
* @author lxp
* @since 2023-03-16
*/
public interface ThsOverRunLogService extends IService<ThsOverRunLog> {
/**
* 保存技术监督监测点
*
* @param superviseParam
* @return
*/
void saveOverRunLog(SuperviseParam superviseParam);
/**
* 查询技术监督监测点集合
*
* @param supIndex
* @return
*/
SuperviceRunLogVo superviseDetail(String supIndex);
/**
* 更新技术监督
*
* @param superviseParam
*/
HttpResult updateSupervise(SuperviseParam superviseParam);
}
//package com.njcn.prepare.harmonic.service.mysql.line;
//
//import com.baomidou.mybatisplus.extension.service.IService;
//import com.njcn.common.pojo.response.HttpResult;
//import com.njcn.process.pojo.param.SuperviseParam;
//import com.njcn.process.pojo.po.ThsOverRunLog;
//
///**
// * <p>
// * 告警/预警监测点列表 服务类
// * </p>
// *
// * @author lxp
// * @since 2023-03-16
// */
//public interface ThsOverRunLogService extends IService<ThsOverRunLog> {
//
// /**
// * 保存技术监督监测点
// *
// * @param superviseParam
// * @return
// */
// void saveOverRunLog(SuperviseParam superviseParam);
//
// /**
// * 查询技术监督监测点集合
// *
// * @param supIndex
// * @return
// */
// SuperviceRunLogVo superviseDetail(String supIndex);
//
// /**
// * 更新技术监督
// *
// * @param superviseParam
// */
// HttpResult updateSupervise(SuperviseParam superviseParam);
//}

View File

@@ -7,9 +7,9 @@
//import com.njcn.harmonic.pojo.vo.SourceSteadyIndicator;
//import com.njcn.harmonic.pojo.vo.ThsStrategyVo;
//import com.njcn.prepare.enums.TypeEnum;
//import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
//import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
//import com.njcn.prepare.harmonic.pojo.po.ThsSupervise;
//import com.njcn.process.pojo.param.SuperviseParam;
//import com.njcn.process.pojo.po.ThsOverRunLog;
//import com.njcn.process.pojo.po.ThsSupervise;
//import com.njcn.process.pojo.po.ThsWarnStrategyAss;
//import com.njcn.user.pojo.po.Dept;
//

View File

@@ -69,7 +69,7 @@ public class RStatLoadTypeServiceImpl implements RStatLoadTypeService {
LocalDate localDate = LocalDateTimeUtil.parseDate(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN);
List<RStatLoadTypeDPO> result = new ArrayList<>();
List<DictData> dataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITORING_LABELS.getCode()).getData();
//过滤监测对象类型(陆上风电、分布式光伏、电气化铁路、其他非线性负荷)
//过滤监测对象类型(陆上风电、光伏电站、电气化铁路、其他非线性负荷)
Map<String, DictData> collect = dataList.stream().filter(temp -> Objects.equals(temp.getLevel(), 1)).collect(Collectors.toMap(DictData::getId, dictData -> dictData));
List<DictData> dataTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DATA_TYPE.getCode()).getData();

View File

@@ -78,7 +78,7 @@ public class RUploadSubstationStatisticalDataDServiceImpl extends MppServiceImpl
if (list.size() > 1){
RUploadSubstationStatisticalDataD rUploadSubstationStatisticalDataD = new RUploadSubstationStatisticalDataD();
rUploadSubstationStatisticalDataD.setId(IdUtil.simpleUUID());
rUploadSubstationStatisticalDataD.setStatisticalDate(calculatedParam.getDataDate());
rUploadSubstationStatisticalDataD.setStatisticalDate(DateUtil.format(DateUtil.parse(calculatedParam.getDataDate()),DatePattern.NORM_MONTH_PATTERN));
rUploadSubstationStatisticalDataD.setStatisticalType(UploadEnum.STATISTICAL_TYPE_02.getCode());
rUploadSubstationStatisticalDataD.setProvinceId(dept.getCode());
rUploadSubstationStatisticalDataD.setProvinceName(dept.getName());
@@ -116,11 +116,14 @@ public class RUploadSubstationStatisticalDataDServiceImpl extends MppServiceImpl
//开始月份
String beginMonth = DateUtil.format(DateUtil.beginOfMonth(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_MONTH_PATTERN)), DatePattern.NORM_MONTH_PATTERN);
//起始时间
String startTime = DateUtil.format(DateUtil.beginOfMonth(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATE_PATTERN);
String startTime = DateUtil.format(DateUtil.beginOfYear(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATE_PATTERN);
//结束时间
String endTime = DateUtil.format(DateUtil.endOfMonth(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATE_PATTERN);
String endTime = DateUtil.format(DateUtil.endOfYear(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATE_PATTERN);
//数据集
List<RUploadSubstationStatisticalDataD> list = this.baseMapper.substationStatisticalMonthData(beginMonth,startTime,endTime);
if (CollUtil.isNotEmpty(list)){
list.forEach(item->{
item.setId(IdUtil.simpleUUID());