Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package com.njcn.mq.message;
|
package com.njcn.mq.message;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -65,6 +64,60 @@ public class AppEventMessage extends BaseMessage {
|
|||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private List<Param> param;
|
private List<Param> param;
|
||||||
|
|
||||||
|
@ApiModelProperty("工程名称")
|
||||||
|
private String prjName;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置启动时间")
|
||||||
|
private Long prjTimeStart;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置结束时间")
|
||||||
|
private Long prjTimeEnd;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置数据路径")
|
||||||
|
private String prjDataPath;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置型号")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置mac地址")
|
||||||
|
private String devMac;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置程序版本")
|
||||||
|
private String appVersion;
|
||||||
|
|
||||||
|
@ApiModelProperty("逻辑子设备id")
|
||||||
|
private Integer clDid;
|
||||||
|
|
||||||
|
@ApiModelProperty("统计间隔")
|
||||||
|
private Integer statCycle;
|
||||||
|
|
||||||
|
@ApiModelProperty("电压等级")
|
||||||
|
private Float volGrade;
|
||||||
|
|
||||||
|
@ApiModelProperty("电压接线方式(0-星型, 1-角型, 2-V型)")
|
||||||
|
private Integer volConType;
|
||||||
|
|
||||||
|
@ApiModelProperty("电流接线方式(0-正常, 1-合成IB, 2-合成IC)")
|
||||||
|
private Integer curConSel;
|
||||||
|
|
||||||
|
@ApiModelProperty("PT变比")
|
||||||
|
private Integer ptRatio;
|
||||||
|
|
||||||
|
@ApiModelProperty("ct变比")
|
||||||
|
private Integer ctRatio;
|
||||||
|
|
||||||
|
@ApiModelProperty("基准短路容量")
|
||||||
|
private Float capacitySscb;
|
||||||
|
|
||||||
|
@ApiModelProperty("最小短路容量")
|
||||||
|
private Float capacitySscmin;
|
||||||
|
|
||||||
|
@ApiModelProperty("供电设备容量")
|
||||||
|
private Float capacitySt;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户协议容量")
|
||||||
|
private Float capacitySi;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ mybatis-plus:
|
|||||||
type-aliases-package: com.njcn.device.pq.pojo,com.njcn.device.pms.pojo,com.njcn.device.biz.pojo.dto
|
type-aliases-package: com.njcn.device.pq.pojo,com.njcn.device.pms.pojo,com.njcn.device.biz.pojo.dto
|
||||||
|
|
||||||
#是否是冀北设备台账树
|
#是否是冀北设备台账树
|
||||||
isJb: true
|
isJb: false
|
||||||
mqtt:
|
mqtt:
|
||||||
client-id: @artifactId@${random.value}
|
client-id: @artifactId@${random.value}
|
||||||
|
|
||||||
|
|||||||
@@ -524,7 +524,7 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
<if test="param.userName!=null and param.userName!=''">
|
<if test="param.userName!=null and param.userName!=''">
|
||||||
and pms_power_client.name like CONCAT('%', #{param.userName}, '%')
|
and pms_power_client.name like CONCAT('%', #{param.userName}, '%') or pms_power_client.id like CONCAT('%', #{param.userName}, '%')
|
||||||
</if>
|
</if>
|
||||||
) t where 1 = 1
|
) t where 1 = 1
|
||||||
<if test="param.comFlag!=null">
|
<if test="param.comFlag!=null">
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class PwUserMonitorDataServiceImpl implements PwUserMonitorDataService {
|
|||||||
page.getRecords().forEach(item->{
|
page.getRecords().forEach(item->{
|
||||||
if(map.containsKey(item.getLineIndex())){
|
if(map.containsKey(item.getLineIndex())){
|
||||||
PwUserMonitorDataVO pwUserMonitorDataVO = map.get(item.getLineIndex());
|
PwUserMonitorDataVO pwUserMonitorDataVO = map.get(item.getLineIndex());
|
||||||
pwUserMonitorDataVO.setIntegrityRate(item.getIntegrityData());
|
pwUserMonitorDataVO.setIntegrityRate(item.getIntegrityData() > 100 ?100:item.getIntegrityData());
|
||||||
voList.add(pwUserMonitorDataVO);
|
voList.add(pwUserMonitorDataVO);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -306,7 +306,8 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
public List<LineDevGetDTO> getPmsCalMonitorList(List<String> monitorIds) {
|
public List<LineDevGetDTO> getPmsCalMonitorList(List<String> monitorIds) {
|
||||||
List<LineDevGetDTO> monitorList = new ArrayList<>();
|
List<LineDevGetDTO> monitorList = new ArrayList<>();
|
||||||
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.select(Monitor::getId,Monitor::getStatisticalInterval,Monitor::getTerminalId).eq(Monitor::getStatus, DataStateEnum.ENABLE.getCode());
|
lambdaQueryWrapper.select(Monitor::getId,Monitor::getStatisticalInterval,Monitor::getTerminalId)
|
||||||
|
.in(Monitor::getId,monitorIds).eq(Monitor::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
|
|
||||||
List<Monitor> monitors = monitorMapper.selectList(lambdaQueryWrapper);
|
List<Monitor> monitors = monitorMapper.selectList(lambdaQueryWrapper);
|
||||||
for(Monitor monitor : monitors){
|
for(Monitor monitor : monitors){
|
||||||
|
|||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2024-08-07
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pq_ywzt_substation")
|
||||||
|
public class YwZtSubstation{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站序号
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型zf01:变电站 zf05:电厂
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属地市
|
||||||
|
*/
|
||||||
|
private String orgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维单位
|
||||||
|
*/
|
||||||
|
private String operationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电站名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级名称
|
||||||
|
*/
|
||||||
|
private String scaleName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维护班组
|
||||||
|
*/
|
||||||
|
private String maintenanceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备状态
|
||||||
|
*/
|
||||||
|
private String runStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备编码
|
||||||
|
*/
|
||||||
|
private String deviceCoding;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投运日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime runTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private BigDecimal lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private BigDecimal lat;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -191,7 +191,8 @@ public class TerminalBaseController extends BaseController {
|
|||||||
@DeleteMapping("delTerminal")
|
@DeleteMapping("delTerminal")
|
||||||
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
||||||
String methodDescribe = getMethodDescribe("delTerminal");
|
String methodDescribe = getMethodDescribe("delTerminal");
|
||||||
terminalBaseService.delTerminal(id);
|
System.out.println(id);
|
||||||
|
// terminalBaseService.delTerminal(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.njcn.device.pq.controller;
|
||||||
|
|
||||||
|
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.pq.pojo.po.YwZtSubstation;
|
||||||
|
import com.njcn.device.pq.service.IYwZtSubstationService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0.0
|
||||||
|
* @author: chenchao
|
||||||
|
* @date: 2022/06/23 11:36
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ywZt")
|
||||||
|
@Api(tags = "业务中台数据管理")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class YwZtSubstationController extends BaseController {
|
||||||
|
|
||||||
|
private final IYwZtSubstationService ywZtSubstationService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/addYwZtSubstation")
|
||||||
|
@ApiOperation("业务中台变电站表同步")
|
||||||
|
public HttpResult<Boolean> syncYwZtSubstation(){
|
||||||
|
String methodDescribe = getMethodDescribe("syncYwZtSubstation");
|
||||||
|
Boolean b = ywZtSubstationService.syncYwZtSubstation();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/getYwZtSubstation")
|
||||||
|
@ApiOperation("获取业务中台变电站")
|
||||||
|
public HttpResult<List<YwZtSubstation>> getYwZtSubstation(@RequestParam(required =false )String orgId){
|
||||||
|
String methodDescribe = getMethodDescribe("getYwZtSubstation");
|
||||||
|
List<YwZtSubstation> ywZtSubstation = ywZtSubstationService.getYwZtSubstation(orgId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, ywZtSubstation, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -35,4 +35,7 @@ public interface SubstationMapper extends BaseMapper<Substation> {
|
|||||||
|
|
||||||
|
|
||||||
List<Substation> test();
|
List<Substation> test();
|
||||||
|
|
||||||
|
//仅供测试冀北电网台账使用
|
||||||
|
List<SubstationDTO> subTest();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.device.pq.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.YwZtSubstation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2024-08-07
|
||||||
|
*/
|
||||||
|
public interface YwZtSubstationMapper extends BaseMapper<YwZtSubstation> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -57,4 +57,48 @@
|
|||||||
line.Id = sub.Id
|
line.Id = sub.Id
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="subTest" resultType="com.njcn.device.pq.pojo.dto.SubstationDTO">
|
||||||
|
SELECT DISTINCT
|
||||||
|
pid as id,
|
||||||
|
powerSubstationName as name ,
|
||||||
|
( SELECT id FROM sys_dict_data WHERE NAME = CONCAT( SUBSTRING_INDEX( powerSubstationName, 'kV', 1 ), "kV" ) ) as scale
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
substation.pid AS pid,
|
||||||
|
substation.id AS substationId,
|
||||||
|
substation.NAME AS substationName,
|
||||||
|
device.id AS deviceId,
|
||||||
|
device.NAME AS deviceName,
|
||||||
|
voltage.id AS voltageId,
|
||||||
|
voltage.NAME AS voltageName,
|
||||||
|
line.id AS lineId,
|
||||||
|
line.NAME AS lineName,
|
||||||
|
lineDetail.Power_Substation_Name AS powerSubstationName,
|
||||||
|
( SELECT id FROM pq_line WHERE `Name` = lineDetail.Power_Substation_Name ) AS Power_Substation_id
|
||||||
|
FROM
|
||||||
|
pq_line line,
|
||||||
|
pq_line voltage,
|
||||||
|
pq_line device,
|
||||||
|
pq_line substation,
|
||||||
|
pq_line gd,
|
||||||
|
pq_line area,
|
||||||
|
pq_device deviceDetail,
|
||||||
|
pq_line_detail lineDetail,
|
||||||
|
pq_voltage vg
|
||||||
|
WHERE
|
||||||
|
line.pid = voltage.id
|
||||||
|
AND voltage.pid = device.id
|
||||||
|
AND device.pid = substation.id
|
||||||
|
AND substation.pid = gd.id
|
||||||
|
AND gd.pid = area.id
|
||||||
|
AND device.id = deviceDetail.id
|
||||||
|
AND line.id = lineDetail.id
|
||||||
|
AND vg.Id = voltage.id
|
||||||
|
ORDER BY
|
||||||
|
substation.`Name`
|
||||||
|
) cc
|
||||||
|
WHERE
|
||||||
|
Power_Substation_id IS NULL;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?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.pq.mapper.YwZtSubstationMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.njcn.device.pq.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pq.pojo.po.YwZtSubstation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2024-08-07
|
||||||
|
*/
|
||||||
|
public interface IYwZtSubstationService extends IService<YwZtSubstation> {
|
||||||
|
|
||||||
|
|
||||||
|
Boolean syncYwZtSubstation();
|
||||||
|
|
||||||
|
List<YwZtSubstation> getYwZtSubstation(String orgId);
|
||||||
|
}
|
||||||
@@ -284,6 +284,12 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TerminalTree> getJbTerminalTree() {
|
public List<TerminalTree> getJbTerminalTree() {
|
||||||
|
/**
|
||||||
|
* 1.先根据监测点电网侧电站,查询是否存在变电站信息
|
||||||
|
* 1.1 如果存在,则根据根据电网标识(Power_Flag),来进行判断是电网侧还是非电网侧
|
||||||
|
* 1.2 不存在,则根据监测点的线路号,进行判断是电网侧还是非电网侧并以当前监测点所对应的变电站为主层级
|
||||||
|
* 2.变电站下不存在监测点信息进行筛查出来,然后进行匹配添加
|
||||||
|
*/
|
||||||
List<TerminalTree> taiZhang = new ArrayList<>();
|
List<TerminalTree> taiZhang = new ArrayList<>();
|
||||||
List<TerminalTree> allList = lineMapper.getAllList();
|
List<TerminalTree> allList = lineMapper.getAllList();
|
||||||
List<TerminalTree> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
List<TerminalTree> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||||
@@ -324,67 +330,138 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
|||||||
List<TerminalTree> subInfoList = new ArrayList<>();
|
List<TerminalTree> subInfoList = new ArrayList<>();
|
||||||
|
|
||||||
lineObjNameMap.forEach((key, value)->{
|
lineObjNameMap.forEach((key, value)->{
|
||||||
List<TerminalTree> valueList = new ArrayList<>();
|
final List<TerminalTree> subVLine = collect1;
|
||||||
//电网侧监测点
|
|
||||||
TerminalTree powerTree=new TerminalTree();
|
|
||||||
powerTree.setName("电网侧");
|
|
||||||
List<TerminalTree> powerFlag = value.stream().filter(x -> x.getPowerFlag().equals(LineBaseEnum.POWER_FLAG.getCode())).collect(Collectors.toList());
|
|
||||||
List<TerminalTree> subChildren = getRecursionChildren(powerFlag, collect1);
|
|
||||||
powerTree.setChildren(new ArrayList<>());
|
|
||||||
|
|
||||||
//非电网侧监测点
|
|
||||||
TerminalTree notPowerTree=new TerminalTree();
|
|
||||||
notPowerTree.setName("非电网侧");
|
|
||||||
List<TerminalTree> powerFlagNot = value.stream().filter(x -> x.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())).collect(Collectors.toList());
|
|
||||||
List<TerminalTree> notSubChildren = getRecursionChildren(powerFlagNot, collect1);
|
|
||||||
notPowerTree.setChildren(new ArrayList<>());
|
|
||||||
valueList.add(powerTree);
|
|
||||||
valueList.add(notPowerTree);
|
|
||||||
//获取变电信息
|
//获取变电信息
|
||||||
List<TerminalTree> collect = subList.stream().filter(x -> x.getName().equals(key)).collect(Collectors.toList());
|
List<TerminalTree> collect = subList.stream().filter(x -> x.getName().equals(key)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//电网侧监测点
|
||||||
|
List<TerminalTree> powerFlag = value.stream().filter(x -> x.getPowerFlag().equals(LineBaseEnum.POWER_FLAG.getCode())).collect(Collectors.toList());
|
||||||
|
if(CollUtil.isEmpty(collect)){
|
||||||
|
//解决变电站下没有监测点显示问题(变电站-》终端-》母线)
|
||||||
|
powerFlag.addAll(collect);
|
||||||
|
}
|
||||||
|
List<TerminalTree> subChildren = getRecursionChildren(powerFlag, subVLine);
|
||||||
|
|
||||||
|
//非电网侧监测点
|
||||||
|
List<TerminalTree> powerFlagNot = value.stream().filter(x -> x.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())).collect(Collectors.toList());
|
||||||
|
List<TerminalTree> notSubChildren = getRecursionChildren(powerFlagNot,subVLine);
|
||||||
|
|
||||||
if(CollUtil.isNotEmpty(collect)){
|
if(CollUtil.isNotEmpty(collect)){
|
||||||
|
List<TerminalTree> valueList = new ArrayList<>();
|
||||||
TerminalTree sub=new TerminalTree();
|
TerminalTree sub=new TerminalTree();
|
||||||
sub.setId(collect.get(0).getId());
|
sub.setId(collect.get(0).getId());
|
||||||
sub.setName(collect.get(0).getName());
|
sub.setName(collect.get(0).getName());
|
||||||
sub.setPid(collect.get(0).getPid());
|
sub.setPid(collect.get(0).getPid());
|
||||||
sub.setChildren(valueList);
|
sub.setChildren(valueList);
|
||||||
|
|
||||||
|
TerminalTree powerTree=new TerminalTree();
|
||||||
|
powerTree.setName("电网侧");
|
||||||
|
powerTree.setId(collect.get(0).getId());
|
||||||
powerTree.setChildren(subChildren);
|
powerTree.setChildren(subChildren);
|
||||||
|
valueList.add(powerTree);
|
||||||
|
|
||||||
|
|
||||||
|
TerminalTree notPowerTree=new TerminalTree();
|
||||||
|
notPowerTree.setName("非电网侧");
|
||||||
notPowerTree.setChildren(notSubChildren);
|
notPowerTree.setChildren(notSubChildren);
|
||||||
|
valueList.add(notPowerTree);
|
||||||
subInfoList.add(sub);
|
subInfoList.add(sub);
|
||||||
}else{
|
}else{
|
||||||
//电网侧变电站能否找到
|
//电网侧变电站能否找到
|
||||||
for (TerminalTree child : subChildren) {
|
for (TerminalTree child : subChildren) {
|
||||||
|
List<TerminalTree> valueList = new ArrayList<>();
|
||||||
List<TerminalTree> exist = subInfoList.stream().filter(x -> x.getId().equals(child.getId())).collect(Collectors.toList());
|
List<TerminalTree> exist = subInfoList.stream().filter(x -> x.getId().equals(child.getId())).collect(Collectors.toList());
|
||||||
if(CollUtil.isNotEmpty(exist)){
|
if(CollUtil.isNotEmpty(exist)){
|
||||||
//电网侧
|
//电网侧
|
||||||
exist.get(0).getChildren().get(0).getChildren().addAll(child.getChildren());
|
List<TerminalTree> children =new ArrayList<>();
|
||||||
|
children.addAll(exist.get(0).getChildren().get(0).getChildren());
|
||||||
|
children.add(child);
|
||||||
|
exist.get(0).getChildren().get(0).setChildren(children);
|
||||||
}else{
|
}else{
|
||||||
TerminalTree sub=new TerminalTree();
|
TerminalTree sub=new TerminalTree();
|
||||||
sub.setId(child.getId());
|
sub.setId(child.getId());
|
||||||
sub.setName(child.getName());
|
sub.setName(child.getName());
|
||||||
sub.setPid(child.getPid());
|
sub.setPid(child.getPid());
|
||||||
valueList.get(0).setChildren(Arrays.asList(child));
|
|
||||||
|
TerminalTree powerTree=new TerminalTree();
|
||||||
|
powerTree.setName("电网侧");
|
||||||
|
powerTree.setId(child.getId());
|
||||||
|
powerTree.setChildren(Arrays.asList(child));
|
||||||
|
valueList.add(powerTree);
|
||||||
|
|
||||||
|
TerminalTree notPowerTree = new TerminalTree();
|
||||||
|
notPowerTree.setName("非电网侧");
|
||||||
|
notPowerTree.setChildren(new ArrayList<>());
|
||||||
|
valueList.add(notPowerTree);
|
||||||
|
|
||||||
sub.setChildren(valueList);
|
sub.setChildren(valueList);
|
||||||
subInfoList.add(sub);
|
subInfoList.add(sub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (TerminalTree child : notSubChildren) {
|
for (TerminalTree child : notSubChildren) {
|
||||||
|
List<TerminalTree> valueList = new ArrayList<>();
|
||||||
List<TerminalTree> exist = subInfoList.stream().filter(x -> x.getId().equals(child.getId())).collect(Collectors.toList());
|
List<TerminalTree> exist = subInfoList.stream().filter(x -> x.getId().equals(child.getId())).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(exist)) {
|
if (CollUtil.isNotEmpty(exist)) {
|
||||||
//非电网侧
|
//非电网侧
|
||||||
exist.get(1).getChildren().get(0).getChildren().addAll(child.getChildren());
|
List<TerminalTree> children =new ArrayList<>();
|
||||||
|
children.addAll(exist.get(0).getChildren().get(1).getChildren());
|
||||||
|
children.add(child);
|
||||||
|
exist.get(0).getChildren().get(1).setChildren(children);
|
||||||
} else {
|
} else {
|
||||||
TerminalTree sub = new TerminalTree();
|
TerminalTree sub = new TerminalTree();
|
||||||
sub.setId(child.getId());
|
sub.setId(child.getId());
|
||||||
sub.setName(child.getName());
|
sub.setName(child.getName());
|
||||||
sub.setPid(child.getPid());
|
sub.setPid(child.getPid());
|
||||||
valueList.get(1).setChildren(Arrays.asList(child));
|
|
||||||
|
TerminalTree powerTree = new TerminalTree();
|
||||||
|
powerTree.setName("电网侧");
|
||||||
|
powerTree.setId(child.getId());
|
||||||
|
powerTree.setChildren(new ArrayList<>());
|
||||||
|
valueList.add(powerTree);
|
||||||
|
|
||||||
|
TerminalTree notPowerTree = new TerminalTree();
|
||||||
|
notPowerTree.setName("非电网侧");
|
||||||
|
notPowerTree.setChildren(Arrays.asList(child));
|
||||||
|
valueList.add(notPowerTree);
|
||||||
|
|
||||||
sub.setChildren(valueList);
|
sub.setChildren(valueList);
|
||||||
subInfoList.add(sub);
|
subInfoList.add(sub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//todo 变电站层级处理不存在下面信息的监测点信息(默认信息就是给他当成电网侧)
|
||||||
|
List<TerminalTree> dw = new ArrayList<>();
|
||||||
|
dw.addAll(subInfoList.stream().collect(Collectors.toList()));
|
||||||
|
dw.addAll(subInfoList.stream().flatMap(x -> x.getChildren().get(0).getChildren().stream()).collect(Collectors.toList()));
|
||||||
|
dw.addAll(subInfoList.stream().flatMap(x -> x.getChildren().get(1).getChildren().stream()).collect(Collectors.toList()));
|
||||||
|
List<TerminalTree> collect = subList.stream().filter(x -> !dw.stream().map(TerminalTree::getId).collect(Collectors.toList()).contains(x.getId()))
|
||||||
|
.distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
for (TerminalTree notSub : collect) {
|
||||||
|
|
||||||
|
TerminalTree notSub1 = findParents(collect1, notSub);
|
||||||
|
List<TerminalTree> valueList = new ArrayList<>();
|
||||||
|
TerminalTree sub = new TerminalTree();
|
||||||
|
sub.setId(notSub.getId());
|
||||||
|
sub.setName(notSub.getName());
|
||||||
|
sub.setPid(notSub.getPid());
|
||||||
|
|
||||||
|
TerminalTree powerTree = new TerminalTree();
|
||||||
|
powerTree.setId(notSub.getId());
|
||||||
|
powerTree.setName("电网侧");
|
||||||
|
powerTree.setChildren(Arrays.asList(notSub1));
|
||||||
|
valueList.add(powerTree);
|
||||||
|
|
||||||
|
TerminalTree notPowerTree = new TerminalTree();
|
||||||
|
notPowerTree.setName("非电网侧");
|
||||||
|
notPowerTree.setChildren(new ArrayList<>());
|
||||||
|
valueList.add(notPowerTree);
|
||||||
|
|
||||||
|
sub.setChildren(valueList);
|
||||||
|
subInfoList.add(sub);
|
||||||
|
}
|
||||||
|
|
||||||
gdList.forEach(gd -> gd.setChildren(getChildren(gd, subInfoList)));
|
gdList.forEach(gd -> gd.setChildren(getChildren(gd, subInfoList)));
|
||||||
provinceList.forEach(province -> province.setChildren(getChildren(province, gdList)));
|
provinceList.forEach(province -> province.setChildren(getChildren(province, gdList)));
|
||||||
@@ -428,26 +505,19 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
|||||||
findParentsRecursive(lineTree, all,aa);
|
findParentsRecursive(lineTree, all,aa);
|
||||||
aa.add(lineTree);
|
aa.add(lineTree);
|
||||||
}
|
}
|
||||||
List<TerminalTree> distinctList = aa.stream().distinct().collect(Collectors.toList());
|
List<TerminalTree> distinctList =new ArrayList<>();
|
||||||
|
distinctList.addAll(aa.stream().distinct().collect(Collectors.toList()));
|
||||||
|
aa.addAll(all);
|
||||||
|
List<TerminalTree> lines = aa.stream().distinct().sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||||
List<TerminalTree> collect = distinctList.stream().filter(x -> x.getLevel() == LineBaseEnum.SUB_LEVEL.getCode()).collect(Collectors.toList());
|
List<TerminalTree> collect = distinctList.stream().filter(x -> x.getLevel() == LineBaseEnum.SUB_LEVEL.getCode()).collect(Collectors.toList());
|
||||||
if(CollUtil.isNotEmpty(collect)){
|
if(CollUtil.isNotEmpty(collect)){
|
||||||
for (TerminalTree tree : collect) {
|
for (TerminalTree tree : collect) {
|
||||||
info.add(findParents(distinctList,tree));
|
info.add(findParents(lines,tree));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
private TerminalTree findParents(List<TerminalTree> all,TerminalTree subTree) {
|
|
||||||
List<TerminalTree> collect = all.stream().filter(allItem -> allItem.getPid().equals(subTree.getId())).collect(Collectors.toList());
|
|
||||||
if (CollUtil.isNotEmpty(collect)) {
|
|
||||||
collect.forEach(treeMap -> {
|
|
||||||
subTree.setChildren(collect);
|
|
||||||
findParents( all,treeMap);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return subTree;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void findParentsRecursive(TerminalTree tree, List<TerminalTree> all,List<TerminalTree> newParents) {
|
private static void findParentsRecursive(TerminalTree tree, List<TerminalTree> all,List<TerminalTree> newParents) {
|
||||||
if (tree.getLevel() == LineBaseEnum.SUB_LEVEL.getCode()) {
|
if (tree.getLevel() == LineBaseEnum.SUB_LEVEL.getCode()) {
|
||||||
@@ -461,6 +531,18 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TerminalTree findParents(List<TerminalTree> all,TerminalTree subTree) {
|
||||||
|
List<TerminalTree> collect = all.stream().filter(allItem -> allItem.getPid().equals(subTree.getId())).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(collect)) {
|
||||||
|
collect.forEach(treeMap -> {
|
||||||
|
subTree.setChildren(collect);
|
||||||
|
findParents( all,treeMap);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return subTree;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 未绑定监测点树
|
* 未绑定监测点树
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.njcn.device.pq.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.njcn.device.pq.mapper.SubstationMapper;
|
||||||
|
import com.njcn.device.pq.mapper.YwZtSubstationMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.Substation;
|
||||||
|
import com.njcn.device.pq.pojo.po.YwZtSubstation;
|
||||||
|
import com.njcn.device.pq.service.ISubstationService;
|
||||||
|
import com.njcn.device.pq.service.IYwZtSubstationService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.pojo.dto.DeptDTO;
|
||||||
|
import com.njcn.web.utils.WebUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2024-08-07
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class YwZtSubstationServiceImpl extends ServiceImpl<YwZtSubstationMapper, YwZtSubstation> implements IYwZtSubstationService {
|
||||||
|
|
||||||
|
|
||||||
|
private final SubstationMapper substationMapper;
|
||||||
|
private final ISubstationService substationService;
|
||||||
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean syncYwZtSubstation() {
|
||||||
|
List<Substation> test = substationMapper.test();
|
||||||
|
//数据库经纬度
|
||||||
|
Map<String, Substation> collect1 = test.stream().collect(Collectors.toMap(Substation::getScale, Function.identity()));
|
||||||
|
//中台变电站信息
|
||||||
|
List<YwZtSubstation> ztSubs = this.list();
|
||||||
|
|
||||||
|
//匹配不到数据
|
||||||
|
List<Substation> loseInfo=new ArrayList<>();
|
||||||
|
//匹配成功数据
|
||||||
|
List<Substation> info=new ArrayList<>();
|
||||||
|
|
||||||
|
collect1.forEach((key,value)->{
|
||||||
|
key=key.substring(key.indexOf("V")+1);
|
||||||
|
String dzmc = getDzmc(key);
|
||||||
|
List<YwZtSubstation> ztNormalSubs = ztSubs.stream().filter(
|
||||||
|
x -> dzmc.indexOf(getDzmc(x.getName())) != -1 || getDzmc(x.getName()).indexOf(dzmc) != -1
|
||||||
|
).collect(Collectors.toList());
|
||||||
|
if(CollUtil.isNotEmpty(ztNormalSubs)) {
|
||||||
|
if(ztNormalSubs.size()>1){
|
||||||
|
List<YwZtSubstation> collect = ztNormalSubs.stream().filter(
|
||||||
|
x -> dzmc.equals(getDzmc(x.getName()))
|
||||||
|
).collect(Collectors.toList());
|
||||||
|
if(CollUtil.isNotEmpty(collect)){
|
||||||
|
value.setLng(collect.get(0).getLng());
|
||||||
|
value.setScale(null);
|
||||||
|
value.setLat(collect.get(0).getLat());
|
||||||
|
info.add(value);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
value.setLng(ztNormalSubs.get(0).getLng());
|
||||||
|
value.setScale(null);
|
||||||
|
value.setLat(ztNormalSubs.get(0).getLat());
|
||||||
|
info.add(value);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
loseInfo.add(value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
List<String> collect = loseInfo.stream().filter(x->x.getLat().doubleValue()==0.0).map(Substation::getScale).collect(Collectors.toList());
|
||||||
|
System.out.println(collect);
|
||||||
|
System.out.println(info);
|
||||||
|
return substationService.updateBatchById(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<YwZtSubstation> getYwZtSubstation(String orgId) {
|
||||||
|
//获取变电站信息
|
||||||
|
List<String> orgIds = new ArrayList<>();
|
||||||
|
if(StrUtil.isNotBlank(orgId)){
|
||||||
|
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(orgId, WebUtil.filterDeptType()).getData();
|
||||||
|
orgIds= deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return this.list(new LambdaQueryWrapper<YwZtSubstation>().in(CollUtil.isNotEmpty(orgIds),YwZtSubstation::getOrgId,orgIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDzmc(String dzmc) {
|
||||||
|
if(StrUtil.isNotBlank(dzmc)) {
|
||||||
|
dzmc = dzmc.replace("变电站", "")
|
||||||
|
.replace("火电厂", "")
|
||||||
|
.replace("供电所", "")
|
||||||
|
.replace("风光储", "")
|
||||||
|
.replace("风电场", "")
|
||||||
|
.replace("光伏电站", "")
|
||||||
|
.replace("光储电站", "")
|
||||||
|
.replace("开关站", "")
|
||||||
|
.replace("桥接站", "");
|
||||||
|
}
|
||||||
|
return dzmc;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,11 +7,9 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.common.utils.LogUtil;
|
|
||||||
import com.njcn.harmonic.pojo.param.UploadDataParam;
|
import com.njcn.harmonic.pojo.param.UploadDataParam;
|
||||||
import com.njcn.harmonic.pojo.po.upload.RUploadCommPointBus;
|
import com.njcn.harmonic.pojo.po.upload.RUploadCommPointBus;
|
||||||
import com.njcn.harmonic.pojo.vo.upload.UploadPointStatisticalDataVo;
|
import com.njcn.harmonic.service.upload.RUploadCommPointBusService;
|
||||||
import com.njcn.harmonic.service.upload.IRUploadCommPointBusService;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -36,7 +34,7 @@ import com.njcn.web.controller.BaseController;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class RUploadCommPointBusController extends BaseController {
|
public class RUploadCommPointBusController extends BaseController {
|
||||||
|
|
||||||
private final IRUploadCommPointBusService irUploadCommPointBusService;
|
private final RUploadCommPointBusService RUploadCommPointBusService;
|
||||||
|
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@@ -45,7 +43,7 @@ public class RUploadCommPointBusController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "param", value = "实体参数", required = true)
|
@ApiImplicitParam(name = "param", value = "实体参数", required = true)
|
||||||
public HttpResult<Page<RUploadCommPointBus>> getCommPointBusPage(@RequestBody @Validated UploadDataParam param) {
|
public HttpResult<Page<RUploadCommPointBus>> getCommPointBusPage(@RequestBody @Validated UploadDataParam param) {
|
||||||
String methodDescribe = getMethodDescribe("getCommPointBusPage");
|
String methodDescribe = getMethodDescribe("getCommPointBusPage");
|
||||||
Page<RUploadCommPointBus> page = irUploadCommPointBusService.getCommPointBusPage(param);
|
Page<RUploadCommPointBus> page = RUploadCommPointBusService.getCommPointBusPage(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +54,7 @@ public class RUploadCommPointBusController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "param", value = "实体参数", required = true)
|
@ApiImplicitParam(name = "param", value = "实体参数", required = true)
|
||||||
public HttpResult<Boolean> upGwCommPoint(@RequestBody UploadDataParam param) {
|
public HttpResult<Boolean> upGwCommPoint(@RequestBody UploadDataParam param) {
|
||||||
String methodDescribe = getMethodDescribe("upGwCommPoint");
|
String methodDescribe = getMethodDescribe("upGwCommPoint");
|
||||||
irUploadCommPointBusService.upGw(param);
|
RUploadCommPointBusService.upGw(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -466,11 +466,11 @@ public class RStatLimitServiceImpl implements RStatLimitService {
|
|||||||
monitorLimitRateVO.setUbalanceOvertime(BigDecimal.valueOf(3.14159));
|
monitorLimitRateVO.setUbalanceOvertime(BigDecimal.valueOf(3.14159));
|
||||||
monitorLimitRateVO.setVoltageDevOvertime(BigDecimal.valueOf(3.14159));
|
monitorLimitRateVO.setVoltageDevOvertime(BigDecimal.valueOf(3.14159));
|
||||||
}else {
|
}else {
|
||||||
monitorLimitRateVO.setFlickerOvertime(BigDecimal.valueOf((double) item.getFlickerOvertime()/item.getFlickerAllTime()*100).setScale(2, RoundingMode.HALF_UP));
|
monitorLimitRateVO.setFlickerOvertime(calculatePercentage(item.getFlickerOvertime(),item.getFlickerAllTime()));
|
||||||
monitorLimitRateVO.setFreqDevOvertime(BigDecimal.valueOf((double) item.getFreqDevOvertime()/item.getAllTime()*100).setScale(2, RoundingMode.HALF_UP));
|
monitorLimitRateVO.setFreqDevOvertime(calculatePercentage(item.getFreqDevOvertime(),item.getAllTime()));
|
||||||
monitorLimitRateVO.setUaberranceOvertime(BigDecimal.valueOf((double) item.getUaberranceOvertime()/item.getAllTime()*100).setScale(2, RoundingMode.HALF_UP));
|
monitorLimitRateVO.setUaberranceOvertime(calculatePercentage(item.getUaberranceOvertime(),item.getAllTime()));
|
||||||
monitorLimitRateVO.setUbalanceOvertime(BigDecimal.valueOf((double) item.getUbalanceOvertime()/item.getAllTime()*100).setScale(2, RoundingMode.HALF_UP));
|
monitorLimitRateVO.setUbalanceOvertime(calculatePercentage(item.getUbalanceOvertime(),item.getAllTime()));
|
||||||
monitorLimitRateVO.setVoltageDevOvertime(BigDecimal.valueOf((double) item.getVoltageDevOvertime()/item.getAllTime()*100).setScale(2, RoundingMode.HALF_UP));
|
monitorLimitRateVO.setVoltageDevOvertime(calculatePercentage(item.getVoltageDevOvertime(),item.getAllTime()));
|
||||||
}
|
}
|
||||||
setUharmOvertimeRatios(item,monitorLimitRateVO);
|
setUharmOvertimeRatios(item,monitorLimitRateVO);
|
||||||
resultList.add(monitorLimitRateVO);
|
resultList.add(monitorLimitRateVO);
|
||||||
@@ -480,6 +480,32 @@ public class RStatLimitServiceImpl implements RStatLimitService {
|
|||||||
return pageResult;
|
return pageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算百分比,结果不超过100
|
||||||
|
*
|
||||||
|
* @param flickerOvertime 闪烁超时时间
|
||||||
|
* @param flickerAllTime 总闪烁时间
|
||||||
|
* @return 计算的百分比(如果结果超过100,则返回100)
|
||||||
|
*/
|
||||||
|
public BigDecimal calculatePercentage(Integer flickerOvertime, Integer flickerAllTime) {
|
||||||
|
// 检查参数是否为null
|
||||||
|
if (flickerOvertime == null || flickerAllTime == null) {
|
||||||
|
throw new IllegalArgumentException("方法遇到不合法参数");
|
||||||
|
}
|
||||||
|
// 将Integer转换为BigDecimal进行计算
|
||||||
|
BigDecimal overtime = BigDecimal.valueOf(flickerOvertime);
|
||||||
|
BigDecimal allTime = BigDecimal.valueOf(flickerAllTime);
|
||||||
|
|
||||||
|
// 计算百分比
|
||||||
|
BigDecimal percentage = overtime.divide(allTime, 10, RoundingMode.HALF_UP)
|
||||||
|
.multiply(BigDecimal.valueOf(100))
|
||||||
|
.setScale(2, RoundingMode.HALF_UP);
|
||||||
|
|
||||||
|
// 如果百分比超过100,则调整为100
|
||||||
|
return percentage.compareTo(BigDecimal.valueOf(100)) > 0 ? BigDecimal.valueOf(100) : percentage;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PwLimitDataVO> pwMonitorLimitDataRange(PwUserMonitorParam pwUserMonitorParam) {
|
public List<PwLimitDataVO> pwMonitorLimitDataRange(PwUserMonitorParam pwUserMonitorParam) {
|
||||||
List<PwLimitDataVO> result = new ArrayList<>();
|
List<PwLimitDataVO> result = new ArrayList<>();
|
||||||
@@ -637,6 +663,7 @@ public class RStatLimitServiceImpl implements RStatLimitService {
|
|||||||
} else {
|
} else {
|
||||||
BigDecimal ratio = BigDecimal.valueOf((double) uharmOvertime / allTime*100)
|
BigDecimal ratio = BigDecimal.valueOf((double) uharmOvertime / allTime*100)
|
||||||
.setScale(2, RoundingMode.HALF_UP);
|
.setScale(2, RoundingMode.HALF_UP);
|
||||||
|
ratio = ratio.compareTo(BigDecimal.valueOf(100)) > 0 ? BigDecimal.valueOf(100) : ratio;
|
||||||
monitorLimitRateVO.getClass().getMethod(setterName, BigDecimal.class)
|
monitorLimitRateVO.getClass().getMethod(setterName, BigDecimal.class)
|
||||||
.invoke(monitorLimitRateVO, ratio);
|
.invoke(monitorLimitRateVO, ratio);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,20 +3,17 @@ package com.njcn.harmonic.service.upload;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
|
||||||
import com.njcn.harmonic.pojo.param.UploadDataParam;
|
import com.njcn.harmonic.pojo.param.UploadDataParam;
|
||||||
import com.njcn.harmonic.pojo.po.upload.RUploadCommPointBus;
|
import com.njcn.harmonic.pojo.po.upload.RUploadCommPointBus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 公共连接点母线电能质量统计 服务类
|
* 公共连接点母线电能质量统计 服务类
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
@Service
|
|
||||||
public interface IRUploadCommPointBusService extends IService<RUploadCommPointBus> {
|
public interface RUploadCommPointBusService extends IService<RUploadCommPointBus> {
|
||||||
|
|
||||||
Page<RUploadCommPointBus> getCommPointBusPage(UploadDataParam param);
|
Page<RUploadCommPointBus> getCommPointBusPage(UploadDataParam param);
|
||||||
|
|
||||||
@@ -6,7 +6,6 @@ import cn.hutool.core.date.DatePattern;
|
|||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -15,7 +14,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
|||||||
import com.njcn.harmonic.mapper.upload.RUploadCommPointBusMapper;
|
import com.njcn.harmonic.mapper.upload.RUploadCommPointBusMapper;
|
||||||
import com.njcn.harmonic.pojo.param.UploadDataParam;
|
import com.njcn.harmonic.pojo.param.UploadDataParam;
|
||||||
import com.njcn.harmonic.pojo.po.upload.RUploadCommPointBus;
|
import com.njcn.harmonic.pojo.po.upload.RUploadCommPointBus;
|
||||||
import com.njcn.harmonic.service.upload.IRUploadCommPointBusService;
|
import com.njcn.harmonic.service.upload.RUploadCommPointBusService;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.web.enums.GWSendEnum;
|
import com.njcn.web.enums.GWSendEnum;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
@@ -37,7 +36,7 @@ import java.util.stream.Stream;
|
|||||||
* @since 2024-08-15
|
* @since 2024-08-15
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class RUploadCommPointBusServiceImpl extends ServiceImpl<RUploadCommPointBusMapper, RUploadCommPointBus> implements IRUploadCommPointBusService {
|
public class RUploadCommPointBusServiceImpl extends ServiceImpl<RUploadCommPointBusMapper, RUploadCommPointBus> implements RUploadCommPointBusService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<RUploadCommPointBus> getCommPointBusPage(UploadDataParam param) {
|
public Page<RUploadCommPointBus> getCommPointBusPage(UploadDataParam param) {
|
||||||
|
|||||||
@@ -124,7 +124,10 @@ public class RUploadEvaluationDataDServiceImpl extends MppServiceImpl<RUploadEva
|
|||||||
|
|
||||||
List<DeptGetChildrenMoreDTO> list = calculatedParam.getIdList();
|
List<DeptGetChildrenMoreDTO> list = calculatedParam.getIdList();
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
if (Objects.equals(Integer.parseInt(UploadEnum.NJCN_DEPT_LEVEL_1.getCode()), item.getDeptLevel())) {
|
if (Objects.equals(Integer.parseInt(UploadEnum.NJCN_DEPT_LEVEL_1.getCode()), item.getDeptLevel())
|
||||||
|
//县数据
|
||||||
|
|| Objects.equals(Integer.parseInt(UploadEnum.NJCN_DEPT_LEVEL_4.getCode()),item.getDeptLevel())
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
|||||||
}
|
}
|
||||||
Map<String, LineDetailVO.Detail> mapDetail = new HashMap<>();
|
Map<String, LineDetailVO.Detail> mapDetail = new HashMap<>();
|
||||||
QueryWrapper<QuitRunningDeviceVO> quitRunningDeviceVOQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<QuitRunningDeviceVO> quitRunningDeviceVOQueryWrapper = new QueryWrapper<>();
|
||||||
|
quitRunningDeviceVOQueryWrapper.eq("supervision_quit_running_device.state", DataStateEnum.ENABLE.getCode());
|
||||||
if (Objects.nonNull(quitRunningDeviceQueryParam)) {
|
if (Objects.nonNull(quitRunningDeviceQueryParam)) {
|
||||||
//判断监测点/设备的选择
|
//判断监测点/设备的选择
|
||||||
// if (Objects.nonNull(quitRunningDeviceQueryParam.getDeviceType()) && Objects.nonNull(quitRunningDeviceQueryParam.getDeviceId())) {
|
// if (Objects.nonNull(quitRunningDeviceQueryParam.getDeviceType()) && Objects.nonNull(quitRunningDeviceQueryParam.getDeviceId())) {
|
||||||
|
|||||||
@@ -798,7 +798,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
userReportPO.setEvaluationDept(userExcel.getEvaluationDept());
|
userReportPO.setEvaluationDept(userExcel.getEvaluationDept());
|
||||||
userReportPO.setEvaluationConclusion(userExcel.getEvaluationConclusion());
|
userReportPO.setEvaluationConclusion(userExcel.getEvaluationConclusion());
|
||||||
userReportPO.setDataType(1);
|
userReportPO.setDataType(1);
|
||||||
userReportPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
userReportPO.setStatus(BpmTaskStatusEnum.APPROVE.getStatus());
|
||||||
userReportPO.setState(DataStateEnum.ENABLE.getCode());
|
userReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
this.baseMapper.insert(userReportPO);
|
this.baseMapper.insert(userReportPO);
|
||||||
//处理敏感用户的信息
|
//处理敏感用户的信息
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class InstanceUtil {
|
|||||||
List<String> delete = list.stream().filter(x -> "delete_info".equals(x)).collect(Collectors.toList());
|
List<String> delete = list.stream().filter(x -> "delete_info".equals(x)).collect(Collectors.toList());
|
||||||
//如果为空则需要判断信息,先判断全部数据是否都是自己创建的,然后判断是否是都是带提交数据
|
//如果为空则需要判断信息,先判断全部数据是否都是自己创建的,然后判断是否是都是带提交数据
|
||||||
if (CollUtil.isEmpty(delete)) {
|
if (CollUtil.isEmpty(delete)) {
|
||||||
long count = list.stream().filter(x -> !userId.equals(x)).count();
|
long count = createBy.stream().filter(x -> !userId.equals(x)).count();
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
throw new BusinessException(SupervisionResponseEnum.NO_POWER);
|
throw new BusinessException(SupervisionResponseEnum.NO_POWER);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import com.njcn.system.api.fallback.EpdFeignClientFallbackFactory;
|
|||||||
import com.njcn.system.pojo.dto.EpdDTO;
|
import com.njcn.system.pojo.dto.EpdDTO;
|
||||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
|
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
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.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@@ -58,4 +58,9 @@ public interface EpdFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/findListByShowName")
|
@PostMapping("/findListByShowName")
|
||||||
HttpResult<List<EleEpdPqd>> findListByShowName(@RequestParam("name") String name);
|
HttpResult<List<EleEpdPqd>> findListByShowName(@RequestParam("name") String name);
|
||||||
|
@PostMapping("/selectByClassId")
|
||||||
|
HttpResult<List<EleEpdPqd>> selectByClassId(@RequestParam("classId") String classId);
|
||||||
|
|
||||||
|
@PostMapping("/selectAll")
|
||||||
|
HttpResult<List<EleEpdPqdListVO>> selectAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.njcn.system.api.EpdFeignClient;
|
|||||||
import com.njcn.system.pojo.dto.EpdDTO;
|
import com.njcn.system.pojo.dto.EpdDTO;
|
||||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
|
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||||
import com.njcn.system.utils.SystemEnumUtil;
|
import com.njcn.system.utils.SystemEnumUtil;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -106,6 +107,18 @@ public class EpdFeignClientFallbackFactory implements FallbackFactory<EpdFeignCl
|
|||||||
log.error("{}异常,降级处理,异常为:{}","根据名称查询字典信息集合",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","根据名称查询字典信息集合",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<EleEpdPqd>> selectByClassId(String classId) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据数据分类查询字典信息集合",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<EleEpdPqdListVO>> selectAll() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据数据分类查询字典信息集合",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,6 +164,16 @@ public class EleEpdPqdController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqds, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqds, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/selectByClassId")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("根据数据分类查询字典数据")
|
||||||
|
public HttpResult<List<EleEpdPqd>> selectByClassId(@RequestParam("classId") @Validated String classId){
|
||||||
|
String methodDescribe = getMethodDescribe("selectByClassId");
|
||||||
|
LogUtil.njcnDebug(log, "{},根据数据分类查询字典数据:", methodDescribe);
|
||||||
|
List<EleEpdPqd> eleEpdPqds = eleEpdPqdService.selectByClassId(classId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqds, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/judgeExist")
|
@PostMapping("/judgeExist")
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiOperation("校验字典是否存在")
|
@ApiOperation("校验字典是否存在")
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.njcn.system.init;
|
||||||
|
|
||||||
|
import com.njcn.system.service.IEleEpdPqdService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.boot.CommandLineRunner;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class InitEpdPqd implements CommandLineRunner {
|
||||||
|
|
||||||
|
private final IEleEpdPqdService epdPqdService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(String... args) {
|
||||||
|
epdPqdService.refreshEpdPqdDataCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,8 +7,6 @@ import com.njcn.system.pojo.param.EleEpdPqdParam;
|
|||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||||
import com.njcn.system.pojo.vo.EleEpdPqdVO;
|
import com.njcn.system.pojo.vo.EleEpdPqdVO;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -23,6 +21,12 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public interface IEleEpdPqdService extends IService<EleEpdPqd> {
|
public interface IEleEpdPqdService extends IService<EleEpdPqd> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新epd内容
|
||||||
|
*/
|
||||||
|
void refreshEpdPqdDataCache();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储模板的字典数据
|
* 存储模板的字典数据
|
||||||
* @param eleEpdPqdParam
|
* @param eleEpdPqdParam
|
||||||
@@ -110,4 +114,5 @@ public interface IEleEpdPqdService extends IService<EleEpdPqd> {
|
|||||||
*/
|
*/
|
||||||
List<EpdDTO> findAll();
|
List<EpdDTO> findAll();
|
||||||
|
|
||||||
|
List<EleEpdPqd> selectByClassId(String classId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.db.constant.DbConstant;
|
import com.njcn.db.constant.DbConstant;
|
||||||
|
import com.njcn.redis.pojo.enums.AppRedisKey;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
import com.njcn.system.enums.SystemResponseEnum;
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
import com.njcn.system.mapper.EleEpdPqdMapper;
|
import com.njcn.system.mapper.EleEpdPqdMapper;
|
||||||
import com.njcn.system.pojo.dto.EpdDTO;
|
import com.njcn.system.pojo.dto.EpdDTO;
|
||||||
@@ -43,6 +45,18 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
|||||||
|
|
||||||
private final IDictDataService idictDataService;
|
private final IDictDataService idictDataService;
|
||||||
|
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void refreshEpdPqdDataCache() {
|
||||||
|
Map<String,String> map = new HashMap<>();
|
||||||
|
List<EpdDTO> list = findAll();
|
||||||
|
list.forEach(item->{
|
||||||
|
map.put(item.getDictName(),item.getTableName());
|
||||||
|
});
|
||||||
|
redisUtil.saveByKey(AppRedisKey.ELE_EPD_PQD,map);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveData(List<EleEpdPqdParam> eleEpdPqdParam) {
|
public void saveData(List<EleEpdPqdParam> eleEpdPqdParam) {
|
||||||
List<EleEpdPqd> list = eleEpdPqdParam.stream().map(item->{
|
List<EleEpdPqd> list = eleEpdPqdParam.stream().map(item->{
|
||||||
@@ -58,7 +72,10 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
|||||||
return eleEpdPqd;
|
return eleEpdPqd;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(list)){
|
if (CollectionUtil.isNotEmpty(list)){
|
||||||
this.saveBatch(list,1000);
|
boolean result = this.saveBatch(list,1000);
|
||||||
|
if (result) {
|
||||||
|
refreshEpdPqdDataCache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +91,10 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
|||||||
eleEpdPqd.setPhase("M");
|
eleEpdPqd.setPhase("M");
|
||||||
}
|
}
|
||||||
eleEpdPqd.setStatus(1);
|
eleEpdPqd.setStatus(1);
|
||||||
this.save(eleEpdPqd);
|
boolean result = this.save(eleEpdPqd);
|
||||||
|
if (result) {
|
||||||
|
refreshEpdPqdDataCache();
|
||||||
|
}
|
||||||
return eleEpdPqd;
|
return eleEpdPqd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +102,10 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
|||||||
public void delete(String id) {
|
public void delete(String id) {
|
||||||
EleEpdPqd eleEpdPqd = this.lambdaQuery().eq(EleEpdPqd::getId,id).one();
|
EleEpdPqd eleEpdPqd = this.lambdaQuery().eq(EleEpdPqd::getId,id).one();
|
||||||
eleEpdPqd.setStatus(0);
|
eleEpdPqd.setStatus(0);
|
||||||
this.updateById(eleEpdPqd);
|
boolean result = this.updateById(eleEpdPqd);
|
||||||
|
if (result) {
|
||||||
|
refreshEpdPqdDataCache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -97,7 +120,10 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
|||||||
if (Objects.isNull(updateParam.getPhase())){
|
if (Objects.isNull(updateParam.getPhase())){
|
||||||
eleEpdPqd.setPhase("M");
|
eleEpdPqd.setPhase("M");
|
||||||
}
|
}
|
||||||
this.updateById(eleEpdPqd);
|
boolean result = this.updateById(eleEpdPqd);
|
||||||
|
if (result) {
|
||||||
|
refreshEpdPqdDataCache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -227,6 +253,11 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EleEpdPqd> selectByClassId(String classId) {
|
||||||
|
return this.lambdaQuery().eq(EleEpdPqd::getClassId,classId).list();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验参数,
|
* 校验参数,
|
||||||
* 1.检查是否存在相同名称的菜单
|
* 1.检查是否存在相同名称的菜单
|
||||||
|
|||||||
Reference in New Issue
Block a user