1.监测点超标信息详情统计
2.终端在线率统计
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
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.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.pojo.dto.RStatOnlineRateDto;
|
||||
import com.njcn.dataProcess.service.IOnlineRate;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 19:48
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping("/dataOnlineRate")
|
||||
@Api(tags = "终端在线率获取")
|
||||
public class DataOnlineRateController extends BaseController {
|
||||
|
||||
@QueryBean
|
||||
private IOnlineRate onlineRateQuery;
|
||||
|
||||
@InsertBean
|
||||
private IOnlineRate onlineRateInsert;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/batchInsertion")
|
||||
@ApiOperation("批量插入")
|
||||
public HttpResult<String> batchInsertion(@RequestBody List<RStatOnlineRateDto.Detail> dataVDTOList) {
|
||||
String methodDescribe = getMethodDescribe("batchInsertion");
|
||||
onlineRateInsert.batchInsertion(dataVDTOList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -95,6 +95,15 @@ public class DataVController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getCountRawData")
|
||||
@ApiOperation("获取总条目数量")
|
||||
public HttpResult<Integer> getCountRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getCountRawData");
|
||||
Integer data = dataVQuery.getCountRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getBaseData")
|
||||
@ApiOperation("获取算法基础数据")
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatOnlineRateD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
* @author web2023
|
||||
*/
|
||||
public interface RStatOnlineRateDMapper extends MppBaseMapper<RStatOnlineRateD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -38,6 +38,13 @@ public interface IDataV extends IMppService<RStatDataVD> {
|
||||
*/
|
||||
List<DataVDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取总条目数量
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
Integer getCountRawData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取监测点原始数据
|
||||
* @param lineParam 监测点参数
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||
import com.njcn.dataProcess.pojo.dto.RStatOnlineRateDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatLimitRateD;
|
||||
import com.njcn.dataProcess.pojo.po.RStatOnlineRateD;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/6 10:22
|
||||
*/
|
||||
public interface IOnlineRate extends IMppService<RStatOnlineRateD>{
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
* @param onlineRateList
|
||||
*/
|
||||
void batchInsertion(List<RStatOnlineRateDto.Detail> onlineRateList);
|
||||
|
||||
}
|
||||
@@ -140,6 +140,33 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getCountRawData(LineCountEvaluateParam lineParam) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||
influxQueryWrapper.regular(DataV::getLineId,lineParam.getLineId())
|
||||
.select(DataV::getLineId)
|
||||
.select(DataV::getPhasicType)
|
||||
.select(DataV::getValueType)
|
||||
.select(DataV::getFreq)
|
||||
.select(DataV::getFreqDev)
|
||||
.select(DataV::getRms)
|
||||
.select(DataV::getRmsLvr)
|
||||
.select(DataV::getVNeg)
|
||||
.select(DataV::getVPos)
|
||||
.select(DataV::getVThd)
|
||||
.select(DataV::getVUnbalance)
|
||||
.select(DataV::getVZero)
|
||||
.select(DataV::getVlDev)
|
||||
.select(DataV::getVuDev)
|
||||
.select(DataV::getQualityFlag)
|
||||
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||
.limit(1)
|
||||
;
|
||||
List<DataV> dataVS = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
return dataVS.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
List<CommonMinuteDto> result = new ArrayList<>();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatOnlineRateDMapper;
|
||||
import com.njcn.dataProcess.pojo.dto.RStatOnlineRateDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatOnlineRateD;
|
||||
import com.njcn.dataProcess.service.IOnlineRate;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/6 10:22
|
||||
*/
|
||||
@Service("InfluxdbOnlineRateImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbOnlineRateImpl extends MppServiceImpl<RStatOnlineRateDMapper, RStatOnlineRateD> implements IOnlineRate {
|
||||
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<RStatOnlineRateDto.Detail> onlineRateList) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,11 @@ public class RelationDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getCountRawData(LineCountEvaluateParam lineParam) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatOnlineRateDMapper;
|
||||
import com.njcn.dataProcess.pojo.dto.RStatOnlineRateDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatOnlineRateD;
|
||||
import com.njcn.dataProcess.service.IOnlineRate;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/6 10:22
|
||||
*/
|
||||
@Service("RelationOnlineRateImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class RelationOnlineRateImpl extends MppServiceImpl<RStatOnlineRateDMapper, RStatOnlineRateD> implements IOnlineRate {
|
||||
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<RStatOnlineRateDto.Detail> onlineRateList) {
|
||||
List<RStatOnlineRateD> result = new ArrayList<>();
|
||||
onlineRateList.forEach(item->{
|
||||
RStatOnlineRateD onlineRate = new RStatOnlineRateD();
|
||||
BeanUtils.copyProperties(item, onlineRate);
|
||||
result.add(onlineRate);
|
||||
});
|
||||
this.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user