Compare commits
7 Commits
e982fa960e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1eb4515da | ||
| c02acfca4f | |||
|
|
221007b367 | ||
| 7f6172d0ad | |||
| 5d4e461ef0 | |||
|
|
0c8b17d336 | ||
|
|
88e0d71718 |
@@ -1,10 +1,18 @@
|
|||||||
package com.njcn.dataProcess.api;
|
package com.njcn.algorithm.pojo.api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2026/05/21 下午 2:41【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.njcn.algorithm.pojo.api.fallback.PqReasonableRangeFeignClientFallbackFactory;
|
||||||
|
import com.njcn.algorithm.pojo.dto.PqReasonableRangeDto;
|
||||||
|
import com.njcn.algorithm.pojo.param.DataCleanParam;
|
||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.dataProcess.api.fallback.PqReasonableRangeFeignClientFallbackFactory;
|
|
||||||
import com.njcn.dataProcess.param.DataCleanParam;
|
|
||||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -17,7 +25,7 @@ import java.util.List;
|
|||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @date 2025年02月13日 20:11
|
* @date 2025年02月13日 20:11
|
||||||
*/
|
*/
|
||||||
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/pqReasonableRange", fallbackFactory = PqReasonableRangeFeignClientFallbackFactory.class, contextId = "pqReasonableRange")
|
@FeignClient(value = ServerInfo.ALGORITHM_BOOT, path = "/pqReasonableRange", fallbackFactory = PqReasonableRangeFeignClientFallbackFactory.class, contextId = "pqReasonableRange")
|
||||||
public interface PqReasonableRangeFeignClient {
|
public interface PqReasonableRangeFeignClient {
|
||||||
|
|
||||||
@PostMapping("/getData")
|
@PostMapping("/getData")
|
||||||
@@ -25,3 +33,4 @@ public interface PqReasonableRangeFeignClient {
|
|||||||
HttpResult<List<PqReasonableRangeDto>> getData(@RequestBody DataCleanParam param);
|
HttpResult<List<PqReasonableRangeDto>> getData(@RequestBody DataCleanParam param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.njcn.dataProcess.api.fallback;
|
package com.njcn.algorithm.pojo.api.fallback;
|
||||||
|
|
||||||
|
import com.njcn.algorithm.pojo.api.PqReasonableRangeFeignClient;
|
||||||
|
import com.njcn.algorithm.pojo.dto.PqReasonableRangeDto;
|
||||||
|
import com.njcn.algorithm.pojo.param.DataCleanParam;
|
||||||
|
import com.njcn.algorithm.pojo.util.PrepareEnumUtil;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.dataProcess.api.PqReasonableRangeFeignClient;
|
|
||||||
import com.njcn.dataProcess.param.DataCleanParam;
|
|
||||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
|
||||||
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
|
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -14,9 +14,11 @@ import org.springframework.stereotype.Component;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xy
|
* Description:
|
||||||
* @version 1.0.0
|
* Date: 2026/05/21 下午 2:42【需求编号】
|
||||||
* @date 2025年02月13日 20:13
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
@@ -32,7 +34,7 @@ public class PqReasonableRangeFeignClientFallbackFactory implements FallbackFact
|
|||||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
if(cause.getCause() instanceof BusinessException){
|
if(cause.getCause() instanceof BusinessException){
|
||||||
BusinessException businessException = (BusinessException) cause.getCause();
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
exceptionEnum = DataProcessingEnumUtil.getExceptionEnum(businessException.getResult());
|
exceptionEnum = PrepareEnumUtil.getExceptionEnum(businessException.getResult());
|
||||||
}
|
}
|
||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new PqReasonableRangeFeignClient() {
|
return new PqReasonableRangeFeignClient() {
|
||||||
@@ -45,3 +47,4 @@ public class PqReasonableRangeFeignClientFallbackFactory implements FallbackFact
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.dataProcess.pojo.dto;
|
package com.njcn.algorithm.pojo.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.dataProcess.param;
|
package com.njcn.algorithm.pojo.param;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.dataProcess.pojo.po;
|
package com.njcn.algorithm.pojo.po;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package com.njcn.algorithm.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.algorithm.pojo.dto.PqReasonableRangeDto;
|
||||||
|
import com.njcn.algorithm.pojo.param.DataCleanParam;
|
||||||
|
import com.njcn.algorithm.service.line.IPqReasonableRangeService;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.enums.DeviceOperate;
|
||||||
|
import com.njcn.web.advice.DeviceLog;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2025-02-13
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@Slf4j
|
||||||
|
@Controller
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pqReasonableRange")
|
||||||
|
@Api(tags = "数据清洗标准库")
|
||||||
|
public class PqReasonableRangeController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IPqReasonableRangeService pqReasonableRangeService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||||
|
@PostMapping("/getData")
|
||||||
|
@ApiOperation("按条件获取数据合理范围")
|
||||||
|
public HttpResult<List<PqReasonableRangeDto>> getData(@RequestBody DataCleanParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("getData");
|
||||||
|
List<PqReasonableRangeDto> list = pqReasonableRangeService.getReasonableRangeList(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperation("新增数据合理范围")
|
||||||
|
public HttpResult<String> save(@RequestBody @Validated PqReasonableRangeDto dto) {
|
||||||
|
String methodDescribe = getMethodDescribe("save");
|
||||||
|
boolean result = pqReasonableRangeService.savePqReasonableRange(dto);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "新增成功", methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "新增失败", methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperation("更新数据合理范围")
|
||||||
|
public HttpResult<String> update(@RequestBody @Validated PqReasonableRangeDto dto) {
|
||||||
|
String methodDescribe = getMethodDescribe("update");
|
||||||
|
boolean result = pqReasonableRangeService.updatePqReasonableRange(dto);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "更新成功", methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "更新失败", methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@ApiOperation("删除数据合理范围")
|
||||||
|
@DeviceLog(operateType = DeviceOperate.DELETE)
|
||||||
|
public HttpResult<String> delete(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
|
boolean result = pqReasonableRangeService.deletePqReasonableRange(id);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "删除成功", methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "删除失败", methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,10 +1,7 @@
|
|||||||
package com.njcn.dataProcess.dao.relation.mapper;
|
package com.njcn.algorithm.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
import com.njcn.algorithm.pojo.po.PqReasonableRange;
|
||||||
import com.njcn.dataProcess.pojo.po.PqReasonableRange;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.njcn.algorithm.service.line;
|
package com.njcn.algorithm.service.line;
|
||||||
|
|
||||||
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
import com.njcn.algorithm.pojo.dto.PqReasonableRangeDto;
|
||||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.njcn.dataProcess.service;
|
package com.njcn.algorithm.service.line;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.dataProcess.param.DataCleanParam;
|
import com.njcn.algorithm.pojo.dto.PqReasonableRangeDto;
|
||||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
import com.njcn.algorithm.pojo.param.DataCleanParam;
|
||||||
import com.njcn.dataProcess.pojo.po.PqReasonableRange;
|
import com.njcn.algorithm.pojo.po.PqReasonableRange;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -24,4 +24,10 @@ public interface IPqReasonableRangeService extends IService<PqReasonableRange> {
|
|||||||
*/
|
*/
|
||||||
List<PqReasonableRangeDto> getReasonableRangeList(DataCleanParam param);
|
List<PqReasonableRangeDto> getReasonableRangeList(DataCleanParam param);
|
||||||
|
|
||||||
|
boolean savePqReasonableRange(PqReasonableRangeDto dto);
|
||||||
|
|
||||||
|
boolean updatePqReasonableRange(PqReasonableRangeDto dto);
|
||||||
|
|
||||||
|
boolean deletePqReasonableRange(String id);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,13 +3,15 @@ package com.njcn.algorithm.serviceimpl.line;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||||
|
import com.njcn.algorithm.pojo.dto.PqReasonableRangeDto;
|
||||||
|
import com.njcn.algorithm.pojo.param.DataCleanParam;
|
||||||
import com.njcn.algorithm.service.line.FlowAsyncService;
|
import com.njcn.algorithm.service.line.FlowAsyncService;
|
||||||
import com.njcn.algorithm.service.line.IDataCleanService;
|
import com.njcn.algorithm.service.line.IDataCleanService;
|
||||||
|
import com.njcn.algorithm.service.line.IPqReasonableRangeService;
|
||||||
import com.njcn.algorithm.utils.MemorySizeUtil;
|
import com.njcn.algorithm.utils.MemorySizeUtil;
|
||||||
import com.njcn.dataProcess.api.*;
|
import com.njcn.dataProcess.api.*;
|
||||||
import com.njcn.dataProcess.dto.RmpEventDetailDTO;
|
import com.njcn.dataProcess.dto.RmpEventDetailDTO;
|
||||||
import com.njcn.dataProcess.enums.DataCleanEnum;
|
import com.njcn.dataProcess.enums.DataCleanEnum;
|
||||||
import com.njcn.dataProcess.param.DataCleanParam;
|
|
||||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
import com.njcn.dataProcess.pojo.dto.*;
|
import com.njcn.dataProcess.pojo.dto.*;
|
||||||
import com.njcn.dataProcess.pojo.po.PqDataVerify;
|
import com.njcn.dataProcess.pojo.po.PqDataVerify;
|
||||||
@@ -33,7 +35,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.time.*;
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@@ -80,7 +84,7 @@ public class DataCleanServiceImpl implements IDataCleanService {
|
|||||||
@Resource
|
@Resource
|
||||||
private PqDataVerifyFeignClient pqDataVerifyFeignClient;
|
private PqDataVerifyFeignClient pqDataVerifyFeignClient;
|
||||||
@Resource
|
@Resource
|
||||||
private PqReasonableRangeFeignClient pqReasonableRangeFeignClient;
|
private IPqReasonableRangeService pqReasonableRangeService;
|
||||||
@Resource
|
@Resource
|
||||||
private LineFeignClient lineFeignClient;
|
private LineFeignClient lineFeignClient;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -644,7 +648,7 @@ public class DataCleanServiceImpl implements IDataCleanService {
|
|||||||
DataCleanParam param = new DataCleanParam();
|
DataCleanParam param = new DataCleanParam();
|
||||||
param.setSystemType(DataCleanEnum.Pqs.getCode());
|
param.setSystemType(DataCleanEnum.Pqs.getCode());
|
||||||
// param.setDataSource(DataCleanEnum.InfluxDB.getCode());
|
// param.setDataSource(DataCleanEnum.InfluxDB.getCode());
|
||||||
List<PqReasonableRangeDto> list = pqReasonableRangeFeignClient.getData(param).getData();
|
List<PqReasonableRangeDto> list = pqReasonableRangeService.getReasonableRangeList(param);
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
pqReasonableRangeDtoMap = list.stream().collect(Collectors.groupingBy(PqReasonableRangeDto::getInfluxdbTableName));
|
pqReasonableRangeDtoMap = list.stream().collect(Collectors.groupingBy(PqReasonableRangeDto::getInfluxdbTableName));
|
||||||
}
|
}
|
||||||
@@ -662,7 +666,7 @@ public class DataCleanServiceImpl implements IDataCleanService {
|
|||||||
if (ObjectUtil.isNotNull(tableName)) {
|
if (ObjectUtil.isNotNull(tableName)) {
|
||||||
param.setTableName(tableName);
|
param.setTableName(tableName);
|
||||||
}
|
}
|
||||||
List<PqReasonableRangeDto> list = pqReasonableRangeFeignClient.getData(param).getData();
|
List<PqReasonableRangeDto> list = pqReasonableRangeService.getReasonableRangeList(param);
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
pqReasonableRangeDtoMap = list.stream().collect(Collectors.toMap(PqReasonableRangeDto::getIndexCode, Function.identity()));
|
pqReasonableRangeDtoMap = list.stream().collect(Collectors.toMap(PqReasonableRangeDto::getIndexCode, Function.identity()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import cn.hutool.core.util.CharsetUtil;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||||
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||||
|
import com.njcn.algorithm.pojo.dto.PqReasonableRangeDto;
|
||||||
import com.njcn.algorithm.service.line.FlowAsyncService;
|
import com.njcn.algorithm.service.line.FlowAsyncService;
|
||||||
import com.njcn.dataProcess.api.*;
|
import com.njcn.dataProcess.api.*;
|
||||||
import com.njcn.dataProcess.dto.DataCleanJsonDTO;
|
import com.njcn.dataProcess.dto.DataCleanJsonDTO;
|
||||||
|
|||||||
@@ -247,6 +247,8 @@ public class IDataOnlineRateServiceImpl implements IDataOnlineRateService {
|
|||||||
long differ = DateUtil.between(date, newDate, DateUnit.MINUTE);
|
long differ = DateUtil.between(date, newDate, DateUnit.MINUTE);
|
||||||
if (online.equals(type)) {
|
if (online.equals(type)) {
|
||||||
minute = InfluxDBPublicParam.DAY_MINUTE - (int) differ;
|
minute = InfluxDBPublicParam.DAY_MINUTE - (int) differ;
|
||||||
|
}else{
|
||||||
|
minute = (int) differ;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<PqsCommunicateDto> communicateDataOld = communicateFeignClient.getRawDataEnd(lineParam).getData();
|
List<PqsCommunicateDto> communicateDataOld = communicateFeignClient.getRawDataEnd(lineParam).getData();
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
package com.njcn.dataProcess.service.impl.relation;
|
package com.njcn.algorithm.serviceimpl.line;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.PqReasonableRangeMapper;
|
import com.njcn.algorithm.mapper.PqReasonableRangeMapper;
|
||||||
import com.njcn.dataProcess.param.DataCleanParam;
|
import com.njcn.algorithm.pojo.dto.PqReasonableRangeDto;
|
||||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
import com.njcn.algorithm.pojo.param.DataCleanParam;
|
||||||
import com.njcn.dataProcess.pojo.po.PqReasonableRange;
|
import com.njcn.algorithm.pojo.po.PqReasonableRange;
|
||||||
import com.njcn.dataProcess.service.IPqReasonableRangeService;
|
import com.njcn.algorithm.service.line.IPqReasonableRangeService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -23,14 +25,18 @@ import java.util.List;
|
|||||||
* @author xy
|
* @author xy
|
||||||
* @since 2025-02-13
|
* @since 2025-02-13
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class PqReasonableRangeServiceImpl extends ServiceImpl<PqReasonableRangeMapper, PqReasonableRange> implements IPqReasonableRangeService {
|
public class PqReasonableRangeServiceImpl extends ServiceImpl<PqReasonableRangeMapper, PqReasonableRange> implements IPqReasonableRangeService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PqReasonableRangeDto> getReasonableRangeList(DataCleanParam param) {
|
public List<PqReasonableRangeDto> getReasonableRangeList(DataCleanParam param) {
|
||||||
List<PqReasonableRangeDto> result = new ArrayList<>();
|
List<PqReasonableRangeDto> result = new ArrayList<>();
|
||||||
LambdaQueryWrapper<PqReasonableRange> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PqReasonableRange> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
if (StrUtil.isNotBlank(param.getSystemType())) {
|
||||||
queryWrapper.eq(PqReasonableRange::getBelongingSystem,param.getSystemType());
|
queryWrapper.eq(PqReasonableRange::getBelongingSystem,param.getSystemType());
|
||||||
|
}
|
||||||
if(StrUtil.isNotBlank(param.getDataSource())){
|
if(StrUtil.isNotBlank(param.getDataSource())){
|
||||||
queryWrapper.eq(PqReasonableRange::getDataSource,param.getDataSource());
|
queryWrapper.eq(PqReasonableRange::getDataSource,param.getDataSource());
|
||||||
}
|
}
|
||||||
@@ -48,4 +54,29 @@ public class PqReasonableRangeServiceImpl extends ServiceImpl<PqReasonableRangeM
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean savePqReasonableRange(PqReasonableRangeDto dto) {
|
||||||
|
PqReasonableRange entity = new PqReasonableRange();
|
||||||
|
BeanUtils.copyProperties(dto, entity);
|
||||||
|
entity.setState(1);
|
||||||
|
return this.save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updatePqReasonableRange(PqReasonableRangeDto dto) {
|
||||||
|
PqReasonableRange entity = new PqReasonableRange();
|
||||||
|
BeanUtils.copyProperties(dto, entity);
|
||||||
|
return this.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deletePqReasonableRange(String id) {
|
||||||
|
PqReasonableRange entity = this.getById(id);
|
||||||
|
if (entity != null) {
|
||||||
|
entity.setState(0);
|
||||||
|
return this.updateById(entity);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -196,5 +196,8 @@ public interface InfluxDBTableConstant {
|
|||||||
String NORMAL = "0";
|
String NORMAL = "0";
|
||||||
String UN_NORMAL = "1";
|
String UN_NORMAL = "1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据清洗标志 0:正常 1:异常
|
||||||
|
*/
|
||||||
|
String ABNORMAL_FLAG = "abnormal_flag";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public class DataVDTO {
|
|||||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||||
private LocalDateTime timeid;
|
private LocalDateTime timeid;
|
||||||
|
private String devId;
|
||||||
private String lineid;
|
private String lineid;
|
||||||
private String phasicType;
|
private String phasicType;
|
||||||
private Double rms;
|
private Double rms;
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
package com.njcn.dataProcess.controller;
|
|
||||||
|
|
||||||
|
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
|
||||||
import com.njcn.common.pojo.constant.OperateType;
|
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
|
||||||
import com.njcn.dataProcess.param.DataCleanParam;
|
|
||||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
|
||||||
import com.njcn.dataProcess.service.IPqReasonableRangeService;
|
|
||||||
import com.njcn.web.controller.BaseController;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* 前端控制器
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author xy
|
|
||||||
* @since 2025-02-13
|
|
||||||
*/
|
|
||||||
@Validated
|
|
||||||
@Slf4j
|
|
||||||
@Controller
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/pqReasonableRange")
|
|
||||||
@Api(tags = "数据清洗标准库")
|
|
||||||
public class PqReasonableRangeController extends BaseController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IPqReasonableRangeService pqReasonableRangeService;
|
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
|
||||||
@PostMapping("/getData")
|
|
||||||
@ApiOperation("按条件获取数据合理范围")
|
|
||||||
public HttpResult<List<PqReasonableRangeDto>> getData(@RequestBody DataCleanParam param) {
|
|
||||||
String methodDescribe = getMethodDescribe("getData");
|
|
||||||
List<PqReasonableRangeDto> list = pqReasonableRangeService.getReasonableRangeList(param);
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -19,6 +19,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,16 +85,18 @@ public class LnDataDealServiceImpl implements LnDataDealService {
|
|||||||
//更新mysqldevice表最新数据时间
|
//更新mysqldevice表最新数据时间
|
||||||
|
|
||||||
if(!CollectionUtils.isEmpty(lnDataDTO.getDataVList())){
|
if(!CollectionUtils.isEmpty(lnDataDTO.getDataVList())){
|
||||||
DataVDTO dataVDTO =lnDataDTO.getDataVList().stream().max(Comparator.comparing(DataVDTO::getTimeid)).get();
|
|
||||||
List<String> lineIdList = lnDataDTO.getDataVList().stream().map(DataVDTO::getLineid).distinct().collect(Collectors.toList());
|
List<String> lineIdList = lnDataDTO.getDataVList().stream().map(DataVDTO::getLineid).distinct().collect(Collectors.toList());
|
||||||
List<LineDeviceStateVO> data = lineFeignClient.getAllLine(lineIdList).getData();
|
List<LineDeviceStateVO> data = lineFeignClient.getAllLine(lineIdList).getData();
|
||||||
//获取所有设备id并去重
|
Map<String, String> map = data.stream().collect(Collectors.toMap(LineDeviceStateVO::getId, temp -> temp.getPids().split(",")[4]));
|
||||||
List<String> devIds = data.stream().map(temp -> {
|
lnDataDTO.getDataVList().forEach(temp->{
|
||||||
return temp.getPids().split(",")[4];
|
temp.setDevId(map.get(temp.getLineid()));
|
||||||
}).distinct().collect(Collectors.toList());
|
});
|
||||||
|
Map<String, List<DataVDTO>> collect = lnDataDTO.getDataVList().stream().collect(Collectors.groupingBy(DataVDTO::getDevId));
|
||||||
devIds.forEach(temp->{
|
collect.forEach((temp,dataVDTOList)->{
|
||||||
PqsCommunicateDto pqsCommunicateDto = new PqsCommunicateDto();
|
PqsCommunicateDto pqsCommunicateDto = new PqsCommunicateDto();
|
||||||
|
DataVDTO dataVDTO =dataVDTOList.stream().max(Comparator.comparing(DataVDTO::getTimeid)).get();
|
||||||
|
|
||||||
pqsCommunicateDto.setTime(LocalDateTimeUtil.format(dataVDTO.getTimeid(), DatePattern.NORM_DATETIME_PATTERN));
|
pqsCommunicateDto.setTime(LocalDateTimeUtil.format(dataVDTO.getTimeid(), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
pqsCommunicateDto.setDevId(temp);
|
pqsCommunicateDto.setDevId(temp);
|
||||||
pqsCommunicateDto.setType(1);
|
pqsCommunicateDto.setType(1);
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataFlickerMapper;
|
import com.njcn.dataProcess.dao.imapper.DataFlickerMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataFlickerRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataFlickerRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataFlickerDTO;
|
import com.njcn.dataProcess.dto.DataFlickerDTO;
|
||||||
@@ -24,12 +20,10 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,10 +41,6 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
|
|||||||
|
|
||||||
private final DataFlickerMapper dataFlickerMapper;
|
private final DataFlickerMapper dataFlickerMapper;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
put("BC", "B");
|
put("BC", "B");
|
||||||
@@ -80,12 +70,7 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
|
|||||||
@Override
|
@Override
|
||||||
public List<DataFlickerDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataFlickerDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataFlickerDto> result = new ArrayList<>();
|
List<DataFlickerDto> result = new ArrayList<>();
|
||||||
List<DataFlicker> list;
|
List<DataFlicker> list = getMinuteData(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam);
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam);
|
|
||||||
}
|
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
DataFlickerDto dto = new DataFlickerDto();
|
DataFlickerDto dto = new DataFlickerDto();
|
||||||
BeanUtils.copyProperties(item, dto);
|
BeanUtils.copyProperties(item, dto);
|
||||||
@@ -98,12 +83,7 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataFlicker> dataIList;
|
List<DataFlicker> dataIList = getMinuteData(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
dataIList = getWlMinuteData(lineParam);
|
|
||||||
} else {
|
|
||||||
dataIList = getMinuteData(lineParam);
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(dataIList)) {
|
if (CollectionUtil.isNotEmpty(dataIList)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -261,56 +241,6 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
|
|||||||
.between(DataFlicker::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
.between(DataFlicker::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||||
.eq(DataFlicker::getQualityFlag, "0");
|
.eq(DataFlicker::getQualityFlag, "0");
|
||||||
quality(result, influxQueryWrapper, lineParam);
|
quality(result, influxQueryWrapper, lineParam);
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataFlicker> getWlMinuteData(LineCountEvaluateParam lineParam) {
|
|
||||||
List<DataFlicker> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineParam.getLineId())) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineParam.getLineId()).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
|
|
||||||
lineParam.getLineId().forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class);
|
|
||||||
influxQueryWrapper.eq(DataFlicker::getLineId, lineId)
|
|
||||||
.eq(DataFlicker::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataFlicker::getLineId)
|
|
||||||
.select(DataFlicker::getPhasicType)
|
|
||||||
.between(DataFlicker::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
|
||||||
.eq(DataFlicker::getQualityFlag, "0");
|
|
||||||
if (CollUtil.isNotEmpty(lineParam.getPhasicType())) {
|
|
||||||
influxQueryWrapper.regular(DataFlicker::getPhasicType, lineParam.getPhasicType());
|
|
||||||
}
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataFlicker::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataFlicker::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
//判断接线方式 (0-星型 1-角型 2-V型) 星型是相电压 角型或者v型是线电压
|
|
||||||
if (Objects.equals(po.getConType(),0)) {
|
|
||||||
//相电压电压变动幅度
|
|
||||||
influxQueryWrapper.select("Pq_Fluct","fluc");
|
|
||||||
//相电压长时闪变
|
|
||||||
influxQueryWrapper.select("Pq_Plt","plt");
|
|
||||||
//相电压短时闪变
|
|
||||||
influxQueryWrapper.select("Pq_Pst","pst");
|
|
||||||
} else {
|
|
||||||
//线电压电压变动幅度
|
|
||||||
influxQueryWrapper.select("Pq_LFluct","fluc");
|
|
||||||
//相电压长时闪变
|
|
||||||
influxQueryWrapper.select("Pq_LPlt","plt");
|
|
||||||
//相电压短时闪变
|
|
||||||
influxQueryWrapper.select("Pq_LPst","pst");
|
|
||||||
}
|
|
||||||
result.addAll(dataFlickerMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -319,7 +249,6 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ package com.njcn.dataProcess.service.impl.influxdb;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataFlucMapper;
|
import com.njcn.dataProcess.dao.imapper.DataFlucMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataFlucRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataFlucRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataFlucDTO;
|
import com.njcn.dataProcess.dto.DataFlucDTO;
|
||||||
@@ -22,12 +18,10 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,11 +39,6 @@ public class InfluxdbDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMa
|
|||||||
|
|
||||||
private final DataFlucMapper dataFlucMapper;
|
private final DataFlucMapper dataFlucMapper;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
put("BC", "B");
|
put("BC", "B");
|
||||||
@@ -78,12 +67,7 @@ public class InfluxdbDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMa
|
|||||||
@Override
|
@Override
|
||||||
public List<DataFlucDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataFlucDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataFlucDto> result = new ArrayList<>();
|
List<DataFlucDto> result = new ArrayList<>();
|
||||||
List<DataFluc> list;
|
List<DataFluc> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataFlucDto dto = new DataFlucDto();
|
DataFlucDto dto = new DataFlucDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -96,12 +80,7 @@ public class InfluxdbDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMa
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataFluc> dataIList;
|
List<DataFluc> dataIList = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
dataIList = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
dataIList = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(dataIList)) {
|
if (CollectionUtil.isNotEmpty(dataIList)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -215,45 +194,6 @@ public class InfluxdbDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMa
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataFluc> getWlMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap, Boolean dataType) {
|
|
||||||
//todo FLUCCF电压波动频度原先oracle表存储的是0,写死的,这边暂不取值
|
|
||||||
List<DataFluc> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineList).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineList.forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFluc.class);
|
|
||||||
influxQueryWrapper.eq(DataFluc::getLineId, lineId)
|
|
||||||
.eq(DataFluc::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataFluc::getLineId)
|
|
||||||
.select(DataFluc::getPhasicType)
|
|
||||||
.between(DataFluc::getTime, startTime, endTime)
|
|
||||||
.eq(DataFluc::getQualityFlag, "0");
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataFluc::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataFluc::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
//判断接线方式 (0-星型 1-角型 2-V型) 星型是相电压 角型或者v型是线电压
|
|
||||||
if (Objects.equals(po.getConType(),0)) {
|
|
||||||
//相电压电压变动幅度
|
|
||||||
influxQueryWrapper.select("Pq_Fluct","fluc");
|
|
||||||
} else {
|
|
||||||
//线电压电压变动幅度
|
|
||||||
influxQueryWrapper.select("Pq_LFluct","fluc");
|
|
||||||
}
|
|
||||||
result.addAll(dataFlucMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -262,7 +202,6 @@ public class InfluxdbDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMa
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataHarmRateIMapper;
|
import com.njcn.dataProcess.dao.imapper.DataHarmRateIMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmRateIRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmRateIRelationMapper;
|
||||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
@@ -28,7 +24,6 @@ import java.time.LocalDateTime;
|
|||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -40,10 +35,6 @@ public class InfluxdbDataHarmRateIImpl extends MppServiceImpl<RStatDataHarmRateI
|
|||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
@Resource
|
@Resource
|
||||||
private DataHarmRateIMapper dataHarmRateIMapper;
|
private DataHarmRateIMapper dataHarmRateIMapper;
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -55,12 +46,7 @@ public class InfluxdbDataHarmRateIImpl extends MppServiceImpl<RStatDataHarmRateI
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmRateIDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataHarmRateIDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataHarmRateIDto> result = new ArrayList<>();
|
List<DataHarmRateIDto> result = new ArrayList<>();
|
||||||
List<DataHarmrateI> list;
|
List<DataHarmrateI> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataHarmRateIDto dto = new DataHarmRateIDto();
|
DataHarmRateIDto dto = new DataHarmRateIDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -73,12 +59,7 @@ public class InfluxdbDataHarmRateIImpl extends MppServiceImpl<RStatDataHarmRateI
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataHarmrateI> data;
|
List<DataHarmrateI> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
data = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(data)) {
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -246,40 +227,6 @@ public class InfluxdbDataHarmRateIImpl extends MppServiceImpl<RStatDataHarmRateI
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataHarmrateI> getWlMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap, Boolean dataType) {
|
|
||||||
List<DataHarmrateI> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineList).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineList.forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateI.class);
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmRI_", "i_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
influxQueryWrapper.eq(DataHarmrateI::getLineId, lineId)
|
|
||||||
.eq(DataHarmrateI::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataHarmrateI::getLineId)
|
|
||||||
.select(DataHarmrateI::getPhasicType)
|
|
||||||
.select(DataHarmrateI::getValueType)
|
|
||||||
//电流基波有效值
|
|
||||||
.select("Pq_RmsFundI_","i_1")
|
|
||||||
.between(DataHarmrateI::getTime, startTime, endTime)
|
|
||||||
.eq(DataHarmrateI::getQualityFlag, "0");
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataHarmrateI::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataHarmrateI::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
result.addAll(dataHarmRateIMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -288,7 +235,6 @@ public class InfluxdbDataHarmRateIImpl extends MppServiceImpl<RStatDataHarmRateI
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
|
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
|
||||||
import com.njcn.dataProcess.dao.imapper.DataHarmRateVMapper;
|
import com.njcn.dataProcess.dao.imapper.DataHarmRateVMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmRateVRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmRateVRelationMapper;
|
||||||
@@ -28,12 +24,10 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,10 +40,6 @@ public class InfluxdbDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
|
|||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
|
|
||||||
private final DataHarmRateVMapper dataHarmRateVMapper;
|
private final DataHarmRateVMapper dataHarmRateVMapper;
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -61,12 +51,7 @@ public class InfluxdbDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataHarmDto> result = new ArrayList<>();
|
List<DataHarmDto> result = new ArrayList<>();
|
||||||
List<DataHarmrateV> list;
|
List<DataHarmrateV> list = getMinuteData(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam);
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam);;
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataHarmDto dto = new DataHarmDto();
|
DataHarmDto dto = new DataHarmDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -97,12 +82,7 @@ public class InfluxdbDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataHarmrateV> data;
|
List<DataHarmrateV> data = getMinuteData(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
data = getWlMinuteData(lineParam);
|
|
||||||
} else {
|
|
||||||
data = getMinuteData(lineParam);;
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(data)) {
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -314,49 +294,6 @@ public class InfluxdbDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataHarmrateV> getWlMinuteData(LineCountEvaluateParam lineParam) {
|
|
||||||
List<DataHarmrateV> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineParam.getLineId())) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineParam.getLineId()).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineParam.getLineId().forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
|
|
||||||
influxQueryWrapper.eq(DataHarmrateV::getLineId, lineId)
|
|
||||||
.eq(DataHarmrateV::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataHarmrateV::getLineId)
|
|
||||||
.select(DataHarmrateV::getPhasicType)
|
|
||||||
.select(DataHarmrateV::getValueType)
|
|
||||||
.between(DataHarmrateV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
|
||||||
.eq(DataHarmrateV::getQualityFlag, "0");
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataHarmrateV::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataHarmrateV::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
//判断接线方式 (0-星型 1-角型 2-V型) 星型是相电压 角型或者v型是线电压
|
|
||||||
if (Objects.equals(po.getConType(),0)) {
|
|
||||||
//相电压基波有效值
|
|
||||||
influxQueryWrapper.select("Pq_RmsFundU_","v_1");
|
|
||||||
//2-50次 相电压谐波含有率
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmU_", "v_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
} else {
|
|
||||||
//线电压基波有效值
|
|
||||||
influxQueryWrapper.select("Pq_RmsFundLU_","v_1");
|
|
||||||
//2-50次 线电压谐波含有率
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmLU_", "v_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
}
|
|
||||||
result.addAll(dataHarmRateVMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -365,8 +302,6 @@ public class InfluxdbDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataHarmphasicIMapper;
|
import com.njcn.dataProcess.dao.imapper.DataHarmphasicIMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPhasicIRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPhasicIRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataHarmphasicIDTO;
|
import com.njcn.dataProcess.dto.DataHarmphasicIDTO;
|
||||||
@@ -25,12 +21,10 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,10 +40,6 @@ public class InfluxdbDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
|
|
||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
private final DataHarmphasicIMapper dataHarmphasicIMapper;
|
private final DataHarmphasicIMapper dataHarmphasicIMapper;
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -78,12 +68,7 @@ public class InfluxdbDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmPhasicIDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataHarmPhasicIDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataHarmPhasicIDto> result = new ArrayList<>();
|
List<DataHarmPhasicIDto> result = new ArrayList<>();
|
||||||
List<DataHarmphasicI> list;
|
List<DataHarmphasicI> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataHarmPhasicIDto dto = new DataHarmPhasicIDto();
|
DataHarmPhasicIDto dto = new DataHarmPhasicIDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -96,12 +81,7 @@ public class InfluxdbDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataHarmphasicI> data;
|
List<DataHarmphasicI> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
data = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(data)) {
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -269,41 +249,6 @@ public class InfluxdbDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataHarmphasicI> getWlMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap,Boolean dataType) {
|
|
||||||
List<DataHarmphasicI> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineList).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineList.forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicI.class);
|
|
||||||
//谐波电流幅值相角
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmIAng_", "i_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
influxQueryWrapper.eq(DataHarmphasicI::getLineId, lineId)
|
|
||||||
.eq(DataHarmphasicI::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataHarmphasicI::getLineId)
|
|
||||||
.select(DataHarmphasicI::getPhasicType)
|
|
||||||
.select(DataHarmphasicI::getValueType)
|
|
||||||
//基波电流相角
|
|
||||||
.select("Pq_FundIAng","i_1")
|
|
||||||
.between(DataHarmphasicI::getTime, startTime, endTime)
|
|
||||||
.eq(DataHarmphasicI::getQualityFlag, "0");
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataHarmphasicI::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataHarmphasicI::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
result.addAll(dataHarmphasicIMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -312,7 +257,7 @@ public class InfluxdbDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,10 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataHarmphasicVMapper;
|
import com.njcn.dataProcess.dao.imapper.DataHarmphasicVMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPhasicVRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPhasicVRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataHarmphasicVDTO;
|
import com.njcn.dataProcess.dto.DataHarmphasicVDTO;
|
||||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
import com.njcn.dataProcess.po.influx.DataHarmphasicI;
|
|
||||||
import com.njcn.dataProcess.po.influx.DataHarmphasicV;
|
import com.njcn.dataProcess.po.influx.DataHarmphasicV;
|
||||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||||
@@ -27,12 +22,10 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,12 +40,7 @@ import java.util.stream.Collectors;
|
|||||||
public class InfluxdbDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPhasicVRelationMapper, RStatDataHarmPhasicVD> implements IDataHarmphasicV {
|
public class InfluxdbDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPhasicVRelationMapper, RStatDataHarmPhasicVD> implements IDataHarmphasicV {
|
||||||
|
|
||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
|
|
||||||
private final DataHarmphasicVMapper dataHarmphasicVMapper;
|
private final DataHarmphasicVMapper dataHarmphasicVMapper;
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -83,12 +71,7 @@ public class InfluxdbDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataHarmDto> result = new ArrayList<>();
|
List<DataHarmDto> result = new ArrayList<>();
|
||||||
List<DataHarmphasicV> list;
|
List<DataHarmphasicV> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataHarmDto dto = new DataHarmDto();
|
DataHarmDto dto = new DataHarmDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -101,12 +84,7 @@ public class InfluxdbDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataHarmphasicV> data;
|
List<DataHarmphasicV> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
data = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(data)) {
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -274,50 +252,6 @@ public class InfluxdbDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public List<DataHarmphasicV> getWlMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap, Boolean dataType) {
|
|
||||||
List<DataHarmphasicV> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineList).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineList.forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicV.class);
|
|
||||||
influxQueryWrapper.eq(DataHarmphasicV::getLineId, lineId)
|
|
||||||
.eq(DataHarmphasicV::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataHarmphasicV::getLineId)
|
|
||||||
.select(DataHarmphasicV::getPhasicType)
|
|
||||||
.select(DataHarmphasicV::getValueType)
|
|
||||||
.between(DataHarmphasicV::getTime, startTime, endTime)
|
|
||||||
.eq(DataHarmphasicV::getQualityFlag, "0");
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataHarmphasicV::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataHarmphasicV::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
//判断接线方式 (0-星型 1-角型 2-V型) 星型是相电压 角型或者v型是线电压
|
|
||||||
if (Objects.equals(po.getConType(),0)) {
|
|
||||||
//相电压基波有效值相角
|
|
||||||
influxQueryWrapper.select("Pq_FundUAng","v_1");
|
|
||||||
//2-50次 相电压谐波相角
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmUAng_", "v_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
} else {
|
|
||||||
//线电压基波有效值相角
|
|
||||||
influxQueryWrapper.select("Pq_FundLUAng","v_1");
|
|
||||||
//2-50次 线电压谐波相角
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmLUAng_", "v_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
}
|
|
||||||
result.addAll(dataHarmphasicVMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -326,7 +260,6 @@ public class InfluxdbDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataHarmpowerPMapper;
|
import com.njcn.dataProcess.dao.imapper.DataHarmpowerPMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerPRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerPRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataHarmpowerPDTO;
|
import com.njcn.dataProcess.dto.DataHarmpowerPDTO;
|
||||||
@@ -26,13 +22,11 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,12 +41,7 @@ import java.util.stream.Collectors;
|
|||||||
public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowerPRelationMapper, RStatDataHarmPowerPD> implements IDataHarmpowerP {
|
public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowerPRelationMapper, RStatDataHarmPowerPD> implements IDataHarmpowerP {
|
||||||
|
|
||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
|
|
||||||
private final DataHarmpowerPMapper dataHarmpowerPMapper;
|
private final DataHarmpowerPMapper dataHarmpowerPMapper;
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -82,12 +71,7 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
@Override
|
@Override
|
||||||
public List<DataPowerPDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataPowerPDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataPowerPDto> result = new ArrayList<>();
|
List<DataPowerPDto> result = new ArrayList<>();
|
||||||
List<DataHarmpowerP> list;
|
List<DataHarmpowerP> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataPowerPDto dto = new DataPowerPDto();
|
DataPowerPDto dto = new DataPowerPDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -100,12 +84,7 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataHarmpowerP> data;
|
List<DataHarmpowerP> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
data = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(data)) {
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -261,57 +240,6 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataHarmpowerP> getWlMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap, Boolean dataType) {
|
|
||||||
List<DataHarmpowerP> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineList).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineList.forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerP.class);
|
|
||||||
//A、B、C谐波有功功率有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmP_", "p_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
//三相总 谐波有功功率有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmTP_", "totP_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
InfluxQueryWrapper eq = influxQueryWrapper.eq(DataHarmpowerP::getLineId, lineId)
|
|
||||||
.eq(DataHarmpowerP::getProcess, Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataHarmpowerP::getLineId)
|
|
||||||
.select(DataHarmpowerP::getPhasicType)
|
|
||||||
.select(DataHarmpowerP::getValueType)
|
|
||||||
//位移功率因数
|
|
||||||
.select("Pq_DF", "df")
|
|
||||||
//视在功率因素
|
|
||||||
.select("Pq_PF", "pf")
|
|
||||||
//A、B、C三相有功功率
|
|
||||||
.select("Pq_P", "p")
|
|
||||||
//基波有功功率
|
|
||||||
.select("Pq_FundP", "p_1")
|
|
||||||
//三相总视在功率因数
|
|
||||||
.select("Pq_TotPF", "totPf")
|
|
||||||
//三相总位移功率因数
|
|
||||||
.select("Pq_TotDF", "totDf")
|
|
||||||
//三相总功率因数
|
|
||||||
.select("Pq_TotP", "totP")
|
|
||||||
//三相总基波有功功率
|
|
||||||
.select("Pq_TotHarmP", "totP1")
|
|
||||||
.between(DataHarmpowerP::getTime, startTime, endTime)
|
|
||||||
.eq(DataHarmpowerP::getQualityFlag, "0");
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataHarmpowerP::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataHarmpowerP::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
result.addAll(dataHarmpowerPMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -320,7 +248,6 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataHarmpowerQMapper;
|
import com.njcn.dataProcess.dao.imapper.DataHarmpowerQMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerQRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerQRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataHarmpowerQDTO;
|
import com.njcn.dataProcess.dto.DataHarmpowerQDTO;
|
||||||
@@ -25,13 +21,11 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,10 +41,6 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
|
|
||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
private final DataHarmpowerQMapper dataHarmpowerQMapper;
|
private final DataHarmpowerQMapper dataHarmpowerQMapper;
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -80,12 +70,7 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmPowerQDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataHarmPowerQDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataHarmPowerQDto> result = new ArrayList<>();
|
List<DataHarmPowerQDto> result = new ArrayList<>();
|
||||||
List<DataHarmpowerQ> list;
|
List<DataHarmpowerQ> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataHarmPowerQDto dto = new DataHarmPowerQDto();
|
DataHarmPowerQDto dto = new DataHarmPowerQDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -98,12 +83,7 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataHarmpowerQ> data;
|
List<DataHarmpowerQ> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
data = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(data)) {
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -254,49 +234,6 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataHarmpowerQ> getWlMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap, Boolean dataType) {
|
|
||||||
List<DataHarmpowerQ> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineList).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineList.forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerQ.class);
|
|
||||||
//A、B、C谐波无功功率有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmQ_", "q_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
//三相总 谐波有功功率有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmTQ_", "totQ_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
influxQueryWrapper.eq(DataHarmpowerQ::getLineId, lineId)
|
|
||||||
.eq(DataHarmpowerQ::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataHarmpowerQ::getLineId)
|
|
||||||
.select(DataHarmpowerQ::getPhasicType)
|
|
||||||
.select(DataHarmpowerQ::getValueType)
|
|
||||||
//A、B、C三相无功功率
|
|
||||||
.select("Pq_Q", "q")
|
|
||||||
//基波无功功率
|
|
||||||
.select("Pq_FundQ","q_1")
|
|
||||||
//总无功功率
|
|
||||||
.select("Pq_TotQ","totQ")
|
|
||||||
//基波无功功率(T)
|
|
||||||
.select("Pq_TotHarmQ","totQ1")
|
|
||||||
.between(DataHarmpowerQ::getTime, startTime, endTime)
|
|
||||||
.eq(DataHarmpowerQ::getQualityFlag, "0");
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataHarmpowerQ::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataHarmpowerQ::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
result.addAll(dataHarmpowerQMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -305,7 +242,6 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataHarmpowerSMapper;
|
import com.njcn.dataProcess.dao.imapper.DataHarmpowerSMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerSRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerSRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataHarmpowerSDTO;
|
import com.njcn.dataProcess.dto.DataHarmpowerSDTO;
|
||||||
@@ -25,13 +21,11 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,10 +41,6 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
|
|
||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
private final DataHarmpowerSMapper dataHarmpowerSMapper;
|
private final DataHarmpowerSMapper dataHarmpowerSMapper;
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -80,12 +70,7 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmPowerSDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataHarmPowerSDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataHarmPowerSDto> result = new ArrayList<>();
|
List<DataHarmPowerSDto> result = new ArrayList<>();
|
||||||
List<DataHarmpowerS> list;
|
List<DataHarmpowerS> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataHarmPowerSDto dto = new DataHarmPowerSDto();
|
DataHarmPowerSDto dto = new DataHarmPowerSDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -98,12 +83,7 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataHarmpowerS> data;
|
List<DataHarmpowerS> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
data = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(data)) {
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -253,49 +233,6 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataHarmpowerS> getWlMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap,Boolean dataType) {
|
|
||||||
List<DataHarmpowerS> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineList).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineList.forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerS.class);
|
|
||||||
//A、B、C谐波视在功率有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmS_", "s_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
//三相总 谐波视在功率有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmTS_", "totS_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
influxQueryWrapper.eq(DataHarmpowerS::getLineId, lineId)
|
|
||||||
.eq(DataHarmpowerS::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataHarmpowerS::getLineId)
|
|
||||||
.select(DataHarmpowerS::getPhasicType)
|
|
||||||
.select(DataHarmpowerS::getValueType)
|
|
||||||
//A、B、C视在功率
|
|
||||||
.select("Pq_S","s")
|
|
||||||
//基波视在功率
|
|
||||||
.select("Pq_FundS","s_1")
|
|
||||||
//总视在功率
|
|
||||||
.select("Pq_TotS","totS")
|
|
||||||
//基波视在功率(T)
|
|
||||||
.select("Pq_TotHarmS","totS1")
|
|
||||||
.between(DataHarmpowerS::getTime, startTime, endTime)
|
|
||||||
.eq(DataHarmpowerS::getQualityFlag, "0");
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataHarmpowerS::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataHarmpowerS::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
result.addAll(dataHarmpowerSMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -304,8 +241,6 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
|
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
|
||||||
import com.njcn.dataProcess.dao.imapper.DataIMapper;
|
import com.njcn.dataProcess.dao.imapper.DataIMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataIRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataIRelationMapper;
|
||||||
@@ -26,12 +22,10 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,11 +43,6 @@ public class InfluxdbDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
|
|||||||
|
|
||||||
private final DataIMapper dataIMapper;
|
private final DataIMapper dataIMapper;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
put("BC", "B");
|
put("BC", "B");
|
||||||
@@ -82,12 +71,7 @@ public class InfluxdbDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
|
|||||||
@Override
|
@Override
|
||||||
public List<DataIDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataIDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataIDto> result = new ArrayList<>();
|
List<DataIDto> result = new ArrayList<>();
|
||||||
List<DataI> list;
|
List<DataI> list = getMinuteDataI(lineParam);;
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteDataI(lineParam);
|
|
||||||
} else {
|
|
||||||
list = getMinuteDataI(lineParam);
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataIDto dto = new DataIDto();
|
DataIDto dto = new DataIDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -100,12 +84,7 @@ public class InfluxdbDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataI> dataIList;
|
List<DataI> dataIList = getMinuteDataI(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
dataIList = getWlMinuteDataI(lineParam);
|
|
||||||
} else {
|
|
||||||
dataIList = getMinuteDataI(lineParam);
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(dataIList)) {
|
if (CollectionUtil.isNotEmpty(dataIList)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -314,57 +293,6 @@ public class InfluxdbDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataI> getWlMinuteDataI(LineCountEvaluateParam lineParam) {
|
|
||||||
List<DataI> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineParam.getLineId())) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineParam.getLineId()).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
|
|
||||||
lineParam.getLineId().forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
|
||||||
//2-50次 谐波电流有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmI_", "i_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
influxQueryWrapper.eq(DataI::getLineId, lineId)
|
|
||||||
.eq(DataI::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataI::getLineId)
|
|
||||||
.select(DataI::getPhasicType)
|
|
||||||
.select(DataI::getValueType)
|
|
||||||
//电流负序
|
|
||||||
.select("Pq_SeqNegI","i_neg")
|
|
||||||
//电流正序
|
|
||||||
.select("Pq_SeqPosI","i_pos")
|
|
||||||
//电流总谐波畸变率
|
|
||||||
.select("Pq_ThdI","i_thd")
|
|
||||||
//电流负序不平衡度
|
|
||||||
.select("Pq_UnbalNegI","i_unbalance")
|
|
||||||
//电流零序
|
|
||||||
.select("Pq_SeqZeroI","i_zero")
|
|
||||||
//电流总有效值
|
|
||||||
.select("Pq_RmsI","rms")
|
|
||||||
//电流基波有效值
|
|
||||||
.select("Pq_RmsFundI","i_1")
|
|
||||||
.between(DataI::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
|
||||||
.eq(DataI::getQualityFlag, "0");
|
|
||||||
if (CollUtil.isNotEmpty(lineParam.getPhasicType())) {
|
|
||||||
influxQueryWrapper.regular(DataI::getPhasicType, lineParam.getPhasicType());
|
|
||||||
}
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataI::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataI::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
result.addAll(dataIMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -373,7 +301,6 @@ public class InfluxdbDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataInharmIMapper;
|
import com.njcn.dataProcess.dao.imapper.DataInharmIMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataInHarmIRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataInHarmIRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataInharmIDTO;
|
import com.njcn.dataProcess.dto.DataInharmIDTO;
|
||||||
@@ -25,12 +21,10 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,10 +40,6 @@ public class InfluxdbDataInharmIImpl extends MppServiceImpl<RStatDataInHarmIRela
|
|||||||
|
|
||||||
private final DataInharmIMapper dataInharmIMapper;
|
private final DataInharmIMapper dataInharmIMapper;
|
||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -79,12 +69,7 @@ public class InfluxdbDataInharmIImpl extends MppServiceImpl<RStatDataInHarmIRela
|
|||||||
@Override
|
@Override
|
||||||
public List<DataInHarmIDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataInHarmIDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataInHarmIDto> result = new ArrayList<>();
|
List<DataInHarmIDto> result = new ArrayList<>();
|
||||||
List<DataInharmI> list;
|
List<DataInharmI> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataInHarmIDto dto = new DataInHarmIDto();
|
DataInHarmIDto dto = new DataInHarmIDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -97,12 +82,7 @@ public class InfluxdbDataInharmIImpl extends MppServiceImpl<RStatDataInHarmIRela
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataInharmI> data;
|
List<DataInharmI> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime(),lineParam.getDataType());
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
data = getWlMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
} else {
|
|
||||||
data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime(),lineParam.getDataType());
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(data)) {
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -270,39 +250,6 @@ public class InfluxdbDataInharmIImpl extends MppServiceImpl<RStatDataInHarmIRela
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataInharmI> getWlMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap, Boolean dataType) {
|
|
||||||
List<DataInharmI> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineList).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineList.forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmI.class);
|
|
||||||
//2-50次 间谐波电流有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_InHarmIAmp_", "i_", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
|
||||||
influxQueryWrapper.eq(DataInharmI::getLineId, lineId)
|
|
||||||
.eq(DataInharmI::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataInharmI::getLineId)
|
|
||||||
.select(DataInharmI::getPhasicType)
|
|
||||||
.select(DataInharmI::getValueType)
|
|
||||||
.between(DataInharmI::getTime, startTime, endTime)
|
|
||||||
.eq(DataInharmI::getQualityFlag, "0");
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataInharmI::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataInharmI::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
result.addAll(dataInharmIMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -311,8 +258,6 @@ public class InfluxdbDataInharmIImpl extends MppServiceImpl<RStatDataInHarmIRela
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataInharmVMapper;
|
import com.njcn.dataProcess.dao.imapper.DataInharmVMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataInHarmVRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataInHarmVRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataInharmVDTO;
|
import com.njcn.dataProcess.dto.DataInharmVDTO;
|
||||||
@@ -26,12 +22,10 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@@ -47,12 +41,7 @@ import java.util.stream.Collectors;
|
|||||||
public class InfluxdbDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRelationMapper, RStatDataInHarmVD> implements IDataInharmV {
|
public class InfluxdbDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRelationMapper, RStatDataInHarmVD> implements IDataInharmV {
|
||||||
|
|
||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
|
|
||||||
private final DataInharmVMapper dataInharmVMapper;
|
private final DataInharmVMapper dataInharmVMapper;
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -81,12 +70,7 @@ public class InfluxdbDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRela
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataHarmDto> result = new ArrayList<>();
|
List<DataHarmDto> result = new ArrayList<>();
|
||||||
List<DataInharmV> list;
|
List<DataInharmV> list = getMinuteData(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteData(lineParam);
|
|
||||||
} else {
|
|
||||||
list = getMinuteData(lineParam);
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataHarmDto dto = new DataHarmDto();
|
DataHarmDto dto = new DataHarmDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -99,12 +83,7 @@ public class InfluxdbDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRela
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataInharmV> data;
|
List<DataInharmV> data = getMinuteData(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
data = getWlMinuteData(lineParam);
|
|
||||||
} else {
|
|
||||||
data = getMinuteData(lineParam);
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(data)) {
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -275,46 +254,6 @@ public class InfluxdbDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRela
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataInharmV> getWlMinuteData(LineCountEvaluateParam lineParam) {
|
|
||||||
List<DataInharmV> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineParam.getLineId())) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineParam.getLineId()).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineParam.getLineId().forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmV.class);
|
|
||||||
//2-50次 间谐波电流有效值
|
|
||||||
influxQueryWrapper.eq(DataInharmV::getLineId, lineId)
|
|
||||||
.eq(DataInharmV::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataInharmV::getLineId)
|
|
||||||
.select(DataInharmV::getPhasicType)
|
|
||||||
.select(DataInharmV::getValueType)
|
|
||||||
.between(DataInharmV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
|
||||||
.eq(DataInharmV::getQualityFlag, "0");
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataInharmV::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataInharmV::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
//判断接线方式 (0-星型 1-角型 2-V型) 星型是相电压 角型或者v型是线电压
|
|
||||||
if (Objects.equals(po.getConType(),0)) {
|
|
||||||
//0.5-49.5次 间谐波相电压有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_InHarmURV_", "v_", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
|
||||||
} else {
|
|
||||||
//0.5-49.5次 间谐波线电压有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_InHarmLURV_", "v_", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
|
||||||
}
|
|
||||||
result.addAll(dataInharmVMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -323,8 +262,6 @@ public class InfluxdbDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRela
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,6 @@ package com.njcn.dataProcess.service.impl.influxdb;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.dao.imapper.DataPltMapper;
|
import com.njcn.dataProcess.dao.imapper.DataPltMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataPltRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataPltRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataPltDTO;
|
import com.njcn.dataProcess.dto.DataPltDTO;
|
||||||
@@ -24,12 +20,10 @@ import org.apache.commons.collections4.ListUtils;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,12 +38,7 @@ import java.util.stream.Collectors;
|
|||||||
public class InfluxdbDataPltImpl extends MppServiceImpl<RStatDataPltRelationMapper, RStatDataPltD> implements IDataPlt {
|
public class InfluxdbDataPltImpl extends MppServiceImpl<RStatDataPltRelationMapper, RStatDataPltD> implements IDataPlt {
|
||||||
|
|
||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
|
|
||||||
private final DataPltMapper dataPltMapper;
|
private final DataPltMapper dataPltMapper;
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -79,12 +68,7 @@ public class InfluxdbDataPltImpl extends MppServiceImpl<RStatDataPltRelationMapp
|
|||||||
@Override
|
@Override
|
||||||
public List<DataPltDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataPltDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataPltDto> result = new ArrayList<>();
|
List<DataPltDto> result = new ArrayList<>();
|
||||||
List<DataPlt> list;
|
List<DataPlt> list = getMinuteDataPlt(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteDataPlt(lineParam);
|
|
||||||
} else {
|
|
||||||
list = getMinuteDataPlt(lineParam);
|
|
||||||
}
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
DataPltDto dto = new DataPltDto();
|
DataPltDto dto = new DataPltDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item,dto);
|
||||||
@@ -97,12 +81,7 @@ public class InfluxdbDataPltImpl extends MppServiceImpl<RStatDataPltRelationMapp
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataPlt> data;
|
List<DataPlt> data = getMinuteDataPlt(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
data = getWlMinuteDataPlt(lineParam);
|
|
||||||
} else {
|
|
||||||
data = getMinuteDataPlt(lineParam);
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(data)) {
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -222,49 +201,6 @@ public class InfluxdbDataPltImpl extends MppServiceImpl<RStatDataPltRelationMapp
|
|||||||
result.addAll(dataList);
|
result.addAll(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataPlt> getWlMinuteDataPlt(LineCountEvaluateParam lineParam) {
|
|
||||||
List<DataPlt> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineParam.getLineId())) {
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineParam.getLineId()).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
|
|
||||||
lineParam.getLineId().forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataPlt.class);
|
|
||||||
influxQueryWrapper.eq(DataPlt::getLineId, lineId)
|
|
||||||
.eq(DataPlt::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataPlt::getLineId)
|
|
||||||
.select(DataPlt::getPhasicType)
|
|
||||||
.select(DataPlt::getValueType)
|
|
||||||
.between(DataPlt::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
|
||||||
.eq(DataPlt::getQualityFlag, "0");
|
|
||||||
if (CollUtil.isNotEmpty(lineParam.getPhasicType())) {
|
|
||||||
influxQueryWrapper.regular(DataPlt::getPhasicType, lineParam.getPhasicType());
|
|
||||||
}
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataPlt::getCldid,Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataPlt::getCldid,Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
//判断接线方式 (0-星型 1-角型 2-V型) 星型是相电压 角型或者v型是线电压
|
|
||||||
if (Objects.equals(po.getConType(),0)) {
|
|
||||||
//相电压长时闪变
|
|
||||||
influxQueryWrapper.select("Pq_Plt","plt");
|
|
||||||
} else {
|
|
||||||
//线电压长时闪变
|
|
||||||
influxQueryWrapper.select("Pq_LPlt","plt");
|
|
||||||
}
|
|
||||||
result.addAll(dataPltMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -273,8 +209,6 @@ public class InfluxdbDataPltImpl extends MppServiceImpl<RStatDataPltRelationMapp
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,6 @@ import cn.hutool.core.collection.ListUtil;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
|
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
|
||||||
import com.njcn.dataProcess.constant.PhaseType;
|
import com.njcn.dataProcess.constant.PhaseType;
|
||||||
import com.njcn.dataProcess.dao.imapper.DataVMapper;
|
import com.njcn.dataProcess.dao.imapper.DataVMapper;
|
||||||
@@ -38,7 +34,6 @@ import java.time.LocalDateTime;
|
|||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,10 +46,6 @@ import java.util.stream.Collectors;
|
|||||||
public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper, RStatDataVD> implements IDataV {
|
public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper, RStatDataVD> implements IDataV {
|
||||||
|
|
||||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
@Resource
|
|
||||||
private CsLineFeignClient csLineFeignClient;
|
|
||||||
@Resource
|
|
||||||
private EquipmentFeignClient equipmentFeignClient;
|
|
||||||
|
|
||||||
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
put("AB", "A");
|
put("AB", "A");
|
||||||
@@ -137,12 +128,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
@Override
|
@Override
|
||||||
public List<DataVDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataVDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataVDto> result = new ArrayList<>();
|
List<DataVDto> result = new ArrayList<>();
|
||||||
List<DataV> list;
|
List<DataV> list = getMinuteDataV(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
list = getWlMinuteDataV(lineParam);
|
|
||||||
} else {
|
|
||||||
list = getMinuteDataV(lineParam);
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(list)) {
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
DataVDto dto = new DataVDto();
|
DataVDto dto = new DataVDto();
|
||||||
@@ -226,12 +212,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
List<DataV> dataVList;
|
List<DataV> dataVList = getMinuteDataV(lineParam);
|
||||||
if (Objects.equals(lineParam.getType(), 2)) {
|
|
||||||
dataVList = getWlMinuteDataV(lineParam);
|
|
||||||
} else {
|
|
||||||
dataVList = getMinuteDataV(lineParam);
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(dataVList)) {
|
if (CollectionUtil.isNotEmpty(dataVList)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
@@ -481,81 +462,6 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
influxQueryWrapper.regular(DataV::getPhasicType, lineParam.getPhasicType());
|
influxQueryWrapper.regular(DataV::getPhasicType, lineParam.getPhasicType());
|
||||||
}
|
}
|
||||||
quality(result, influxQueryWrapper, lineParam);
|
quality(result, influxQueryWrapper, lineParam);
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按监测点集合、时间条件获取dataV分钟数据
|
|
||||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
|
||||||
*/
|
|
||||||
public List<DataV> getWlMinuteDataV(LineCountEvaluateParam lineParam) {
|
|
||||||
List<DataV> result = new ArrayList<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(lineParam.getLineId())) {
|
|
||||||
//fixme 这边查询的数据可以缓存起来,因为日表计算时可以使用
|
|
||||||
//获取监测点信息
|
|
||||||
List<CsLinePO> line = csLineFeignClient.queryLineById(lineParam.getLineId()).getData();
|
|
||||||
Map<String, CsLinePO> lineMap = line.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
|
||||||
//获取设备信息
|
|
||||||
List<String> devList = line.stream().map(CsLinePO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryDTO> dev = equipmentFeignClient.queryDeviceById(devList).getData();
|
|
||||||
Map<String, CsEquipmentDeliveryDTO> devsMap = dev.stream().collect(Collectors.toMap(CsEquipmentDeliveryDTO::getId, Function.identity()));
|
|
||||||
lineParam.getLineId().forEach(lineId -> {
|
|
||||||
String devId = lineMap.get(lineId).getDeviceId();
|
|
||||||
CsLinePO po = lineMap.get(lineId);
|
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
|
||||||
influxQueryWrapper.eq(DataV::getLineId, lineId)
|
|
||||||
.eq(DataV::getProcess, Integer.toString(devsMap.get(devId).getProcess()))
|
|
||||||
.select(DataV::getLineId)
|
|
||||||
.select(DataV::getPhasicType)
|
|
||||||
.select(DataV::getValueType)
|
|
||||||
//频率
|
|
||||||
.select("Pq_Freq", "freq")
|
|
||||||
//频率偏差
|
|
||||||
.select("Pq_FreqDev", "freq_dev")
|
|
||||||
//相电压有效值
|
|
||||||
.select("Pq_RmsU", "rms")
|
|
||||||
//线电压有效值
|
|
||||||
.select("Pq_RmsLU", "rms_lvr")
|
|
||||||
//电压负序
|
|
||||||
.select("Pq_SeqNegU", "v_neg")
|
|
||||||
//电压正序
|
|
||||||
.select("Pq_SeqPosU", "v_pos")
|
|
||||||
//电压零序
|
|
||||||
.select("Pq_SeqZeroU", "v_zero")
|
|
||||||
//电压负序不平衡度
|
|
||||||
.select("Pq_UnbalNegU", "v_unbalance")
|
|
||||||
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
|
||||||
.eq(DataV::getQualityFlag, "0");
|
|
||||||
if (CollUtil.isNotEmpty(lineParam.getPhasicType())) {
|
|
||||||
influxQueryWrapper.regular(DataV::getPhasicType, lineParam.getPhasicType());
|
|
||||||
}
|
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
|
||||||
influxQueryWrapper.eq(DataV::getCldid, Integer.toString(po.getClDid()));
|
|
||||||
} else {
|
|
||||||
influxQueryWrapper.eq(DataV::getCldid, Integer.toString(po.getLineNo()));
|
|
||||||
}
|
|
||||||
//判断接线方式 (0-星型 1-角型 2-V型) 星型是相电压 角型或者v型是线电压
|
|
||||||
if (Objects.equals(po.getConType(), 0)) {
|
|
||||||
//相电压偏差
|
|
||||||
influxQueryWrapper.select("Pq_UDev", "vu_dev");
|
|
||||||
//相电压谐波总畸变率
|
|
||||||
influxQueryWrapper.select("Pq_ThdU", "v_thd");
|
|
||||||
//相电压基波有效值
|
|
||||||
influxQueryWrapper.select("Pq_RmsFundU", "v_1");
|
|
||||||
//2-50次 相电压谐波有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmUV_", "v_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
} else {
|
|
||||||
//线电压偏差
|
|
||||||
influxQueryWrapper.select("Pq_LUDev", "vu_dev");
|
|
||||||
//线电压谐波总畸变率
|
|
||||||
influxQueryWrapper.select("Pq_ThdLU", "v_thd");
|
|
||||||
//线电压基波有效值
|
|
||||||
influxQueryWrapper.select("Pq_RmsFundLU", "v_1");
|
|
||||||
//2-50次 线电压谐波有效值
|
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmLUV_", "v_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
|
||||||
}
|
|
||||||
result.addAll(dataVMapper.selectByQueryWrapper(influxQueryWrapper));
|
|
||||||
});
|
|
||||||
if (CollectionUtil.isNotEmpty(result)) {
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
result.forEach(item -> {
|
result.forEach(item -> {
|
||||||
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
String newType = PHASE_MAPPING.get(item.getPhasicType());
|
||||||
@@ -564,7 +470,6 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
|
||||||
import com.njcn.message.api.fallback.ProduceFeignClientFallbackFactory;
|
import com.njcn.message.api.fallback.ProduceFeignClientFallbackFactory;
|
||||||
|
import com.njcn.message.message.AskFileSysMessage;
|
||||||
import com.njcn.message.message.DeviceRebootMessage;
|
import com.njcn.message.message.DeviceRebootMessage;
|
||||||
import com.njcn.message.message.ProcessRebootMessage;
|
import com.njcn.message.message.ProcessRebootMessage;
|
||||||
import com.njcn.message.message.RecallMessage;
|
import com.njcn.message.message.RecallMessage;
|
||||||
@@ -38,4 +39,7 @@ public interface ProduceFeignClient {
|
|||||||
|
|
||||||
public HttpResult<Boolean> askRestartProcess(@RequestBody ProcessRebootMessage message);
|
public HttpResult<Boolean> askRestartProcess(@RequestBody ProcessRebootMessage message);
|
||||||
|
|
||||||
|
@PostMapping("/askFileSys")
|
||||||
|
public HttpResult<String> askFileSys(@RequestBody AskFileSysMessage message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
|
||||||
import com.njcn.message.api.ProduceFeignClient;
|
import com.njcn.message.api.ProduceFeignClient;
|
||||||
|
import com.njcn.message.message.AskFileSysMessage;
|
||||||
import com.njcn.message.message.DeviceRebootMessage;
|
import com.njcn.message.message.DeviceRebootMessage;
|
||||||
import com.njcn.message.message.ProcessRebootMessage;
|
import com.njcn.message.message.ProcessRebootMessage;
|
||||||
import com.njcn.message.message.RecallMessage;
|
import com.njcn.message.message.RecallMessage;
|
||||||
@@ -53,6 +54,12 @@ public class ProduceFeignClientFallbackFactory implements FallbackFactory<Produc
|
|||||||
log.error("{}异常,降级处理,异常为:{}", "进程重启", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "进程重启", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> askFileSys(AskFileSysMessage message) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "请求装置文件系统", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ public interface BusinessTopic {
|
|||||||
String ASK_REAL_DATA_TOPIC = "ask_real_data_topic";
|
String ASK_REAL_DATA_TOPIC = "ask_real_data_topic";
|
||||||
String RECALL_TOPIC = "recall_Topic";
|
String RECALL_TOPIC = "recall_Topic";
|
||||||
|
|
||||||
|
String FILE_TOPIC = "File_Topic";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************************数据中心*********************************/
|
/********************************数据中心*********************************/
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.message.message;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/12/13 10:15【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AskFileSysMessage {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* guid : sdghsfdhfdhdfhdfghd234234534534
|
||||||
|
* frontid : dhdfhdfghd2342
|
||||||
|
* ProcessNo : 1
|
||||||
|
* devid : 167456737637374567
|
||||||
|
* type : 2
|
||||||
|
* Path : /remote/vol1_stat.txt
|
||||||
|
* DevPath : /etc/vol1_stat.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String guid;
|
||||||
|
private String nodeId;
|
||||||
|
private int processNo;
|
||||||
|
private String devId;
|
||||||
|
private int type;
|
||||||
|
private String path;
|
||||||
|
private String remotePath;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.message.messagedto;
|
||||||
|
|
||||||
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2026/04/29 下午 3:16【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FileSysDTO<T> extends BaseMessage implements Serializable {
|
||||||
|
private String guid;
|
||||||
|
private String nodeId;
|
||||||
|
private int processNo;
|
||||||
|
private String devId;
|
||||||
|
private int type;
|
||||||
|
private String path;
|
||||||
|
private String devPath;
|
||||||
|
private int result;
|
||||||
|
private T detail;
|
||||||
|
}
|
||||||
@@ -33,7 +33,7 @@ import java.util.Objects;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "Device_Run_Flag_Topic",
|
topic = "Device_Run_Flag_Topic",
|
||||||
consumerGroup = "Device_Run_Flag_Consumer",
|
consumerGroup = "Device_Run_Flag_Consumer",
|
||||||
selectorExpression = "*",
|
selectorExpression = "Test_Tag||Test_Keys",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
package com.njcn.message.consumer;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.njcn.message.constant.MessageStatus;
|
||||||
|
import com.njcn.message.constant.RedisKeyPrefix;
|
||||||
|
import com.njcn.message.messagedto.FileSysDTO;
|
||||||
|
import com.njcn.message.messagedto.MessageDataDTO;
|
||||||
|
import com.njcn.message.websocket.WebSocketServer;
|
||||||
|
import com.njcn.middle.rocket.constant.EnhanceMessageConstant;
|
||||||
|
import com.njcn.middle.rocket.handler.EnhanceConsumerMessageHandler;
|
||||||
|
import com.njcn.redis.pojo.enums.RedisKeyEnum;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.system.api.RocketMqLogFeignClient;
|
||||||
|
import com.njcn.system.pojo.po.RocketmqMsgErrorLog;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
|
import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/12/13 10:06【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@RocketMQMessageListener(
|
||||||
|
topic = "File_Reply_Topic",
|
||||||
|
consumerGroup = "file_sys_consumer",
|
||||||
|
consumeThreadNumber = 10,
|
||||||
|
enableMsgTrace = true
|
||||||
|
)
|
||||||
|
@Slf4j
|
||||||
|
public class FileSysDataConsumer extends EnhanceConsumerMessageHandler<FileSysDTO> implements RocketMQListener<String> {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
@Resource
|
||||||
|
private StringRedisTemplate stringRedisTemplate;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RocketMqLogFeignClient rocketMqLogFeignClient;
|
||||||
|
@Override
|
||||||
|
public void onMessage(String message) {
|
||||||
|
|
||||||
|
FileSysDTO messageDataDTO = JSONObject.parseObject(message, FileSysDTO.class);
|
||||||
|
super.dispatchMessage(messageDataDTO);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 通过redis分布式锁判断当前消息所处状态
|
||||||
|
* 1、null 查不到该key的数据,属于第一次消费,放行
|
||||||
|
* 2、fail 上次消息消费时发生异常,放行
|
||||||
|
* 3、being processed 正在处理,打回去
|
||||||
|
* 4、success 最近72小时消费成功,避免重复消费,打回去
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean filter(FileSysDTO message) {
|
||||||
|
String keyStatus = redisUtil.getStringByKey(RedisKeyPrefix.REAL_TIME_DATA.concat(message.getKey()));
|
||||||
|
if (Objects.isNull(keyStatus) || keyStatus.equalsIgnoreCase(MessageStatus.FAIL)) {
|
||||||
|
|
||||||
|
redisUtil.saveByKeyWithExpire(RedisKeyPrefix.REAL_TIME_DATA.concat(message.getKey()), MessageStatus.BEING_PROCESSED, 30L);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 消费成功,缓存到redis5分钟,避免重复消费
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void consumeSuccess(FileSysDTO message) {
|
||||||
|
// redisUtil.saveByKeyWithExpire(RedisKeyPrefix.REAL_TIME_DATA.concat(message.getKey()), MessageStatus.SUCCESS, 5*60L);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void handleMessage(FileSysDTO message) {
|
||||||
|
|
||||||
|
String msgId = message.getGuid();
|
||||||
|
// 1. 将结果存入 Redis,过期时间 60 秒(足够完成请求)
|
||||||
|
String key = "pending:" + msgId;
|
||||||
|
redisUtil.saveByKeyWithExpire(key, message, 60L);
|
||||||
|
// 2. 发布 Redis 通知,让等待的实例知道结果已就绪
|
||||||
|
stringRedisTemplate.convertAndSend("result_ready_channel", msgId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发生异常时,进行错误信息入库保存
|
||||||
|
* 默认没有实现类,子类可以实现该方法,调用feign接口进行入库保存
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void saveExceptionMsgLog(FileSysDTO message, String identity, Exception exception) {
|
||||||
|
redisUtil.saveByKeyWithExpire(RedisKeyPrefix.REAL_TIME_DATA.concat(message.getKey()), MessageStatus.FAIL, RedisKeyEnum.ROCKET_MQ_KEY.getTime());
|
||||||
|
RocketmqMsgErrorLog rocketmqMsgErrorLog = new RocketmqMsgErrorLog();
|
||||||
|
rocketmqMsgErrorLog.setMsgKey(message.getKey());
|
||||||
|
rocketmqMsgErrorLog.setResource(message.getSource());
|
||||||
|
if (identity.equalsIgnoreCase(EnhanceMessageConstant.IDENTITY_SINGLE)) {
|
||||||
|
//数据库字段配置长度200,避免插入失败,大致分析异常原因
|
||||||
|
String exceptionMsg = exception.getMessage();
|
||||||
|
if(exceptionMsg.length() > 200){
|
||||||
|
exceptionMsg = exceptionMsg.substring(0,180);
|
||||||
|
}
|
||||||
|
rocketmqMsgErrorLog.setRecord(exceptionMsg);
|
||||||
|
//如果是当前消息重试的则略过
|
||||||
|
if(!message.getSource().startsWith(EnhanceMessageConstant.RETRY_PREFIX)){
|
||||||
|
//单次消费异常
|
||||||
|
rocketMqLogFeignClient.add(rocketmqMsgErrorLog);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rocketmqMsgErrorLog.setRecord("重试消费" + super.getMaxRetryTimes() + "次,依旧消费失败。");
|
||||||
|
//重试N次后,依然消费异常
|
||||||
|
rocketMqLogFeignClient.add(rocketmqMsgErrorLog);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 处理失败后,是否重试
|
||||||
|
* 一般开启
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected boolean isRetry() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 消费失败是否抛出异常,抛出异常后就不再消费了
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected boolean throwException() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "LN_Topic",
|
topic = "LN_Topic",
|
||||||
consumerGroup = "ln_consumer",
|
consumerGroup = "ln_consumer",
|
||||||
selectorExpression = "*",
|
selectorExpression = "Test_Tag||Test_Keys",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import java.util.Objects;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "Heart_Beat_Topic",
|
topic = "Heart_Beat_Topic",
|
||||||
consumerGroup = "Heartb_Beat_Topic_Consumer",
|
consumerGroup = "Heartb_Beat_Topic_Consumer",
|
||||||
selectorExpression = "*",
|
selectorExpression = "Test_Tag||Test_Keys",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import java.util.Objects;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "Real_Time_Data_Topic",
|
topic = "Real_Time_Data_Topic",
|
||||||
consumerGroup = "real_time_consumer",
|
consumerGroup = "real_time_consumer",
|
||||||
selectorExpression = "*",
|
selectorExpression = "Test_Tag||Test_Keys",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import java.util.Objects;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "log_Topic",
|
topic = "log_Topic",
|
||||||
consumerGroup = "Log_Topic_Consumer",
|
consumerGroup = "Log_Topic_Consumer",
|
||||||
selectorExpression = "*",
|
selectorExpression = "Test_Tag||Test_Keys",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import java.util.Objects;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "Topic_Reply_Topic",
|
topic = "Topic_Reply_Topic",
|
||||||
consumerGroup = "Topic_Reply_Topic_Consumer",
|
consumerGroup = "Topic_Reply_Topic_Consumer",
|
||||||
selectorExpression = "*",
|
selectorExpression = "Test_Tag||Test_Keys",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,9 +7,11 @@ 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.message.message.AskFileSysMessage;
|
||||||
import com.njcn.message.message.DeviceRebootMessage;
|
import com.njcn.message.message.DeviceRebootMessage;
|
||||||
import com.njcn.message.message.ProcessRebootMessage;
|
import com.njcn.message.message.ProcessRebootMessage;
|
||||||
import com.njcn.message.message.RecallMessage;
|
import com.njcn.message.message.RecallMessage;
|
||||||
|
import com.njcn.message.produce.template.AskFileSysMessaggeTemplate;
|
||||||
import com.njcn.message.produce.template.DeviceRebootMessageTemplate;
|
import com.njcn.message.produce.template.DeviceRebootMessageTemplate;
|
||||||
import com.njcn.message.produce.template.ProcessRebootMessageTemplate;
|
import com.njcn.message.produce.template.ProcessRebootMessageTemplate;
|
||||||
import com.njcn.message.produce.template.RecallMessaggeTemplate;
|
import com.njcn.message.produce.template.RecallMessaggeTemplate;
|
||||||
@@ -40,6 +42,7 @@ public class ProduceController extends BaseController {
|
|||||||
|
|
||||||
private final ProcessRebootMessageTemplate processRebootMessageTemplate;
|
private final ProcessRebootMessageTemplate processRebootMessageTemplate;
|
||||||
|
|
||||||
|
private final AskFileSysMessaggeTemplate askFileSysMessaggeTemplate;
|
||||||
|
|
||||||
@PostMapping("/recall")
|
@PostMapping("/recall")
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@@ -76,4 +79,14 @@ public class ProduceController extends BaseController {
|
|||||||
processRebootMessageTemplate.sendMember(baseMessage,message.getNodeId());
|
processRebootMessageTemplate.sendMember(baseMessage,message.getNodeId());
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/askFileSys")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("请求文件系统")
|
||||||
|
@ApiImplicitParam(name = "message", value = "参数", required = true)
|
||||||
|
public HttpResult<String> askFileSys(@RequestBody AskFileSysMessage message){
|
||||||
|
String methodDescribe = getMethodDescribe("askFileSys");
|
||||||
|
SendResult sendResult = askFileSysMessaggeTemplate.sendMember(message);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,message.getGuid() , methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.message.produce.template;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.njcn.message.constant.BusinessResource;
|
||||||
|
import com.njcn.message.constant.BusinessTopic;
|
||||||
|
import com.njcn.message.message.AskFileSysMessage;
|
||||||
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
|
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||||
|
import org.apache.rocketmq.client.producer.SendResult;
|
||||||
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/12/13 15:15【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class AskFileSysMessaggeTemplate extends RocketMQEnhanceTemplate {
|
||||||
|
public AskFileSysMessaggeTemplate(RocketMQTemplate template) {
|
||||||
|
super(template);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendResult sendMember(AskFileSysMessage askRealDataMessage) {
|
||||||
|
BaseMessage baseMessage = new BaseMessage();
|
||||||
|
baseMessage.setMessageBody(JSONObject.toJSONString(askRealDataMessage));
|
||||||
|
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
|
baseMessage.setKey(askRealDataMessage.getGuid());
|
||||||
|
return send(BusinessTopic.FILE_TOPIC,askRealDataMessage.getNodeId() , baseMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
package com.njcn.message.produce.template;
|
package com.njcn.message.produce.template;
|
||||||
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.njcn.message.constant.BusinessResource;
|
import com.njcn.message.constant.BusinessResource;
|
||||||
import com.njcn.message.constant.BusinessTopic;
|
import com.njcn.message.constant.BusinessTopic;
|
||||||
import com.njcn.message.message.AskRealDataMessage;
|
|
||||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||||
import org.apache.rocketmq.client.producer.SendResult;
|
import org.apache.rocketmq.client.producer.SendResult;
|
||||||
@@ -26,8 +24,7 @@ public class AskRealDataMessaggeTemplate extends RocketMQEnhanceTemplate {
|
|||||||
|
|
||||||
public SendResult sendMember(BaseMessage askRealDataMessage,String nodeId) {
|
public SendResult sendMember(BaseMessage askRealDataMessage,String nodeId) {
|
||||||
askRealDataMessage.setSource(BusinessResource.WEB_RESOURCE);
|
askRealDataMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
AskRealDataMessage dto = JSON.parseObject(askRealDataMessage.getMessageBody(), AskRealDataMessage.class);
|
askRealDataMessage.setKey("Test_Keys");
|
||||||
askRealDataMessage.setKey(dto.getLine());
|
return send(nodeId+"_"+BusinessTopic.ASK_REAL_DATA_TOPIC,"Test_Tag" , askRealDataMessage);
|
||||||
return send(BusinessTopic.ASK_REAL_DATA_TOPIC,nodeId , askRealDataMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package com.njcn.message.produce.template;
|
package com.njcn.message.produce.template;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.njcn.message.constant.BusinessResource;
|
import com.njcn.message.constant.BusinessResource;
|
||||||
import com.njcn.message.constant.BusinessTopic;
|
import com.njcn.message.constant.BusinessTopic;
|
||||||
import com.njcn.message.message.AskRealDataMessage;
|
|
||||||
import com.njcn.message.message.DeviceRebootMessage;
|
|
||||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||||
import org.apache.rocketmq.client.producer.SendResult;
|
import org.apache.rocketmq.client.producer.SendResult;
|
||||||
@@ -27,6 +24,7 @@ public class DeviceRebootMessageTemplate extends RocketMQEnhanceTemplate {
|
|||||||
|
|
||||||
public SendResult sendMember(BaseMessage baseMessage,String nodeId) {
|
public SendResult sendMember(BaseMessage baseMessage,String nodeId) {
|
||||||
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
return send(BusinessTopic.CONTROL_TOPIC,nodeId, baseMessage);
|
baseMessage.setKey("Test_Keys");
|
||||||
|
return send(nodeId+"_"+BusinessTopic.CONTROL_TOPIC,"Test_Tag", baseMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package com.njcn.message.produce.template;
|
package com.njcn.message.produce.template;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.njcn.message.constant.BusinessResource;
|
import com.njcn.message.constant.BusinessResource;
|
||||||
import com.njcn.message.constant.BusinessTopic;
|
import com.njcn.message.constant.BusinessTopic;
|
||||||
import com.njcn.message.message.AskRealDataMessage;
|
|
||||||
import com.njcn.message.message.ProcessRebootMessage;
|
|
||||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||||
import org.apache.rocketmq.client.producer.SendResult;
|
import org.apache.rocketmq.client.producer.SendResult;
|
||||||
@@ -27,8 +24,7 @@ public class ProcessRebootMessageTemplate extends RocketMQEnhanceTemplate {
|
|||||||
|
|
||||||
public SendResult sendMember(BaseMessage baseMessage,String nodeId) {
|
public SendResult sendMember(BaseMessage baseMessage,String nodeId) {
|
||||||
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
ProcessRebootMessage dto = JSON.parseObject(baseMessage.getMessageBody(), ProcessRebootMessage.class);
|
baseMessage.setKey("Test_Keys");
|
||||||
baseMessage.setKey(dto.getIndex()+"");
|
return send(nodeId+"_"+BusinessTopic.PROCESS_TOPIC,"Test_Tag", baseMessage);
|
||||||
return send(BusinessTopic.PROCESS_TOPIC,nodeId, baseMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public class RecallMessaggeTemplate extends RocketMQEnhanceTemplate {
|
|||||||
|
|
||||||
public SendResult sendMember(BaseMessage recallMessage,String nodeId) {
|
public SendResult sendMember(BaseMessage recallMessage,String nodeId) {
|
||||||
recallMessage.setSource(BusinessResource.WEB_RESOURCE);
|
recallMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
return send(BusinessTopic.RECALL_TOPIC,nodeId , recallMessage);
|
recallMessage.setKey("Test_Keys");
|
||||||
|
return send(nodeId+"_"+BusinessTopic.RECALL_TOPIC,"Test_Tag" , recallMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user