完成暂态算法和调整部分逻辑

This commit is contained in:
wr
2025-03-17 20:13:04 +08:00
parent a7bf00e312
commit cd84bd00d4
29 changed files with 871 additions and 40 deletions

View File

@@ -0,0 +1,42 @@
package com.njcn.dataProcess.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.dataProcess.api.fallback.EventDetailFeignClientClientFallbackFactory;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @Description:
* @Author: wr
* @Date: 2025/3/7 9:30
*/
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/eventDetailCount", fallbackFactory = EventDetailFeignClientClientFallbackFactory.class, contextId = "eventDetailCount")
public interface EventDetailFeignClient {
@PostMapping("/batchInsertionD")
HttpResult<String> batchInsertionD(@RequestBody List<DataEventDetailDto> eventDetailDto);
@PostMapping("/batchInsertionM")
HttpResult<String> batchInsertionM(@RequestBody List<DataEventDetailDto> eventDetailDto);
@PostMapping("/batchInsertionQ")
HttpResult<String> batchInsertionQ(@RequestBody List<DataEventDetailDto> eventDetailDto);
@PostMapping("/batchInsertionY")
HttpResult<String> batchInsertionY(@RequestBody List<DataEventDetailDto> eventDetailDto);
@PostMapping("/getRawDataD")
HttpResult<List<DataEventDetailDto>> getRawDataD(@RequestBody LineCountEvaluateParam lineParam);
@PostMapping("/getRawDataM")
HttpResult<List<DataEventDetailDto>> getRawDataM(@RequestBody LineCountEvaluateParam lineParam);
@PostMapping("/getRawDataQ")
HttpResult<List<DataEventDetailDto>> getRawDataQ(@RequestBody LineCountEvaluateParam lineParam);
}

View File

@@ -5,10 +5,13 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.dataProcess.api.fallback.RmpEventFeignClientFallbackFactory;
import com.njcn.dataProcess.dto.RmpEventDetailDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @author denghuajun
* @version 1.0.0
@@ -17,9 +20,9 @@ import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/rmpEventDetail", fallbackFactory = RmpEventFeignClientFallbackFactory.class, contextId = "rmpEventDetail")
public interface RmpEventDetailFeignClient {
@PostMapping("/batchInsertion")
HttpResult<String> batchInsertion(@RequestBody RmpEventDetailDTO rmpEventDetailDTO);
@PostMapping("/getRawData")
HttpResult<List<RmpEventDetailDTO>> getRawData(@RequestBody LineCountEvaluateParam lineParam);
}

View File

@@ -0,0 +1,86 @@
package com.njcn.dataProcess.api.fallback;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.dataProcess.api.EventDetailFeignClient;
import com.njcn.dataProcess.api.PqDataVerifyFeignClient;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.PqDataVerify;
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author xy
* @version 1.0.0
* @date 2025年02月13日 20:13
*/
@Slf4j
@Component
public class EventDetailFeignClientClientFallbackFactory implements FallbackFactory<EventDetailFeignClient> {
/**
* 输出远程请求接口异常日志
* @param cause RPC请求异常
*/
@Override
public EventDetailFeignClient create(Throwable cause) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if(cause.getCause() instanceof BusinessException){
BusinessException businessException = (BusinessException) cause.getCause();
exceptionEnum = DataProcessingEnumUtil.getExceptionEnum(businessException.getResult());
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new EventDetailFeignClient() {
@Override
public HttpResult<String> batchInsertionD(List<DataEventDetailDto> eventDetailDto) {
log.error("{}异常,降级处理,异常为:{}","暂态事件(天)统计批量插入",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<String> batchInsertionM(List<DataEventDetailDto> eventDetailDto) {
log.error("{}异常,降级处理,异常为:{}","暂态事件(月)统计批量插入",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<String> batchInsertionQ(List<DataEventDetailDto> eventDetailDto) {
log.error("{}异常,降级处理,异常为:{}","暂态事件(季)统计批量插入",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<String> batchInsertionY(List<DataEventDetailDto> eventDetailDto) {
log.error("{}异常,降级处理,异常为:{}","暂态事件(年)统计批量插入",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<DataEventDetailDto>> getRawDataD(LineCountEvaluateParam lineParam) {
log.error("{}异常,降级处理,异常为:{}","获取(天)原始数据",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<DataEventDetailDto>> getRawDataM(LineCountEvaluateParam lineParam) {
log.error("{}异常,降级处理,异常为:{}","获取(月)原始数据",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<DataEventDetailDto>> getRawDataQ(LineCountEvaluateParam lineParam) {
log.error("{}异常,降级处理,异常为:{}","获取(季)原始数据",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -5,12 +5,14 @@ import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.dataProcess.api.RmpEventDetailFeignClient;
import com.njcn.dataProcess.dto.RmpEventDetailDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
import com.njcn.system.utils.SystemEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author denghuajun
* @version 1.0.0
@@ -42,6 +44,12 @@ public class RmpEventFeignClientFallbackFactory implements FallbackFactory<RmpEv
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<RmpEventDetailDTO>> getRawData(LineCountEvaluateParam lineParam) {
log.error("{}异常,降级处理,异常为:{}","获取时间范围数据",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -20,7 +20,6 @@ public class RmpEventDetailDTO implements Serializable {
@ApiModelProperty(value = "暂时事件ID")
private String eventId;
@ApiModelProperty(value = "监测点ID(复制)")
private String measurementPointId;

View File

@@ -105,4 +105,45 @@ public class TimeUtils {
DateUtil.parse(time, DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN);
}
/**
* 根据日期获取当月零点时间
* String类型的yyyy-MM-dd转成yyyy-MM-dd HH:mm:ss
*/
public static String getBeginOfQuarter(String time) {
return DateUtil.format(
DateUtil.beginOfQuarter(
DateUtil.parse(time, DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN);
}
/**
* 根据日期获取当月结束时间
* String类型的yyyy-MM-dd转成yyyy-MM-dd HH:mm:ss
*/
public static String getEndOfQuarter(String time) {
return DateUtil.format(
DateUtil.endOfQuarter(
DateUtil.parse(time, DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN);
}
/**
* 根据日期获取当月零点时间
* String类型的yyyy-MM-dd转成yyyy-MM-dd HH:mm:ss
*/
public static String getBeginOfYear(String time) {
return DateUtil.format(
DateUtil.beginOfYear(
DateUtil.parse(time, DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN);
}
/**
* 根据日期获取当月结束时间
* String类型的yyyy-MM-dd转成yyyy-MM-dd HH:mm:ss
*/
public static String getEndOfYear(String time) {
return DateUtil.format(
DateUtil.endOfYear(
DateUtil.parse(time, DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN);
}
}

View File

@@ -9,6 +9,7 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.dataProcess.dto.RmpEventDetailDTO;
import com.njcn.dataProcess.annotation.InsertBean;
import com.njcn.dataProcess.annotation.QueryBean;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.service.IRmpEventDetail;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
@@ -21,6 +22,8 @@ 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
@@ -46,14 +49,22 @@ public class RmpEventDetailController extends BaseController {
@ApiOperation("批量插入")
public HttpResult<String> batchInsertion(@RequestBody RmpEventDetailDTO rmpEventDetailDTO) {
String methodDescribe = getMethodDescribe("batchInsertion");
iRmpEventDetailInsert.batchInsertion(rmpEventDetailDTO);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/getRawData")
@ApiOperation("获取时间范围数据")
public HttpResult<List<RmpEventDetailDTO>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
String methodDescribe = getMethodDescribe("getRawData");
List<RmpEventDetailDTO> rawData = iRmpEventDetailInsert.getRawData(lineParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
}
}

View File

@@ -0,0 +1,69 @@
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.DataEventDetailDto;
import com.njcn.dataProcess.service.*;
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("/eventDetailCount")
@Api(tags = "暂态事件统计")
public class RmpEventDetailDController extends BaseController {
@QueryBean
private IRmpEventDetailD eventDetailDQuery;
@InsertBean
private IRmpEventDetailD eventDetailDInsert;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/batchInsertionD")
@ApiOperation("暂态事件(天)统计批量插入")
public HttpResult<String> batchInsertionD(@RequestBody List<DataEventDetailDto> eventDetailDto) {
String methodDescribe = getMethodDescribe("batchInsertionD");
eventDetailDInsert.batchInsertion(eventDetailDto);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getRawDataD")
@ApiOperation("获取(天)原始数据")
public HttpResult<List<DataEventDetailDto>> getRawDataD(@RequestBody LineCountEvaluateParam lineParam) {
String methodDescribe = getMethodDescribe("getRawDataD");
List<DataEventDetailDto> rawData = eventDetailDInsert.getRawData(lineParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
}
}

View File

@@ -0,0 +1,71 @@
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.DataEventDetailDto;
import com.njcn.dataProcess.service.IRmpEventDetailM;
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("/eventDetailCount")
@Api(tags = "暂态事件统计")
public class RmpEventDetailMController extends BaseController {
@QueryBean
private IRmpEventDetailM eventDetailMQuery;
@InsertBean
private IRmpEventDetailM eventDetailMInsert;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/batchInsertionM")
@ApiOperation("暂态事件(月)统计批量插入")
public HttpResult<String> batchInsertionM(@RequestBody List<DataEventDetailDto> eventDetailDto) {
String methodDescribe = getMethodDescribe("batchInsertionM");
eventDetailMInsert.batchInsertion(eventDetailDto);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getRawDataM")
@ApiOperation("获取(月)原始数据")
public HttpResult<List<DataEventDetailDto>> getRawDataM(@RequestBody LineCountEvaluateParam lineParam) {
String methodDescribe = getMethodDescribe("getRawDataM");
List<DataEventDetailDto> rawData = eventDetailMInsert.getRawData(lineParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
}
}

View File

@@ -0,0 +1,71 @@
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.DataEventDetailDto;
import com.njcn.dataProcess.service.IRmpEventDetailQ;
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("/eventDetailCount")
@Api(tags = "暂态事件统计")
public class RmpEventDetailQController extends BaseController {
@QueryBean
private IRmpEventDetailQ eventDetailQQuery;
@InsertBean
private IRmpEventDetailQ eventDetailQInsert;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/batchInsertionQ")
@ApiOperation("暂态事件(季)统计批量插入")
public HttpResult<String> batchInsertionQ(@RequestBody List<DataEventDetailDto> eventDetailDto) {
String methodDescribe = getMethodDescribe("batchInsertionQ");
eventDetailQInsert.batchInsertion(eventDetailDto);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getRawDataQ")
@ApiOperation("获取(季)原始数据")
public HttpResult<List<DataEventDetailDto>> getRawDataQ(@RequestBody LineCountEvaluateParam lineParam) {
String methodDescribe = getMethodDescribe("getRawDataQ");
List<DataEventDetailDto> rawData = eventDetailQInsert.getRawData(lineParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
}
}

View File

@@ -0,0 +1,56 @@
package com.njcn.dataProcess.controller;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.dataProcess.annotation.InsertBean;
import com.njcn.dataProcess.annotation.QueryBean;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.service.IRmpEventDetailY;
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("/eventDetailCount")
@Api(tags = "暂态事件统计")
public class RmpEventDetailYController extends BaseController {
@QueryBean
private IRmpEventDetailY eventDetailYQuery;
@InsertBean
private IRmpEventDetailY eventDetailYInsert;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/batchInsertionY")
@ApiOperation("暂态事件(年)统计批量插入")
public HttpResult<String> batchInsertionY(@RequestBody List<DataEventDetailDto> eventDetailDto) {
String methodDescribe = getMethodDescribe("batchInsertionY");
eventDetailYInsert.batchInsertion(eventDetailDto);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
}

View File

@@ -1,6 +1,10 @@
package com.njcn.dataProcess.service;
import com.njcn.dataProcess.dto.RmpEventDetailDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
import java.util.List;
/**
* Description:
@@ -10,5 +14,13 @@ import com.njcn.dataProcess.dto.RmpEventDetailDTO;
* @version V1.0.0
*/
public interface IRmpEventDetail {
void batchInsertion(RmpEventDetailDTO rmpEventDetailDTO);
/**
* 获取时间范围数据
* @param lineParam
* @return
*/
List<RmpEventDetailDTO> getRawData(LineCountEvaluateParam lineParam);
}

View File

@@ -2,6 +2,7 @@ package com.njcn.dataProcess.service;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailD;
@@ -12,7 +13,7 @@ import java.util.List;
* @Author: wr
* @Date: 2025/3/14 13:49
*/
public interface IRmpEventDetailDService extends IMppService<RMpEventDetailD> {
public interface IRmpEventDetailD extends IMppService<RMpEventDetailD> {
/**
* 批量插入数据
@@ -22,4 +23,11 @@ public interface IRmpEventDetailDService extends IMppService<RMpEventDetailD> {
*/
void batchInsertion(List<DataEventDetailDto> eventDetailDto);
/**
* 获取原始数据
* @param lineParam
*/
List<DataEventDetailDto> getRawData(LineCountEvaluateParam lineParam);
}

View File

@@ -2,6 +2,7 @@ package com.njcn.dataProcess.service;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailM;
@@ -12,7 +13,7 @@ import java.util.List;
* @Author: wr
* @Date: 2025/3/14 13:49
*/
public interface IRmpEventDetailMService extends IMppService<RMpEventDetailM> {
public interface IRmpEventDetailM extends IMppService<RMpEventDetailM> {
/**
* 批量插入数据
* @param eventDetailDto
@@ -21,4 +22,9 @@ public interface IRmpEventDetailMService extends IMppService<RMpEventDetailM> {
*/
void batchInsertion(List<DataEventDetailDto> eventDetailDto);
/**
* 获取原始数据
* @param lineParam
*/
List<DataEventDetailDto> getRawData(LineCountEvaluateParam lineParam);
}

View File

@@ -2,6 +2,7 @@ package com.njcn.dataProcess.service;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailQ;
@@ -12,7 +13,7 @@ import java.util.List;
* @Author: wr
* @Date: 2025/3/14 13:49
*/
public interface IRmpEventDetailQService extends IMppService<RMpEventDetailQ> {
public interface IRmpEventDetailQ extends IMppService<RMpEventDetailQ> {
/**
* 批量插入数据
* @param eventDetailDto
@@ -21,4 +22,9 @@ public interface IRmpEventDetailQService extends IMppService<RMpEventDetailQ> {
*/
void batchInsertion(List<DataEventDetailDto> eventDetailDto);
/**
* 获取原始数据
* @param lineParam
*/
List<DataEventDetailDto> getRawData(LineCountEvaluateParam lineParam);
}

View File

@@ -12,7 +12,7 @@ import java.util.List;
* @Author: wr
* @Date: 2025/3/14 13:49
*/
public interface IRmpEventDetailYService extends IMppService<RMpEventDetailY> {
public interface IRmpEventDetailY extends IMppService<RMpEventDetailY> {
/**
* 批量插入数据

View File

@@ -2,12 +2,14 @@ package com.njcn.dataProcess.service.impl.influxdb;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.dataProcess.dao.relation.mapper.RMpEventDetailDMapper;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailD;
import com.njcn.dataProcess.service.IRmpEventDetailDService;
import com.njcn.dataProcess.service.IRmpEventDetailD;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
@@ -17,11 +19,16 @@ import java.util.List;
*/
@Service("InfluxdbRmpEventDetailDImpl")
@RequiredArgsConstructor
public class InfluxdbRmpEventDetailDImpl extends MppServiceImpl<RMpEventDetailDMapper, RMpEventDetailD> implements IRmpEventDetailDService {
public class InfluxdbRmpEventDetailDImpl extends MppServiceImpl<RMpEventDetailDMapper, RMpEventDetailD> implements IRmpEventDetailD {
@Override
public void batchInsertion(List<DataEventDetailDto> eventDetailDto) {
}
@Override
public List<DataEventDetailDto> getRawData(LineCountEvaluateParam lineParam) {
return Collections.emptyList();
}
}

View File

@@ -1,10 +1,14 @@
package com.njcn.dataProcess.service.impl.influxdb;
import com.njcn.dataProcess.dto.RmpEventDetailDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.service.IRmpEventDetail;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* Description:
* Date: 2024/11/28 9:07【需求编号】
@@ -20,5 +24,10 @@ public class InfluxdbRmpEventDetailImpl implements IRmpEventDetail {
}
@Override
public List<RmpEventDetailDTO> getRawData(LineCountEvaluateParam lineParam) {
return Collections.emptyList();
}
}

View File

@@ -2,12 +2,14 @@ package com.njcn.dataProcess.service.impl.influxdb;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.dataProcess.dao.relation.mapper.RMpEventDetailMMapper;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailM;
import com.njcn.dataProcess.service.IRmpEventDetailMService;
import com.njcn.dataProcess.service.IRmpEventDetailM;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
@@ -15,13 +17,18 @@ import java.util.List;
* @Author: wr
* @Date: 2025/3/14 13:54
*/
@Service("InfluxdbRmpEventDetailDImpl")
@Service("InfluxdbRmpEventDetailMImpl")
@RequiredArgsConstructor
public class InfluxdbRmpEventDetailMImpl extends MppServiceImpl<RMpEventDetailMMapper, RMpEventDetailM> implements IRmpEventDetailMService {
public class InfluxdbRmpEventDetailMImpl extends MppServiceImpl<RMpEventDetailMMapper, RMpEventDetailM> implements IRmpEventDetailM {
@Override
public void batchInsertion(List<DataEventDetailDto> eventDetailDto) {
}
@Override
public List<DataEventDetailDto> getRawData(LineCountEvaluateParam lineParam) {
return Collections.emptyList();
}
}

View File

@@ -2,12 +2,14 @@ package com.njcn.dataProcess.service.impl.influxdb;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.dataProcess.dao.relation.mapper.RMpEventDetailQMapper;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailQ;
import com.njcn.dataProcess.service.IRmpEventDetailQService;
import com.njcn.dataProcess.service.IRmpEventDetailQ;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
@@ -17,11 +19,16 @@ import java.util.List;
*/
@Service("InfluxdbRmpEventDetailQImpl")
@RequiredArgsConstructor
public class InfluxdbRmpEventDetailQImpl extends MppServiceImpl<RMpEventDetailQMapper, RMpEventDetailQ> implements IRmpEventDetailQService {
public class InfluxdbRmpEventDetailQImpl extends MppServiceImpl<RMpEventDetailQMapper, RMpEventDetailQ> implements IRmpEventDetailQ {
@Override
public void batchInsertion(List<DataEventDetailDto> eventDetailDto) {
}
@Override
public List<DataEventDetailDto> getRawData(LineCountEvaluateParam lineParam) {
return Collections.emptyList();
}
}

View File

@@ -4,7 +4,7 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.dataProcess.dao.relation.mapper.RMpEventDetailYMapper;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailY;
import com.njcn.dataProcess.service.IRmpEventDetailYService;
import com.njcn.dataProcess.service.IRmpEventDetailY;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -17,7 +17,7 @@ import java.util.List;
*/
@Service("InfluxdbRmpEventDetailYImpl")
@RequiredArgsConstructor
public class InfluxdbRmpEventDetailYImpl extends MppServiceImpl<RMpEventDetailYMapper, RMpEventDetailY> implements IRmpEventDetailYService {
public class InfluxdbRmpEventDetailYImpl extends MppServiceImpl<RMpEventDetailYMapper, RMpEventDetailY> implements IRmpEventDetailY {
@Override

View File

@@ -1,10 +1,13 @@
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.RMpEventDetailDMapper;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailD;
import com.njcn.dataProcess.service.IRmpEventDetailDService;
import com.njcn.dataProcess.service.IRmpEventDetailD;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -19,7 +22,7 @@ import java.util.List;
*/
@Service("RelationRmpEventDetailDImpl")
@RequiredArgsConstructor
public class RelationRmpEventDetailDImpl extends MppServiceImpl<RMpEventDetailDMapper, RMpEventDetailD> implements IRmpEventDetailDService {
public class RelationRmpEventDetailDImpl extends MppServiceImpl<RMpEventDetailDMapper, RMpEventDetailD> implements IRmpEventDetailD {
@Override
@@ -32,4 +35,21 @@ public class RelationRmpEventDetailDImpl extends MppServiceImpl<RMpEventDetailDM
});
this.saveOrUpdateBatchByMultiId(result);
}
@Override
public List<DataEventDetailDto> getRawData(LineCountEvaluateParam lineParam) {
List<DataEventDetailDto> result = new ArrayList<>();
LambdaQueryWrapper<RMpEventDetailD> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lineParam.getLineId()),RMpEventDetailD::getMeasurementPointId,lineParam.getLineId())
.ge(RMpEventDetailD::getDataDate,lineParam.getStartTime())
.le(RMpEventDetailD::getDataDate,lineParam.getEndTime());
List<RMpEventDetailD> list = this.list(lambdaQueryWrapper);
list.forEach(item->{
DataEventDetailDto dto = new DataEventDetailDto();
BeanUtils.copyProperties(item,dto);
result.add(dto);
});
return result;
}
}

View File

@@ -1,16 +1,26 @@
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.core.conditions.query.QueryWrapper;
import com.njcn.dataProcess.constant.PhaseType;
import com.njcn.dataProcess.dto.RmpEventDetailDTO;
import com.njcn.dataProcess.dao.relation.mapper.RmpEventDetailMapper;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.relation.RmpEventDetail;
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
import com.njcn.dataProcess.pojo.po.RStatLimitRateD;
import com.njcn.dataProcess.service.IRmpEventDetail;
import com.njcn.dataProcess.util.BeanFeildUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Description:
* Date: 2024/11/28 9:07【需求编号】
@@ -24,8 +34,6 @@ public class RelationRmpEventDetailImpl implements IRmpEventDetail {
private final RmpEventDetailMapper rmpEventDetailMapper;
@Override
public void batchInsertion(RmpEventDetailDTO rmpEventDetailDTO) {
RmpEventDetail rmpEventDetail = new RmpEventDetail();
BeanUtils.copyProperties(rmpEventDetailDTO,rmpEventDetail, BeanFeildUtils.getNullPropertyNames(rmpEventDetailDTO));
rmpEventDetailMapper.delete(new QueryWrapper<RmpEventDetail>()
@@ -36,4 +44,20 @@ public class RelationRmpEventDetailImpl implements IRmpEventDetail {
rmpEventDetailMapper.insert(rmpEventDetail);
}
@Override
public List<RmpEventDetailDTO> getRawData(LineCountEvaluateParam lineParam) {
List<RmpEventDetailDTO> result = new ArrayList<>();
LambdaQueryWrapper<RmpEventDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lineParam.getLineId()),RmpEventDetail::getMeasurementPointId,lineParam.getLineId())
.ge(RmpEventDetail::getStartTime,lineParam.getStartTime())
.le(RmpEventDetail::getStartTime,lineParam.getEndTime());
List<RmpEventDetail> rmpEventDetails = rmpEventDetailMapper.selectList(lambdaQueryWrapper);
rmpEventDetails.forEach(item->{
RmpEventDetailDTO dto = new RmpEventDetailDTO();
BeanUtils.copyProperties(item,dto);
result.add(dto);
});
return result;
}
}

View File

@@ -1,10 +1,13 @@
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.RMpEventDetailMMapper;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailM;
import com.njcn.dataProcess.service.IRmpEventDetailMService;
import com.njcn.dataProcess.service.IRmpEventDetailM;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -19,7 +22,7 @@ import java.util.List;
*/
@Service("RelationRmpEventDetailMImpl")
@RequiredArgsConstructor
public class RelationRmpEventDetailMImpl extends MppServiceImpl<RMpEventDetailMMapper, RMpEventDetailM> implements IRmpEventDetailMService {
public class RelationRmpEventDetailMImpl extends MppServiceImpl<RMpEventDetailMMapper, RMpEventDetailM> implements IRmpEventDetailM {
@Override
@@ -32,4 +35,21 @@ public class RelationRmpEventDetailMImpl extends MppServiceImpl<RMpEventDetailMM
});
this.saveOrUpdateBatchByMultiId(result);
}
@Override
public List<DataEventDetailDto> getRawData(LineCountEvaluateParam lineParam) {
List<DataEventDetailDto> result = new ArrayList<>();
LambdaQueryWrapper<RMpEventDetailM> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lineParam.getLineId()),RMpEventDetailM::getMeasurementPointId,lineParam.getLineId())
.ge(RMpEventDetailM::getDataDate,lineParam.getStartTime())
.le(RMpEventDetailM::getDataDate,lineParam.getEndTime());
List<RMpEventDetailM> list = this.list(lambdaQueryWrapper);
list.forEach(item->{
DataEventDetailDto dto = new DataEventDetailDto();
BeanUtils.copyProperties(item,dto);
result.add(dto);
});
return result;
}
}

View File

@@ -1,10 +1,13 @@
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.RMpEventDetailQMapper;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailQ;
import com.njcn.dataProcess.service.IRmpEventDetailQService;
import com.njcn.dataProcess.service.IRmpEventDetailQ;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -19,7 +22,7 @@ import java.util.List;
*/
@Service("RelationRmpEventDetailQImpl")
@RequiredArgsConstructor
public class RelationRmpEventDetailQImpl extends MppServiceImpl<RMpEventDetailQMapper, RMpEventDetailQ> implements IRmpEventDetailQService {
public class RelationRmpEventDetailQImpl extends MppServiceImpl<RMpEventDetailQMapper, RMpEventDetailQ> implements IRmpEventDetailQ {
@Override
@@ -32,4 +35,21 @@ public class RelationRmpEventDetailQImpl extends MppServiceImpl<RMpEventDetailQM
});
this.saveOrUpdateBatchByMultiId(result);
}
@Override
public List<DataEventDetailDto> getRawData(LineCountEvaluateParam lineParam) {
List<DataEventDetailDto> result = new ArrayList<>();
LambdaQueryWrapper<RMpEventDetailQ> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lineParam.getLineId()),RMpEventDetailQ::getMeasurementPointId,lineParam.getLineId())
.ge(RMpEventDetailQ::getDataDate,lineParam.getStartTime())
.le(RMpEventDetailQ::getDataDate,lineParam.getEndTime());
List<RMpEventDetailQ> list = this.list(lambdaQueryWrapper);
list.forEach(item->{
DataEventDetailDto dto = new DataEventDetailDto();
BeanUtils.copyProperties(item,dto);
result.add(dto);
});
return result;
}
}

View File

@@ -4,7 +4,7 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.dataProcess.dao.relation.mapper.RMpEventDetailYMapper;
import com.njcn.dataProcess.pojo.dto.DataEventDetailDto;
import com.njcn.dataProcess.pojo.po.RMpEventDetailY;
import com.njcn.dataProcess.service.IRmpEventDetailYService;
import com.njcn.dataProcess.service.IRmpEventDetailY;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -19,7 +19,7 @@ import java.util.List;
*/
@Service("RelationRmpEventDetailYImpl")
@RequiredArgsConstructor
public class RelationRmpEventDetailYImpl extends MppServiceImpl<RMpEventDetailYMapper, RMpEventDetailY> implements IRmpEventDetailYService {
public class RelationRmpEventDetailYImpl extends MppServiceImpl<RMpEventDetailYMapper, RMpEventDetailY> implements IRmpEventDetailY{
@Override