13 Commits

Author SHA1 Message Date
hzj
917e3fb2d5 海南bug修改提交 2025-12-23 11:40:18 +08:00
cdf
e0f1e314a4 组件管理加排序 2025-12-23 09:33:18 +08:00
cdf
2f2ed06a35 组件管理加排序 2025-12-22 19:59:25 +08:00
xy
277400670d 微调 2025-12-22 14:11:16 +08:00
xy
a1031109c4 微调 2025-12-22 10:09:15 +08:00
cdf
eeb27c519b sql适配大梦数据库 2025-12-19 16:15:55 +08:00
wr
670eaf7d38 微调 2025-12-19 10:19:59 +08:00
xy
2b79cefad6 微调 2025-12-19 10:18:13 +08:00
xy
212db18835 新增异常数据问题 2025-12-18 22:24:03 +08:00
wr
e9a1c34160 调整异常数据界面业务 2025-12-18 22:22:36 +08:00
wr
fb7a2b7084 调整异常数据界面业务 2025-12-17 19:25:08 +08:00
wr
4b3ec39a11 Merge remote-tracking branch 'origin/main' 2025-12-16 18:25:33 +08:00
wr
2d255a5dd3 微调 2025-12-16 18:23:43 +08:00
45 changed files with 386 additions and 335 deletions

View File

@@ -83,10 +83,10 @@ public class EventRelevantAnalysisController extends BaseController {
public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){ public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){
String methodDescribe = getMethodDescribe("queryEventsAssPage"); String methodDescribe = getMethodDescribe("queryEventsAssPage");
String searchValue = baseParam.getSearchValue(); String searchValue = baseParam.getSearchValue();
Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX); // Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
if(pattern.matcher(searchValue).find()){ // if(pattern.matcher(searchValue).find()){
throw new BusinessException(ValidMessage.SPECIAL_REGEX); // throw new BusinessException(ValidMessage.SPECIAL_REGEX);
} // }
Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam); Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
} }

View File

@@ -565,7 +565,7 @@ public class SecondaryEvaluationServiceImpl implements SecondaryEvaluationServic
unblance.add(evaluationResult); unblance.add(evaluationResult);
evaluationResult = new AssessResultVO.EvaluationResult(); evaluationResult = new AssessResultVO.EvaluationResult();
evaluationResult.setData(result.getApproUnblance().multiply(BigDecimal.valueOf(200))); evaluationResult.setData(result.getApproUnblance());
evaluationResult.setLimitData(overLimit.getUnblance()); evaluationResult.setLimitData(overLimit.getUnblance());
evaluationResult.setIsQualified(NumberUtil.isLess(evaluationResult.getData(), evaluationResult.getLimitData())); evaluationResult.setIsQualified(NumberUtil.isLess(evaluationResult.getData(), evaluationResult.getLimitData()));
unblance.add(evaluationResult); unblance.add(evaluationResult);

View File

@@ -471,6 +471,8 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class); List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> { advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
item.setFeatureAmplitude(item.getFeatureAmplitude()*100);
if (map.containsKey(item.getLineId())) { if (map.containsKey(item.getLineId())) {
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId()); AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
item.setGdName(areaLineInfoVO.getGdName()); item.setGdName(areaLineInfoVO.getGdName());

View File

@@ -7,10 +7,10 @@
SELECT DISTINCT SELECT DISTINCT
monitor.Org_Id AS orgId, monitor.Org_Id AS orgId,
monitor.Org_Name AS orgName, monitor.Org_Name AS orgName,
monitor.`Powerr_Id` AS powerId, monitor.Powerr_Id AS powerId,
monitor.`Powerr_Name` AS powerName, monitor.Powerr_Name AS powerName,
monitor.id AS monitorId, monitor.id AS monitorId,
monitor.`Name` AS monitorName, monitor.Name AS monitorName,
monitor.Line_Id, monitor.Line_Id,
monitor.Line_Name, monitor.Line_Name,
pdm.Monitor_Sort AS monitorSort, pdm.Monitor_Sort AS monitorSort,
@@ -29,8 +29,8 @@
( (
SELECT SELECT
pm.id, pm.id,
pm.`Name`, pm.Name,
pm.`Status`, pm.Status,
pm.Org_Id, pm.Org_Id,
pm.Org_Name, pm.Org_Name,
pm.Powerr_Id, pm.Powerr_Id,
@@ -51,8 +51,8 @@
) AS monitor ) AS monitor
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
WHERE WHERE
monitor.`Status` = 1 monitor.Status = 1
AND pdm.`Status` = 1 AND pdm.Status = 1
AND monitor.Org_Id IN AND monitor.Org_Id IN
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=","> <foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
#{orgId} #{orgId}
@@ -85,7 +85,7 @@
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser} AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
</if> </if>
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''"> <if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%') AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
</if> </if>
</select> </select>

View File

@@ -93,7 +93,7 @@ public class DeviceParam {
@NotBlank(message = "设备制造商不能为空") @NotBlank(message = "设备制造商不能为空")
private String manufacturer; private String manufacturer;
@ApiModelProperty(name = "electroplate",value = "功能",required = true) @ApiModelProperty(name = "electroplate",value = "功能",required = true)
@NotNull(message = "电镀标识不能为空") @NotNull(message = "电镀标识不能为空")
private Integer electroplate; private Integer electroplate;

View File

@@ -41,4 +41,6 @@ public class MonitorBaseParam extends BaseParam {
@ApiModelProperty(value = "监测点运行状态") @ApiModelProperty(value = "监测点运行状态")
private Integer lineRunFlag; private Integer lineRunFlag;
@ApiModelProperty(value = "异常天数时间")
private List<String> time;
} }

View File

@@ -52,17 +52,5 @@ public class PqDataVerifyCount implements Serializable {
@TableField(value = "total_all") @TableField(value = "total_all")
private Integer totalAll ; private Integer totalAll ;
/**
* 异常短时闪变数量
*/
@TableField(value = "flicker")
private Integer flicker ;
/**
* 短时闪变总数量
*/
@TableField(value = "flicker_all")
private Integer flickerAll;
} }

View File

@@ -136,8 +136,10 @@ public class AreaLineInfoVO implements Serializable {
@ApiModelProperty(name = "objId",value = "对象id") @ApiModelProperty(name = "objId",value = "对象id")
private String objId; private String objId;
private Double vHarmonicValue; ; @ApiModelProperty(name = "vHarmonicValue",value = "污染值")
private Double vHarmonicValue;
@ApiModelProperty(name = "userList",value = "敏感用户信息")
private List<User> userList; private List<User> userList;
@Data @Data

View File

@@ -96,7 +96,7 @@ public class DeviceVO implements Serializable {
@ApiModelProperty(name = "manufacturer",value = "设备制造商Guid") @ApiModelProperty(name = "manufacturer",value = "设备制造商Guid")
private String manufacturer; private String manufacturer;
@ApiModelProperty(name = "electroplate",value = "功能") @ApiModelProperty(name = "electroplate",value = "功能")
private Integer electroplate; private Integer electroplate;
@ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间") @ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间")

View File

@@ -17,6 +17,8 @@ public class DetailAbnormalVO {
private String date; private String date;
private List<String> dateList;
private String monitorName; private String monitorName;
private String bdName; private String bdName;
@@ -58,6 +60,15 @@ public class DetailAbnormalVO {
} }
@Data
public static class DetailAbnormalCountVO {
private Integer timeSum;
private Integer errCount;
private List<DetailAbnormalInnerVO> time;
}
@Data @Data
public static class DetailLimitInnerVO{ public static class DetailLimitInnerVO{

View File

@@ -13,10 +13,10 @@ public class PowerQualityIndicatorsVO {
@ApiModelProperty(name = "monitorId",value = "监测点id") @ApiModelProperty(name = "monitorId",value = "监测点id")
private String monitorId; private String monitorId;
//监测点名称
@ApiModelProperty(name = "monitorName",value = "监测点名称") @ApiModelProperty(name = "monitorName",value = "监测点名称")
private String monitorName; private String monitorName;
//所属终端名称
@ApiModelProperty(name = "devName",value = "所属终端名称") @ApiModelProperty(name = "devName",value = "所属终端名称")
private String devName; private String devName;
@@ -25,23 +25,25 @@ public class PowerQualityIndicatorsVO {
@ApiModelProperty(name = "manufacturer",value = "所属厂商") @ApiModelProperty(name = "manufacturer",value = "所属厂商")
private String manufacturer; private String manufacturer;
//所属电站
@ApiModelProperty(name = "stationName",value = "所属电站") @ApiModelProperty(name = "stationName",value = "所属电站")
private String stationName; private String stationName;
//监测对象类型
@ApiModelProperty(name = "objType",value = "监测对象类型") @ApiModelProperty(name = "objType",value = "监测对象类型")
private String objType; private String objType;
//监测对象名称
@ApiModelProperty(name = "objName",value = "监测对象名称") @ApiModelProperty(name = "objName",value = "监测对象名称")
private String objName; private String objName;
//电压等级
@ApiModelProperty(name = "voltageLevel",value = "电压等级") @ApiModelProperty(name = "voltageLevel",value = "电压等级")
private String voltageLevel; private String voltageLevel;
//异常天数
@ApiModelProperty(name = "abnormalDay",value = "异常天数") @ApiModelProperty(name = "abnormalDay",value = "异常天数")
private Integer abnormalDay; private Integer abnormalDay;
//严重度
@ApiModelProperty(name = "severity",value = "严重度") @ApiModelProperty(name = "severity",value = "严重度")
private Integer severity; private Integer severity;
@ApiModelProperty("地市")
private String city;
} }

View File

@@ -86,9 +86,9 @@ public class DataVerifyController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/monitorAbnormalTableDetail") @PostMapping("/monitorAbnormalTableDetail")
@ApiOperation("弹框-获取异常监测点列表详情") @ApiOperation("弹框-获取异常监测点列表详情")
public HttpResult<List<DetailAbnormalVO.DetailAbnormalInnerVO>> monitorAbnormalTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){ public HttpResult<DetailAbnormalVO.DetailAbnormalCountVO> monitorAbnormalTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
String methodDescribe = getMethodDescribe("monitorAbnormalTableDetail"); String methodDescribe = getMethodDescribe("monitorAbnormalTableDetail");
List<DetailAbnormalVO.DetailAbnormalInnerVO> list = iPqDataVerifyBakService.monitorAbnormalTableDetail(monitorBaseParam); DetailAbnormalVO.DetailAbnormalCountVO list = iPqDataVerifyBakService.monitorAbnormalTableDetail(monitorBaseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
} }

View File

@@ -8,9 +8,7 @@
SELECT SELECT
line_id AS lineId, line_id AS lineId,
SUM(total) AS total, SUM(total) AS total,
SUM(total_all) AS totalAll, SUM(total_all) AS totalAll
SUM(flicker) AS flicker,
SUM(flicker_all) AS flickerAll
FROM FROM
pq_data_verify_count pq_data_verify_count
<where> <where>
@@ -32,12 +30,12 @@
<select id="getAnomalousData" resultType="OnlineMonitorVo"> <select id="getAnomalousData" resultType="OnlineMonitorVo">
SELECT DISTINCT SELECT DISTINCT
t6.`Name` gdName, t6.Name gdName,
t5.`Name` subName, t5.Name subName,
t4.`Name` deviceName, t4.Name deviceName,
t1.Line_Id lineId, t1.Line_Id lineId,
t2.`Name` lineName, t2.Name lineName,
t8.`Name` monitorObjType, t8.Name monitorObjType,
t7.Obj_Name monitorObj, t7.Obj_Name monitorObj,
"异常数据" as target, "异常数据" as target,
count(t1.time_id) lastDay count(t1.time_id) lastDay
@@ -51,7 +49,7 @@
left join pq_line_detail t7 on t1.Line_Id = t7.Id left join pq_line_detail t7 on t1.Line_Id = t7.Id
left join sys_dict_data t8 on t7.Load_Type = t8.Id left join sys_dict_data t8 on t7.Load_Type = t8.Id
WHERE WHERE
(t1.total + t1.flicker) > 0 t1.total > 0
<if test="lineIds!=null and lineIds.size > 0"> <if test="lineIds!=null and lineIds.size > 0">
and Line_Id in and Line_Id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=","> <foreach collection="lineIds" item="item" open="(" close=")" separator=",">

View File

@@ -381,7 +381,7 @@
line.LEVEL, line.LEVEL,
line.sort, line.sort,
line.pids, line.pids,
CONCAT(voltage.name, '_', line.name, '(',device.`Name`,')') name, CONCAT(voltage.name, '_', line.name, '(',device.Name,')') name,
comFlag.Com_Flag, comFlag.Com_Flag,
detail.pt_type, detail.pt_type,
detail.obj_id detail.obj_id

View File

@@ -27,8 +27,7 @@ public interface IPqDataVerifyBakService extends IService<PqDataVerifyBak> {
List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam); List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam);
DetailAbnormalVO.DetailAbnormalCountVO monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);
List<DetailAbnormalVO.DetailAbnormalInnerVO> monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);

View File

@@ -20,30 +20,27 @@ import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto; import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
import com.njcn.dataProcess.pojo.dto.DataLimitTargetDto; import com.njcn.dataProcess.pojo.dto.DataLimitTargetDto;
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto; import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
import com.njcn.device.biz.enums.DeviceResponseEnum; import com.njcn.device.biz.enums.DeviceResponseEnum;
import com.njcn.device.biz.pojo.dto.LineDevGetDTO; import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
import com.njcn.device.biz.pojo.po.Overlimit; import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.device.line.mapper.LineMapper; import com.njcn.device.line.mapper.LineMapper;
import com.njcn.device.line.service.DeptLineService;
import com.njcn.device.overlimit.service.IOverLimitService; import com.njcn.device.overlimit.service.IOverLimitService;
import com.njcn.device.pq.mapper.DataVerifyMapper; import com.njcn.device.pq.mapper.DataVerifyMapper;
import com.njcn.device.pq.mapper.PqDataVerifyBakMapper;
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam; import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
import com.njcn.device.pq.pojo.po.DataVerify; import com.njcn.device.pq.pojo.po.DataVerify;
import com.njcn.device.pq.pojo.po.DeptLine;
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO; import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
import com.njcn.device.pq.pojo.vo.LineDetailDataVO; import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
import com.njcn.device.pq.pojo.vo.dataClean.*; import com.njcn.device.pq.pojo.vo.dataClean.*;
import com.njcn.device.pq.service.CommTerminalService; import com.njcn.device.pq.service.CommTerminalService;
import com.njcn.device.pq.service.IDataVerifyService; import com.njcn.device.pq.service.IDataVerifyService;
import com.njcn.harmonic.pojo.po.RStatDataVD;
import com.njcn.supervision.api.UserLedgerFeignClient; import com.njcn.supervision.api.UserLedgerFeignClient;
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.api.DictTreeFeignClient; import com.njcn.system.api.DictTreeFeignClient;
import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.DictData;
import com.njcn.system.pojo.po.SysDicTreePO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -51,7 +48,6 @@ import org.springframework.stereotype.Service;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
@@ -73,28 +69,21 @@ import java.util.stream.Collectors;
public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVerify> implements IDataVerifyService { public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVerify> implements IDataVerifyService {
private static final Logger logger = LoggerFactory.getLogger(DataVerifyServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(DataVerifyServiceImpl.class);
private static final String SEPARATOR = "&"; private static final String SEPARATOR = "&";
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN); private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
private final CommTerminalService commTerminalService; private final CommTerminalService commTerminalService;
private final LineMapper lineMapper; private final LineMapper lineMapper;
private final DictTreeFeignClient dictTreeFeignClient; private final DictTreeFeignClient dictTreeFeignClient;
private final UserLedgerFeignClient userLedgerFeignClient; private final UserLedgerFeignClient userLedgerFeignClient;
private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient; private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient;
private final DataLimitTargetFeignClient dataLimitTargetFeignClient; private final DataLimitTargetFeignClient dataLimitTargetFeignClient;
private final DataLimitRateFeignClient dataLimitRateFeignClient; private final DataLimitRateFeignClient dataLimitRateFeignClient;
private final DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient; private final DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
private final DicDataFeignClient dicDataFeignClient; private final DicDataFeignClient dicDataFeignClient;
private final IOverLimitService overLimitService; private final IOverLimitService overLimitService;
private final DeptLineService deptLineService;
@Override @Override
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) { public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
@@ -545,7 +534,10 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
}else{
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.VThd.getCode());
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(uaberrance, dto);
assess.setUharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
} }
//谐波电流 //谐波电流
if (CollUtil.isNotEmpty(iharm)) { if (CollUtil.isNotEmpty(iharm)) {
@@ -672,6 +664,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
processHarmonicTarget(dto, targetMap, DicDataEnum.HARMONIC_CURRENT.getCode(), "iharm", 2, 25, result); processHarmonicTarget(dto, targetMap, DicDataEnum.HARMONIC_CURRENT.getCode(), "iharm", 2, 25, result);
processHarmonicTarget(dto, targetMap, DicDataEnum.INTERHARMONIC_VOLTAGE.getCode(), "inuharm", 1, 16, result); processHarmonicTarget(dto, targetMap, DicDataEnum.INTERHARMONIC_VOLTAGE.getCode(), "inuharm", 1, 16, result);
} }
private void processStandardTarget(DataLimitRateDetailDto dto, Map<String, DictData> targetMap, private void processStandardTarget(DataLimitRateDetailDto dto, Map<String, DictData> targetMap,
String targetCode, String data, String targetCode, String data,
List<DetailAbnormalVO.DetailLimitInnerVO> result) { List<DetailAbnormalVO.DetailLimitInnerVO> result) {
@@ -976,7 +969,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
List<LocalDate> dateList = list.stream().map(it -> it.getTime().toLocalDate()).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList()); List<LocalDate> dateList = list.stream().map(it -> it.getTime().toLocalDate()).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
processTable(monitorBaseParam, dateList, result, key); processTable(monitorBaseParam, dateList, result, key);
}); });
dealTableResult(result); dealTableResult(result, monitorBaseParam.getSearchValue());
return result; return result;
} }
@@ -988,7 +981,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
List<LocalDate> dateList = list.stream().map(DataLimitTargetDto::getTime).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList()); List<LocalDate> dateList = list.stream().map(DataLimitTargetDto::getTime).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
processTable(monitorBaseParam, dateList, result, key); processTable(monitorBaseParam, dateList, result, key);
}); });
dealTableResult(result); dealTableResult(result, monitorBaseParam.getSearchValue());
return result; return result;
} }
@@ -1015,34 +1008,44 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
} }
} }
private void dealTableResult(List<PowerQualityIndicatorsVO> result) { private void dealTableResult(List<PowerQualityIndicatorsVO> result, String searchValue) {
if (CollUtil.isNotEmpty(result)) { if (CollUtil.isNotEmpty(result)) {
List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData(); // List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity())); // Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList()); List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList());
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, null, null); List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, searchValue, null);
Map<String, AreaLineInfoVO> areaMap = areaLineInfoVOList.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity())); Map<String, PowerQualityIndicatorsVO> areaMap = result.stream().collect(Collectors.toMap(PowerQualityIndicatorsVO::getMonitorId, Function.identity()));
List<DeptLine> deptLines = deptLineService.selectDeptLine(ids);
List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList()); Map<String, String> deptName = deptLines.stream().collect(Collectors.toMap(DeptLine::getLineId, DeptLine::getId));
List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData(); // List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity())); // List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
result.forEach(it -> { // Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
if (areaMap.containsKey(it.getMonitorId())) { List<PowerQualityIndicatorsVO> info = new ArrayList<>();
AreaLineInfoVO areaLineInfoVO = areaMap.get(it.getMonitorId()); for (AreaLineInfoVO lineDetail : areaLineInfoVOList) {
it.setMonitorName(areaLineInfoVO.getLineName()); if (areaMap.containsKey(lineDetail.getLineId())) {
it.setStationName(areaLineInfoVO.getSubName()); PowerQualityIndicatorsVO it = areaMap.get(lineDetail.getLineId());
it.setDevName(areaLineInfoVO.getDeviceName()); it.setMonitorName(lineDetail.getLineName());
it.setVoltageLevel(areaLineInfoVO.getVoltageScale()); it.setStationName(lineDetail.getSubName());
it.setIp(Base64.encode(areaLineInfoVO.getIp())); if(deptName.containsKey(lineDetail.getLineId())){
it.setManufacturer(areaLineInfoVO.getManufacturer()); it.setCity(deptName.get(lineDetail.getLineId()));
if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
} }
if (userMap.containsKey(areaLineInfoVO.getObjId())) { it.setDevName(lineDetail.getDeviceName());
it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName()); it.setVoltageLevel(lineDetail.getVoltageScale());
it.setIp(Base64.encode(lineDetail.getIp()));
it.setManufacturer(lineDetail.getManufacturer());
it.setObjType(lineDetail.getLoadType());
it.setObjName(lineDetail.getObjName());
info.add(it);
// if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
// it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
// }
// if (userMap.containsKey(areaLineInfoVO.getObjId())) {
// it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
// }
} }
} }
}); result.clear();
result.addAll(info);
} }
} }

View File

@@ -384,8 +384,6 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
onlineRateParam.setIds(lineIds); onlineRateParam.setIds(lineIds);
List<PqDataVerifyCount> sumVerify = pqDataVerifyCountService.getSumVerify(onlineRateParam); List<PqDataVerifyCount> sumVerify = pqDataVerifyCountService.getSumVerify(onlineRateParam);
//超标率
// List<RStatLimitRateDPO> limitRatePOList = rStatLimitRateDClient.monitorIdsGetLimitInfo(rStatLimitQueryParam).getData();
for (GeneralDeviceDTO dto : deviceInfo) { for (GeneralDeviceDTO dto : deviceInfo) {
detail = new DeviceRunEvaluateVO.Detail(); detail = new DeviceRunEvaluateVO.Detail();
@@ -393,7 +391,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
detail.setCount(dto.getDeviceIndexes().size()); detail.setCount(dto.getDeviceIndexes().size());
detail.setOnline(onLineRate(onlineRateByDev, dto.getDeviceIndexes())); detail.setOnline(onLineRate(onlineRateByDev, dto.getDeviceIndexes()));
detail.setIntegrity(integrity(integrityList, dto.getLineIndexes())); detail.setIntegrity(integrity(integrityList, dto.getLineIndexes()));
detail.setQualified(verify(sumVerify, dto.getLineIndexes())); detail.setQualified(verifyDev(sumVerify, dto.getLineIndexes(), dto.getDeviceIndexes()));
detail.setScore(ONINTEGRITY.multiply(detail.getIntegrity()) detail.setScore(ONINTEGRITY.multiply(detail.getIntegrity())
.add(ONLINERATE.multiply(detail.getOnline()) .add(ONLINERATE.multiply(detail.getOnline())
.add(LIMITRATE.multiply(detail.getQualified()))).stripTrailingZeros().setScale(2, RoundingMode.HALF_UP)); .add(LIMITRATE.multiply(detail.getQualified()))).stripTrailingZeros().setScale(2, RoundingMode.HALF_UP));
@@ -436,18 +434,28 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
return info; return info;
} }
private BigDecimal verifyDev(List<PqDataVerifyCount> sumVerify, List<String> lineIds, List<String> devIds) {
//异常率
List<PqDataVerifyCount> verifyList = sumVerify.stream().filter(x->x.getTotal()>0).filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
List<String> verifyLine = verifyList.stream().map(PqDataVerifyCount::getLineId).distinct().collect(Collectors.toList());
List<String> devIdsLine = lineMapper.getDevIdsLine(verifyLine);
if (CollUtil.isNotEmpty(devIdsLine)) {
return NumberUtil.round(Math.min(devIdsLine.size() * 100.0 / devIds.size(), 100), 2);
} else {
return new BigDecimal(0);
}
}
private BigDecimal verify(List<PqDataVerifyCount> sumVerify, List<String> lineIds) { private BigDecimal verify(List<PqDataVerifyCount> sumVerify, List<String> lineIds) {
//异常率 //异常率
List<PqDataVerifyCount> verifyList = sumVerify.stream().filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList()); List<PqDataVerifyCount> verifyList = sumVerify.stream().filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
if (CollUtil.isNotEmpty(verifyList)) { if (CollUtil.isNotEmpty(verifyList)) {
double total = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotal).sum(); double total = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotal).sum();
double totalAll = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotalAll).sum(); double totalAll = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotalAll).sum();
double flicker = verifyList.stream().mapToDouble(PqDataVerifyCount::getFlicker).sum(); if (totalAll == 0) {
double flickerAll = verifyList.stream().mapToDouble(PqDataVerifyCount::getFlickerAll).sum();
if (totalAll + flickerAll == 0) {
return new BigDecimal(0); return new BigDecimal(0);
} }
return NumberUtil.round(Math.min((total + flicker) * 100 / (totalAll + flickerAll), 100), 2); return NumberUtil.round(Math.min(total * 100.0 / totalAll, 100), 2);
} else { } else {
return new BigDecimal(0); return new BigDecimal(0);
} }
@@ -462,7 +470,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
if (dueTime == 0) { if (dueTime == 0) {
return new BigDecimal(0); return new BigDecimal(0);
} }
return NumberUtil.round(Math.min(realTime * 100 / dueTime, 100), 2); return NumberUtil.round(Math.min(realTime * 100.0 / dueTime, 100), 2);
} else { } else {
return new BigDecimal(0); return new BigDecimal(0);
} }

View File

@@ -18,10 +18,12 @@ import com.njcn.dataProcess.enums.DataCleanEnum;
import com.njcn.dataProcess.param.DataCleanParam; import com.njcn.dataProcess.param.DataCleanParam;
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto; import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
import com.njcn.device.line.mapper.LineMapper; import com.njcn.device.line.mapper.LineMapper;
import com.njcn.device.line.service.DeptLineService;
import com.njcn.device.pq.constant.Param; import com.njcn.device.pq.constant.Param;
import com.njcn.device.pq.enums.LineBaseEnum; import com.njcn.device.pq.enums.LineBaseEnum;
import com.njcn.device.pq.mapper.PqDataVerifyBakMapper; import com.njcn.device.pq.mapper.PqDataVerifyBakMapper;
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam; import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
import com.njcn.device.pq.pojo.po.DeptLine;
import com.njcn.device.pq.pojo.po.PqDataVerifyBak; import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO; import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
import com.njcn.device.pq.pojo.vo.LineDetailDataVO; import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
@@ -33,10 +35,7 @@ import com.njcn.device.pq.service.CommTerminalService;
import com.njcn.device.pq.service.IPqDataVerifyBakService; import com.njcn.device.pq.service.IPqDataVerifyBakService;
import com.njcn.oss.utils.FileStorageUtil; import com.njcn.oss.utils.FileStorageUtil;
import com.njcn.supervision.api.UserLedgerFeignClient; import com.njcn.supervision.api.UserLedgerFeignClient;
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
import com.njcn.system.api.DictTreeFeignClient; import com.njcn.system.api.DictTreeFeignClient;
import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.pojo.po.SysDicTreePO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -65,19 +64,13 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
private static final String SEPARATOR = "-"; private static final String SEPARATOR = "-";
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN); private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
private final CommTerminalService commTerminalService; private final CommTerminalService commTerminalService;
private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient; private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient;
private final LineMapper lineMapper; private final LineMapper lineMapper;
private final DictTreeFeignClient dictTreeFeignClient; private final DictTreeFeignClient dictTreeFeignClient;
private final UserLedgerFeignClient userLedgerFeignClient; private final UserLedgerFeignClient userLedgerFeignClient;
private final FileStorageUtil fileStorageUtil; private final FileStorageUtil fileStorageUtil;
private final DeptLineService deptLineService;
@Override @Override
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) { public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
@@ -94,7 +87,6 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
} else { } else {
verifyMonitorVO.setRunNum(0); verifyMonitorVO.setRunNum(0);
verifyMonitorVO.setAbnormalNum(0); verifyMonitorVO.setAbnormalNum(0);
verifyMonitorVO.setMapList(getRangeAbnormalMonitor(monitorBaseParam, new ArrayList<>())); verifyMonitorVO.setMapList(getRangeAbnormalMonitor(monitorBaseParam, new ArrayList<>()));
verifyMonitorVO.setTargetList(getAbnormalTarget(new ArrayList<>())); verifyMonitorVO.setTargetList(getAbnormalTarget(new ArrayList<>()));
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(new ArrayList<>(), monitorBaseParam)); verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(new ArrayList<>(), monitorBaseParam));
@@ -111,7 +103,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
List<LocalDate> dateList = list.stream().map(PqDataVerifyBak::getTimeId).sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList()); List<LocalDate> dateList = list.stream().map(PqDataVerifyBak::getTimeId).sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
processTable(monitorBaseParam, dateList, result, key); processTable(monitorBaseParam, dateList, result, key);
}); });
dealTableResult(result); dealTableResult(result, monitorBaseParam.getSearchValue());
return result; return result;
} }
@@ -137,34 +129,44 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
} }
} }
private void dealTableResult(List<PowerQualityIndicatorsVO> result) { private void dealTableResult(List<PowerQualityIndicatorsVO> result, String searchValue) {
if (CollUtil.isNotEmpty(result)) { if (CollUtil.isNotEmpty(result)) {
List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData(); // List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity())); // Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList()); List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList());
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, null, null); List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, searchValue, null);
Map<String, AreaLineInfoVO> areaMap = areaLineInfoVOList.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity())); Map<String, PowerQualityIndicatorsVO> areaMap = result.stream().collect(Collectors.toMap(PowerQualityIndicatorsVO::getMonitorId, Function.identity()));
List<DeptLine> deptLines = deptLineService.selectDeptLine(ids);
List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList()); Map<String, String> deptName = deptLines.stream().collect(Collectors.toMap(DeptLine::getLineId, DeptLine::getId));
List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData(); // List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity())); // List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
result.forEach(it -> { // Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
if (areaMap.containsKey(it.getMonitorId())) { List<PowerQualityIndicatorsVO> info = new ArrayList<>();
AreaLineInfoVO areaLineInfoVO = areaMap.get(it.getMonitorId()); for (AreaLineInfoVO lineDetail : areaLineInfoVOList) {
it.setMonitorName(areaLineInfoVO.getLineName()); if (areaMap.containsKey(lineDetail.getLineId())) {
it.setStationName(areaLineInfoVO.getSubName()); PowerQualityIndicatorsVO it = areaMap.get(lineDetail.getLineId());
it.setDevName(areaLineInfoVO.getDeviceName()); it.setMonitorName(lineDetail.getLineName());
it.setVoltageLevel(areaLineInfoVO.getVoltageScale()); it.setStationName(lineDetail.getSubName());
it.setIp(Base64.encode(areaLineInfoVO.getIp())); it.setDevName(lineDetail.getDeviceName());
it.setManufacturer(areaLineInfoVO.getManufacturer()); if(deptName.containsKey(lineDetail.getLineId())){
if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) { it.setCity(deptName.get(lineDetail.getLineId()));
it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
} }
if (userMap.containsKey(areaLineInfoVO.getObjId())) { it.setVoltageLevel(lineDetail.getVoltageScale());
it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName()); it.setIp(Base64.encode(lineDetail.getIp()));
it.setManufacturer(lineDetail.getManufacturer());
it.setObjType(lineDetail.getLoadType());
it.setObjName(lineDetail.getObjName());
info.add(it);
// if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
// it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
// }
// if (userMap.containsKey(areaLineInfoVO.getObjId())) {
// it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
// }
} }
} }
}); result.clear();
result.addAll(info);
} }
} }
@@ -267,97 +269,29 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
} }
} }
List<PqDataVerifyBak> dataVerifyList = this.list(lambdaQueryWrapper); List<PqDataVerifyBak> dataVerifyList = this.list(lambdaQueryWrapper);
for (PqDataVerifyBak pqDataVerifyBak : dataVerifyList) { Map<String, List<PqDataVerifyBak>> VerifyMap = dataVerifyList.stream().collect(Collectors.groupingBy(PqDataVerifyBak::getLineId));
LineDetailDataVO lineDevGetDTO = lineDetailMap.get(pqDataVerifyBak.getLineId()); VerifyMap.forEach((key, value) -> {
LineDetailDataVO lineDevGetDTO = lineDetailMap.get(key);
String temBgName = ""; String temBgName = "";
if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG.getCode())) { if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG.getCode())) {
temBgName = lineDevGetDTO.getBdName(); temBgName = lineDevGetDTO.getBdName();
} else if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())) { } else if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())) {
temBgName = lineDevGetDTO.getObjName(); temBgName = lineDevGetDTO.getObjName();
} }
try (InputStream fileStream = fileStorageUtil.getFileStream(pqDataVerifyBak.getPath())) {
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
String[] errorTimeCount = {"0"};
Long[] errAllCount = {0L};
jsonArray.forEach(it -> {
JSONObject targetJson = (JSONObject) it;
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
if (targetJson.containsKey(monitorBaseParam.getTargetKey())) {
JSONArray innerJson = targetJson.getJSONArray(monitorBaseParam.getTargetKey());
PqReasonableRangeDto dto = rangeMap.get(monitorBaseParam.getTargetKey());
if (Objects.nonNull(dto.getHarmStart()) && Objects.nonNull(dto.getHarmEnd())) {
errorTimeCount[0] = targetJson.get("errorTimes").toString();
for (Object oJson : innerJson) {
JSONObject jsonObjectTem = (JSONObject) oJson;
JSONArray list = jsonObjectTem.getJSONArray("list");
list.forEach(listItem -> {
JSONObject object = (JSONObject) listItem;
long errCount = Long.parseLong(object.get("errorCounts").toString());
errAllCount[0] += errCount;
});
}
} else {
for (Object oJson : innerJson) {
JSONObject jsonObjectTem = (JSONObject) oJson;
JSONArray list = jsonObjectTem.getJSONArray("list");
list.forEach(listItem -> {
JSONObject object = (JSONObject) listItem;
long errCount = Long.parseLong(object.get("errorCounts").toString());
errAllCount[0] += errCount;
});
errorTimeCount[0] = jsonObjectTem.get("errorTimes").toString();
}
}
}
} else {
rangeMap.forEach((rangeKey, val) -> {
if (targetJson.containsKey(rangeKey)) {
JSONArray innerJson = targetJson.getJSONArray(rangeKey);
for (Object oJson : innerJson) {
JSONObject jsonObjectTem = (JSONObject) oJson;
JSONArray list = jsonObjectTem.getJSONArray("list");
list.forEach(listItem -> {
JSONObject object = (JSONObject) listItem;
long errCount = Long.parseLong(object.get("errorCounts").toString());
errAllCount[0] += errCount;
});
}
}
});
if (targetJson.containsKey("lineErrorTimes")) {
errorTimeCount[0] = targetJson.get("lineErrorTimes").toString();
}
}
});
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO(); DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
detailAbnormalVO.setTimeSum(errorTimeCount[0]); detailAbnormalVO.setDateList(value.stream().map(x -> x.getTimeId().format(DatePattern.NORM_DATE_FORMATTER)).collect(Collectors.toList()));
detailAbnormalVO.setDate(pqDataVerifyBak.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
detailAbnormalVO.setBdName(temBgName);
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
detailAbnormalVO.setErrCount(errAllCount[0].toString());
result.add(detailAbnormalVO);
} catch (BusinessException b) {
//文件为空时候的特殊处理
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
detailAbnormalVO.setTimeSum("/");
detailAbnormalVO.setDate(pqDataVerifyBak.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName()); detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
detailAbnormalVO.setBdName(temBgName); detailAbnormalVO.setBdName(temBgName);
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId()); detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey()); detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
result.add(detailAbnormalVO); result.add(detailAbnormalVO);
} catch (Exception e) { });
throw new BusinessException("数据异常");
}
}
return result; return result;
} }
@Override @Override
public List<DetailAbnormalVO.DetailAbnormalInnerVO> monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam) { public DetailAbnormalVO.DetailAbnormalCountVO monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam) {
Map<String, PqReasonableRangeDto> dtoMap = getStandRange(); Map<String, PqReasonableRangeDto> dtoMap = getStandRange();
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) { if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
if (!dtoMap.containsKey(monitorBaseParam.getTargetKey())) { if (!dtoMap.containsKey(monitorBaseParam.getTargetKey())) {
@@ -366,21 +300,23 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
} }
List<DetailAbnormalVO.DetailAbnormalInnerVO> result = new ArrayList<>(); List<DetailAbnormalVO.DetailAbnormalInnerVO> result = new ArrayList<>();
LambdaQueryWrapper<PqDataVerifyBak> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PqDataVerifyBak> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime()))) lambdaQueryWrapper.in(PqDataVerifyBak::getTimeId, monitorBaseParam.getTime())
.in(PqDataVerifyBak::getLineId, monitorBaseParam.getMonitorIds()).orderByAsc(PqDataVerifyBak::getTimeId); .in(PqDataVerifyBak::getLineId, monitorBaseParam.getMonitorIds());
PqDataVerifyBak pqDataVerifyBak = this.getOne(lambdaQueryWrapper); List<PqDataVerifyBak> pqDataVerifyBak = this.list(lambdaQueryWrapper);
try (InputStream fileStream = fileStorageUtil.getFileStream(pqDataVerifyBak.getPath())) { Integer[] errorTimeCount = {0};
Integer[] errAllCount = {0};
for (PqDataVerifyBak dataVerifyBak : pqDataVerifyBak) {
try (InputStream fileStream = fileStorageUtil.getFileStream(dataVerifyBak.getPath())) {
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig())); JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
for (Object it : jsonArray) { jsonArray.forEach(it->{
JSONObject targetJson = (JSONObject) it; JSONObject targetJson = (JSONObject) it;
if (targetJson.containsKey("lineErrorTimes")) { if (targetJson.containsKey("lineErrorTimes")) {
continue; errorTimeCount[0] += Integer.valueOf(targetJson.get("lineErrorTimes").toString());
} }else{
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) { if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
if (targetJson.containsKey(monitorBaseParam.getTargetKey())) { if (targetJson.containsKey(monitorBaseParam.getTargetKey())) {
resultDeal(dtoMap, monitorBaseParam.getTargetKey(), targetJson, result); resultDeal(dtoMap, monitorBaseParam.getTargetKey(), targetJson, result, dataVerifyBak.getTimeId().toString(), errAllCount);
break;
} }
} else { } else {
String tarKey = ""; String tarKey = "";
@@ -388,22 +324,26 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
String key = entry.getKey(); String key = entry.getKey();
if (targetJson.containsKey(key)) { if (targetJson.containsKey(key)) {
tarKey = key; tarKey = key;
break;
} }
} }
resultDeal(dtoMap, tarKey, targetJson, result); resultDeal(dtoMap, tarKey, targetJson, result, dataVerifyBak.getTimeId().toString(), errAllCount);
} }
} }
});
} catch (Exception e) { } catch (Exception e) {
throw new BusinessException("数据异常"); throw new BusinessException("数据异常" + e);
}
} }
// 排序实现 // 排序实现
result = result.stream() DetailAbnormalVO.DetailAbnormalCountVO info = new DetailAbnormalVO.DetailAbnormalCountVO();
.sorted(Comparator.comparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTime) info.setTimeSum(errorTimeCount[0]);
info.setErrCount(errAllCount[0]);
info.setTime(result.stream()
.sorted(Comparator.comparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTargetName)
.thenComparing(vo -> extractHarmonicOrder(vo.getTargetName())) .thenComparing(vo -> extractHarmonicOrder(vo.getTargetName()))
.thenComparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTargetName)) .thenComparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTime))
.collect(Collectors.toList()); .collect(Collectors.toList()));
return result; return info;
} }
@@ -431,12 +371,13 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
* 处理json对象中list数组 * 处理json对象中list数组
*/ */
private void resultDeal(Map<String, PqReasonableRangeDto> dtoMap, String targetKey, JSONObject targetJson, List<DetailAbnormalVO.DetailAbnormalInnerVO> result) { private void resultDeal(Map<String, PqReasonableRangeDto> dtoMap, String targetKey, JSONObject targetJson, List<DetailAbnormalVO.DetailAbnormalInnerVO> result, String date, Integer[] errorCounts) {
PqReasonableRangeDto pqReasonableRangeDto = dtoMap.get(targetKey); PqReasonableRangeDto pqReasonableRangeDto = dtoMap.get(targetKey);
JSONArray innerJson = targetJson.getJSONArray(targetKey); JSONArray innerJson = targetJson.getJSONArray(targetKey);
innerJson.forEach(oo -> { innerJson.forEach(oo -> {
JSONObject jsonObjectTem = (JSONObject) oo; JSONObject jsonObjectTem = (JSONObject) oo;
String targetName = jsonObjectTem.get("targetName").toString(); String targetName = jsonObjectTem.get("targetName").toString();
errorCounts[0] += Integer.valueOf(jsonObjectTem.get("errorCounts").toString());
JSONArray list = jsonObjectTem.getJSONArray("list"); JSONArray list = jsonObjectTem.getJSONArray("list");
List<DetailAbnormalVO.DetailLimitInnerVO> temList = new ArrayList<>(); List<DetailAbnormalVO.DetailLimitInnerVO> temList = new ArrayList<>();
list.forEach(listItem -> { list.forEach(listItem -> {
@@ -447,7 +388,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
String valueType = object.get("valueType").toString(); String valueType = object.get("valueType").toString();
for (int i = 0; i < timeArr.size(); i++) { for (int i = 0; i < timeArr.size(); i++) {
DetailAbnormalVO.DetailLimitInnerVO temData = new DetailAbnormalVO.DetailLimitInnerVO(); DetailAbnormalVO.DetailLimitInnerVO temData = new DetailAbnormalVO.DetailLimitInnerVO();
temData.setTime(timeArr.get(i).toString()); temData.setTime(date + " " + timeArr.get(i).toString());
temData.setVal(valueArr.get(i).toString()); temData.setVal(valueArr.get(i).toString());
temData.setTargetName(targetName); temData.setTargetName(targetName);
temData.setTargetKey(targetKey); temData.setTargetKey(targetKey);
@@ -475,11 +416,11 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
vo.setTargetKey(targetKey); vo.setTargetKey(targetKey);
vo.setPhaseType(phaseKey); vo.setPhaseType(phaseKey);
if ((DataCleanEnum.DataI.getCode() + SEPARATOR + DataCleanEnum.RmsI.getCode() ).equals(targetKey)) { // if ((DataCleanEnum.DataI.getCode() + SEPARATOR + DataCleanEnum.RmsI.getCode() ).equals(targetKey)) {
vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + "*CT1" + unit); // vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + "*CT1" + unit);
} else { // } else {
vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + unit); vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + unit);
} // }
valueList.forEach(ites -> { valueList.forEach(ites -> {
switch (ites.getType()) { switch (ites.getType()) {
case "AVG": case "AVG":
@@ -686,12 +627,11 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
if (StrUtil.isNotBlank(dto.getUnit())) { if (StrUtil.isNotBlank(dto.getUnit())) {
unit = dto.getUnit(); unit = dto.getUnit();
} }
if (temStr.equals(Param.rms_i)) { // if (temStr.equals(Param.rms_i)) {
verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + "*CT1" + unit); // verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + "*CT1" + unit);
} else { // } else {
verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + unit); verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + unit);
} // }
result.add(verifyTargetVO); result.add(verifyTargetVO);
} }

View File

@@ -579,4 +579,13 @@ public interface LineMapper extends BaseMapper<Line> {
* 根据Pid获取所有子节点 * 根据Pid获取所有子节点
*/ */
List<String> getSubIdByPid(@Param("pid") String pid); List<String> getSubIdByPid(@Param("pid") String pid);
/**
* 根据监测点id获取终端id
*
* @param ids 监测点集合
* @return 结果
*/
List<String> getDevIdsLine(@Param("ids") List<String> ids);
} }

View File

@@ -1542,7 +1542,7 @@
<select id="selectByIds" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$Detail"> <select id="selectByIds" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$Detail">
SELECT DISTINCT SELECT DISTINCT
line.id as lineId, line.id as lineId,
dept.`Name` deptName, dept.Name deptName,
area.name as areaId, area.name as areaId,
gd.NAME gdName, gd.NAME gdName,
substation.NAME subName, substation.NAME subName,
@@ -1935,5 +1935,19 @@
AND t2.Monitor_Flag = 0 AND t2.Monitor_Flag = 0
</if> </if>
</select> </select>
<select id="getDevIdsLine" resultType="java.lang.String">
SELECT
DISTINCT d.id
FROM
pq_line a
INNER JOIN pq_line v ON a.pid = v.id
INNER JOIN pq_line d ON v.pid = d.id
where
a.id in
<foreach collection="ids" separator="," open="(" close=")" item="item">
#{item}
</foreach>
</select>
</mapper> </mapper>

View File

@@ -44,6 +44,13 @@ public interface DeptLineService extends IService<DeptLine> {
List<DeptLine> selectDeptBindLines(List<String> ids); List<DeptLine> selectDeptBindLines(List<String> ids);
/**
* 根据监测点id获取部门信息
* @param ids
* @return
*/
List<DeptLine> selectDeptLine(List<String> ids);
/** /**
* 根据部门ids集合查询所有监测点id * 根据部门ids集合查询所有监测点id
* @param ids 部门ids * @param ids 部门ids

View File

@@ -27,6 +27,7 @@ import com.njcn.system.pojo.vo.DictTreeVO;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.dto.DeptDTO; import com.njcn.user.pojo.dto.DeptDTO;
import com.njcn.user.pojo.po.Dept; import com.njcn.user.pojo.po.Dept;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.web.pojo.param.DeptLineParam; import com.njcn.web.pojo.param.DeptLineParam;
import com.njcn.web.utils.WebUtil; import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -34,10 +35,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -111,6 +109,22 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
return this.lambdaQuery().in(DeptLine::getId, ids).list(); return this.lambdaQuery().in(DeptLine::getId, ids).list();
} }
@Override
public List<DeptLine> selectDeptLine(List<String> ids) {
List<DeptLine> list = this.lambdaQuery().in(DeptLine::getLineId, ids).list();
if (CollUtil.isNotEmpty(list)) {
List<Dept> data = deptFeignClient.getAllDept().getData();
Map<String, String> deptName = data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
for (DeptLine deptLine : list) {
if (deptName.containsKey(deptLine.getId())) {
deptLine.setId(deptName.get(deptLine.getId()));
}
}
return list;
}
return new ArrayList<>();
}
@Override @Override
public List<String> getLineByDeptIds(List<String> ids,String manufacturer, List<Integer> runFlag, List<Integer> dataType, String objType) { public List<String> getLineByDeptIds(List<String> ids,String manufacturer, List<Integer> runFlag, List<Integer> dataType, String objType) {
return this.baseMapper.getLineIdByDeptIds(ids, manufacturer ,runFlag, dataType, objType); return this.baseMapper.getLineIdByDeptIds(ids, manufacturer ,runFlag, dataType, objType);

View File

@@ -112,12 +112,12 @@
<select id="getNoData" resultType="OnlineMonitorVo"> <select id="getNoData" resultType="OnlineMonitorVo">
SELECT DISTINCT SELECT DISTINCT
t6.`Name` gdName, t6.Name gdName,
t5.`Name` subName, t5.Name subName,
t4.`Name` deviceName, t4.Name deviceName,
t1.line_index lineId, t1.line_index lineId,
t2.`Name` lineName, t2.Name lineName,
t8.`Name` monitorObjType, t8.Name monitorObjType,
t7.Obj_Name monitorObj, t7.Obj_Name monitorObj,
"完整性为0" as target, "完整性为0" as target,
count(t1.time_id) lastDay count(t1.time_id) lastDay

View File

@@ -92,7 +92,7 @@ public class PqDevice implements Serializable {
*/ */
private Date nextTimeCheck; private Date nextTimeCheck;
/** /**
* 电功能 0关闭 1开启 默认关闭 * 电功能 0关闭 1开启 默认关闭
*/ */
private Integer electroplate; private Integer electroplate;
/** /**

View File

@@ -259,12 +259,10 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
private List<AreaAnalysisVO.Children> assReasonPQ(Map<String, List<String>> stringListMap, List<RmpEventDetailPO> info, String typeId){ private List<AreaAnalysisVO.Children> assReasonPQ(Map<String, List<String>> stringListMap, List<RmpEventDetailPO> info, String typeId){
List<AreaAnalysisVO.Children> reasonList = new ArrayList<>(); List<AreaAnalysisVO.Children> reasonList = new ArrayList<>();
List<RmpEventDetailPO> reasons = info.stream().filter(x -> typeId.equals(x.getAdvanceReason())).collect(Collectors.toList());
Integer allCount = 0; Integer allCount = 0;
for (Map.Entry<String, List<String>> stringListEntry : stringListMap.entrySet()) { for (Map.Entry<String, List<String>> stringListEntry : stringListMap.entrySet()) {
List<String> value = stringListEntry.getValue(); List<String> value = stringListEntry.getValue();
Integer count = reasons.stream().filter(x -> value.contains(x.getAdvanceType())).mapToInt(RmpEventDetailPO::getCount).sum(); Integer count = info.stream().filter(x -> value.contains(x.getAdvanceType())).mapToInt(RmpEventDetailPO::getCount).sum();
AreaAnalysisVO.Children allType = new AreaAnalysisVO.Children(); AreaAnalysisVO.Children allType = new AreaAnalysisVO.Children();
allType.setName(stringListEntry.getKey()); allType.setName(stringListEntry.getKey());
allType.setValue(count); allType.setValue(count);

View File

@@ -22,10 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -67,7 +64,7 @@ public class AreaInfoServiceImpl implements AreaInfoService {
if (CollectionUtil.isNotEmpty(lineIds)) { if (CollectionUtil.isNotEmpty(lineIds)) {
List<AreaLineInfoVO> resList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData(); List<AreaLineInfoVO> resList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
if (1 == deviceInfoParam.getIsPollution()) { if (Objects.equals(1,deviceInfoParam.getIsPollution())) {
OnlineRateParam.Info param = new OnlineRateParam.Info(); OnlineRateParam.Info param = new OnlineRateParam.Info();
param.setIds(resList.stream().map(AreaLineInfoVO::getLineId).distinct().collect(Collectors.toList())); param.setIds(resList.stream().map(AreaLineInfoVO::getLineId).distinct().collect(Collectors.toList()));
param.setDicData(deviceInfoParam.getDicData()); param.setDicData(deviceInfoParam.getDicData());
@@ -151,6 +148,8 @@ public class AreaInfoServiceImpl implements AreaInfoService {
eventDetailNew = BeanUtil.copyProperties(eventDetail, EventDetailNew.class); eventDetailNew = BeanUtil.copyProperties(eventDetail, EventDetailNew.class);
//监测点id //监测点id
eventDetailNew.setLineId(eventDetail.getMeasurementPointId()); eventDetailNew.setLineId(eventDetail.getMeasurementPointId());
//需要转成百分比*100
eventDetailNew.setFeatureAmplitude(eventDetail.getFeatureAmplitude()*100);
//持续时间 //持续时间
eventDetailNew.setDuration(eventDetail.getDuration()); eventDetailNew.setDuration(eventDetail.getDuration());
//特征幅值 //特征幅值

View File

@@ -490,7 +490,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
public Page<AdvanceEventDetailVO> getEventByLineIdsCount(EventBaseParam.Info param) { public Page<AdvanceEventDetailVO> getEventByLineIdsCount(EventBaseParam.Info param) {
Page<AdvanceEventDetailVO> pageResult = new Page<>(); Page<AdvanceEventDetailVO> pageResult = new Page<>();
param.setLineOrDevice(0); param.setLineOrDevice(0);
param.setDeptIndex("0d52f9f6e43ec0ee83013cd32da93f66"); param.setDeptIndex(param.getDeptIndex());
param.setStatisticalType(new SimpleDTO()); param.setStatisticalType(new SimpleDTO());
//获取终端台账类信息 //获取终端台账类信息
List<GeneralDeviceDTO> deviceInfo = generalDeviceInfoClient.getPracticalRunDeviceInfo(param).getData(); List<GeneralDeviceDTO> deviceInfo = generalDeviceInfoClient.getPracticalRunDeviceInfo(param).getData();
@@ -500,6 +500,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
.eq(StrUtil.isNotBlank(param.getDicData()), RmpEventDetailPO::getEventType, param.getDicData()) .eq(StrUtil.isNotBlank(param.getDicData()), RmpEventDetailPO::getEventType, param.getDicData())
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime()))) .ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())))
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime()))) .le(StrUtil.isNotBlank(param.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())))
.orderByDesc(RmpEventDetailPO::getStartTime)
); );
List<String> tempLineIds = poPage.getRecords().stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList()); List<String> tempLineIds = poPage.getRecords().stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList());
if(CollUtil.isNotEmpty(tempLineIds)){ if(CollUtil.isNotEmpty(tempLineIds)){

View File

@@ -204,13 +204,41 @@ public class TransientServiceImpl implements TransientService {
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) { if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG; cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT; datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
log.info("本地磁盘波形文件路径----" + cfgPath);
//适配文件后缀小写
cfgPath2 = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG.toLowerCase();
datPath2 = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT.toLowerCase();
log.info("本地磁盘波形文件路径----" + cfgPath2);
log.info("本地磁盘波形文件路径----" + datPath2);
try (
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath); InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath); InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
)
{
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
}
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
} catch (Exception e) {
log.info("大写文件流为空");
try {
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath2);
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath2);
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) { if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND); throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
} }
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1); waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
} catch (Exception e1) {
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
}
}
} else { } else {
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG; cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT; datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT;
@@ -495,22 +523,23 @@ public class TransientServiceImpl implements TransientService {
try { try {
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) { if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG; cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
log.info("cfg-----"+cfgPath);
log.info("cfg-----"+datPath);
//判断文件是否存在 //判断文件是否存在
boolean result1 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), cfgPath); File file = new File(cfgPath);
if (!result1) { if(!file.exists()){
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG_LOWER; cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG_LOWER;
cfg = GeneralConstant.CFG_LOWER;
} }
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT; datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
boolean result2 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), datPath); File file2 = new File(datPath);
if (!result2) { if(!file2.exists()){
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT_LOWER; datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT_LOWER;
dat = GeneralConstant.DAT_LOWER;
} }
log.info("cfg-----"+cfgPath);
log.info("cfg-----"+datPath);
cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath); cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
} else { } else {
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG; cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
boolean result1 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), cfgPath); boolean result1 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), cfgPath);

View File

@@ -54,11 +54,11 @@ public class QualifiedReportController extends BaseController {
@ApiImplicitParam(name = "qualifiedReportParam", value = "合格率报告参数", required = true) @ApiImplicitParam(name = "qualifiedReportParam", value = "合格率报告参数", required = true)
public HttpResult<Page<FpyReportDTO>> pageTable(@RequestBody @Validated QualifiedReportParam qualifiedReportParam) { public HttpResult<Page<FpyReportDTO>> pageTable(@RequestBody @Validated QualifiedReportParam qualifiedReportParam) {
TimeInterval timeInterval = new TimeInterval(); TimeInterval timeInterval = new TimeInterval();
String searchValue = qualifiedReportParam.getSearchValue(); // String searchValue = qualifiedReportParam.getSearchValue();
Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX); // Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
if(pattern.matcher(searchValue).find()){ // if(pattern.matcher(searchValue).find()){
throw new BusinessException(ValidMessage.SPECIAL_REGEX); // throw new BusinessException(ValidMessage.SPECIAL_REGEX);
} // }
String methodDescribe = getMethodDescribe("pageTable"); String methodDescribe = getMethodDescribe("pageTable");
Page<FpyReportDTO> result = qualifiedReportService.pageTable(qualifiedReportParam); Page<FpyReportDTO> result = qualifiedReportService.pageTable(qualifiedReportParam);
log.info("合格率报告执行时长:"+timeInterval.interval()); log.info("合格率报告执行时长:"+timeInterval.interval());

View File

@@ -7,10 +7,10 @@
p1.id id, p1.id id,
p2.Org_Name dept, p2.Org_Name dept,
p2.Powerr_Name substation, p2.Powerr_Name substation,
p3.`Name` deviceName, p3.Name deviceName,
p2.`Name` lineName, p2.Name lineName,
p1.line_id lineId, p1.line_id lineId,
p4.`Name` businessType, p4.Name businessType,
p2.Monitor_Object_Name objectName, p2.Monitor_Object_Name objectName,
p1.target_type targetType, p1.target_type targetType,
p1.over_limit_day overLimitDay, p1.over_limit_day overLimitDay,

View File

@@ -19,7 +19,7 @@
line_index id, line_index id,
LEAST(ROUND(SUM(real_time) / SUM(due_time), 2) * 100,100) integrityData LEAST(ROUND(SUM(real_time) / SUM(due_time), 2) * 100,100) integrityData
FROM FROM
`r_stat_integrity_d` r_stat_integrity_d
WHERE time_id between #{startTime} and #{endTime} WHERE time_id between #{startTime} and #{endTime}
GROUP BY line_index GROUP BY line_index
</select> </select>
@@ -35,7 +35,7 @@
100 100
) integrityData ) integrityData
FROM FROM
`r_stat_onlinerate_d` r_stat_onlinerate_d
WHERE time_id between #{startTime} and #{endTime} WHERE time_id between #{startTime} and #{endTime}
GROUP BY dev_index GROUP BY dev_index
</select> </select>

View File

@@ -54,7 +54,7 @@ public class SensitiveReportExcel implements Serializable {
// private String orgId; // private String orgId;
@Excel(name = "工程预期投产日期(yyyy-MM-dd)", width = 30) @Excel(name = "*工程预期投产日期(yyyy-MM-dd)", width = 30)
private String expectedProductionDate; private String expectedProductionDate;
@Excel(name = "电压等级", width = 30) @Excel(name = "电压等级", width = 30)

View File

@@ -57,7 +57,7 @@ public class SensitiveUserSExcel implements Serializable {
// private String orgId; // private String orgId;
@Excel(name = "工程预期投产日期(yyyy-MM-dd)", width = 30) @Excel(name = "*工程预期投产日期(yyyy-MM-dd)", width = 30)
@NotBlank(message = "工程预期投产日期不能为空") @NotBlank(message = "工程预期投产日期不能为空")
private String expectedProductionDate; private String expectedProductionDate;

View File

@@ -209,14 +209,14 @@ public class SupervisionDevMainReportExcel {
private String timeSyncFunction = "0"; private String timeSyncFunction = "0";
/** /**
* 电功能 * 电功能
*/ */
@Excel(name = "电度功能", width = 30, replace = {"关闭_0", "开启_1"}) @Excel(name = "电度功能", width = 30, replace = {"关闭_0", "开启_1"})
private String electroplatingFunction = "0"; private String electroplatingFunction = "0";
/** /**
* 召标志 * 召标志
*/ */
@Excel(name = "召唤标志", width = 30, replace = {"周期触发_0", "变位触发_1"}) @Excel(name = "召唤标志", width = 30, replace = {"周期触发_0", "变位触发_1"})
private String summonFlag = "0"; private String summonFlag = "0";

View File

@@ -206,9 +206,9 @@ public class SupervisionTempDeviceReportParam {
private Integer timeSyncFunction; private Integer timeSyncFunction;
/** /**
* 电功能 * 电功能
*/ */
@ApiModelProperty(value="功能") @ApiModelProperty(value="功能")
private Integer electroplatingFunction; private Integer electroplatingFunction;
/** /**
@@ -218,9 +218,9 @@ public class SupervisionTempDeviceReportParam {
private String monitoringDeviceInstallationPosition; private String monitoringDeviceInstallationPosition;
/** /**
* 召标志 * 召标志
*/ */
@ApiModelProperty(value="标志") @ApiModelProperty(value="标志")
private String summonFlag; private String summonFlag;
/** /**

View File

@@ -204,7 +204,7 @@ public class SupervisionTempDeviceReport {
private Integer timeSyncFunction; private Integer timeSyncFunction;
/** /**
* 电功能 * 电功能
*/ */
@TableField(value = "electroplating_function") @TableField(value = "electroplating_function")
private Integer electroplatingFunction; private Integer electroplatingFunction;
@@ -216,7 +216,7 @@ public class SupervisionTempDeviceReport {
private String monitoringDeviceInstallationPosition; private String monitoringDeviceInstallationPosition;
/** /**
* 召标志 * 召标志
*/ */
@TableField(value = "summon_flag") @TableField(value = "summon_flag")
private String summonFlag; private String summonFlag;

View File

@@ -82,4 +82,7 @@ public class OnlineVo implements Serializable {
@ApiModelProperty("最新数据时间") @ApiModelProperty("最新数据时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private LocalDateTime updateTime; private LocalDateTime updateTime;
@ApiModelProperty("数据类型 0:无数据 1:超标告警 2:异常数据")
private Integer dataType;
} }

View File

@@ -292,7 +292,11 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
} }
} }
queryWrapper.orderBy(true, true, "D.Name", "p4.Name", "p3.Name"); queryWrapper.orderBy(true, true, "D.Name", "p4.Name", "p3.Name");
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper); Page<OnlineVo> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
page.getRecords().forEach(item -> {
item.setDataType(param.getDataType());
});
return page;
} }
@Override @Override
@@ -344,6 +348,8 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
} }
}); });
dataMap.put("${noData}", CollUtil.isEmpty(dataList1) ? "0" : String.valueOf(dataList1.size())); dataMap.put("${noData}", CollUtil.isEmpty(dataList1) ? "0" : String.valueOf(dataList1.size()));
} else {
dataMap.put("${noData}", "0");
} }
if (CollUtil.isNotEmpty(list2)) { if (CollUtil.isNotEmpty(list2)) {
list2.forEach(item -> { list2.forEach(item -> {

View File

@@ -56,6 +56,7 @@ import com.njcn.web.factory.PageFactory;
import com.njcn.web.utils.RequestUtil; import com.njcn.web.utils.RequestUtil;
import com.njcn.web.utils.WebUtil; import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@@ -65,6 +66,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -78,6 +80,7 @@ import java.util.stream.Stream;
*/ */
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j
public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<SupervisionDevMainReportPOMapper, SupervisionDevMainReportPO> implements SupervisionDevMainReportPOService { public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<SupervisionDevMainReportPOMapper, SupervisionDevMainReportPO> implements SupervisionDevMainReportPOService {
@@ -502,6 +505,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
@Override @Override
public void importDevData(MultipartFile file, HttpServletResponse response) { public void importDevData(MultipartFile file, HttpServletResponse response) {
log.info("beginImport-------------------"+ LocalDateTime.now());
ImportParams params = new ImportParams(); ImportParams params = new ImportParams();
//表头 //表头
params.setHeadRows(1); params.setHeadRows(1);
@@ -528,8 +532,11 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_ERROR); throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_ERROR);
} }
List<SupervisionDevMainReportExcel.ExcelMsg> devMsgList = new ArrayList<>(); List<SupervisionDevMainReportExcel.ExcelMsg> devMsgList = new ArrayList<>();
log.info("beginqueryjiBeiArea-------------------"+ LocalDateTime.now());
//所属地市 //所属地市
List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData(); List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData();
log.info("beginquerydeptS-------------------"+ LocalDateTime.now());
//所属供电公司 //所属供电公司
List<DeptDTO> deptS = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData(); List<DeptDTO> deptS = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
@@ -542,6 +549,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
//获取所有前置机 //获取所有前置机
List<Node> nodes = nodeClient.nodeAllList().getData(); List<Node> nodes = nodeClient.nodeAllList().getData();
Map<String, String> nodeMap = nodes.stream().collect(Collectors.toMap(Node::getName, Node::getId, (k1, k2) -> k1)); Map<String, String> nodeMap = nodes.stream().collect(Collectors.toMap(Node::getName, Node::getId, (k1, k2) -> k1));
log.info("beginquerydevConnect-------------------"+ LocalDateTime.now());
//接线方式 //接线方式
List<DictData> devConnect = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData(); List<DictData> devConnect = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
@@ -552,10 +560,14 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
List<DictData> voltageTransformer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData(); List<DictData> voltageTransformer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
//中性点接线方式 //中性点接线方式
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData(); List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
log.info("beginqueryneutralPoint-------------------"+ LocalDateTime.now());
SubstationParam substationParam=new SubstationParam(); SubstationParam substationParam=new SubstationParam();
substationParam.setOrgIds(deptS.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList())); substationParam.setOrgIds(deptS.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList()));
log.info("beginquerySubGetBase-------------------"+ LocalDateTime.now());
List<SubGetBase> data = commterminalGeneralClient.tagOrIdGetSub(substationParam).getData(); List<SubGetBase> data = commterminalGeneralClient.tagOrIdGetSub(substationParam).getData();
log.info("endquerySubGetBase-------------------"+ LocalDateTime.now());
SupervisionDevMainReportPO po; SupervisionDevMainReportPO po;
if (CollectionUtil.isNotEmpty(devExcels)) { if (CollectionUtil.isNotEmpty(devExcels)) {

View File

@@ -793,8 +793,9 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
params.setHeadRows(1); params.setHeadRows(1);
//标题 //标题
params.setTitleRows(1); params.setTitleRows(1);
params.setNeedVerify(true); params.setNeedVerify(false);
params.setStartSheetIndex(0); params.setStartSheetIndex(0);
params.setReadRows(100); // 最多读取100行数据
params.setSheetNum(1); params.setSheetNum(1);
List<SensitiveUserSExcel> sensitiveUserExcels; List<SensitiveUserSExcel> sensitiveUserExcels;
try { try {
@@ -1018,6 +1019,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
params.setTitleRows(1); params.setTitleRows(1);
params.setNeedVerify(false); // 关闭校验,避免校验导致的性能问题 params.setNeedVerify(false); // 关闭校验,避免校验导致的性能问题
params.setStartSheetIndex(0); params.setStartSheetIndex(0);
params.setReadRows(100); // 最多读取100行数据
params.setSheetNum(1); params.setSheetNum(1);
// 限制最大读取行数防止Excel模板带下拉列表导致读取大量空行 // 限制最大读取行数防止Excel模板带下拉列表导致读取大量空行
// 如果实际数据超过此限制,需要分批导入或调整此参数 // 如果实际数据超过此限制,需要分批导入或调整此参数
@@ -1055,7 +1057,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
//评估类型 //评估类型
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData(); List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData();
//解决填报部门问题 //解决填报部门问题
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getUserIndex(), WebUtil.filterDeptType()).getData(); List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
//执行批量导入敏感及重要用户,入库过程中会进行数据校验 //执行批量导入敏感及重要用户,入库过程中会进行数据校验
List<SensitiveReportExcel.SensitiveReportExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>(); List<SensitiveReportExcel.SensitiveReportExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();

View File

@@ -18,7 +18,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
Id, page_name, thumbnail, remark, container_config, sort, `state`, Create_By, Create_Time, Id, page_name, thumbnail, remark, container_config, sort, "state", Create_By, Create_Time,
Update_By, Update_Time Update_By, Update_Time
</sql> </sql>

View File

@@ -40,7 +40,8 @@ public class PqDashboardPageServiceImpl extends ServiceImpl<PqDashboardPageMappe
// checkName(pqDashboardPageParam,false); // checkName(pqDashboardPageParam,false);
BeanUtils.copyProperties(pqDashboardPageParam,pqDashboardPage); BeanUtils.copyProperties(pqDashboardPageParam,pqDashboardPage);
pqDashboardPage.setState(0); //根据前端传递状态赋值
//pqDashboardPage.setState(0);
pqDashboardPage.setUserId(RequestUtil.getUserIndex()); pqDashboardPage.setUserId(RequestUtil.getUserIndex());
this.save(pqDashboardPage); this.save(pqDashboardPage);
return true; return true;

View File

@@ -98,11 +98,11 @@ public class PqFrontLogsServiceImpl extends ServiceImpl<PqFrontLogsMapper, PqFro
@Override @Override
public Page<PqFrontLogsVO> queryPage(PqFrontLogsParam baseParam) { public Page<PqFrontLogsVO> queryPage(PqFrontLogsParam baseParam) {
QueryWrapper<PqFrontLogs> queryWrapper = new QueryWrapper<>(); QueryWrapper<PqFrontLogs> queryWrapper = new QueryWrapper<>();
if (Objects.nonNull(baseParam.getSearchBeginTime()) && Objects.nonNull(baseParam.getSearchEndTime())) { if (StringUtils.isNotBlank(baseParam.getSearchBeginTime()) && StringUtils.isNotBlank(baseParam.getSearchEndTime())) {
queryWrapper.between("A.update_Time", baseParam.getSearchBeginTime()+" 00:00:00", baseParam.getSearchEndTime()+" 23:59:59"); queryWrapper.between("A.update_Time", baseParam.getSearchBeginTime()+" 00:00:00", baseParam.getSearchEndTime()+" 23:59:59");
} }
if(Objects.nonNull(baseParam.getSearchValue())){ if(StringUtils.isNotBlank(baseParam.getSearchValue())){
queryWrapper.like("line.name", baseParam.getSearchValue()); queryWrapper.like("line.name", baseParam.getSearchValue());
} }
queryWrapper.eq(StringUtils.isNotBlank(baseParam.getCode()),"A.code",baseParam.getCode()); queryWrapper.eq(StringUtils.isNotBlank(baseParam.getCode()),"A.code",baseParam.getCode());

View File

@@ -26,10 +26,7 @@ import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -110,13 +107,15 @@ public class ComponentServiceImpl extends ServiceImpl<ComponentMapper, Component
ComponentVO componentVO = new ComponentVO(); ComponentVO componentVO = new ComponentVO();
componentVO.setId(dictData.getId()); componentVO.setId(dictData.getId());
componentVO.setName(dictData.getName()); componentVO.setName(dictData.getName());
componentVO.setSort(dictData.getSort());
componentVO.setChildren( componentVO.setChildren(
v.stream() v.stream()
.filter(fun -> Objects.equals(ComponentState.FATHER_PID, fun.getPid())) .filter(fun -> Objects.equals(ComponentState.FATHER_PID, fun.getPid()))
.peek(funS -> funS.setChildren(getChildCategoryList(funS, v))) .peek(funS -> funS.setChildren(getChildCategoryList(funS, v))).sorted(Comparator.comparing(ComponentVO::getSort))
.collect(Collectors.toList())); .collect(Collectors.toList()));
result.add(componentVO); result.add(componentVO);
}); });
result.sort(Comparator.comparing(ComponentVO::getSort));
} }
return result; return result;
} }
@@ -182,7 +181,7 @@ public class ComponentServiceImpl extends ServiceImpl<ComponentMapper, Component
*/ */
private List<ComponentVO> getChildCategoryList(ComponentVO currMenu, List<ComponentVO> categories) { private List<ComponentVO> getChildCategoryList(ComponentVO currMenu, List<ComponentVO> categories) {
return categories.stream().filter(o -> Objects.equals(o.getPid(), currMenu.getId())) return categories.stream().filter(o -> Objects.equals(o.getPid(), currMenu.getId()))
.peek(o -> o.setChildren(getChildCategoryList(o, categories))) .peek(o -> o.setChildren(getChildCategoryList(o, categories))).sorted(Comparator.comparing(ComponentVO::getSort))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }

View File

@@ -495,10 +495,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
List<User> users1 = this.listByIds(collect); List<User> users1 = this.listByIds(collect);
if (CollectionUtil.isNotEmpty(users1)) { if (CollectionUtil.isNotEmpty(users1)) {
users1.forEach(item->{ users1.forEach(item->{
if (item.getState() == 1) {
UserVO userVO = new UserVO(); UserVO userVO = new UserVO();
userVO.setId(item.getId()); userVO.setId(item.getId());
userVO.setName(item.getName()); userVO.setName(item.getName());
users.add(userVO); users.add(userVO);
}
}); });
} }
return users; return users;