Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -3,6 +3,7 @@ package com.njcn.influx.imapper;
|
||||
|
||||
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||
|
||||
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
||||
import com.njcn.influx.pojo.po.cs.EntData;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
|
||||
@@ -20,4 +21,6 @@ public interface EvtDataMapper extends InfluxDbBaseMapper<EntData> {
|
||||
|
||||
|
||||
List<EntData> getEventData(InfluxQueryWrapper influxQueryWrapper);
|
||||
|
||||
EventDataSetDTO getEventDataSet(InfluxQueryWrapper influxQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public interface InfluxDBTableConstant {
|
||||
String CL_DID = "cl_did";
|
||||
|
||||
/**
|
||||
* 逻辑子设备id
|
||||
* 逻辑子设备id/暂态事件号
|
||||
*/
|
||||
String UUID = "uuid";
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.influx.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/9/6 9:52【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class EventDataSetDTO {
|
||||
private String name;
|
||||
private String value;
|
||||
private String type;
|
||||
|
||||
private String unit;
|
||||
|
||||
private String showName;
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import java.util.List;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Deprecated
|
||||
public class EventQueryDTO {
|
||||
private String devId;
|
||||
private List<String> lineIds;
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.time.Instant;
|
||||
*/
|
||||
@Data
|
||||
@Measurement(name = "evt_data")
|
||||
@Deprecated
|
||||
public class EntData {
|
||||
|
||||
@Column(name = "time")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.influx.service;
|
||||
|
||||
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
||||
import com.njcn.influx.pojo.dto.EventQueryDTO;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.pojo.po.cs.EntData;
|
||||
@@ -24,5 +25,8 @@ public interface EvtDataService {
|
||||
* @Author: clam
|
||||
* @Date: 2023/8/30
|
||||
*/
|
||||
@Deprecated
|
||||
List<EntData> getEventData(EventQueryDTO eventQueryDTO);
|
||||
|
||||
EventDataSetDTO getEventDataSet(String tableName,String uuid,String columnName );
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.influx.service.impl;
|
||||
import com.njcn.influx.imapper.CommonMapper;
|
||||
import com.njcn.influx.imapper.EvtDataMapper;
|
||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
||||
import com.njcn.influx.pojo.dto.EventQueryDTO;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.pojo.po.cs.EntData;
|
||||
@@ -26,6 +27,7 @@ import java.util.List;
|
||||
public class EvtDataServiceImpl implements EvtDataService {
|
||||
private final EvtDataMapper commonMapper;
|
||||
@Override
|
||||
@Deprecated
|
||||
public List<EntData> getEventData(EventQueryDTO eventQueryDTO) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper("evt_data", EntData.class);
|
||||
influxQueryWrapper.select(EntData::getLineId,EntData::getTarget,EntData::getTime,EntData::getTime,
|
||||
@@ -38,4 +40,14 @@ public class EvtDataServiceImpl implements EvtDataService {
|
||||
return commonMapper.getEventData(influxQueryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventDataSetDTO getEventDataSet(String tableName, String uuid, String columnName) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName, EventDataSetDTO.class);
|
||||
influxQueryWrapper.select(columnName,InfluxDBTableConstant.VALUE)
|
||||
.eq(InfluxDBTableConstant.UUID,uuid);
|
||||
|
||||
|
||||
return commonMapper.getEventDataSet(influxQueryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,15 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.api.fallback.EleEvtFeignClientFallbackFactory;
|
||||
import com.njcn.system.pojo.param.EleEvtParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.po.EleEvtParm;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
@@ -24,5 +27,7 @@ public interface EleEvtFeignClient {
|
||||
|
||||
@PostMapping("/delete")
|
||||
HttpResult<EleEpdPqd> delete(@RequestParam("id") String id);
|
||||
@PostMapping("/queryByPid")
|
||||
HttpResult<List<EleEvtParm>> queryByPid(@RequestParam("pid") String pid);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.njcn.system.api.EpdFeignClient;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.param.EleEvtParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.po.EleEvtParm;
|
||||
import com.njcn.system.utils.SystemEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -47,6 +48,12 @@ public class EleEvtFeignClientFallbackFactory implements FallbackFactory<EleEvtF
|
||||
log.error("{}异常,降级处理,异常为:{}","删除事件拓展数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<EleEvtParm>> queryByPid(String pid) {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询事件拓展数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,12 @@ public enum DicDataEnum {
|
||||
SCOTT_TRANS("SCOTT牵引变压器", "SCOTT_Trans"),
|
||||
YN_V_TRANS("YN v联结平衡牵引变压器", "YN_V_Trans"),
|
||||
YN_A_TRANS("YN A联结平衡牵引变压器", "YN_A_Trans"),
|
||||
|
||||
/**
|
||||
* APP暂态事件类型
|
||||
*/
|
||||
EVT_DIPSTR("电压暂降事件启动","Evt_DipStr"),
|
||||
EVT_INTRSTR("电压中断事件启动","Evt_IntrStr"),
|
||||
EVT_SWLSTR("电压暂升事件启动","Evt_SwlStr"),
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ public enum DicDataTypeEnum {
|
||||
DEVICE_UNIT("数据单位类型","Device_Unit"),
|
||||
//国网上送
|
||||
PLAN_STATUS("计划状态","plan_status"),
|
||||
APP_EVENT("APP暂态事件类型","app_event")
|
||||
|
||||
|
||||
;
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.param.EleEvtParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.po.EleEvtParm;
|
||||
import com.njcn.system.service.IEleEvtParmService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 事件拓展表 前端控制器
|
||||
@@ -62,6 +65,17 @@ public class EleEvtParmController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/queryByPid")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("删除事件拓展数据")
|
||||
@ApiImplicitParam(name = "pid", value = "pid", required = true)
|
||||
public HttpResult<List<EleEvtParm>> queryByPid(@RequestParam String pid){
|
||||
String methodDescribe = getMethodDescribe("queryByPid");
|
||||
LogUtil.njcnDebug(log, "{},传递的id为:{}", methodDescribe,pid);
|
||||
List<EleEvtParm> list = eleEvtParmService.queryByPid(pid);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
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.FileUtil;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
||||
import com.njcn.device.pq.pojo.vo.DataScaleVO;
|
||||
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -15,15 +8,12 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Description:
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.param.EleEvtParam;
|
||||
import com.njcn.system.pojo.po.EleEvtParm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 事件拓展表 服务类
|
||||
@@ -18,4 +20,5 @@ public interface IEleEvtParmService extends IService<EleEvtParm> {
|
||||
|
||||
void delete(String id);
|
||||
|
||||
List<EleEvtParm> queryByPid(String pid);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.njcn.system.service.IEleEvtParmService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 事件拓展表 服务实现类
|
||||
@@ -33,4 +35,9 @@ public class EleEvtParmServiceImpl extends ServiceImpl<EleEvtParmMapper, EleEvtP
|
||||
deleteWrapper.eq(EleEvtParm::getPid,id);
|
||||
this.baseMapper.delete(deleteWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EleEvtParm> queryByPid(String pid) {
|
||||
return this.lambdaQuery().eq(EleEvtParm::getPid,pid).list();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user