Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -6,10 +6,13 @@ 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.dto.DataFlickerDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataFlickerDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataIDto;
|
||||
import com.njcn.dataProcess.service.IDataFlicker;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -54,9 +57,31 @@ public class DataFlickerController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getRawData")
|
||||
@ApiOperation("获取原始数据")
|
||||
public HttpResult<List<DataFlickerDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<DataFlickerDto> data = dataFlickerQuery.getRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getBaseData")
|
||||
@ApiOperation("获取算法基础数据")
|
||||
public HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getBaseData");
|
||||
List<CommonMinuteDto> data = dataFlickerQuery.getBaseData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("关系型数据库插入数据")
|
||||
public HttpResult<String> addList(@RequestBody List<DataFlickerDto> dataFlickerDtoList) {
|
||||
String methodDescribe = getMethodDescribe("addList");
|
||||
dataFlickerInsert.addList(dataFlickerDtoList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "", methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,9 +6,12 @@ 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.dto.DataFlucDTO;
|
||||
import com.njcn.dataProcess.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.dto.DataFlucDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataFlucDto;
|
||||
import com.njcn.dataProcess.service.IDataFluc;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -42,7 +45,6 @@ public class DataFlucController extends BaseController {
|
||||
@InsertBean
|
||||
private IDataFluc dataFlucInsert;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/batchInsertion")
|
||||
@ApiOperation("批量插入")
|
||||
@@ -53,9 +55,31 @@ public class DataFlucController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getRawData")
|
||||
@ApiOperation("获取原始数据")
|
||||
public HttpResult<List<DataFlucDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<DataFlucDto> data = dataFlucQuery.getRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getBaseData")
|
||||
@ApiOperation("获取算法基础数据")
|
||||
public HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getBaseData");
|
||||
List<CommonMinuteDto> data = dataFlucQuery.getBaseData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("关系型数据库插入数据")
|
||||
public HttpResult<String> addList(@RequestBody List<DataFlucDto> dataFlucDtoList) {
|
||||
String methodDescribe = getMethodDescribe("addList");
|
||||
dataFlucInsert.addList(dataFlucDtoList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "", methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
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.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
import com.njcn.dataProcess.service.IDataHarmRateV;
|
||||
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("/dataHarmRateV")
|
||||
@Api(tags = "谐波电压含有率")
|
||||
public class DataHarmRateVController extends BaseController {
|
||||
|
||||
@QueryBean
|
||||
private IDataHarmRateV dataHarmRateVQuery;
|
||||
|
||||
@InsertBean
|
||||
private IDataHarmRateV dataHarmRateVInsert;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getRawData")
|
||||
@ApiOperation("获取原始数据")
|
||||
public HttpResult<List<DataHarmDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<DataHarmDto> data = dataHarmRateVQuery.getRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,9 +6,12 @@ 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.dto.DataHarmphasicIDTO;
|
||||
import com.njcn.dataProcess.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicIDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPhasicIDto;
|
||||
import com.njcn.dataProcess.service.IDataHarmphasicI;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -53,7 +56,23 @@ public class DataHarmphasicIController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getBaseData")
|
||||
@ApiOperation("获取算法基础数据")
|
||||
public HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getBaseData");
|
||||
List<CommonMinuteDto> data = dataHarmphasicIQuery.getBaseData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("关系型数据库插入数据")
|
||||
public HttpResult<String> addList(@RequestBody List<DataHarmPhasicIDto> list) {
|
||||
String methodDescribe = getMethodDescribe("addList");
|
||||
dataHarmphasicIInsert.addList(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "", methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,9 +6,14 @@ 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.dto.DataHarmphasicVDTO;
|
||||
import com.njcn.dataProcess.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicVDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPhasicIDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPhasicVDto;
|
||||
import com.njcn.dataProcess.service.IDataHarmphasicV;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -53,9 +58,31 @@ public class DataHarmphasicVController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getRawData")
|
||||
@ApiOperation("获取原始数据")
|
||||
public HttpResult<List<DataHarmDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<DataHarmDto> data = dataHarmphasicVQuery.getRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getBaseData")
|
||||
@ApiOperation("获取算法基础数据")
|
||||
public HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getBaseData");
|
||||
List<CommonMinuteDto> data = dataHarmphasicVQuery.getBaseData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("关系型数据库插入数据")
|
||||
public HttpResult<String> addList(@RequestBody List<DataHarmPhasicVDto> list) {
|
||||
String methodDescribe = getMethodDescribe("addList");
|
||||
dataHarmphasicVInsert.addList(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "", methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,9 +6,14 @@ 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.dto.DataHarmpowerPDTO;
|
||||
import com.njcn.dataProcess.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerPDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPhasicVDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPowerPDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataPowerPDto;
|
||||
import com.njcn.dataProcess.service.IDataHarmpowerP;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -53,9 +58,31 @@ public class DataHarmpowerPController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getRawData")
|
||||
@ApiOperation("获取原始数据")
|
||||
public HttpResult<List<DataPowerPDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<DataPowerPDto> data = dataHarmpowerPQuery.getRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getBaseData")
|
||||
@ApiOperation("获取算法基础数据")
|
||||
public HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getBaseData");
|
||||
List<CommonMinuteDto> data = dataHarmpowerPQuery.getBaseData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("关系型数据库插入数据")
|
||||
public HttpResult<String> addList(@RequestBody List<DataHarmPowerPDto> list) {
|
||||
String methodDescribe = getMethodDescribe("addList");
|
||||
dataHarmpowerPInsert.addList(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "", methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerQDTO;
|
||||
import com.njcn.dataProcess.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPowerPDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPowerQDto;
|
||||
import com.njcn.dataProcess.service.IDataHarmpowerQ;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -53,7 +57,23 @@ public class DataHarmpowerQController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getBaseData")
|
||||
@ApiOperation("获取算法基础数据")
|
||||
public HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getBaseData");
|
||||
List<CommonMinuteDto> data = dataHarmpowerQQuery.getBaseData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("关系型数据库插入数据")
|
||||
public HttpResult<String> addList(@RequestBody List<DataHarmPowerQDto> list) {
|
||||
String methodDescribe = getMethodDescribe("addList");
|
||||
dataHarmpowerQInsert.addList(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "", methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,9 +6,12 @@ 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.dto.DataIDTO;
|
||||
import com.njcn.dataProcess.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.dto.DataIDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataIDto;
|
||||
import com.njcn.dataProcess.service.IDataI;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -53,9 +56,31 @@ public class DataIController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getRawData")
|
||||
@ApiOperation("获取原始数据")
|
||||
public HttpResult<List<DataIDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<DataIDto> data = dataIQuery.getRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getBaseData")
|
||||
@ApiOperation("获取算法基础数据")
|
||||
public HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getBaseData");
|
||||
List<CommonMinuteDto> data = dataIQuery.getBaseData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("关系型数据库插入数据")
|
||||
public HttpResult<String> addList(@RequestBody List<DataIDto> dataIDtoList) {
|
||||
String methodDescribe = getMethodDescribe("addList");
|
||||
dataIInsert.addList(dataIDtoList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "", methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.dataProcess.dto.DataInharmVDTO;
|
||||
import com.njcn.dataProcess.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
import com.njcn.dataProcess.service.IDataInharmV;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -53,9 +55,14 @@ public class DataInharmVController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getRawData")
|
||||
@ApiOperation("获取原始数据")
|
||||
public HttpResult<List<DataHarmDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<DataHarmDto> data = dataInharmVQuery.getRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,9 +6,11 @@ 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.dto.DataPltDTO;
|
||||
import com.njcn.dataProcess.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.dto.DataPltDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataPltDto;
|
||||
import com.njcn.dataProcess.service.IDataPlt;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -53,9 +55,14 @@ public class DataPltController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getRawData")
|
||||
@ApiOperation("获取原始数据")
|
||||
public HttpResult<List<DataPltDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<DataPltDto> data = dataPltQuery.getRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -105,9 +105,10 @@ public class DataVController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addInfluxDbList")
|
||||
@ApiOperation("时序数据库插入数据")
|
||||
@Deprecated
|
||||
public HttpResult<String> addInfluxDbList(@RequestBody List<DataVDto> dataVList) {
|
||||
String methodDescribe = getMethodDescribe("addInfluxDbList");
|
||||
dataVInsert.addInfluxDbList(dataVList);
|
||||
dataVQuery.addInfluxDbList(dataVList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "", methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
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.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.po.PqDataVerify;
|
||||
import com.njcn.dataProcess.service.IPqDataVerifyService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pqDataVerify")
|
||||
public class PqDataVerifyController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IPqDataVerifyService pqDataVerifyService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/insertData")
|
||||
@ApiOperation("存储清洗的异常数据")
|
||||
public HttpResult<List<PqDataVerify>> insertData(@RequestBody List<PqDataVerify> list) {
|
||||
String methodDescribe = getMethodDescribe("insertData");
|
||||
pqDataVerifyService.insertData(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/queryData")
|
||||
@ApiOperation("查询清洗的异常数据")
|
||||
public HttpResult<List<PqDataVerify>> queryData(@RequestBody LineCountEvaluateParam param) {
|
||||
String methodDescribe = getMethodDescribe("queryData");
|
||||
List<PqDataVerify> list = pqDataVerifyService.queryData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.njcn.dataProcess.dao.imapper;
|
||||
|
||||
import com.njcn.dataProcess.po.influx.DataHarmrateV;
|
||||
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
public interface DataHarmRateVMapper extends InfluxDbBaseMapper<DataHarmrateV> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.PqDataVerify;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-17
|
||||
*/
|
||||
public interface PqDataVerifyMapper extends MppBaseMapper<PqDataVerify> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
||||
import com.njcn.dataProcess.pojo.po.PqReasonableRange;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-13
|
||||
*/
|
||||
public interface PqReasonableRangeMapper extends BaseMapper<PqReasonableRange> {
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataFlickerD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataFlickerRelationMapper extends MppBaseMapper<RStatDataFlickerD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataFlucD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataFlucRelationMapper extends MppBaseMapper<RStatDataFlucD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPhasicID;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataHarmPhasicIRelationMapper extends MppBaseMapper<RStatDataHarmPhasicID> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPhasicVD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataHarmPhasicVRelationMapper extends MppBaseMapper<RStatDataHarmPhasicVD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPowerPD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataHarmPowerPRelationMapper extends MppBaseMapper<RStatDataHarmPowerPD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPowerQD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataHarmPowerQRelationMapper extends MppBaseMapper<RStatDataHarmPowerQD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPowerSD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataHarmPowerSRelationMapper extends MppBaseMapper<RStatDataHarmPowerSD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmRateID;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataHarmRateIRelationMapper extends MppBaseMapper<RStatDataHarmRateID> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmRateVD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataHarmRateVRelationMapper extends MppBaseMapper<RStatDataHarmRateVD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataID;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataIRelationMapper extends MppBaseMapper<RStatDataID> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataInHarmID;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataInHarmIRelationMapper extends MppBaseMapper<RStatDataInHarmID> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataInHarmVD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataInHarmVRelationMapper extends MppBaseMapper<RStatDataInHarmVD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataPltD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface RStatDataPltRelationMapper extends MppBaseMapper<RStatDataPltD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.dto.DataFlickerDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataFlickerDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataFlickerD;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,6 +16,24 @@ import java.util.List;
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface IDataFlicker {
|
||||
public interface IDataFlicker extends IMppService<RStatDataFlickerD> {
|
||||
void batchInsertion(List<DataFlickerDTO> dataIDTOList);
|
||||
|
||||
/**
|
||||
* 获取原始数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<DataFlickerDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取监测点原始数据
|
||||
* @param lineParam 监测点参数
|
||||
*/
|
||||
List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
*/
|
||||
void addList(List<DataFlickerDto> dataIDtoList);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.dto.DataFlucDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataFlucDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataFlucD;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,6 +16,24 @@ import java.util.List;
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface IDataFluc {
|
||||
public interface IDataFluc extends IMppService<RStatDataFlucD> {
|
||||
void batchInsertion(List<DataFlucDTO> dataIDTOList);
|
||||
|
||||
/**
|
||||
* 获取原始数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<DataFlucDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取监测点原始数据
|
||||
* @param lineParam 监测点参数
|
||||
*/
|
||||
List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
*/
|
||||
void addList(List<DataFlucDto> dataFlucDtoList);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
public interface IDataHarmRateV {
|
||||
|
||||
/**
|
||||
* 获取原始数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
}
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicIDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPhasicIDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPhasicID;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,6 +16,17 @@ import java.util.List;
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface IDataHarmphasicI {
|
||||
public interface IDataHarmphasicI extends IMppService<RStatDataHarmPhasicID> {
|
||||
void batchInsertion(List<DataHarmphasicIDTO> dataIDTOList);
|
||||
|
||||
/**
|
||||
* 获取监测点原始数据
|
||||
* @param lineParam 监测点参数
|
||||
*/
|
||||
List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
*/
|
||||
void addList(List<DataHarmPhasicIDto> list);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicVDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPhasicVDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPhasicVD;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,6 +17,24 @@ import java.util.List;
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface IDataHarmphasicV {
|
||||
public interface IDataHarmphasicV extends IMppService<RStatDataHarmPhasicVD> {
|
||||
void batchInsertion(List<DataHarmphasicVDTO> dataIDTOList);
|
||||
|
||||
/**
|
||||
* 获取原始数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取预处理数据
|
||||
* @param lineParam 监测点参数
|
||||
*/
|
||||
List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
*/
|
||||
void addList(List<DataHarmPhasicVDto> list);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerPDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPowerPDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataPowerPDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPowerPD;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,6 +17,24 @@ import java.util.List;
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface IDataHarmpowerP {
|
||||
public interface IDataHarmpowerP extends IMppService<RStatDataHarmPowerPD> {
|
||||
void batchInsertion(List<DataHarmpowerPDTO> dataIDTOList);
|
||||
|
||||
/**
|
||||
* 获取原始数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<DataPowerPDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取预处理数据
|
||||
* @param lineParam 监测点参数
|
||||
*/
|
||||
List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
*/
|
||||
void addList(List<DataHarmPowerPDto> list);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerQDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPowerQDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPowerQD;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,6 +16,17 @@ import java.util.List;
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface IDataHarmpowerQ {
|
||||
public interface IDataHarmpowerQ extends IMppService<RStatDataHarmPowerQD> {
|
||||
void batchInsertion(List<DataHarmpowerQDTO> dataIDTOList);
|
||||
|
||||
/**
|
||||
* 获取预处理数据
|
||||
* @param lineParam 监测点参数
|
||||
*/
|
||||
List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
*/
|
||||
void addList(List<DataHarmPowerQDto> list);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.dto.DataIDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataIDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataID;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataVD;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,6 +17,25 @@ import java.util.List;
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface IDataI {
|
||||
public interface IDataI extends IMppService<RStatDataID> {
|
||||
|
||||
void batchInsertion(List<DataIDTO> dataIDTOList);
|
||||
|
||||
/**
|
||||
* 获取原始数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<DataIDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取监测点原始数据
|
||||
* @param lineParam 监测点参数
|
||||
*/
|
||||
List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
*/
|
||||
void addList(List<DataIDto> dataIDtoList);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataInharmVDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,4 +16,11 @@ import java.util.List;
|
||||
public interface IDataInharmV {
|
||||
|
||||
void batchInsertion(List<DataInharmVDTO> dataIDTOList);
|
||||
|
||||
/**
|
||||
* 获取原始数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataPltDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataIDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataPltDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -13,4 +16,11 @@ import java.util.List;
|
||||
*/
|
||||
public interface IDataPlt {
|
||||
void batchInsertion(List<DataPltDTO> dataPltDTOList);
|
||||
|
||||
/**
|
||||
* 获取原始数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<DataPltDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.dto.DataVDTO;
|
||||
import com.njcn.dataProcess.dto.DataVFiveItemDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataV;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataVDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataVD;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.po.PqDataVerify;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-17
|
||||
*/
|
||||
public interface IPqDataVerifyService extends IMppService<PqDataVerify> {
|
||||
|
||||
/**
|
||||
* 异常数据插入
|
||||
* @param list
|
||||
*/
|
||||
void insertData(List<PqDataVerify> list);
|
||||
|
||||
/**
|
||||
* 异常数据查询
|
||||
* @param param
|
||||
*/
|
||||
List<PqDataVerify> queryData(LineCountEvaluateParam param);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.dataProcess.param.DataCleanParam;
|
||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
||||
import com.njcn.dataProcess.pojo.po.PqReasonableRange;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-13
|
||||
*/
|
||||
public interface IPqReasonableRangeService extends IService<PqReasonableRange> {
|
||||
|
||||
/**
|
||||
* 根据条件获取稳态指标正常范围数据
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<PqReasonableRangeDto> getReasonableRangeList(DataCleanParam param);
|
||||
|
||||
}
|
||||
@@ -1,15 +1,29 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataFlickerDTO;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.imapper.DataFlickerMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataFlickerRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataFlickerDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataFlicker;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataFlickerDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataFlickerD;
|
||||
import com.njcn.dataProcess.service.IDataFlicker;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -21,7 +35,9 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("InfluxdbDataFlickerImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbDataFlickerImpl implements IDataFlicker {
|
||||
public class InfluxdbDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRelationMapper, RStatDataFlickerD> implements IDataFlicker {
|
||||
|
||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||
|
||||
private final DataFlickerMapper dataFlickerMapper;
|
||||
|
||||
@@ -44,4 +60,117 @@ public class InfluxdbDataFlickerImpl implements IDataFlicker {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataFlickerDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
List<DataFlickerDto> result = new ArrayList<>();
|
||||
List<DataFlicker> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime());
|
||||
list.forEach(item->{
|
||||
DataFlickerDto dto = new DataFlickerDto();
|
||||
BeanUtils.copyProperties(item,dto);
|
||||
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
List<CommonMinuteDto> result = new ArrayList<>();
|
||||
List<DataFlicker> dataIList = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime());
|
||||
if (CollectionUtil.isNotEmpty(dataIList)) {
|
||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||
//以监测点分组
|
||||
Map<String,List<DataFlicker>> lineMap = dataIList.stream().collect(Collectors.groupingBy(DataFlicker::getLineId));
|
||||
lineMap.forEach((line,lineList)->{
|
||||
CommonMinuteDto dto = new CommonMinuteDto();
|
||||
dto.setLineId(line);
|
||||
dto.setTime(time);
|
||||
dto.setQualityFlag(lineList.get(0).getQualityFlag());
|
||||
//以相别分组
|
||||
Map<String,List<DataFlicker>> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataFlicker::getPhasicType));
|
||||
List<CommonMinuteDto.PhasicType> phasicTypes = new ArrayList<>();
|
||||
phasicTypeMap.forEach((phasicType,phasicTypeList)->{
|
||||
CommonMinuteDto.PhasicType type = new CommonMinuteDto.PhasicType();
|
||||
type.setPhasicType(phasicType);
|
||||
|
||||
List<CommonMinuteDto.ValueType> valueTypes = new ArrayList<>();
|
||||
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
||||
value.setValueType(null);
|
||||
|
||||
//规定好集合指标参数
|
||||
List<Double> data1 = phasicTypeList.stream().map(DataFlicker::getFluc).collect(Collectors.toList());
|
||||
List<Double> data2 = phasicTypeList.stream().map(DataFlicker::getPlt).collect(Collectors.toList());
|
||||
List<Double> data3 = phasicTypeList.stream().map(DataFlicker::getPst).collect(Collectors.toList());
|
||||
|
||||
List<List<Double>> lists = Arrays.asList(data1,data2,data3);
|
||||
value.setValueList(lists);
|
||||
valueTypes.add(value);
|
||||
|
||||
type.setValueTypeList(valueTypes);
|
||||
phasicTypes.add(type);
|
||||
});
|
||||
dto.setPhasicTypeList(phasicTypes);
|
||||
result.add(dto);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataFlickerDto> dataIDtoList) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取分钟数据
|
||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataFlicker> getMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataFlicker> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class);
|
||||
influxQueryWrapper.regular(DataFlicker::getLineId, lineList)
|
||||
.select(DataFlicker::getLineId)
|
||||
.select(DataFlicker::getPhasicType)
|
||||
.select(DataFlicker::getFluc)
|
||||
.select(DataFlicker::getPst)
|
||||
.select(DataFlicker::getPlt)
|
||||
.select(DataFlicker::getQualityFlag)
|
||||
.between(DataFlicker::getTime, startTime, endTime)
|
||||
.eq(DataFlicker::getQualityFlag,"0");
|
||||
List<DataFlicker> list = dataFlickerMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataFlicker>> lineMap = list.stream().collect(Collectors.groupingBy(DataFlicker::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,当前监测点自身的异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataFlicker> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,29 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataFlucDTO;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.imapper.DataFlucMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataFlucRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataFlucDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataFluc;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataFlucDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataFlucD;
|
||||
import com.njcn.dataProcess.service.IDataFluc;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -21,7 +35,9 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("InfluxdbDataFlucImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbDataFlucImpl implements IDataFluc {
|
||||
public class InfluxdbDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMapper, RStatDataFlucD> implements IDataFluc {
|
||||
|
||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||
|
||||
private final DataFlucMapper dataFlucMapper;
|
||||
|
||||
@@ -44,4 +60,115 @@ public class InfluxdbDataFlucImpl implements IDataFluc {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataFlucDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
List<DataFlucDto> result = new ArrayList<>();
|
||||
List<DataFluc> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime());
|
||||
list.forEach(item->{
|
||||
DataFlucDto dto = new DataFlucDto();
|
||||
BeanUtils.copyProperties(item,dto);
|
||||
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
List<CommonMinuteDto> result = new ArrayList<>();
|
||||
List<DataFluc> dataIList = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime());
|
||||
if (CollectionUtil.isNotEmpty(dataIList)) {
|
||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||
//以监测点分组
|
||||
Map<String,List<DataFluc>> lineMap = dataIList.stream().collect(Collectors.groupingBy(DataFluc::getLineId));
|
||||
lineMap.forEach((line,lineList)->{
|
||||
CommonMinuteDto dto = new CommonMinuteDto();
|
||||
dto.setLineId(line);
|
||||
dto.setTime(time);
|
||||
dto.setQualityFlag(lineList.get(0).getQualityFlag());
|
||||
//以相别分组
|
||||
Map<String,List<DataFluc>> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataFluc::getPhasicType));
|
||||
List<CommonMinuteDto.PhasicType> phasicTypes = new ArrayList<>();
|
||||
phasicTypeMap.forEach((phasicType,phasicTypeList)->{
|
||||
CommonMinuteDto.PhasicType type = new CommonMinuteDto.PhasicType();
|
||||
type.setPhasicType(phasicType);
|
||||
|
||||
List<CommonMinuteDto.ValueType> valueTypes = new ArrayList<>();
|
||||
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
||||
value.setValueType(null);
|
||||
|
||||
//规定好集合指标参数
|
||||
List<Double> data1 = phasicTypeList.stream().map(DataFluc::getFluc).collect(Collectors.toList());
|
||||
List<Double> data2 = phasicTypeList.stream().map(DataFluc::getFluccf).collect(Collectors.toList());
|
||||
|
||||
List<List<Double>> lists = Arrays.asList(data1,data2);
|
||||
value.setValueList(lists);
|
||||
valueTypes.add(value);
|
||||
|
||||
type.setValueTypeList(valueTypes);
|
||||
phasicTypes.add(type);
|
||||
});
|
||||
dto.setPhasicTypeList(phasicTypes);
|
||||
result.add(dto);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataFlucDto> dataFlucDtoList) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取分钟数据
|
||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataFluc> getMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataFluc> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFluc.class);
|
||||
influxQueryWrapper.regular(DataFluc::getLineId, lineList)
|
||||
.select(DataFluc::getLineId)
|
||||
.select(DataFluc::getPhasicType)
|
||||
.select(DataFluc::getFluc)
|
||||
.select(DataFluc::getFluccf)
|
||||
.select(DataFluc::getQualityFlag)
|
||||
.between(DataFluc::getTime, startTime, endTime)
|
||||
.eq(DataFluc::getQualityFlag,"0");
|
||||
List<DataFluc> list = dataFlucMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataFluc>> lineMap = list.stream().collect(Collectors.groupingBy(DataFluc::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,当前监测点自身的异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataFluc> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||
import com.njcn.dataProcess.dao.imapper.DataHarmRateVMapper;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataHarmrateV;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
import com.njcn.dataProcess.service.IDataHarmRateV;
|
||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Service("InfluxdbDataHarmRateVImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbDataHarmRateVImpl implements IDataHarmRateV {
|
||||
|
||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||
|
||||
private final DataHarmRateVMapper dataHarmRateVMapper;
|
||||
|
||||
@Override
|
||||
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
List<DataHarmDto> result = new ArrayList<>();
|
||||
List<DataHarmrateV> list = getMinuteDataI(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime());
|
||||
list.forEach(item->{
|
||||
DataHarmDto dto = new DataHarmDto();
|
||||
BeanUtils.copyProperties(item,dto);
|
||||
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取dataI分钟数据
|
||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataHarmrateV> getMinuteDataI(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataHarmrateV> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
|
||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||
influxQueryWrapper.regular(DataHarmrateV::getLineId, lineList)
|
||||
.select(DataHarmrateV::getLineId)
|
||||
.select(DataHarmrateV::getPhasicType)
|
||||
.select(DataHarmrateV::getValueType)
|
||||
.select(DataHarmrateV::getQualityFlag)
|
||||
.between(DataHarmrateV::getTime, startTime, endTime)
|
||||
.eq(DataHarmrateV::getQualityFlag,"0");
|
||||
List<DataHarmrateV> list = dataHarmRateVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataHarmrateV>> lineMap = list.stream().collect(Collectors.groupingBy(DataHarmrateV::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,当前监测点自身的异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataHarmrateV> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,30 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicIDTO;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||
import com.njcn.dataProcess.dao.imapper.DataHarmphasicIMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPhasicIRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicIDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataHarmphasicI;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPhasicIDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPhasicID;
|
||||
import com.njcn.dataProcess.service.IDataHarmphasicI;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -21,11 +36,11 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("InfluxdbDataHarmphasicIImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbDataHarmphasicIImpl implements IDataHarmphasicI {
|
||||
public class InfluxdbDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPhasicIRelationMapper, RStatDataHarmPhasicID> implements IDataHarmphasicI {
|
||||
|
||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||
private final DataHarmphasicIMapper dataHarmphasicIMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<DataHarmphasicIDTO> dataHarmphasicIDTOList) {
|
||||
int totalCount = dataHarmphasicIDTOList.size();
|
||||
@@ -44,4 +59,156 @@ public class InfluxdbDataHarmphasicIImpl implements IDataHarmphasicI {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
List<CommonMinuteDto> result = new ArrayList<>();
|
||||
List<DataHarmphasicI> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime());
|
||||
if (CollectionUtil.isNotEmpty(data)) {
|
||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||
//以监测点分组
|
||||
Map<String,List<DataHarmphasicI>> lineMap = data.stream().collect(Collectors.groupingBy(DataHarmphasicI::getLineId));
|
||||
lineMap.forEach((line,lineList)->{
|
||||
CommonMinuteDto dto = new CommonMinuteDto();
|
||||
dto.setLineId(line);
|
||||
dto.setTime(time);
|
||||
dto.setQualityFlag(lineList.get(0).getQualityFlag());
|
||||
//以相别分组
|
||||
Map<String,List<DataHarmphasicI>> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataHarmphasicI::getPhasicType));
|
||||
List<CommonMinuteDto.PhasicType> phasicTypes = new ArrayList<>();
|
||||
phasicTypeMap.forEach((phasicType,phasicTypeList)->{
|
||||
CommonMinuteDto.PhasicType type = new CommonMinuteDto.PhasicType();
|
||||
type.setPhasicType(phasicType);
|
||||
//以数据类型分组
|
||||
Map<String,List<DataHarmphasicI>> valueTypeMap = phasicTypeList.stream().collect(Collectors.groupingBy(DataHarmphasicI::getValueType));
|
||||
List<CommonMinuteDto.ValueType> valueTypes = new ArrayList<>();
|
||||
valueTypeMap.forEach((valueType,valueTypeList)->{
|
||||
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
||||
value.setValueType(valueType);
|
||||
//规定好集合指标参数
|
||||
List<Double> data12 = valueTypeList.stream().map(DataHarmphasicI::getI1).collect(Collectors.toList());
|
||||
List<Double> data13 = valueTypeList.stream().map(DataHarmphasicI::getI2).collect(Collectors.toList());
|
||||
List<Double> data14 = valueTypeList.stream().map(DataHarmphasicI::getI3).collect(Collectors.toList());
|
||||
List<Double> data15 = valueTypeList.stream().map(DataHarmphasicI::getI4).collect(Collectors.toList());
|
||||
List<Double> data16 = valueTypeList.stream().map(DataHarmphasicI::getI5).collect(Collectors.toList());
|
||||
List<Double> data17 = valueTypeList.stream().map(DataHarmphasicI::getI6).collect(Collectors.toList());
|
||||
List<Double> data18 = valueTypeList.stream().map(DataHarmphasicI::getI7).collect(Collectors.toList());
|
||||
List<Double> data19 = valueTypeList.stream().map(DataHarmphasicI::getI8).collect(Collectors.toList());
|
||||
List<Double> data20 = valueTypeList.stream().map(DataHarmphasicI::getI9).collect(Collectors.toList());
|
||||
List<Double> data21 = valueTypeList.stream().map(DataHarmphasicI::getI10).collect(Collectors.toList());
|
||||
List<Double> data22 = valueTypeList.stream().map(DataHarmphasicI::getI11).collect(Collectors.toList());
|
||||
List<Double> data23 = valueTypeList.stream().map(DataHarmphasicI::getI12).collect(Collectors.toList());
|
||||
List<Double> data24 = valueTypeList.stream().map(DataHarmphasicI::getI13).collect(Collectors.toList());
|
||||
List<Double> data25 = valueTypeList.stream().map(DataHarmphasicI::getI14).collect(Collectors.toList());
|
||||
List<Double> data26 = valueTypeList.stream().map(DataHarmphasicI::getI15).collect(Collectors.toList());
|
||||
List<Double> data27 = valueTypeList.stream().map(DataHarmphasicI::getI16).collect(Collectors.toList());
|
||||
List<Double> data28 = valueTypeList.stream().map(DataHarmphasicI::getI17).collect(Collectors.toList());
|
||||
List<Double> data29 = valueTypeList.stream().map(DataHarmphasicI::getI18).collect(Collectors.toList());
|
||||
List<Double> data30 = valueTypeList.stream().map(DataHarmphasicI::getI19).collect(Collectors.toList());
|
||||
List<Double> data31 = valueTypeList.stream().map(DataHarmphasicI::getI20).collect(Collectors.toList());
|
||||
List<Double> data32 = valueTypeList.stream().map(DataHarmphasicI::getI21).collect(Collectors.toList());
|
||||
List<Double> data33 = valueTypeList.stream().map(DataHarmphasicI::getI22).collect(Collectors.toList());
|
||||
List<Double> data34 = valueTypeList.stream().map(DataHarmphasicI::getI23).collect(Collectors.toList());
|
||||
List<Double> data35 = valueTypeList.stream().map(DataHarmphasicI::getI24).collect(Collectors.toList());
|
||||
List<Double> data36 = valueTypeList.stream().map(DataHarmphasicI::getI25).collect(Collectors.toList());
|
||||
List<Double> data37 = valueTypeList.stream().map(DataHarmphasicI::getI26).collect(Collectors.toList());
|
||||
List<Double> data38 = valueTypeList.stream().map(DataHarmphasicI::getI27).collect(Collectors.toList());
|
||||
List<Double> data39 = valueTypeList.stream().map(DataHarmphasicI::getI28).collect(Collectors.toList());
|
||||
List<Double> data40 = valueTypeList.stream().map(DataHarmphasicI::getI29).collect(Collectors.toList());
|
||||
List<Double> data41 = valueTypeList.stream().map(DataHarmphasicI::getI30).collect(Collectors.toList());
|
||||
List<Double> data42 = valueTypeList.stream().map(DataHarmphasicI::getI31).collect(Collectors.toList());
|
||||
List<Double> data43 = valueTypeList.stream().map(DataHarmphasicI::getI32).collect(Collectors.toList());
|
||||
List<Double> data44 = valueTypeList.stream().map(DataHarmphasicI::getI33).collect(Collectors.toList());
|
||||
List<Double> data45 = valueTypeList.stream().map(DataHarmphasicI::getI34).collect(Collectors.toList());
|
||||
List<Double> data46 = valueTypeList.stream().map(DataHarmphasicI::getI35).collect(Collectors.toList());
|
||||
List<Double> data47 = valueTypeList.stream().map(DataHarmphasicI::getI36).collect(Collectors.toList());
|
||||
List<Double> data48 = valueTypeList.stream().map(DataHarmphasicI::getI37).collect(Collectors.toList());
|
||||
List<Double> data49 = valueTypeList.stream().map(DataHarmphasicI::getI38).collect(Collectors.toList());
|
||||
List<Double> data50 = valueTypeList.stream().map(DataHarmphasicI::getI39).collect(Collectors.toList());
|
||||
List<Double> data51 = valueTypeList.stream().map(DataHarmphasicI::getI40).collect(Collectors.toList());
|
||||
List<Double> data52 = valueTypeList.stream().map(DataHarmphasicI::getI41).collect(Collectors.toList());
|
||||
List<Double> data53 = valueTypeList.stream().map(DataHarmphasicI::getI42).collect(Collectors.toList());
|
||||
List<Double> data54 = valueTypeList.stream().map(DataHarmphasicI::getI43).collect(Collectors.toList());
|
||||
List<Double> data55 = valueTypeList.stream().map(DataHarmphasicI::getI44).collect(Collectors.toList());
|
||||
List<Double> data56 = valueTypeList.stream().map(DataHarmphasicI::getI45).collect(Collectors.toList());
|
||||
List<Double> data57 = valueTypeList.stream().map(DataHarmphasicI::getI46).collect(Collectors.toList());
|
||||
List<Double> data58 = valueTypeList.stream().map(DataHarmphasicI::getI47).collect(Collectors.toList());
|
||||
List<Double> data59 = valueTypeList.stream().map(DataHarmphasicI::getI48).collect(Collectors.toList());
|
||||
List<Double> data60 = valueTypeList.stream().map(DataHarmphasicI::getI49).collect(Collectors.toList());
|
||||
List<Double> data61 = valueTypeList.stream().map(DataHarmphasicI::getI50).collect(Collectors.toList());
|
||||
|
||||
List<List<Double>> lists = Arrays.asList(data12,data13,data14,data15,data16
|
||||
,data17,data18,data19,data20,data21,data22,data23,data24,data25,data26
|
||||
,data27,data28,data29,data30,data31,data32,data33,data34,data35,data36
|
||||
,data37,data38,data39,data40,data41,data42,data43,data44,data45,data46
|
||||
,data47,data48,data49,data50,data51,data52,data53,data54,data55,data56
|
||||
,data57,data58,data59,data60,data61);
|
||||
value.setValueList(lists);
|
||||
valueTypes.add(value);
|
||||
});
|
||||
type.setValueTypeList(valueTypes);
|
||||
phasicTypes.add(type);
|
||||
});
|
||||
dto.setPhasicTypeList(phasicTypes);
|
||||
result.add(dto);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataHarmPhasicIDto> list) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取分钟数据
|
||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataHarmphasicI> getMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataHarmphasicI> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicI.class);
|
||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||
influxQueryWrapper.regular(DataHarmphasicI::getLineId, lineList)
|
||||
.select(DataHarmphasicI::getLineId)
|
||||
.select(DataHarmphasicI::getPhasicType)
|
||||
.select(DataHarmphasicI::getValueType)
|
||||
.select(DataHarmphasicI::getQualityFlag)
|
||||
.between(DataHarmphasicI::getTime, startTime, endTime)
|
||||
.eq(DataHarmphasicI::getQualityFlag,"0");
|
||||
List<DataHarmphasicI> list = dataHarmphasicIMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataHarmphasicI>> lineMap = list.stream().collect(Collectors.groupingBy(DataHarmphasicI::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,当前监测点自身的异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataHarmphasicI> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,30 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicVDTO;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||
import com.njcn.dataProcess.dao.imapper.DataHarmphasicVMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPhasicVRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicVDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataHarmphasicI;
|
||||
import com.njcn.dataProcess.po.influx.DataHarmphasicV;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPhasicVDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPhasicVD;
|
||||
import com.njcn.dataProcess.service.IDataHarmphasicV;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -21,7 +36,9 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("InfluxdbDataHarmphasicVImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbDataHarmphasicVImpl 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 DataHarmphasicVMapper dataHarmphasicVMapper;
|
||||
|
||||
@@ -44,4 +61,169 @@ public class InfluxdbDataHarmphasicVImpl implements IDataHarmphasicV {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
List<DataHarmDto> result = new ArrayList<>();
|
||||
List<DataHarmphasicV> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime());
|
||||
list.forEach(item->{
|
||||
DataHarmDto dto = new DataHarmDto();
|
||||
BeanUtils.copyProperties(item,dto);
|
||||
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
List<CommonMinuteDto> result = new ArrayList<>();
|
||||
List<DataHarmphasicV> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime());
|
||||
if (CollectionUtil.isNotEmpty(data)) {
|
||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||
//以监测点分组
|
||||
Map<String,List<DataHarmphasicV>> lineMap = data.stream().collect(Collectors.groupingBy(DataHarmphasicV::getLineId));
|
||||
lineMap.forEach((line,lineList)->{
|
||||
CommonMinuteDto dto = new CommonMinuteDto();
|
||||
dto.setLineId(line);
|
||||
dto.setTime(time);
|
||||
dto.setQualityFlag(lineList.get(0).getQualityFlag());
|
||||
//以相别分组
|
||||
Map<String,List<DataHarmphasicV>> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataHarmphasicV::getPhasicType));
|
||||
List<CommonMinuteDto.PhasicType> phasicTypes = new ArrayList<>();
|
||||
phasicTypeMap.forEach((phasicType,phasicTypeList)->{
|
||||
CommonMinuteDto.PhasicType type = new CommonMinuteDto.PhasicType();
|
||||
type.setPhasicType(phasicType);
|
||||
//以数据类型分组
|
||||
Map<String,List<DataHarmphasicV>> valueTypeMap = phasicTypeList.stream().collect(Collectors.groupingBy(DataHarmphasicV::getValueType));
|
||||
List<CommonMinuteDto.ValueType> valueTypes = new ArrayList<>();
|
||||
valueTypeMap.forEach((valueType,valueTypeList)->{
|
||||
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
||||
value.setValueType(valueType);
|
||||
//规定好集合指标参数
|
||||
List<Double> data12 = valueTypeList.stream().map(DataHarmphasicV::getV1).collect(Collectors.toList());
|
||||
List<Double> data13 = valueTypeList.stream().map(DataHarmphasicV::getV2).collect(Collectors.toList());
|
||||
List<Double> data14 = valueTypeList.stream().map(DataHarmphasicV::getV3).collect(Collectors.toList());
|
||||
List<Double> data15 = valueTypeList.stream().map(DataHarmphasicV::getV4).collect(Collectors.toList());
|
||||
List<Double> data16 = valueTypeList.stream().map(DataHarmphasicV::getV5).collect(Collectors.toList());
|
||||
List<Double> data17 = valueTypeList.stream().map(DataHarmphasicV::getV6).collect(Collectors.toList());
|
||||
List<Double> data18 = valueTypeList.stream().map(DataHarmphasicV::getV7).collect(Collectors.toList());
|
||||
List<Double> data19 = valueTypeList.stream().map(DataHarmphasicV::getV8).collect(Collectors.toList());
|
||||
List<Double> data20 = valueTypeList.stream().map(DataHarmphasicV::getV9).collect(Collectors.toList());
|
||||
List<Double> data21 = valueTypeList.stream().map(DataHarmphasicV::getV10).collect(Collectors.toList());
|
||||
List<Double> data22 = valueTypeList.stream().map(DataHarmphasicV::getV11).collect(Collectors.toList());
|
||||
List<Double> data23 = valueTypeList.stream().map(DataHarmphasicV::getV12).collect(Collectors.toList());
|
||||
List<Double> data24 = valueTypeList.stream().map(DataHarmphasicV::getV13).collect(Collectors.toList());
|
||||
List<Double> data25 = valueTypeList.stream().map(DataHarmphasicV::getV14).collect(Collectors.toList());
|
||||
List<Double> data26 = valueTypeList.stream().map(DataHarmphasicV::getV15).collect(Collectors.toList());
|
||||
List<Double> data27 = valueTypeList.stream().map(DataHarmphasicV::getV16).collect(Collectors.toList());
|
||||
List<Double> data28 = valueTypeList.stream().map(DataHarmphasicV::getV17).collect(Collectors.toList());
|
||||
List<Double> data29 = valueTypeList.stream().map(DataHarmphasicV::getV18).collect(Collectors.toList());
|
||||
List<Double> data30 = valueTypeList.stream().map(DataHarmphasicV::getV19).collect(Collectors.toList());
|
||||
List<Double> data31 = valueTypeList.stream().map(DataHarmphasicV::getV20).collect(Collectors.toList());
|
||||
List<Double> data32 = valueTypeList.stream().map(DataHarmphasicV::getV21).collect(Collectors.toList());
|
||||
List<Double> data33 = valueTypeList.stream().map(DataHarmphasicV::getV22).collect(Collectors.toList());
|
||||
List<Double> data34 = valueTypeList.stream().map(DataHarmphasicV::getV23).collect(Collectors.toList());
|
||||
List<Double> data35 = valueTypeList.stream().map(DataHarmphasicV::getV24).collect(Collectors.toList());
|
||||
List<Double> data36 = valueTypeList.stream().map(DataHarmphasicV::getV25).collect(Collectors.toList());
|
||||
List<Double> data37 = valueTypeList.stream().map(DataHarmphasicV::getV26).collect(Collectors.toList());
|
||||
List<Double> data38 = valueTypeList.stream().map(DataHarmphasicV::getV27).collect(Collectors.toList());
|
||||
List<Double> data39 = valueTypeList.stream().map(DataHarmphasicV::getV28).collect(Collectors.toList());
|
||||
List<Double> data40 = valueTypeList.stream().map(DataHarmphasicV::getV29).collect(Collectors.toList());
|
||||
List<Double> data41 = valueTypeList.stream().map(DataHarmphasicV::getV30).collect(Collectors.toList());
|
||||
List<Double> data42 = valueTypeList.stream().map(DataHarmphasicV::getV31).collect(Collectors.toList());
|
||||
List<Double> data43 = valueTypeList.stream().map(DataHarmphasicV::getV32).collect(Collectors.toList());
|
||||
List<Double> data44 = valueTypeList.stream().map(DataHarmphasicV::getV33).collect(Collectors.toList());
|
||||
List<Double> data45 = valueTypeList.stream().map(DataHarmphasicV::getV34).collect(Collectors.toList());
|
||||
List<Double> data46 = valueTypeList.stream().map(DataHarmphasicV::getV35).collect(Collectors.toList());
|
||||
List<Double> data47 = valueTypeList.stream().map(DataHarmphasicV::getV36).collect(Collectors.toList());
|
||||
List<Double> data48 = valueTypeList.stream().map(DataHarmphasicV::getV37).collect(Collectors.toList());
|
||||
List<Double> data49 = valueTypeList.stream().map(DataHarmphasicV::getV38).collect(Collectors.toList());
|
||||
List<Double> data50 = valueTypeList.stream().map(DataHarmphasicV::getV39).collect(Collectors.toList());
|
||||
List<Double> data51 = valueTypeList.stream().map(DataHarmphasicV::getV40).collect(Collectors.toList());
|
||||
List<Double> data52 = valueTypeList.stream().map(DataHarmphasicV::getV41).collect(Collectors.toList());
|
||||
List<Double> data53 = valueTypeList.stream().map(DataHarmphasicV::getV42).collect(Collectors.toList());
|
||||
List<Double> data54 = valueTypeList.stream().map(DataHarmphasicV::getV43).collect(Collectors.toList());
|
||||
List<Double> data55 = valueTypeList.stream().map(DataHarmphasicV::getV44).collect(Collectors.toList());
|
||||
List<Double> data56 = valueTypeList.stream().map(DataHarmphasicV::getV45).collect(Collectors.toList());
|
||||
List<Double> data57 = valueTypeList.stream().map(DataHarmphasicV::getV46).collect(Collectors.toList());
|
||||
List<Double> data58 = valueTypeList.stream().map(DataHarmphasicV::getV47).collect(Collectors.toList());
|
||||
List<Double> data59 = valueTypeList.stream().map(DataHarmphasicV::getV48).collect(Collectors.toList());
|
||||
List<Double> data60 = valueTypeList.stream().map(DataHarmphasicV::getV49).collect(Collectors.toList());
|
||||
List<Double> data61 = valueTypeList.stream().map(DataHarmphasicV::getV50).collect(Collectors.toList());
|
||||
|
||||
List<List<Double>> lists = Arrays.asList(data12,data13,data14,data15,data16
|
||||
,data17,data18,data19,data20,data21,data22,data23,data24,data25,data26
|
||||
,data27,data28,data29,data30,data31,data32,data33,data34,data35,data36
|
||||
,data37,data38,data39,data40,data41,data42,data43,data44,data45,data46
|
||||
,data47,data48,data49,data50,data51,data52,data53,data54,data55,data56
|
||||
,data57,data58,data59,data60,data61);
|
||||
value.setValueList(lists);
|
||||
valueTypes.add(value);
|
||||
});
|
||||
type.setValueTypeList(valueTypes);
|
||||
phasicTypes.add(type);
|
||||
});
|
||||
dto.setPhasicTypeList(phasicTypes);
|
||||
result.add(dto);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataHarmPhasicVDto> list) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取分钟数据
|
||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataHarmphasicV> getMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataHarmphasicV> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicV.class);
|
||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||
influxQueryWrapper.regular(DataHarmphasicV::getLineId, lineList)
|
||||
.select(DataHarmphasicV::getLineId)
|
||||
.select(DataHarmphasicV::getPhasicType)
|
||||
.select(DataHarmphasicV::getValueType)
|
||||
.select(DataHarmphasicV::getQualityFlag)
|
||||
.between(DataHarmphasicV::getTime, startTime, endTime)
|
||||
.eq(DataHarmphasicV::getQualityFlag,"0");
|
||||
List<DataHarmphasicV> list = dataHarmphasicVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataHarmphasicV>> lineMap = list.stream().collect(Collectors.groupingBy(DataHarmphasicV::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,当前监测点自身的异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataHarmphasicV> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,30 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerPDTO;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||
import com.njcn.dataProcess.dao.imapper.DataHarmpowerPMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerPRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerPDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataHarmphasicV;
|
||||
import com.njcn.dataProcess.po.influx.DataHarmpowerP;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPowerPDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataPowerPDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPowerPD;
|
||||
import com.njcn.dataProcess.service.IDataHarmpowerP;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -21,7 +36,9 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("InfluxdbDataHarmpowerPImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbDataHarmpowerPImpl 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 DataHarmpowerPMapper dataHarmpowerPMapper;
|
||||
|
||||
@@ -43,4 +60,176 @@ public class InfluxdbDataHarmpowerPImpl implements IDataHarmpowerP {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataPowerPDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
List<DataPowerPDto> result = new ArrayList<>();
|
||||
List<DataHarmpowerP> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime());
|
||||
list.forEach(item->{
|
||||
DataPowerPDto dto = new DataPowerPDto();
|
||||
BeanUtils.copyProperties(item,dto);
|
||||
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
List<CommonMinuteDto> result = new ArrayList<>();
|
||||
List<DataHarmpowerP> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime());
|
||||
if (CollectionUtil.isNotEmpty(data)) {
|
||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||
//以监测点分组
|
||||
Map<String,List<DataHarmpowerP>> lineMap = data.stream().collect(Collectors.groupingBy(DataHarmpowerP::getLineId));
|
||||
lineMap.forEach((line,lineList)->{
|
||||
CommonMinuteDto dto = new CommonMinuteDto();
|
||||
dto.setLineId(line);
|
||||
dto.setTime(time);
|
||||
dto.setQualityFlag(lineList.get(0).getQualityFlag());
|
||||
//以相别分组
|
||||
Map<String,List<DataHarmpowerP>> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataHarmpowerP::getPhasicType));
|
||||
List<CommonMinuteDto.PhasicType> phasicTypes = new ArrayList<>();
|
||||
phasicTypeMap.forEach((phasicType,phasicTypeList)->{
|
||||
CommonMinuteDto.PhasicType type = new CommonMinuteDto.PhasicType();
|
||||
type.setPhasicType(phasicType);
|
||||
//以数据类型分组
|
||||
Map<String,List<DataHarmpowerP>> valueTypeMap = phasicTypeList.stream().collect(Collectors.groupingBy(DataHarmpowerP::getValueType));
|
||||
List<CommonMinuteDto.ValueType> valueTypes = new ArrayList<>();
|
||||
valueTypeMap.forEach((valueType,valueTypeList)->{
|
||||
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
||||
value.setValueType(valueType);
|
||||
//规定好集合指标参数
|
||||
List<Double> data1 = valueTypeList.stream().map(DataHarmpowerP::getDf).collect(Collectors.toList());
|
||||
List<Double> data2 = valueTypeList.stream().map(DataHarmpowerP::getPf).collect(Collectors.toList());
|
||||
List<Double> data3 = valueTypeList.stream().map(DataHarmpowerP::getP).collect(Collectors.toList());
|
||||
|
||||
List<Double> data12 = valueTypeList.stream().map(DataHarmpowerP::getP1).collect(Collectors.toList());
|
||||
List<Double> data13 = valueTypeList.stream().map(DataHarmpowerP::getP2).collect(Collectors.toList());
|
||||
List<Double> data14 = valueTypeList.stream().map(DataHarmpowerP::getP3).collect(Collectors.toList());
|
||||
List<Double> data15 = valueTypeList.stream().map(DataHarmpowerP::getP4).collect(Collectors.toList());
|
||||
List<Double> data16 = valueTypeList.stream().map(DataHarmpowerP::getP5).collect(Collectors.toList());
|
||||
List<Double> data17 = valueTypeList.stream().map(DataHarmpowerP::getP6).collect(Collectors.toList());
|
||||
List<Double> data18 = valueTypeList.stream().map(DataHarmpowerP::getP7).collect(Collectors.toList());
|
||||
List<Double> data19 = valueTypeList.stream().map(DataHarmpowerP::getP8).collect(Collectors.toList());
|
||||
List<Double> data20 = valueTypeList.stream().map(DataHarmpowerP::getP9).collect(Collectors.toList());
|
||||
List<Double> data21 = valueTypeList.stream().map(DataHarmpowerP::getP10).collect(Collectors.toList());
|
||||
List<Double> data22 = valueTypeList.stream().map(DataHarmpowerP::getP11).collect(Collectors.toList());
|
||||
List<Double> data23 = valueTypeList.stream().map(DataHarmpowerP::getP12).collect(Collectors.toList());
|
||||
List<Double> data24 = valueTypeList.stream().map(DataHarmpowerP::getP13).collect(Collectors.toList());
|
||||
List<Double> data25 = valueTypeList.stream().map(DataHarmpowerP::getP14).collect(Collectors.toList());
|
||||
List<Double> data26 = valueTypeList.stream().map(DataHarmpowerP::getP15).collect(Collectors.toList());
|
||||
List<Double> data27 = valueTypeList.stream().map(DataHarmpowerP::getP16).collect(Collectors.toList());
|
||||
List<Double> data28 = valueTypeList.stream().map(DataHarmpowerP::getP17).collect(Collectors.toList());
|
||||
List<Double> data29 = valueTypeList.stream().map(DataHarmpowerP::getP18).collect(Collectors.toList());
|
||||
List<Double> data30 = valueTypeList.stream().map(DataHarmpowerP::getP19).collect(Collectors.toList());
|
||||
List<Double> data31 = valueTypeList.stream().map(DataHarmpowerP::getP20).collect(Collectors.toList());
|
||||
List<Double> data32 = valueTypeList.stream().map(DataHarmpowerP::getP21).collect(Collectors.toList());
|
||||
List<Double> data33 = valueTypeList.stream().map(DataHarmpowerP::getP22).collect(Collectors.toList());
|
||||
List<Double> data34 = valueTypeList.stream().map(DataHarmpowerP::getP23).collect(Collectors.toList());
|
||||
List<Double> data35 = valueTypeList.stream().map(DataHarmpowerP::getP24).collect(Collectors.toList());
|
||||
List<Double> data36 = valueTypeList.stream().map(DataHarmpowerP::getP25).collect(Collectors.toList());
|
||||
List<Double> data37 = valueTypeList.stream().map(DataHarmpowerP::getP26).collect(Collectors.toList());
|
||||
List<Double> data38 = valueTypeList.stream().map(DataHarmpowerP::getP27).collect(Collectors.toList());
|
||||
List<Double> data39 = valueTypeList.stream().map(DataHarmpowerP::getP28).collect(Collectors.toList());
|
||||
List<Double> data40 = valueTypeList.stream().map(DataHarmpowerP::getP29).collect(Collectors.toList());
|
||||
List<Double> data41 = valueTypeList.stream().map(DataHarmpowerP::getP30).collect(Collectors.toList());
|
||||
List<Double> data42 = valueTypeList.stream().map(DataHarmpowerP::getP31).collect(Collectors.toList());
|
||||
List<Double> data43 = valueTypeList.stream().map(DataHarmpowerP::getP32).collect(Collectors.toList());
|
||||
List<Double> data44 = valueTypeList.stream().map(DataHarmpowerP::getP33).collect(Collectors.toList());
|
||||
List<Double> data45 = valueTypeList.stream().map(DataHarmpowerP::getP34).collect(Collectors.toList());
|
||||
List<Double> data46 = valueTypeList.stream().map(DataHarmpowerP::getP35).collect(Collectors.toList());
|
||||
List<Double> data47 = valueTypeList.stream().map(DataHarmpowerP::getP36).collect(Collectors.toList());
|
||||
List<Double> data48 = valueTypeList.stream().map(DataHarmpowerP::getP37).collect(Collectors.toList());
|
||||
List<Double> data49 = valueTypeList.stream().map(DataHarmpowerP::getP38).collect(Collectors.toList());
|
||||
List<Double> data50 = valueTypeList.stream().map(DataHarmpowerP::getP39).collect(Collectors.toList());
|
||||
List<Double> data51 = valueTypeList.stream().map(DataHarmpowerP::getP40).collect(Collectors.toList());
|
||||
List<Double> data52 = valueTypeList.stream().map(DataHarmpowerP::getP41).collect(Collectors.toList());
|
||||
List<Double> data53 = valueTypeList.stream().map(DataHarmpowerP::getP42).collect(Collectors.toList());
|
||||
List<Double> data54 = valueTypeList.stream().map(DataHarmpowerP::getP43).collect(Collectors.toList());
|
||||
List<Double> data55 = valueTypeList.stream().map(DataHarmpowerP::getP44).collect(Collectors.toList());
|
||||
List<Double> data56 = valueTypeList.stream().map(DataHarmpowerP::getP45).collect(Collectors.toList());
|
||||
List<Double> data57 = valueTypeList.stream().map(DataHarmpowerP::getP46).collect(Collectors.toList());
|
||||
List<Double> data58 = valueTypeList.stream().map(DataHarmpowerP::getP47).collect(Collectors.toList());
|
||||
List<Double> data59 = valueTypeList.stream().map(DataHarmpowerP::getP48).collect(Collectors.toList());
|
||||
List<Double> data60 = valueTypeList.stream().map(DataHarmpowerP::getP49).collect(Collectors.toList());
|
||||
List<Double> data61 = valueTypeList.stream().map(DataHarmpowerP::getP50).collect(Collectors.toList());
|
||||
|
||||
List<List<Double>> lists = Arrays.asList(data1,data2,data3,data12,data13,data14
|
||||
,data15,data16,data17,data18,data19,data20,data21,data22,data23,data24
|
||||
,data25,data26,data27,data28,data29,data30,data31,data32,data33,data34
|
||||
,data35,data36,data37,data38,data39,data40,data41,data42,data43,data44
|
||||
,data45,data46,data47,data48,data49,data50,data51,data52,data53,data54
|
||||
,data55,data56,data57,data58,data59,data60,data61);
|
||||
value.setValueList(lists);
|
||||
valueTypes.add(value);
|
||||
});
|
||||
type.setValueTypeList(valueTypes);
|
||||
phasicTypes.add(type);
|
||||
});
|
||||
dto.setPhasicTypeList(phasicTypes);
|
||||
result.add(dto);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataHarmPowerPDto> list) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取分钟数据
|
||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataHarmpowerP> getMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataHarmpowerP> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerP.class);
|
||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.P, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||
influxQueryWrapper.regular(DataHarmpowerP::getLineId, lineList)
|
||||
.select(DataHarmpowerP::getLineId)
|
||||
.select(DataHarmpowerP::getPhasicType)
|
||||
.select(DataHarmpowerP::getValueType)
|
||||
.select(DataHarmpowerP::getP)
|
||||
.select(DataHarmpowerP::getDf)
|
||||
.select(DataHarmpowerP::getPf)
|
||||
.select(DataHarmpowerP::getQualityFlag)
|
||||
.between(DataHarmpowerP::getTime, startTime, endTime)
|
||||
.eq(DataHarmpowerP::getQualityFlag,"0");
|
||||
List<DataHarmpowerP> list = dataHarmpowerPMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataHarmpowerP>> lineMap = list.stream().collect(Collectors.groupingBy(DataHarmpowerP::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,当前监测点自身的异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataHarmpowerP> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,28 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerQDTO;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||
import com.njcn.dataProcess.dao.imapper.DataHarmpowerQMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerQRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerQDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataHarmpowerP;
|
||||
import com.njcn.dataProcess.po.influx.DataHarmpowerQ;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPowerQDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPowerQD;
|
||||
import com.njcn.dataProcess.service.IDataHarmpowerQ;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -21,8 +34,9 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("InfluxdbDataHarmpowerQImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbDataHarmpowerQImpl implements IDataHarmpowerQ {
|
||||
public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowerQRelationMapper, RStatDataHarmPowerQD> implements IDataHarmpowerQ {
|
||||
|
||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||
private final DataHarmpowerQMapper dataHarmpowerQMapper;
|
||||
|
||||
|
||||
@@ -43,4 +57,160 @@ public class InfluxdbDataHarmpowerQImpl implements IDataHarmpowerQ {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
List<CommonMinuteDto> result = new ArrayList<>();
|
||||
List<DataHarmpowerQ> data = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime());
|
||||
if (CollectionUtil.isNotEmpty(data)) {
|
||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||
//以监测点分组
|
||||
Map<String,List<DataHarmpowerQ>> lineMap = data.stream().collect(Collectors.groupingBy(DataHarmpowerQ::getLineId));
|
||||
lineMap.forEach((line,lineList)->{
|
||||
CommonMinuteDto dto = new CommonMinuteDto();
|
||||
dto.setLineId(line);
|
||||
dto.setTime(time);
|
||||
dto.setQualityFlag(lineList.get(0).getQualityFlag());
|
||||
//以相别分组
|
||||
Map<String,List<DataHarmpowerQ>> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataHarmpowerQ::getPhasicType));
|
||||
List<CommonMinuteDto.PhasicType> phasicTypes = new ArrayList<>();
|
||||
phasicTypeMap.forEach((phasicType,phasicTypeList)->{
|
||||
CommonMinuteDto.PhasicType type = new CommonMinuteDto.PhasicType();
|
||||
type.setPhasicType(phasicType);
|
||||
//以数据类型分组
|
||||
Map<String,List<DataHarmpowerQ>> valueTypeMap = phasicTypeList.stream().collect(Collectors.groupingBy(DataHarmpowerQ::getValueType));
|
||||
List<CommonMinuteDto.ValueType> valueTypes = new ArrayList<>();
|
||||
valueTypeMap.forEach((valueType,valueTypeList)->{
|
||||
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
||||
value.setValueType(valueType);
|
||||
//规定好集合指标参数
|
||||
List<Double> data1 = valueTypeList.stream().map(DataHarmpowerQ::getQ).collect(Collectors.toList());
|
||||
|
||||
List<Double> data12 = valueTypeList.stream().map(DataHarmpowerQ::getQ1).collect(Collectors.toList());
|
||||
List<Double> data13 = valueTypeList.stream().map(DataHarmpowerQ::getQ2).collect(Collectors.toList());
|
||||
List<Double> data14 = valueTypeList.stream().map(DataHarmpowerQ::getQ3).collect(Collectors.toList());
|
||||
List<Double> data15 = valueTypeList.stream().map(DataHarmpowerQ::getQ4).collect(Collectors.toList());
|
||||
List<Double> data16 = valueTypeList.stream().map(DataHarmpowerQ::getQ5).collect(Collectors.toList());
|
||||
List<Double> data17 = valueTypeList.stream().map(DataHarmpowerQ::getQ6).collect(Collectors.toList());
|
||||
List<Double> data18 = valueTypeList.stream().map(DataHarmpowerQ::getQ7).collect(Collectors.toList());
|
||||
List<Double> data19 = valueTypeList.stream().map(DataHarmpowerQ::getQ8).collect(Collectors.toList());
|
||||
List<Double> data20 = valueTypeList.stream().map(DataHarmpowerQ::getQ9).collect(Collectors.toList());
|
||||
List<Double> data21 = valueTypeList.stream().map(DataHarmpowerQ::getQ10).collect(Collectors.toList());
|
||||
List<Double> data22 = valueTypeList.stream().map(DataHarmpowerQ::getQ11).collect(Collectors.toList());
|
||||
List<Double> data23 = valueTypeList.stream().map(DataHarmpowerQ::getQ12).collect(Collectors.toList());
|
||||
List<Double> data24 = valueTypeList.stream().map(DataHarmpowerQ::getQ13).collect(Collectors.toList());
|
||||
List<Double> data25 = valueTypeList.stream().map(DataHarmpowerQ::getQ14).collect(Collectors.toList());
|
||||
List<Double> data26 = valueTypeList.stream().map(DataHarmpowerQ::getQ15).collect(Collectors.toList());
|
||||
List<Double> data27 = valueTypeList.stream().map(DataHarmpowerQ::getQ16).collect(Collectors.toList());
|
||||
List<Double> data28 = valueTypeList.stream().map(DataHarmpowerQ::getQ17).collect(Collectors.toList());
|
||||
List<Double> data29 = valueTypeList.stream().map(DataHarmpowerQ::getQ18).collect(Collectors.toList());
|
||||
List<Double> data30 = valueTypeList.stream().map(DataHarmpowerQ::getQ19).collect(Collectors.toList());
|
||||
List<Double> data31 = valueTypeList.stream().map(DataHarmpowerQ::getQ20).collect(Collectors.toList());
|
||||
List<Double> data32 = valueTypeList.stream().map(DataHarmpowerQ::getQ21).collect(Collectors.toList());
|
||||
List<Double> data33 = valueTypeList.stream().map(DataHarmpowerQ::getQ22).collect(Collectors.toList());
|
||||
List<Double> data34 = valueTypeList.stream().map(DataHarmpowerQ::getQ23).collect(Collectors.toList());
|
||||
List<Double> data35 = valueTypeList.stream().map(DataHarmpowerQ::getQ24).collect(Collectors.toList());
|
||||
List<Double> data36 = valueTypeList.stream().map(DataHarmpowerQ::getQ25).collect(Collectors.toList());
|
||||
List<Double> data37 = valueTypeList.stream().map(DataHarmpowerQ::getQ26).collect(Collectors.toList());
|
||||
List<Double> data38 = valueTypeList.stream().map(DataHarmpowerQ::getQ27).collect(Collectors.toList());
|
||||
List<Double> data39 = valueTypeList.stream().map(DataHarmpowerQ::getQ28).collect(Collectors.toList());
|
||||
List<Double> data40 = valueTypeList.stream().map(DataHarmpowerQ::getQ29).collect(Collectors.toList());
|
||||
List<Double> data41 = valueTypeList.stream().map(DataHarmpowerQ::getQ30).collect(Collectors.toList());
|
||||
List<Double> data42 = valueTypeList.stream().map(DataHarmpowerQ::getQ31).collect(Collectors.toList());
|
||||
List<Double> data43 = valueTypeList.stream().map(DataHarmpowerQ::getQ32).collect(Collectors.toList());
|
||||
List<Double> data44 = valueTypeList.stream().map(DataHarmpowerQ::getQ33).collect(Collectors.toList());
|
||||
List<Double> data45 = valueTypeList.stream().map(DataHarmpowerQ::getQ34).collect(Collectors.toList());
|
||||
List<Double> data46 = valueTypeList.stream().map(DataHarmpowerQ::getQ35).collect(Collectors.toList());
|
||||
List<Double> data47 = valueTypeList.stream().map(DataHarmpowerQ::getQ36).collect(Collectors.toList());
|
||||
List<Double> data48 = valueTypeList.stream().map(DataHarmpowerQ::getQ37).collect(Collectors.toList());
|
||||
List<Double> data49 = valueTypeList.stream().map(DataHarmpowerQ::getQ38).collect(Collectors.toList());
|
||||
List<Double> data50 = valueTypeList.stream().map(DataHarmpowerQ::getQ39).collect(Collectors.toList());
|
||||
List<Double> data51 = valueTypeList.stream().map(DataHarmpowerQ::getQ40).collect(Collectors.toList());
|
||||
List<Double> data52 = valueTypeList.stream().map(DataHarmpowerQ::getQ41).collect(Collectors.toList());
|
||||
List<Double> data53 = valueTypeList.stream().map(DataHarmpowerQ::getQ42).collect(Collectors.toList());
|
||||
List<Double> data54 = valueTypeList.stream().map(DataHarmpowerQ::getQ43).collect(Collectors.toList());
|
||||
List<Double> data55 = valueTypeList.stream().map(DataHarmpowerQ::getQ44).collect(Collectors.toList());
|
||||
List<Double> data56 = valueTypeList.stream().map(DataHarmpowerQ::getQ45).collect(Collectors.toList());
|
||||
List<Double> data57 = valueTypeList.stream().map(DataHarmpowerQ::getQ46).collect(Collectors.toList());
|
||||
List<Double> data58 = valueTypeList.stream().map(DataHarmpowerQ::getQ47).collect(Collectors.toList());
|
||||
List<Double> data59 = valueTypeList.stream().map(DataHarmpowerQ::getQ48).collect(Collectors.toList());
|
||||
List<Double> data60 = valueTypeList.stream().map(DataHarmpowerQ::getQ49).collect(Collectors.toList());
|
||||
List<Double> data61 = valueTypeList.stream().map(DataHarmpowerQ::getQ50).collect(Collectors.toList());
|
||||
|
||||
List<List<Double>> lists = Arrays.asList(data1,data12,data13,data14
|
||||
,data15,data16,data17,data18,data19,data20,data21,data22,data23,data24
|
||||
,data25,data26,data27,data28,data29,data30,data31,data32,data33,data34
|
||||
,data35,data36,data37,data38,data39,data40,data41,data42,data43,data44
|
||||
,data45,data46,data47,data48,data49,data50,data51,data52,data53,data54
|
||||
,data55,data56,data57,data58,data59,data60,data61);
|
||||
value.setValueList(lists);
|
||||
valueTypes.add(value);
|
||||
});
|
||||
type.setValueTypeList(valueTypes);
|
||||
phasicTypes.add(type);
|
||||
});
|
||||
dto.setPhasicTypeList(phasicTypes);
|
||||
result.add(dto);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataHarmPowerQDto> list) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取分钟数据
|
||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataHarmpowerQ> getMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataHarmpowerQ> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerQ.class);
|
||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.Q, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||
influxQueryWrapper.regular(DataHarmpowerQ::getLineId, lineList)
|
||||
.select(DataHarmpowerQ::getLineId)
|
||||
.select(DataHarmpowerQ::getPhasicType)
|
||||
.select(DataHarmpowerQ::getValueType)
|
||||
.select(DataHarmpowerQ::getQ)
|
||||
.select(DataHarmpowerQ::getQualityFlag)
|
||||
.between(DataHarmpowerQ::getTime, startTime, endTime)
|
||||
.eq(DataHarmpowerQ::getQualityFlag,"0");
|
||||
List<DataHarmpowerQ> list = dataHarmpowerQMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataHarmpowerQ>> lineMap = list.stream().collect(Collectors.groupingBy(DataHarmpowerQ::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,当前监测点自身的异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataHarmpowerQ> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,31 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataIDTO;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||
import com.njcn.dataProcess.dao.imapper.DataIMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataIRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataIDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataI;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataIDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataID;
|
||||
import com.njcn.dataProcess.service.IDataI;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -21,7 +37,9 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("InfluxdbDataIImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbDataIImpl implements IDataI {
|
||||
public class InfluxdbDataIImpl extends MppServiceImpl<RStatDataIRelationMapper, RStatDataID> implements IDataI {
|
||||
|
||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||
|
||||
private final DataIMapper dataIMapper;
|
||||
|
||||
@@ -43,4 +61,184 @@ public class InfluxdbDataIImpl implements IDataI {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataIDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
List<DataIDto> result = new ArrayList<>();
|
||||
List<DataI> list = getMinuteDataI(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime());
|
||||
list.forEach(item->{
|
||||
DataIDto dto = new DataIDto();
|
||||
BeanUtils.copyProperties(item,dto);
|
||||
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
List<CommonMinuteDto> result = new ArrayList<>();
|
||||
List<DataI> dataIList = getMinuteDataI(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime());
|
||||
if (CollectionUtil.isNotEmpty(dataIList)) {
|
||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||
//以监测点分组
|
||||
Map<String,List<DataI>> lineMap = dataIList.stream().collect(Collectors.groupingBy(DataI::getLineId));
|
||||
lineMap.forEach((line,lineList)->{
|
||||
CommonMinuteDto dto = new CommonMinuteDto();
|
||||
dto.setLineId(line);
|
||||
dto.setTime(time);
|
||||
dto.setQualityFlag(lineList.get(0).getQualityFlag());
|
||||
//以相别分组
|
||||
Map<String,List<DataI>> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataI::getPhasicType));
|
||||
List<CommonMinuteDto.PhasicType> phasicTypes = new ArrayList<>();
|
||||
phasicTypeMap.forEach((phasicType,phasicTypeList)->{
|
||||
CommonMinuteDto.PhasicType type = new CommonMinuteDto.PhasicType();
|
||||
type.setPhasicType(phasicType);
|
||||
//以数据类型分组
|
||||
Map<String,List<DataI>> valueTypeMap = phasicTypeList.stream().collect(Collectors.groupingBy(DataI::getValueType));
|
||||
List<CommonMinuteDto.ValueType> valueTypes = new ArrayList<>();
|
||||
valueTypeMap.forEach((valueType,valueTypeList)->{
|
||||
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
||||
value.setValueType(valueType);
|
||||
//规定好集合指标参数
|
||||
List<Double> data1 = valueTypeList.stream().map(DataI::getINeg).collect(Collectors.toList());
|
||||
List<Double> data2 = valueTypeList.stream().map(DataI::getIPos).collect(Collectors.toList());
|
||||
List<Double> data3 = valueTypeList.stream().map(DataI::getIThd).collect(Collectors.toList());
|
||||
List<Double> data4 = valueTypeList.stream().map(DataI::getIUnbalance).collect(Collectors.toList());
|
||||
List<Double> data5 = valueTypeList.stream().map(DataI::getIZero).collect(Collectors.toList());
|
||||
List<Double> data6 = valueTypeList.stream().map(DataI::getRms).collect(Collectors.toList());
|
||||
|
||||
List<Double> data12 = valueTypeList.stream().map(DataI::getI1).collect(Collectors.toList());
|
||||
List<Double> data13 = valueTypeList.stream().map(DataI::getI2).collect(Collectors.toList());
|
||||
List<Double> data14 = valueTypeList.stream().map(DataI::getI3).collect(Collectors.toList());
|
||||
List<Double> data15 = valueTypeList.stream().map(DataI::getI4).collect(Collectors.toList());
|
||||
List<Double> data16 = valueTypeList.stream().map(DataI::getI5).collect(Collectors.toList());
|
||||
List<Double> data17 = valueTypeList.stream().map(DataI::getI6).collect(Collectors.toList());
|
||||
List<Double> data18 = valueTypeList.stream().map(DataI::getI7).collect(Collectors.toList());
|
||||
List<Double> data19 = valueTypeList.stream().map(DataI::getI8).collect(Collectors.toList());
|
||||
List<Double> data20 = valueTypeList.stream().map(DataI::getI9).collect(Collectors.toList());
|
||||
List<Double> data21 = valueTypeList.stream().map(DataI::getI10).collect(Collectors.toList());
|
||||
List<Double> data22 = valueTypeList.stream().map(DataI::getI11).collect(Collectors.toList());
|
||||
List<Double> data23 = valueTypeList.stream().map(DataI::getI12).collect(Collectors.toList());
|
||||
List<Double> data24 = valueTypeList.stream().map(DataI::getI13).collect(Collectors.toList());
|
||||
List<Double> data25 = valueTypeList.stream().map(DataI::getI14).collect(Collectors.toList());
|
||||
List<Double> data26 = valueTypeList.stream().map(DataI::getI15).collect(Collectors.toList());
|
||||
List<Double> data27 = valueTypeList.stream().map(DataI::getI16).collect(Collectors.toList());
|
||||
List<Double> data28 = valueTypeList.stream().map(DataI::getI17).collect(Collectors.toList());
|
||||
List<Double> data29 = valueTypeList.stream().map(DataI::getI18).collect(Collectors.toList());
|
||||
List<Double> data30 = valueTypeList.stream().map(DataI::getI19).collect(Collectors.toList());
|
||||
List<Double> data31 = valueTypeList.stream().map(DataI::getI20).collect(Collectors.toList());
|
||||
List<Double> data32 = valueTypeList.stream().map(DataI::getI21).collect(Collectors.toList());
|
||||
List<Double> data33 = valueTypeList.stream().map(DataI::getI22).collect(Collectors.toList());
|
||||
List<Double> data34 = valueTypeList.stream().map(DataI::getI23).collect(Collectors.toList());
|
||||
List<Double> data35 = valueTypeList.stream().map(DataI::getI24).collect(Collectors.toList());
|
||||
List<Double> data36 = valueTypeList.stream().map(DataI::getI25).collect(Collectors.toList());
|
||||
List<Double> data37 = valueTypeList.stream().map(DataI::getI26).collect(Collectors.toList());
|
||||
List<Double> data38 = valueTypeList.stream().map(DataI::getI27).collect(Collectors.toList());
|
||||
List<Double> data39 = valueTypeList.stream().map(DataI::getI28).collect(Collectors.toList());
|
||||
List<Double> data40 = valueTypeList.stream().map(DataI::getI29).collect(Collectors.toList());
|
||||
List<Double> data41 = valueTypeList.stream().map(DataI::getI30).collect(Collectors.toList());
|
||||
List<Double> data42 = valueTypeList.stream().map(DataI::getI31).collect(Collectors.toList());
|
||||
List<Double> data43 = valueTypeList.stream().map(DataI::getI32).collect(Collectors.toList());
|
||||
List<Double> data44 = valueTypeList.stream().map(DataI::getI33).collect(Collectors.toList());
|
||||
List<Double> data45 = valueTypeList.stream().map(DataI::getI34).collect(Collectors.toList());
|
||||
List<Double> data46 = valueTypeList.stream().map(DataI::getI35).collect(Collectors.toList());
|
||||
List<Double> data47 = valueTypeList.stream().map(DataI::getI36).collect(Collectors.toList());
|
||||
List<Double> data48 = valueTypeList.stream().map(DataI::getI37).collect(Collectors.toList());
|
||||
List<Double> data49 = valueTypeList.stream().map(DataI::getI38).collect(Collectors.toList());
|
||||
List<Double> data50 = valueTypeList.stream().map(DataI::getI39).collect(Collectors.toList());
|
||||
List<Double> data51 = valueTypeList.stream().map(DataI::getI40).collect(Collectors.toList());
|
||||
List<Double> data52 = valueTypeList.stream().map(DataI::getI41).collect(Collectors.toList());
|
||||
List<Double> data53 = valueTypeList.stream().map(DataI::getI42).collect(Collectors.toList());
|
||||
List<Double> data54 = valueTypeList.stream().map(DataI::getI43).collect(Collectors.toList());
|
||||
List<Double> data55 = valueTypeList.stream().map(DataI::getI44).collect(Collectors.toList());
|
||||
List<Double> data56 = valueTypeList.stream().map(DataI::getI45).collect(Collectors.toList());
|
||||
List<Double> data57 = valueTypeList.stream().map(DataI::getI46).collect(Collectors.toList());
|
||||
List<Double> data58 = valueTypeList.stream().map(DataI::getI47).collect(Collectors.toList());
|
||||
List<Double> data59 = valueTypeList.stream().map(DataI::getI48).collect(Collectors.toList());
|
||||
List<Double> data60 = valueTypeList.stream().map(DataI::getI49).collect(Collectors.toList());
|
||||
List<Double> data61 = valueTypeList.stream().map(DataI::getI50).collect(Collectors.toList());
|
||||
|
||||
List<List<Double>> lists = Arrays.asList(data1,data2,data3,data4,data5,data6
|
||||
,data12,data13,data14,data15,data16,data17,data18,data19,data20
|
||||
,data21,data22,data23,data24,data25,data26,data27,data28,data29,data30
|
||||
,data31,data32,data33,data34,data35,data36,data37,data38,data39,data40
|
||||
,data41,data42,data43,data44,data45,data46,data47,data48,data49,data50
|
||||
,data51,data52,data53,data54,data55,data56,data57,data58,data59,data60
|
||||
,data61);
|
||||
value.setValueList(lists);
|
||||
valueTypes.add(value);
|
||||
});
|
||||
type.setValueTypeList(valueTypes);
|
||||
phasicTypes.add(type);
|
||||
});
|
||||
dto.setPhasicTypeList(phasicTypes);
|
||||
result.add(dto);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataIDto> dataIDtoList) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取dataI分钟数据
|
||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataI> getMinuteDataI(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataI> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||
influxQueryWrapper.regular(DataI::getLineId, lineList)
|
||||
.select(DataI::getLineId)
|
||||
.select(DataI::getPhasicType)
|
||||
.select(DataI::getValueType)
|
||||
.select(DataI::getINeg)
|
||||
.select(DataI::getIPos)
|
||||
.select(DataI::getIThd)
|
||||
.select(DataI::getIUnbalance)
|
||||
.select(DataI::getIZero)
|
||||
.select(DataI::getRms)
|
||||
.select(DataI::getQualityFlag)
|
||||
.between(DataI::getTime, startTime, endTime)
|
||||
.eq(DataI::getQualityFlag,"0");
|
||||
List<DataI> list = dataIMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataI>> lineMap = list.stream().collect(Collectors.groupingBy(DataI::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,当前监测点自身的异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataI> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,29 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataInharmVDTO;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||
import com.njcn.dataProcess.dao.imapper.DataInharmVMapper;
|
||||
import com.njcn.dataProcess.dto.DataInharmVDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataI;
|
||||
import com.njcn.dataProcess.po.influx.DataInharmV;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
import com.njcn.dataProcess.service.IDataInharmV;
|
||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/11/18 14:33【需求编号】
|
||||
@@ -23,6 +35,8 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbDataInharmVImpl implements IDataInharmV {
|
||||
|
||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||
|
||||
private final DataInharmVMapper dataInharmVMapper;
|
||||
|
||||
|
||||
@@ -43,4 +57,68 @@ public class InfluxdbDataInharmVImpl implements IDataInharmV {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
List<DataHarmDto> result = new ArrayList<>();
|
||||
List<DataInharmV> list = getMinuteData(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime());
|
||||
list.forEach(item->{
|
||||
DataHarmDto dto = new DataHarmDto();
|
||||
BeanUtils.copyProperties(item,dto);
|
||||
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取dataI分钟数据
|
||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataInharmV> getMinuteData(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataInharmV> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmV.class);
|
||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||
influxQueryWrapper.regular(DataInharmV::getLineId, lineList)
|
||||
.select(DataInharmV::getLineId)
|
||||
.select(DataInharmV::getPhasicType)
|
||||
.select(DataInharmV::getValueType)
|
||||
.select(DataInharmV::getQualityFlag)
|
||||
.between(DataI::getTime, startTime, endTime)
|
||||
.eq(DataI::getQualityFlag,"0");
|
||||
List<DataInharmV> list = dataInharmVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataInharmV>> lineMap = list.stream().collect(Collectors.groupingBy(DataInharmV::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,当前监测点自身的异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataInharmV> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataPltDTO;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||
import com.njcn.dataProcess.dao.imapper.DataPltMapper;
|
||||
import com.njcn.dataProcess.dto.DataPltDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataI;
|
||||
import com.njcn.dataProcess.po.influx.DataPlt;
|
||||
import com.njcn.dataProcess.pojo.dto.DataPltDto;
|
||||
import com.njcn.dataProcess.service.IDataPlt;
|
||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -23,8 +34,9 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbDataPltImpl implements IDataPlt {
|
||||
|
||||
private final DataPltMapper dataPltMapper;
|
||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||
|
||||
private final DataPltMapper dataPltMapper;
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<DataPltDTO> dataPltDTOList) {
|
||||
@@ -44,4 +56,68 @@ public class InfluxdbDataPltImpl implements IDataPlt {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataPltDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
List<DataPltDto> result = new ArrayList<>();
|
||||
List<DataPlt> list = getMinuteDataPlt(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime());
|
||||
list.forEach(item->{
|
||||
DataPltDto dto = new DataPltDto();
|
||||
BeanUtils.copyProperties(item,dto);
|
||||
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取dataI分钟数据
|
||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataPlt> getMinuteDataPlt(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataPlt> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataPlt.class);
|
||||
influxQueryWrapper.regular(DataPlt::getLineId, lineList)
|
||||
.select(DataPlt::getLineId)
|
||||
.select(DataPlt::getPhasicType)
|
||||
.select(DataPlt::getPlt)
|
||||
.select(DataPlt::getQualityFlag)
|
||||
.between(DataPlt::getTime, startTime, endTime)
|
||||
.eq(DataPlt::getQualityFlag,"0");
|
||||
List<DataPlt> list = dataPltMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataPlt>> lineMap = list.stream().collect(Collectors.groupingBy(DataPlt::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,当前监测点自身的异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataPlt> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -39,7 +40,7 @@ import java.util.stream.Collectors;
|
||||
@Service("InfluxdbDataVImpl")
|
||||
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 DataVMapper dataVMapper;
|
||||
@@ -119,7 +120,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
||||
@Override
|
||||
public List<DataVDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
List<DataVDto> result = new ArrayList<>();
|
||||
List<DataV> list = getMinuteDataV(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), false);
|
||||
List<DataV> list = getMinuteDataV(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime());
|
||||
list.forEach(item->{
|
||||
DataVDto dto = new DataVDto();
|
||||
BeanUtils.copyProperties(item,dto);
|
||||
@@ -132,7 +133,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
List<CommonMinuteDto> result = new ArrayList<>();
|
||||
List<DataV> dataVList = getMinuteDataV(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),true);
|
||||
List<DataV> dataVList = getMinuteDataV(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(),lineParam.getAbnormalTime());
|
||||
if (CollectionUtil.isNotEmpty(dataVList)) {
|
||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||
//以监测点分组
|
||||
@@ -141,6 +142,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
||||
CommonMinuteDto dto = new CommonMinuteDto();
|
||||
dto.setLineId(line);
|
||||
dto.setTime(time);
|
||||
dto.setQualityFlag(lineList.get(0).getQualityFlag());
|
||||
//以相别分组
|
||||
Map<String,List<DataV>> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataV::getPhasicType));
|
||||
List<CommonMinuteDto.PhasicType> phasicTypes = new ArrayList<>();
|
||||
@@ -256,8 +258,14 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取dataV分钟数据
|
||||
* timeMap参数来判断是否进行数据出来 timeMap为空则不进行数据处理
|
||||
* 剔除异常数据,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<DataV> getMinuteDataV(List<String> lineList, String startTime, String endTime, boolean clean) {
|
||||
public List<DataV> getMinuteDataV(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
|
||||
List<DataV> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||
influxQueryWrapper.regular(DataV::getLineId, lineList)
|
||||
@@ -276,11 +284,38 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
||||
.select(DataV::getVlDev)
|
||||
.select(DataV::getVuDev)
|
||||
.select(DataV::getQualityFlag)
|
||||
.between(DataV::getTime, startTime, endTime);
|
||||
if (clean) {
|
||||
influxQueryWrapper.eq(DataV::getAbnormalFlag,0);
|
||||
.between(DataV::getTime, startTime, endTime)
|
||||
.eq(DataV::getQualityFlag,"0");
|
||||
List<DataV> list = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
Map<String,List<DataV>> lineMap = list.stream().collect(Collectors.groupingBy(DataV::getLineId));
|
||||
//有异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||
lineMap.forEach((k,v)->{
|
||||
List<String> timeList = timeMap.get(k);
|
||||
//有异常数据,是自身异常数据
|
||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||
List<DataV> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||
result.addAll(filterList);
|
||||
}
|
||||
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||
else {
|
||||
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||
result.addAll(v);
|
||||
}
|
||||
}
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
return dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
//没有异常数据,则使用原数据
|
||||
else {
|
||||
result.addAll(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.PqDataVerifyMapper;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.po.PqDataVerify;
|
||||
import com.njcn.dataProcess.service.IPqDataVerifyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-17
|
||||
*/
|
||||
@Service
|
||||
public class PqDataVerifyServiceImpl extends MppServiceImpl<PqDataVerifyMapper, PqDataVerify> implements IPqDataVerifyService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertData(List<PqDataVerify> list) {
|
||||
this.saveOrUpdateBatchByMultiId(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PqDataVerify> queryData(LineCountEvaluateParam param) {
|
||||
LambdaQueryWrapper<PqDataVerify> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.between(PqDataVerify::getTime,param.getStartTime(),param.getEndTime());
|
||||
if (CollUtil.isNotEmpty(param.getLineId())) {
|
||||
queryWrapper.in(PqDataVerify::getLineId,param.getLineId());
|
||||
}
|
||||
if (!Objects.isNull(param.getTableName())) {
|
||||
queryWrapper.eq(PqDataVerify::getIndexTable, param.getTableName());
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.PqReasonableRangeMapper;
|
||||
import com.njcn.dataProcess.param.DataCleanParam;
|
||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
||||
import com.njcn.dataProcess.pojo.po.PqReasonableRange;
|
||||
import com.njcn.dataProcess.service.IPqReasonableRangeService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-13
|
||||
*/
|
||||
@Service
|
||||
public class PqReasonableRangeServiceImpl extends ServiceImpl<PqReasonableRangeMapper, PqReasonableRange> implements IPqReasonableRangeService {
|
||||
|
||||
@Override
|
||||
public List<PqReasonableRangeDto> getReasonableRangeList(DataCleanParam param) {
|
||||
List<PqReasonableRangeDto> result = new ArrayList<>();
|
||||
LambdaQueryWrapper<PqReasonableRange> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PqReasonableRange::getBelongingSystem,param.getSystemType())
|
||||
.eq(PqReasonableRange::getDataSource,param.getDataSource())
|
||||
.eq(PqReasonableRange::getInfluxdbTableName,param.getTableName())
|
||||
.eq(PqReasonableRange::getState,1);
|
||||
List<PqReasonableRange> list = this.list(queryWrapper);
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item->{
|
||||
PqReasonableRangeDto dto = new PqReasonableRangeDto();
|
||||
BeanUtils.copyProperties(item,dto);
|
||||
result.add(dto);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,25 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataFlickerDTO;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataFlickerRelationMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataFlickerRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataFlickerDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.relation.DataFlicker;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataFlickerDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataFlickerD;
|
||||
import com.njcn.dataProcess.service.IDataFlicker;
|
||||
import com.njcn.dataProcess.util.BeanFeildUtils;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -23,9 +32,12 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("RelationDataFlickerImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class RelationDataFlickerImpl implements IDataFlicker {
|
||||
public class RelationDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRelationMapper, RStatDataFlickerD> implements IDataFlicker {
|
||||
private final DataFlickerRelationMapper dataFlickerRelationMapper;
|
||||
|
||||
@Resource
|
||||
private IDataFlicker dataFlicker;
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<DataFlickerDTO> dataFlickerDTOList) {
|
||||
int totalCount = dataFlickerDTOList.size();
|
||||
@@ -53,4 +65,28 @@ public class RelationDataFlickerImpl implements IDataFlicker {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataFlickerDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataFlickerDto> dataIDtoList) {
|
||||
List<RStatDataFlickerD> result = new ArrayList<>();
|
||||
dataIDtoList.forEach(item->{
|
||||
RStatDataFlickerD data = new RStatDataFlickerD();
|
||||
data.setTime(TimeUtils.LocalDataTimeToLocalDate2(item.getTime()));
|
||||
data.setPhasicType(item.getPhasicType());
|
||||
data.setQualityFlag(Integer.valueOf(item.getQualityFlag()));
|
||||
BeanUtils.copyProperties(item, data);
|
||||
result.add(data);
|
||||
});
|
||||
dataFlicker.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataFlucDTO;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataFlucRelationMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataFlucRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataFlucDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.relation.DataFluc;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataFlucDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataFlucD;
|
||||
import com.njcn.dataProcess.service.IDataFluc;
|
||||
import com.njcn.dataProcess.util.BeanFeildUtils;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -23,8 +32,11 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("RelationDataFlucImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class RelationDataFlucImpl implements IDataFluc {
|
||||
public class RelationDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMapper, RStatDataFlucD> implements IDataFluc {
|
||||
private final DataFlucRelationMapper dataFlucRelationMapper;
|
||||
|
||||
@Resource
|
||||
private IDataFluc dataFluc;
|
||||
@Override
|
||||
public void batchInsertion(List<DataFlucDTO> dataFlucDTOList) {
|
||||
int totalCount = dataFlucDTOList.size();
|
||||
@@ -43,5 +55,31 @@ public class RelationDataFlucImpl implements IDataFluc {
|
||||
dataFlucRelationMapper.insertBatchSomeColumn(dataFlucList);
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataFlucDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataFlucDto> dataFlucDtoList) {
|
||||
List<RStatDataFlucD> result = new ArrayList<>();
|
||||
dataFlucDtoList.forEach(item->{
|
||||
RStatDataFlucD data = new RStatDataFlucD();
|
||||
data.setTime(TimeUtils.LocalDataTimeToLocalDate2(item.getTime()));
|
||||
data.setPhasicType(item.getPhasicType());
|
||||
data.setQualityFlag(Integer.valueOf(item.getQualityFlag()));
|
||||
BeanUtils.copyProperties(item, data);
|
||||
result.add(data);
|
||||
});
|
||||
dataFluc.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataIRelationMapper;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
import com.njcn.dataProcess.service.IDataHarmRateV;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Service("RelationDataHarmRateVImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class RelationDataHarmRateVImpl implements IDataHarmRateV {
|
||||
|
||||
@Resource
|
||||
private DataIRelationMapper dataIRelationMapper;
|
||||
|
||||
@Override
|
||||
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,25 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicIDTO;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataHarmphasicIRelationMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPhasicIRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicIDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.relation.DataHarmphasicI;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPhasicIDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPhasicID;
|
||||
import com.njcn.dataProcess.service.IDataHarmphasicI;
|
||||
import com.njcn.dataProcess.util.BeanFeildUtils;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -23,10 +32,13 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("RelationDataHarmphasicIImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class RelationDataHarmphasicIImpl implements IDataHarmphasicI {
|
||||
public class RelationDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPhasicIRelationMapper, RStatDataHarmPhasicID> implements IDataHarmphasicI {
|
||||
|
||||
private final DataHarmphasicIRelationMapper dataHarmphasicIRelationMapper;
|
||||
|
||||
@Resource
|
||||
private IDataHarmphasicI dataHarmphasicI;
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<DataHarmphasicIDTO> dataHarmphasicIDTOList) {
|
||||
int totalCount = dataHarmphasicIDTOList.size();
|
||||
@@ -54,4 +66,23 @@ public class RelationDataHarmphasicIImpl implements IDataHarmphasicI {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataHarmPhasicIDto> list) {
|
||||
List<RStatDataHarmPhasicID> result = new ArrayList<>();
|
||||
list.forEach(item->{
|
||||
RStatDataHarmPhasicID data = new RStatDataHarmPhasicID();
|
||||
data.setTime(TimeUtils.LocalDataTimeToLocalDate2(item.getTime()));
|
||||
data.setPhasicType(item.getPhasicType());
|
||||
data.setQualityFlag(Integer.valueOf(item.getQualityFlag()));
|
||||
BeanUtils.copyProperties(item, data);
|
||||
result.add(data);
|
||||
});
|
||||
dataHarmphasicI.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicVDTO;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataHarmphasicVRelationMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPhasicVRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataHarmphasicVDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.relation.DataHarmphasicV;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPhasicVDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPhasicVD;
|
||||
import com.njcn.dataProcess.service.IDataHarmphasicV;
|
||||
import com.njcn.dataProcess.util.BeanFeildUtils;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -22,8 +33,12 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("RelationDataHarmphasicVImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class RelationDataHarmphasicVImpl implements IDataHarmphasicV {
|
||||
public class RelationDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPhasicVRelationMapper, RStatDataHarmPhasicVD> implements IDataHarmphasicV {
|
||||
|
||||
private final DataHarmphasicVRelationMapper dataHarmphasicVRelationMapper;
|
||||
@Resource
|
||||
private IDataHarmphasicV dataHarmphasicV;
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<DataHarmphasicVDTO> dataHarmphasicVDTOList) {
|
||||
int totalCount = dataHarmphasicVDTOList.size();
|
||||
@@ -50,5 +65,29 @@ public class RelationDataHarmphasicVImpl implements IDataHarmphasicV {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataHarmPhasicVDto> list) {
|
||||
List<RStatDataHarmPhasicVD> result = new ArrayList<>();
|
||||
list.forEach(item->{
|
||||
RStatDataHarmPhasicVD data = new RStatDataHarmPhasicVD();
|
||||
data.setTime(TimeUtils.LocalDataTimeToLocalDate2(item.getTime()));
|
||||
data.setPhasicType(item.getPhasicType());
|
||||
data.setQualityFlag(Integer.valueOf(item.getQualityFlag()));
|
||||
BeanUtils.copyProperties(item, data);
|
||||
result.add(data);
|
||||
});
|
||||
dataHarmphasicV.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerPDTO;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataHarmpowerPRelationMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerPRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerPDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.relation.DataHarmpowerP;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPowerPDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataPowerPDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPowerPD;
|
||||
import com.njcn.dataProcess.service.IDataHarmpowerP;
|
||||
import com.njcn.dataProcess.util.BeanFeildUtils;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -23,9 +33,11 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("RelationDataHarmpowerPImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class RelationDataHarmpowerPImpl implements IDataHarmpowerP {
|
||||
public class RelationDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowerPRelationMapper, RStatDataHarmPowerPD> implements IDataHarmpowerP {
|
||||
|
||||
private final DataHarmpowerPRelationMapper dataHarmpowerPRelationMapper;
|
||||
@Resource
|
||||
private IDataHarmpowerP dataHarmPowerP;
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<DataHarmpowerPDTO> dataHarmpowerPDTOList) {
|
||||
@@ -53,4 +65,28 @@ public class RelationDataHarmpowerPImpl implements IDataHarmpowerP {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataPowerPDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataHarmPowerPDto> list) {
|
||||
List<RStatDataHarmPowerPD> result = new ArrayList<>();
|
||||
list.forEach(item->{
|
||||
RStatDataHarmPowerPD data = new RStatDataHarmPowerPD();
|
||||
data.setTime(TimeUtils.LocalDataTimeToLocalDate2(item.getTime()));
|
||||
data.setPhasicType(item.getPhasicType());
|
||||
data.setQualityFlag(Integer.valueOf(item.getQualityFlag()));
|
||||
BeanUtils.copyProperties(item, data);
|
||||
result.add(data);
|
||||
});
|
||||
dataHarmPowerP.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerQDTO;
|
||||
import com.njcn.dataProcess.po.relation.DataHarmpowerQ;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataHarmpowerQRelationMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerQRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataHarmpowerQDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.relation.DataHarmpowerQ;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmPowerQDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmPowerQD;
|
||||
import com.njcn.dataProcess.service.IDataHarmpowerQ;
|
||||
import com.njcn.dataProcess.util.BeanFeildUtils;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -24,8 +34,10 @@ import java.util.stream.Collectors;
|
||||
@Service("RelationDataHarmpowerQImpl")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class RelationDataHarmpowerQImpl implements IDataHarmpowerQ {
|
||||
public class RelationDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowerQRelationMapper, RStatDataHarmPowerQD> implements IDataHarmpowerQ {
|
||||
private final DataHarmpowerQRelationMapper dataHarmpowerQRelationMapper;
|
||||
@Resource
|
||||
private IDataHarmpowerQ dataHarmpowerQ;
|
||||
@Override
|
||||
public void batchInsertion(List<DataHarmpowerQDTO> dataHarmpowerQDTOList) {
|
||||
int totalCount = dataHarmpowerQDTOList.size();
|
||||
@@ -56,4 +68,23 @@ public class RelationDataHarmpowerQImpl implements IDataHarmpowerQ {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataHarmPowerQDto> list) {
|
||||
List<RStatDataHarmPowerQD> result = new ArrayList<>();
|
||||
list.forEach(item->{
|
||||
RStatDataHarmPowerQD data = new RStatDataHarmPowerQD();
|
||||
data.setTime(TimeUtils.LocalDataTimeToLocalDate2(item.getTime()));
|
||||
data.setPhasicType(item.getPhasicType());
|
||||
data.setQualityFlag(Integer.valueOf(item.getQualityFlag()));
|
||||
BeanUtils.copyProperties(item, data);
|
||||
result.add(data);
|
||||
});
|
||||
dataHarmpowerQ.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.njcn.dataProcess.dto.DataIDTO;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataIRelationMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataIRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataIDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.relation.DataI;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataIDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataID;
|
||||
import com.njcn.dataProcess.service.IDataI;
|
||||
import com.njcn.dataProcess.util.BeanFeildUtils;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -24,9 +32,14 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service("RelationDataIImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class RelationDataIImpl implements IDataI {
|
||||
public class RelationDataIImpl extends MppServiceImpl<RStatDataIRelationMapper, RStatDataID> implements IDataI {
|
||||
@Resource
|
||||
private DataIRelationMapper dataIRelationMapper;
|
||||
|
||||
@Resource
|
||||
private IDataI iDataI;
|
||||
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<DataIDTO> dataIDTOList) {
|
||||
int totalCount = dataIDTOList.size();
|
||||
@@ -51,4 +64,28 @@ public class RelationDataIImpl implements IDataI {
|
||||
dataIRelationMapper.insertBatchSomeColumn(dataIList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataIDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DataIDto> dataIDtoList) {
|
||||
List<RStatDataID> result = new ArrayList<>();
|
||||
dataIDtoList.forEach(item->{
|
||||
RStatDataID dataI = new RStatDataID();
|
||||
dataI.setTime(TimeUtils.LocalDataTimeToLocalDate2(item.getTime()));
|
||||
dataI.setPhasicType(item.getPhasicType());
|
||||
dataI.setQualityFlag(Integer.valueOf(item.getQualityFlag()));
|
||||
BeanUtils.copyProperties(item, dataI);
|
||||
result.add(dataI);
|
||||
});
|
||||
iDataI.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.njcn.dataProcess.service.impl.relation;
|
||||
import com.njcn.dataProcess.dto.DataInharmVDTO;
|
||||
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataVInharmVRelationMapper;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.relation.DataInharmV;
|
||||
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||
import com.njcn.dataProcess.service.IDataInharmV;
|
||||
import com.njcn.dataProcess.util.BeanFeildUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -11,6 +13,7 @@ import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -51,4 +54,9 @@ public class RelationDataInharmVImpl implements IDataInharmV {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.njcn.dataProcess.service.impl.relation;
|
||||
import com.njcn.dataProcess.dto.DataPltDTO;
|
||||
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataPltRelationMapper;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.relation.DataPlt;
|
||||
import com.njcn.dataProcess.pojo.dto.DataPltDto;
|
||||
import com.njcn.dataProcess.service.IDataPlt;
|
||||
import com.njcn.dataProcess.util.BeanFeildUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -11,6 +13,7 @@ import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -51,4 +54,9 @@ public class RelationDataPltImpl implements IDataPlt {
|
||||
dataPltRelationMapper.insertBatchSomeColumn(dataPltList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataPltDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.DataVRelationMapper;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataVRelationMapper;
|
||||
import com.njcn.dataProcess.dto.DataVDTO;
|
||||
@@ -20,6 +21,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Field;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -37,8 +39,10 @@ import java.util.stream.Collectors;
|
||||
public class RelationDataVImpl extends MppServiceImpl<RStatDataVRelationMapper, RStatDataVD> implements IDataV {
|
||||
@Resource
|
||||
private DataVRelationMapper dataVRelationMapper;
|
||||
|
||||
@Resource
|
||||
private IDataV iDataV;
|
||||
|
||||
@Override
|
||||
public Map<String, List<DataVFiveItemDTO>> getLineCountEvaluate(LineCountEvaluateParam lineParam) {
|
||||
|
||||
@@ -100,10 +104,11 @@ public class RelationDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
||||
RStatDataVD dataV = new RStatDataVD();
|
||||
dataV.setTime(TimeUtils.LocalDataTimeToLocalDate2(item.getTime()));
|
||||
dataV.setPhasicType(item.getPhasicType());
|
||||
dataV.setQualityFlag(Integer.valueOf(item.getQualityFlag()));
|
||||
BeanUtils.copyProperties(item, dataV);
|
||||
result.add(dataV);
|
||||
});
|
||||
iDataV.saveOrUpdateBatch(result);
|
||||
iDataV.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user