bug调整
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package com.njcn.csdevice.controller.equipment;
|
package com.njcn.csdevice.controller.equipment;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
|
||||||
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
@@ -81,18 +80,21 @@ public class DeviceFtpController extends BaseController {
|
|||||||
})
|
})
|
||||||
public HttpResult<String> downloadFile(@RequestParam("nDid") String nDid, @RequestParam("name") String name, @RequestParam("size") Integer size, @RequestParam("fileCheck") String fileCheck){
|
public HttpResult<String> downloadFile(@RequestParam("nDid") String nDid, @RequestParam("name") String name, @RequestParam("size") Integer size, @RequestParam("fileCheck") String fileCheck){
|
||||||
String methodDescribe = getMethodDescribe("downloadFile");
|
String methodDescribe = getMethodDescribe("downloadFile");
|
||||||
String result = deviceFtpService.downloadFile(nDid,name,size,fileCheck);
|
deviceFtpService.downloadFile(nDid,name,size,fileCheck);
|
||||||
redisUtil.delete("downloadFilePath:"+name);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, "文件下载中,请稍等");
|
||||||
redisUtil.delete("fileCheck"+name);
|
}
|
||||||
redisUtil.delete("fileDowning:"+nDid);
|
|
||||||
if (Objects.isNull(result)) {
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
@PostMapping("/getDownloadFilePath")
|
||||||
} else {
|
@ApiOperation("获取文件下载路径")
|
||||||
int step = (int) Math.ceil((double) size / 51200);
|
@ApiImplicitParams({
|
||||||
String json = "{fileName:"+name+",allStep:"+ step +",nowStep:"+ step +"}";
|
@ApiImplicitParam(name = "nDid", value = "nDid", required = true),
|
||||||
publisher.send("/Web/Progress/" + nDid, new Gson().toJson(json), 1, false);
|
@ApiImplicitParam(name = "name", value = "文件路径名", required = true)
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
})
|
||||||
}
|
public HttpResult<String> getDownloadFilePath(@RequestParam("nDid") String nDid, @RequestParam("name") String name){
|
||||||
|
String methodDescribe = getMethodDescribe("getDownloadFilePath");
|
||||||
|
String result = deviceFtpService.getDownloadFilePath(nDid,name);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ public interface DeviceFtpService {
|
|||||||
|
|
||||||
List<MakeUpVo> askDeviceFileOrDir(String nDid, String name, String type);
|
List<MakeUpVo> askDeviceFileOrDir(String nDid, String name, String type);
|
||||||
|
|
||||||
String downloadFile(String nDid, String name, Integer size, String fileCheck);
|
void downloadFile(String nDid, String name, Integer size, String fileCheck);
|
||||||
|
|
||||||
|
String getDownloadFilePath(String nDid, String name);
|
||||||
|
|
||||||
boolean createFile(String nDid, String path);
|
boolean createFile(String nDid, String path);
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.njcn.csdevice.service.ICsLedgerService;
|
|||||||
import com.njcn.csdevice.util.InfluxDbParamUtil;
|
import com.njcn.csdevice.util.InfluxDbParamUtil;
|
||||||
import com.njcn.csdevice.utils.DataChangeUtil;
|
import com.njcn.csdevice.utils.DataChangeUtil;
|
||||||
import com.njcn.csharmonic.api.EventFeignClient;
|
import com.njcn.csharmonic.api.EventFeignClient;
|
||||||
|
import com.njcn.csharmonic.constant.HarmonicConstant;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||||
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
||||||
@@ -82,49 +83,24 @@ import java.util.stream.Stream;
|
|||||||
public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> implements ICsGroupService {
|
public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> implements ICsGroupService {
|
||||||
|
|
||||||
private final ICsDataArrayService csDataArrayService;
|
private final ICsDataArrayService csDataArrayService;
|
||||||
|
|
||||||
private final CsGroArrMapper csGroArrMapper;
|
private final CsGroArrMapper csGroArrMapper;
|
||||||
|
|
||||||
private final CsGroupMapper csGroupMapper;
|
private final CsGroupMapper csGroupMapper;
|
||||||
|
|
||||||
private final CsDataArrayMapper csDataArrayMapper;
|
private final CsDataArrayMapper csDataArrayMapper;
|
||||||
|
|
||||||
private final CommonService commonService;
|
private final CommonService commonService;
|
||||||
|
|
||||||
private final EpdFeignClient epdFeignClient;
|
private final EpdFeignClient epdFeignClient;
|
||||||
|
|
||||||
private final CsLineFeignClient csLineFeignClient;
|
private final CsLineFeignClient csLineFeignClient;
|
||||||
private final ICsLedgerService iCsLedgerService;
|
private final ICsLedgerService iCsLedgerService;
|
||||||
|
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
private final EquipmentFeignClient equipmentFeignClient;
|
private final EquipmentFeignClient equipmentFeignClient;
|
||||||
|
|
||||||
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
||||||
|
|
||||||
private final EvtDataService evtDataService;
|
private final EvtDataService evtDataService;
|
||||||
|
|
||||||
private final DecimalFormat df = new DecimalFormat("#0.00");
|
private final DecimalFormat df = new DecimalFormat("#0.00");
|
||||||
|
|
||||||
private final EleEvtFeignClient eleEvtFeignClient;
|
private final EleEvtFeignClient eleEvtFeignClient;
|
||||||
|
|
||||||
private final OverlimitMapper overlimitMapper;
|
private final OverlimitMapper overlimitMapper;
|
||||||
|
|
||||||
private final CsDataSetMapper csDataSetMapper;
|
private final CsDataSetMapper csDataSetMapper;
|
||||||
|
|
||||||
private final EventFeignClient eventFeignClient;
|
private final EventFeignClient eventFeignClient;
|
||||||
|
|
||||||
private final InfluxDbParamUtil influxDbParamUtil;
|
private final InfluxDbParamUtil influxDbParamUtil;
|
||||||
|
|
||||||
private final Set<String> POWER_LIST = new HashSet<>(Arrays.asList(
|
|
||||||
"电网有功功率", "电网无功功率", "电网视在功率", "负载有功功率",
|
|
||||||
"负载无功功率", "负载视在功率", "有功功率", "无功功率",
|
|
||||||
"视在功率", "基波有功功率", "基波无功功率",
|
|
||||||
"基波视在功率", "三相总有功功率", "三相总无功功率",
|
|
||||||
"三相总视在功率","相电压总有效值","线电压总有效值","相电压基波有效值","线电压基波有效值","电压正序分量"
|
|
||||||
));
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public List<CsGroupVO> getGroupData(String dataSet) {
|
public List<CsGroupVO> getGroupData(String dataSet) {
|
||||||
@@ -196,6 +172,8 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
}
|
}
|
||||||
if (vo.getAnotherName().contains("A相") || vo.getAnotherName().contains("B相") || vo.getAnotherName().contains("C相")) {
|
if (vo.getAnotherName().contains("A相") || vo.getAnotherName().contains("B相") || vo.getAnotherName().contains("C相")) {
|
||||||
vo.setAnotherName(vo.getAnotherName().substring(0,2));
|
vo.setAnotherName(vo.getAnotherName().substring(0,2));
|
||||||
|
} else if (vo.getAnotherName().contains("AB") || vo.getAnotherName().contains("BC") || vo.getAnotherName().contains("CA")) {
|
||||||
|
vo.setAnotherName(vo.getAnotherName().substring(0,2).concat("相"));
|
||||||
}
|
}
|
||||||
arrayList.add(vo);
|
arrayList.add(vo);
|
||||||
}
|
}
|
||||||
@@ -349,29 +327,39 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
return commonQueryParam;
|
return commonQueryParam;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
||||||
//List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtData(commonQueryParams);
|
|
||||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||||
ThdDataVO vo = new ThdDataVO();
|
ThdDataVO vo = new ThdDataVO();
|
||||||
vo.setLineId(temp.getLineId());
|
vo.setLineId(temp.getLineId());
|
||||||
vo.setPhase(temp.getPhaseType());
|
vo.setPhase(Objects.equals("M",temp.getPhaseType())?null:temp.getPhaseType());
|
||||||
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||||
vo.setPosition(position);
|
vo.setPosition(position);
|
||||||
vo.setTime(temp.getTime());
|
vo.setTime(temp.getTime());
|
||||||
vo.setStatMethod(temp.getValueType());
|
vo.setStatMethod(temp.getValueType());
|
||||||
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||||
if (ObjectUtil.isNotNull(epdPqd.getPrimaryFormula()) && !Objects.equals(csDataSet.getDataLevel(), commonStatisticalQueryParam.getDataLevel())) {
|
double re;
|
||||||
Double re;
|
if (Objects.equals("Primary",commonStatisticalQueryParam.getDataLevel())) {
|
||||||
if ("Primary".equals(csDataSet.getDataLevel())) {
|
if (Objects.equals("Primary",csDataSet.getDataLevel())) {
|
||||||
re = DataChangeUtil.primaryToSecondary(epdPqd.getPrimaryFormula(), temp.getValue(), pt, ct);
|
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||||
|
vo.setUnit(epdPqd.getUnit());
|
||||||
} else {
|
} else {
|
||||||
re = DataChangeUtil.secondaryToPrimary(epdPqd.getPrimaryFormula(), temp.getValue(), pt, ct);
|
if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) {
|
||||||
|
re = DataChangeUtil.secondaryToPrimary(epdPqd.getPrimaryFormula(), temp.getValue(), pt, ct) / 1000;
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
vo.setUnit("k" + epdPqd.getUnit());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
|
||||||
} else {
|
} else {
|
||||||
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
if (Objects.equals("Primary",csDataSet.getDataLevel())) {
|
||||||
|
if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) {
|
||||||
|
re = DataChangeUtil.primaryToSecondary(epdPqd.getPrimaryFormula(), temp.getValue(), pt, ct);
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||||
|
}
|
||||||
|
vo.setUnit(epdPqd.getUnit());
|
||||||
}
|
}
|
||||||
vo.setStatisticalIndex(epdPqd.getId());
|
vo.setStatisticalIndex(epdPqd.getId());
|
||||||
vo.setUnit(epdPqd.getUnit());
|
|
||||||
vo.setStatisticalName(epdPqd.getName());
|
vo.setStatisticalName(epdPqd.getName());
|
||||||
vo.setAnotherName(epdPqd.getShowName());
|
vo.setAnotherName(epdPqd.getShowName());
|
||||||
return vo;
|
return vo;
|
||||||
@@ -413,7 +401,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||||
ThdDataVO vo = new ThdDataVO();
|
ThdDataVO vo = new ThdDataVO();
|
||||||
vo.setLineId(temp.getLineId());
|
vo.setLineId(temp.getLineId());
|
||||||
vo.setPhase(temp.getPhaseType());
|
vo.setPhase(Objects.equals("M",temp.getPhaseType())?null:temp.getPhaseType());
|
||||||
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||||
vo.setPosition(position);
|
vo.setPosition(position);
|
||||||
vo.setTime(temp.getTime());
|
vo.setTime(temp.getTime());
|
||||||
@@ -555,7 +543,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||||
ThdDataVO vo = new ThdDataVO();
|
ThdDataVO vo = new ThdDataVO();
|
||||||
vo.setLineId(temp.getLineId());
|
vo.setLineId(temp.getLineId());
|
||||||
vo.setPhase(temp.getPhaseType());
|
vo.setPhase(Objects.equals("M",temp.getPhaseType())?null:temp.getPhaseType());
|
||||||
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||||
vo.setPosition(position);
|
vo.setPosition(position);
|
||||||
vo.setTime(temp.getTime());
|
vo.setTime(temp.getTime());
|
||||||
@@ -655,7 +643,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||||
ThdDataVO vo = new ThdDataVO();
|
ThdDataVO vo = new ThdDataVO();
|
||||||
vo.setLineId(temp.getLineId());
|
vo.setLineId(temp.getLineId());
|
||||||
vo.setPhase(temp.getPhaseType());
|
vo.setPhase(Objects.equals("M",temp.getPhaseType())?null:temp.getPhaseType());
|
||||||
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||||
vo.setPosition(position);
|
vo.setPosition(position);
|
||||||
vo.setTime(temp.getTime());
|
vo.setTime(temp.getTime());
|
||||||
@@ -821,9 +809,12 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断功率是否需要转换
|
//判断指标是否需要转换
|
||||||
public boolean changePower(String name) {
|
public boolean changePower(String name) {
|
||||||
return POWER_LIST.stream()
|
if(name.contains("相角")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return HarmonicConstant.POWER_LIST.stream()
|
||||||
.anyMatch(name::contains);
|
.anyMatch(name::contains);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.njcn.oss.utils.FileStorageUtil;
|
|||||||
import com.njcn.redis.pojo.enums.AppRedisKey;
|
import com.njcn.redis.pojo.enums.AppRedisKey;
|
||||||
import com.njcn.redis.utils.RedisUtil;
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
@@ -86,8 +87,8 @@ public class DeviceFtpServiceImpl implements DeviceFtpService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String downloadFile(String nDid, String name, Integer size, String fileCheck) {
|
@Async
|
||||||
String result = null;
|
public void downloadFile(String nDid, String name, Integer size, String fileCheck) {
|
||||||
judgeClientOnline(nDid);
|
judgeClientOnline(nDid);
|
||||||
Object task = redisUtil.getObjectByKey("fileDowning:"+nDid);
|
Object task = redisUtil.getObjectByKey("fileDowning:"+nDid);
|
||||||
if (Objects.nonNull(task)) {
|
if (Objects.nonNull(task)) {
|
||||||
@@ -98,25 +99,26 @@ public class DeviceFtpServiceImpl implements DeviceFtpService {
|
|||||||
throw new BusinessException(AlgorithmResponseEnum.FILE_BUSY);
|
throw new BusinessException(AlgorithmResponseEnum.FILE_BUSY);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
redisUtil.delete("downloadFilePath:"+name);
|
redisUtil.delete("downloadFilePath:"+ nDid + name);
|
||||||
boolean file = askDeviceDataFeignClient.downloadFile(nDid,name,size,fileCheck).getData();
|
askDeviceDataFeignClient.downloadFile(nDid,name,size,fileCheck).getData();
|
||||||
if (!file) {
|
|
||||||
redisUtil.delete("fileDowning:"+nDid);
|
|
||||||
redisUtil.delete("fileCheck"+name);
|
|
||||||
throw new BusinessException(AlgorithmResponseEnum.FILE_DOWNLOAD_ERROR);
|
|
||||||
}
|
|
||||||
Object object = redisUtil.getObjectByKey("downloadFilePath:"+name);
|
|
||||||
if (Objects.nonNull(object)) {
|
|
||||||
result = (String) object;
|
|
||||||
redisUtil.delete("downloadFilePath:"+name);
|
|
||||||
redisUtil.delete("fileCheck"+name);
|
|
||||||
redisUtil.delete("fileDowning:"+nDid);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
redisUtil.delete("fileDowning:"+nDid);
|
redisUtil.delete("fileDowning:"+nDid);
|
||||||
redisUtil.delete("fileCheck"+name);
|
redisUtil.delete("fileCheck"+nDid+name);
|
||||||
throw new BusinessException(AlgorithmResponseEnum.FILE_DOWNLOADING);
|
throw new BusinessException(AlgorithmResponseEnum.FILE_DOWNLOADING);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDownloadFilePath(String nDid, String name) {
|
||||||
|
String result = null;
|
||||||
|
Object object = redisUtil.getObjectByKey("downloadFilePath:" + nDid + name);
|
||||||
|
if (Objects.nonNull(object)) {
|
||||||
|
result = (String) object;
|
||||||
|
redisUtil.delete("downloadFilePath:" + nDid + name);
|
||||||
|
}
|
||||||
|
redisUtil.delete("fileCheck"+nDid+name);
|
||||||
|
redisUtil.delete("fileDowning:"+nDid);
|
||||||
|
redisUtil.delete(AppRedisKey.FILE_PART.concat(name));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||||
ThdDataVO vo = new ThdDataVO();
|
ThdDataVO vo = new ThdDataVO();
|
||||||
vo.setLineId(temp.getLineId());
|
vo.setLineId(temp.getLineId());
|
||||||
vo.setPhase(temp.getPhaseType());
|
vo.setPhase(Objects.equals("M",temp.getPhaseType())?null:temp.getPhaseType());
|
||||||
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||||
vo.setPosition(position);
|
vo.setPosition(position);
|
||||||
vo.setTime(temp.getTime());
|
vo.setTime(temp.getTime());
|
||||||
|
|||||||
@@ -73,12 +73,11 @@ public interface HarmonicConstant {
|
|||||||
|
|
||||||
String CTRL_DATA = "ctrl_data";
|
String CTRL_DATA = "ctrl_data";
|
||||||
|
|
||||||
|
|
||||||
Set<String> POWER_LIST = new HashSet<>(Arrays.asList(
|
Set<String> POWER_LIST = new HashSet<>(Arrays.asList(
|
||||||
"电网有功功率", "电网无功功率", "电网视在功率", "负载有功功率",
|
"电网有功功率", "电网无功功率", "电网视在功率", "负载有功功率",
|
||||||
"负载无功功率", "负载视在功率", "有功功率", "无功功率",
|
"负载无功功率", "负载视在功率", "有功功率", "无功功率",
|
||||||
"视在功率", "基波有功功率", "基波无功功率",
|
"视在功率", "基波有功功率", "基波无功功率",
|
||||||
"基波视在功率", "三相总有功功率", "三相总无功功率",
|
"基波视在功率", "三相总有功功率", "三相总无功功率",
|
||||||
"三相总视在功率"
|
"三相总视在功率","相电压总有效值","线电压总有效值","相电压基波有效值","线电压基波有效值","电压正序分量"
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,8 +127,11 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//判断功率是否需要转换
|
//判断指标是否需要转换
|
||||||
public boolean changePower(String name) {
|
public boolean changePower(String name) {
|
||||||
|
if(name.contains("相角")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return POWER_LIST.stream()
|
return POWER_LIST.stream()
|
||||||
.anyMatch(name::contains);
|
.anyMatch(name::contains);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user