feat: 增加旧版首页相关接口

dev
huangfeng 1 year ago
parent ab841e501b
commit 913227e50f

@ -0,0 +1,35 @@
package com.xydl.cac.old;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author Leo_Feng
* @date 2021-09-17
*/
@Data
public class ArrVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty(value="观测字段", name="equipment")
private String equipment;
/**
*
*/
@ApiModelProperty(value="值集合", name="currentVals")
private List<String> currentVals;
/**
*
*/
@ApiModelProperty(value="时间集合", name="dTimes")
private List<String> dTimes;
}

@ -0,0 +1,43 @@
package com.xydl.cac.old;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags = "旧接口")
@RestController
@RequestMapping("BlqController")
public class ArresterController {
@Resource
OldService service;
/**
*
*
* @param eqmid
* @return
*/
@ApiOperation(value = "查询避雷器表格数据")
@GetMapping(value = "/queryTableData/{eqmid}")
public AjaxResult queryTableData(@PathVariable Integer eqmid) {
return AjaxResult.success(service.queryTableDataList2(eqmid));
}
/**
*
*
* @param eqmid
* @return
*/
@ApiOperation(value = "查询避雷器趋势图数据")
@GetMapping(value = "/queryLineData/{eqmid}")
public AjaxResult queryLineData(@PathVariable Integer eqmid) {
return AjaxResult.success(service.queryLineDataList2(eqmid));
}
}

@ -0,0 +1,190 @@
package com.xydl.cac.old;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author Bobi_huo
* @date 2020-12-25 18:31
*/
@Data
public class ArresterVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* @Fields id
*/
@ApiModelProperty(value="设备id", name="eqmId")
private Integer eqmId;
/**
* @Fields
*/
@ApiModelProperty(value="创建时间", name="dTime")
private String dTime;
/**
* @Fields A
*/
@ApiModelProperty(value="A相系统电压", name="ptA")
private String ptA;
/**
* @Fields A
*/
@ApiModelProperty(value="A相全电流", name="lcA")
private String lcA;
/**
* @Fields A
*/
@ApiModelProperty(value="A相阻性电流", name="rcA")
private String rcA;
/**
* @Fields B
*/
@ApiModelProperty(value="B相系统电压", name="ptB")
private String ptB;
/**
* @Fields B
*/
@ApiModelProperty(value="B相全电流", name="lcB")
private String lcB;
/**
* @Fields B
*/
@ApiModelProperty(value="B相阻性电流", name="rcB")
private String rcB;
/**
* @Fields C
*/
@ApiModelProperty(value="C相系统电压", name="ptC")
private String ptC;
/**
* @Fields C
*/
@ApiModelProperty(value="C相全电流", name="lcC")
private String lcC;
/**
* @Fields C
*/
@ApiModelProperty(value="C相阻性电流", name="rcC")
private String rcC;
/**
* @Fields A
*/
@ApiModelProperty(value="A相最近落雷时间", name="lastLigtmA")
private String lastLigtmA;
/**
* @Fields A
*/
@ApiModelProperty(value="A相累计落雷次数", name="ligcntA")
private String ligcntA;
/**
* @Fields A
*/
@ApiModelProperty(value="A相容性电流", name="cacUrA")
private String cacUrA;
/**
* @Fields A
*/
@ApiModelProperty(value="A相阻容比", name="riScarteA")
private String riScarteA;
/**
* @Fields AIED
*/
@ApiModelProperty(value="A相IED与监测设备通讯异常", name="modeVconfA")
private String modeVconfA;
/**
* @Fields A
*/
@ApiModelProperty(value="A相设备运行异常", name="supDevRunA")
private String supDevRunA;
/**
* @Fields B
*/
@ApiModelProperty(value="B相最近落雷时间", name="lastLigtmB")
private String lastLigtmB;
/**
* @Fields B
*/
@ApiModelProperty(value="B相累计落雷次数", name="ligcntB")
private String ligcntB;
/**
* @Fields B
*/
@ApiModelProperty(value="B相容性电流", name="cacUrB")
private String cacUrB;
/**
* @Fields B
*/
@ApiModelProperty(value="B相阻容比", name="riScarteB")
private String riScarteB;
/**
* @Fields BIED
*/
@ApiModelProperty(value="B相IED与监测设备通讯异常", name="modeVconfB")
private String modeVconfB;
/**
* @Fields B
*/
@ApiModelProperty(value="B相设备运行异常", name="supDevRunB")
private String supDevRunB;
/**
* @Fields C
*/
@ApiModelProperty(value="C相最近落雷时间", name="lastLigtmC")
private String lastLigtmC;
/**
* @Fields C
*/
@ApiModelProperty(value="C相累计落雷次数", name="ligcntC")
private String ligcntC;
/**
* @Fields C
*/
@ApiModelProperty(value="C相容性电流", name="cacUrC")
private String cacUrC;
/**
* @Fields C
*/
@ApiModelProperty(value="C相阻容比", name="riScarteC")
private String riScarteC;
/**
* @Fields CIED
*/
@ApiModelProperty(value="C相IED与监测设备通讯异常", name="modeVconfC")
private String modeVconfC;
/**
* @Fields C
*/
@ApiModelProperty(value="C相设备运行异常", name="supDevRunC")
private String supDevRunC;
}

@ -0,0 +1,169 @@
package com.xydl.cac.old;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@Api(tags = "旧接口")
@RestController
@RequestMapping("cableCirculationController")
public class CableCirculationController {
@Resource
OldService service;
// /**
// * 获取电缆环流设备
// *
// * @return
// */
// @ApiOperation(value = "获取电缆环流设备")
// @GetMapping(value = "/getDevice")
// public AjaxResult getDeviceInfo() {
// return AjaxResult.success(circulationService.getDeviceInfo());
// }
//
// /**
// * 查询电缆环流历史数据
// *
// * @return
// */
// @ApiOperation(value = "查询电缆环流历史数据")
// @PostMapping(value = "/queryHistoryData")
// public AjaxResult queryHistoryDataList(@RequestBody CableCirculationDto dto) {
// return AjaxResult.success(circulationService.queryHistoryDataList(dto));
// }
//
// /**
// * 查询不同相位最近时间的数据
// *
// * @param zid
// * @returnqueryDataByTime
// */
// @ApiOperation(value = "查询不同相位最近时间的数据")
// @GetMapping(value = "/query/{zid}")
// public AjaxResult queryLastTime(@PathVariable("zid") String zid) {
// return AjaxResult.success(circulationService.queryLastTime(zid));
// }
//
// /**
// * 根据时间查询统计数据默认查询15天
// *
// * @param dto
// * @return
// */
// @ApiOperation(value = "根据时间查询统计数据默认查询15天")
// @PostMapping(value = "/queryDataByTime")
// public AjaxResult queryDataByTime(@RequestBody CableCirculationStatisticsDto dto) {
// return AjaxResult.success(circulationService.queryDataByTime(dto));
// }
/**
*
*
* @param dto
* @return
*/
@ApiOperation(value = "获取告警信息列表")
@PostMapping(value = "/page")
public AjaxResult page(@RequestBody CableWarningDto dto) {
return AjaxResult.success(service.selectPages(dto));
}
// /**
// * 获取二级告警信息
// *
// * @param dto
// * @return
// */
// @ApiOperation(value = "获取二级告警信息")
// @PostMapping(value = "/secondPage")
// public AjaxResult getSecondPage(@RequestBody CableWarningDto dto) {
// return AjaxResult.success(circulationService.getWarningPage(dto));
// }
//
// /**
// * 处理告警信息
// */
// @ApiOperation(value = "修改告警信息")
// @PostMapping(value = "/deal")
// public AjaxResult deal(@RequestBody CableWarningDto dto) {
// return returnAjax(circulationService.alarmHandling(dto));
// }
//
// /**
// * 导出电缆环流实时数据
// *
// * @param dto
// * @return
// */
// @ApiOperation(value = "导出电缆环流实时数据")
// @PostMapping(value = "/exportCableByCondition")
// public AjaxResult exportCableByCondition(@RequestBody CableCirculationDto dto) {
// return circulationService.exportCableData(dto);
// }
//
// /**
// * 新增电缆环流阈值
// *
// * @param dto
// * @return
// */
// @ApiOperation(value = "设置电缆环流阈值")
// @PostMapping(value = "/setThreshold")
// public AjaxResult setThreshold(@RequestBody CableThresholdDto dto) {
// return circulationService.setThreshold(dto);
// }
//
//
// /**
// * 新增电缆环流阈值
// *
// * @param dto
// * @return
// */
// @ApiOperation(value = "新增电缆环流阈值")
// @PostMapping(value = "/add")
// public AjaxResult saveThreshold(@RequestBody CableThresholdDto dto) {
// return circulationService.saveThreshold(dto);
// }
//
// /**
// * 修改电缆环流阈值
// *
// * @param dto
// * @return
// */
// @ApiOperation(value = "修改电缆环流阈值")
// @PostMapping(value = "/update")
// public AjaxResult updateThreshold(@RequestBody CableThresholdDto dto) {
// return circulationService.updateThreshold(dto);
// }
//
// /**
// * 获取电缆环流阈值信息
// *
// * @param eqmId
// * @return
// */
// @ApiOperation(value = "获取电缆环流阈值信息")
// @GetMapping(value = "/getThreshold/{eqmId}")
// public AjaxResult getThreshold(@PathVariable("eqmId") String eqmId) {
// return AjaxResult.success(circulationService.getThreshold(eqmId));
// }
//
// /**
// * 获取当前设备的相位
// *
// * @param zid
// * @return
// */
// @ApiOperation(value = "获取电缆环流阈值信息")
// @GetMapping(value = "/getPhase/{zid}")
// public AjaxResult getPhase(@PathVariable("zid") String zid) {
// return AjaxResult.success(circulationService.getPhase(zid));
// }
}

@ -0,0 +1,112 @@
package com.xydl.cac.old;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author Bobi_huo
* @date 2020-12-22 13:50
*/
@Data
public class CableWarningDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* @Fields id
*/
@ApiModelProperty(value="主键", name="id")
private String id;
/**
* @Fields id
*/
@ApiModelProperty(value="设备id", name="eqmId")
private String eqmId;
/**
* @Fields id
*/
@ApiModelProperty(value="类型id", name="lxid")
private String lxid;
/**
* @Fields id
*/
@ApiModelProperty(value="间隔id", name="jgid")
private String jgid;
/**
* @Fields id
*/
@ApiModelProperty(value="监测设备类型id", name="mtid")
private String mtid;
/**
* @Fields
*/
@ApiModelProperty(value="告警时间", name="warnTime")
private String warnTime;
/**
* @Fields
*/
@ApiModelProperty(value="告警值", name="warningValue")
private String warningValue;
/**
*
*/
@ApiModelProperty(value="告警阈值", name="threadval")
private String threadval;
/**
* //
*/
@ApiModelProperty(value="告警信息/设备名称/设备安装位置", name="warnDesc")
private String warnDesc;
/**
* 0: 1: 2:
*/
@ApiModelProperty(value="告警级别 0:高 1:中 2:低", name="warnLevel")
private String warnLevel;
/**
* 0: 1:
*/
@ApiModelProperty(value="处理状态 0:已处理 1:未处理", name="state")
private String state;
/**
*
*/
@ApiModelProperty(value="处理结果描述", name="process")
private String process;
/**
* id
*/
@ApiModelProperty(value="处理人id", name="processUser")
private String processUser;
/**
*
*/
@ApiModelProperty(value="处理时间", name="processTime")
private String processTime;
/**
*
*/
@ApiModelProperty(value="开始时间", name="startTime")
private String startTime;
/**
*
*/
@ApiModelProperty(value="结束时间", name="endTime")
private String endTime;
}

@ -0,0 +1,94 @@
package com.xydl.cac.old;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author Bobi_huo
* @date 2020-12-22 13:50
*/
@Data
public class CableWarningVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* @Fields id
*/
@ApiModelProperty(value="主键", name="id")
private String id;
/**
* @Fields id
*/
@ApiModelProperty(value="设备id", name="eqmId")
private String eqmId;
/**
*
*/
@ApiModelProperty(value="设备名称", name="deviceName")
private String deviceName;
/**
*
*/
@ApiModelProperty(value="告警次数", name="warningCount")
private String warningCount;
/**
* @Fields
*/
@ApiModelProperty(value="告警时间", name="warnTime")
private String warnTime;
/**
* @Fields
*/
@ApiModelProperty(value="告警值", name="warningValue")
private String warningValue;
/**
*
*/
@ApiModelProperty(value="告警阈值", name="threadval")
private String threadval;
/**
* //
*/
@ApiModelProperty(value="告警信息/设备名称/设备安装位置", name="warnDesc")
private String warnDesc;
/**
* 0: 1: 2:
*/
@ApiModelProperty(value="告警级别 0:高 1:中 2:低", name="warnLevel")
private String warnLevel;
/**
* 0: 1:
*/
@ApiModelProperty(value="处理状态 0:已处理 1:未处理", name="state")
private String state;
/**
*
*/
@ApiModelProperty(value="处理结果描述", name="process")
private String process;
/**
* id
*/
@ApiModelProperty(value="处理人id", name="processUser")
private String processUser;
/**
*
*/
@ApiModelProperty(value="处理时间", name="processTime")
private String processTime;
}

@ -0,0 +1,53 @@
package com.xydl.cac.old;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags = "旧接口")
@RestController
@RequestMapping("ironCoreJoinClampController")
public class IronCoreJoinClampController {
@Resource
OldService service;
/**
* /
*
* @param ironCoreId
* @param clampId
* @return
*/
@ApiOperation(value = "查询铁芯/夹件表格数据")
@GetMapping(value = "/queryTableData/{ironCoreId}/{clampId}")
public AjaxResult queryTableData(@PathVariable("ironCoreId") Integer ironCoreId,
@PathVariable("clampId") Integer clampId) {
IronCoreJoinClampDto dto = new IronCoreJoinClampDto();
dto.setIronCoreId(ironCoreId);
dto.setClampId(clampId);
// 铁芯/夹件表格取5条进行展示
return AjaxResult.success(service.queryTableDataList(dto));
}
/**
* /
* @param ironCoreId
* @param clampId
* @return
*/
@ApiOperation(value = "查询铁芯/夹件趋势图数据")
@GetMapping(value = "/queryLineData/{ironCoreId}/{clampId}")
public AjaxResult queryLineData(@PathVariable("ironCoreId") Integer ironCoreId,
@PathVariable("clampId") Integer clampId) {
IronCoreJoinClampDto dto = new IronCoreJoinClampDto();
dto.setIronCoreId(ironCoreId);
dto.setClampId(clampId);
return AjaxResult.success(service.queryLineDataList(dto));
}
}

@ -0,0 +1,39 @@
package com.xydl.cac.old;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class IronCoreJoinClampDto {
private static final long serialVersionUID = 1L;
/**
* @Fields id
*/
@ApiModelProperty(value="铁芯设备id", name="ironCoreId")
private Integer ironCoreId;
/**
* @Fields id
*/
@ApiModelProperty(value="夹件设备id", name="clampId")
private Integer clampId;
/**
* @Fields
*/
@ApiModelProperty(value="创建时间", name="dTime")
private String dTime;
/**
* @Fields A
*/
@ApiModelProperty(value="铁芯A相泄露电流", name="ironCoreValue")
private String ironCoreValue;
/**
* @Fields A
*/
@ApiModelProperty(value="夹件A相泄露电流", name="clampValue")
private String clampValue;
}

@ -0,0 +1,35 @@
package com.xydl.cac.old;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author Leo_Feng
* @date 2021-09-17
*/
@Data
public class IronVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty(value="观测字段", name="equipment")
private String equipment;
/**
*
*/
@ApiModelProperty(value="值集合", name="currentVals")
private List<String> currentVals;
/**
*
*/
@ApiModelProperty(value="时间集合", name="dTimes")
private List<String> dTimes;
}

@ -0,0 +1,52 @@
package com.xydl.cac.old;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@Api(tags = "旧接口")
@RestController
@RequestMapping("oilChromaController")
public class OilChromaController {
@Resource
OldService service;
/**
*
*
* @param eqmid
* @return
*/
@ApiOperation(value = "查询油色谱表格数据")
@GetMapping(value = "/queryTableData/{eqmid}")
public AjaxResult queryTableData(@PathVariable Integer eqmid) {
List<OilChromaVo> oilChromaVoList = service.queryTableDataList(eqmid);
// 油色谱表格只取一条进行展示
if (oilChromaVoList.size() != 0) {
return AjaxResult.success(oilChromaVoList.get(0));
} else {
return AjaxResult.success("操作成功", null);
}
}
/**
*
*
* @param eqmid
* @return
*/
@ApiOperation(value = "查询油色谱趋势图数据")
@GetMapping(value = "/queryLineData/{eqmid}")
public AjaxResult queryLineData(@PathVariable Integer eqmid) {
return AjaxResult.success(service.queryLineDataList(eqmid));
}
}

@ -0,0 +1,114 @@
package com.xydl.cac.old;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author Bobi_huo
* @date 2020-12-24 11:12
*/
@Data
@ApiModel("油色谱")
public class OilChromaVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* @Fields
*/
@ApiModelProperty(value="主键", name="eqmId")
private String eqmId;
/**
* @Fields
*/
@ApiModelProperty(value="甲烷含量", name="ch4ppm")
private String ch4ppm;
/**
* @Fields
*/
@ApiModelProperty(value="乙烯含量", name="c2h4ppm")
private String c2h4ppm;
/**
* @Fields
*/
@ApiModelProperty(value="乙烷含量", name="c2h6ppm")
private String c2h6ppm;
/**
* @Fields
*/
@ApiModelProperty(value="乙炔含量", name="c2h2ppm")
private String c2h2ppm;
/**
* @Fields
*/
@ApiModelProperty(value="氢气含量", name="h2ppm")
private String h2ppm;
/**
* @Fields
*/
@ApiModelProperty(value="一氧化碳含量", name="coppm")
private String coppm;
/**
* @Fields
*/
@ApiModelProperty(value="二氧化碳含量", name="co2ppm")
private String co2ppm;
/**
* @Fields
*/
@ApiModelProperty(value="氧气含量", name="o2ppm")
private String o2ppm;
/**
* @Fields
*/
@ApiModelProperty(value="氮气含量", name="n2ppm")
private String n2ppm;
/**
* @Fields
*/
@ApiModelProperty(value="水含量", name="h2oppm")
private String h2oppm;
/**
* @Fields
*/
@ApiModelProperty(value="载气压力", name="gaspress")
private String gaspress;
/**
* @Fields
*/
@ApiModelProperty(value="瓦斯继电器中故障气", name="flatgas")
private String flatgas;
/**
* @Fields
*/
@ApiModelProperty(value="总烃", name="totalhydrocarbon")
private String totalhydrocarbon;
/**
* @Fields
*/
@ApiModelProperty(value="总可燃气体", name="cmbugas")
private String cmbugas;
/**
* @Fields
*/
@ApiModelProperty(value="创建时间", name="dTime")
private String dTime;
}

@ -0,0 +1,35 @@
package com.xydl.cac.old;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author Bobi_huo
* @date 2020-12-24 11:12
*/
@Data
public class OilVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty(value="观测字段", name="gas")
private String gas;
/**
*
*/
@ApiModelProperty(value="值集合", name="currentVals")
private List<String> currentVals;
/**
*
*/
@ApiModelProperty(value="时间集合", name="dTimes")
private List<String> dTimes;
}

@ -6,6 +6,9 @@ import com.xydl.cac.repository.NSensorRepository;
import com.xydl.cac.repository.ZsbRepository;
import com.xydl.cac.service.ZsbService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -25,6 +28,8 @@ public class OldService {
ZsbRepository zsbRepository;
@Resource
NSensorRepository sensorRepository;
@Resource
private JdbcTemplate jdbcTemplate;
public List<BaseLxDevice> getLxDevice(Integer jgid, List<String> mtid) throws Exception {
List<BaseLxDevice> result = new ArrayList<>();
@ -130,4 +135,350 @@ public class OldService {
equipment.setOtherNum(otherNum);
return equipment;
}
List<OilChromaVo> queryTableDataList(Integer eqmid) {
String sql = "SELECT * FROM data_epa_h WHERE eqmid=" + eqmid + " ORDER BY d_time DESC LIMIT 1";
List<OilChromaVo> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(OilChromaVo.class));
return list;
}
List<OilVo> queryLineDataList(Integer eqmid) {
String sql = "SELECT * FROM data_epa_h WHERE eqmid=" + eqmid + " ORDER BY d_time DESC LIMIT 15";
List<OilChromaVo> oilDataList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(OilChromaVo.class));
OilVo ch4 = new OilVo();
List<String> ch4Values = new ArrayList<>();
ch4.setCurrentVals(ch4Values);
OilVo c2h4 = new OilVo();
List<String> c2h4Values = new ArrayList<>();
c2h4.setCurrentVals(c2h4Values);
OilVo c2h6 = new OilVo();
List<String> c2h6Values = new ArrayList<>();
c2h6.setCurrentVals(c2h6Values);
OilVo c2h2 = new OilVo();
List<String> c2h2Values = new ArrayList<>();
c2h2.setCurrentVals(c2h2Values);
OilVo h2 = new OilVo();
List<String> h2Values = new ArrayList<>();
h2.setCurrentVals(h2Values);
OilVo co = new OilVo();
List<String> coValues = new ArrayList<>();
co.setCurrentVals(coValues);
OilVo co2 = new OilVo();
List<String> co2Values = new ArrayList<>();
co2.setCurrentVals(co2Values);
OilVo totalhydrocarbon = new OilVo();
List<String> totalhydrocarbonValues = new ArrayList<>();
totalhydrocarbon.setCurrentVals(totalhydrocarbonValues);
List<String> times = new ArrayList<>();
for (OilChromaVo vo : oilDataList) {
ch4.getCurrentVals().add(vo.getCh4ppm());
c2h4.getCurrentVals().add(vo.getC2h4ppm());
c2h6.getCurrentVals().add(vo.getC2h6ppm());
c2h2.getCurrentVals().add(vo.getC2h2ppm());
h2.getCurrentVals().add(vo.getH2ppm());
co.getCurrentVals().add(vo.getCoppm());
co2.getCurrentVals().add(vo.getCo2ppm());
totalhydrocarbon.getCurrentVals().add(vo.getTotalhydrocarbon());
times.add(vo.getDTime());
}
ch4.setDTimes(times);
c2h4.setDTimes(times);
c2h6.setDTimes(times);
c2h2.setDTimes(times);
h2.setDTimes(times);
co.setDTimes(times);
co2.setDTimes(times);
totalhydrocarbon.setDTimes(times);
ch4.setGas("甲烷(μL/L)");
c2h4.setGas("乙烯(μL/L)");
c2h6.setGas("乙烷(μL/L)");
c2h2.setGas("乙炔(μL/L)");
h2.setGas("氢气(μL/L)");
co.setGas("一氧化碳(μL/L)");
co2.setGas("二氧化碳(μL/L)");
totalhydrocarbon.setGas("总烃(μL/L)");
List<OilVo> lineDataList = new ArrayList<>();
lineDataList.add(ch4);
lineDataList.add(c2h4);
lineDataList.add(c2h6);
lineDataList.add(c2h2);
lineDataList.add(h2);
lineDataList.add(co);
lineDataList.add(co2);
lineDataList.add(totalhydrocarbon);
return lineDataList;
}
List<IronCoreJoinClampDto> queryTableDataList(IronCoreJoinClampDto dto) {
String sql = "select t1.d_time, t1.d_ct_1 iron_core_value, t2.d_ct_1 clamp_value" +
" from (select eqmid, d_time, d_ct_1 from data_eia_h where eqmid = " + dto.getIronCoreId() + " order by d_time desc limit 5) t1" +
" left join" +
" (select eqmid, d_time, d_ct_1 from data_eia_h where eqmid = " + dto.getClampId() + " order by d_time desc limit 5) t2" +
" on t1.d_time = t2.d_time" +
" order by d_time desc";
List<IronCoreJoinClampDto> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IronCoreJoinClampDto.class));
return list;
}
List<IronVo> queryLineDataList(IronCoreJoinClampDto dto) {
String sql = "select t1.d_time, t1.d_ct_1 iron_core_value, t2.d_ct_1 clamp_value" +
" from (select eqmid, d_time, d_ct_1 from data_eia_h where eqmid = " + dto.getIronCoreId() + " order by d_time desc limit 15) t1" +
" left join" +
" (select eqmid, d_time, d_ct_1 from data_eia_h where eqmid = " + dto.getClampId() + " order by d_time desc limit 15) t2" +
" on t1.d_time = t2.d_time" +
" order by d_time desc";
List<IronCoreJoinClampDto> IronDataList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IronCoreJoinClampDto.class));
IronVo ironCore = new IronVo();
List<String> ironCoreValues = new ArrayList<>();
ironCore.setCurrentVals(ironCoreValues);
IronVo clamp = new IronVo();
List<String> clampValues = new ArrayList<>();
clamp.setCurrentVals(clampValues);
List<String> times = new ArrayList<>();
for (IronCoreJoinClampDto vo : IronDataList) {
ironCore.getCurrentVals().add(vo.getIronCoreValue());
clamp.getCurrentVals().add(vo.getClampValue());
times.add(vo.getDTime());
}
ironCore.setDTimes(times);
clamp.setDTimes(times);
ironCore.setEquipment("铁芯泄露电流(mA)");
clamp.setEquipment("夹件泄露电流(mA)");
List<IronVo> lineDataList = new ArrayList<>();
lineDataList.add(ironCore);
lineDataList.add(clamp);
return lineDataList;
}
List<ArresterVo> queryTableDataList2(Integer eqmid) {
String sql = "SELECT * FROM data_moa_h WHERE eqmid=" + eqmid + " ORDER BY d_time DESC LIMIT 2";
List<ArresterVo> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ArresterVo.class));
return list;
}
List<ArrVo> queryLineDataList2(Integer eqmid) {
String sql = "SELECT * FROM data_moa_h WHERE eqmid=" + eqmid + " ORDER BY d_time DESC LIMIT 15";
List<ArresterVo> arresterDataList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ArresterVo.class));
// A相系统电压
ArrVo a1 = new ArrVo();
List<String> a1Values = new ArrayList<>();
a1.setCurrentVals(a1Values);
// A相全电流
ArrVo a2 = new ArrVo();
List<String> a2Values = new ArrayList<>();
a2.setCurrentVals(a2Values);
// A相阻性电流
ArrVo a3 = new ArrVo();
List<String> a3Values = new ArrayList<>();
a3.setCurrentVals(a3Values);
ArrVo b1 = new ArrVo();
List<String> b1Values = new ArrayList<>();
b1.setCurrentVals(b1Values);
ArrVo b2 = new ArrVo();
List<String> b2Values = new ArrayList<>();
b2.setCurrentVals(b2Values);
ArrVo b3 = new ArrVo();
List<String> b3Values = new ArrayList<>();
b3.setCurrentVals(b3Values);
ArrVo c1 = new ArrVo();
List<String> c1Values = new ArrayList<>();
c1.setCurrentVals(c1Values);
ArrVo c2 = new ArrVo();
List<String> c2Values = new ArrayList<>();
c2.setCurrentVals(c2Values);
ArrVo c3 = new ArrVo();
List<String> c3Values = new ArrayList<>();
c3.setCurrentVals(c3Values);
List<String> times = new ArrayList<>();
for (ArresterVo vo : arresterDataList) {
a1.getCurrentVals().add(vo.getPtA());
a2.getCurrentVals().add(vo.getLcA());
a3.getCurrentVals().add(vo.getRcA());
b1.getCurrentVals().add(vo.getPtB());
b2.getCurrentVals().add(vo.getLcB());
b3.getCurrentVals().add(vo.getRcB());
c1.getCurrentVals().add(vo.getPtC());
c2.getCurrentVals().add(vo.getLcC());
c3.getCurrentVals().add(vo.getRcC());
times.add(vo.getDTime());
}
a1.setDTimes(times);
a2.setDTimes(times);
a3.setDTimes(times);
b1.setDTimes(times);
b2.setDTimes(times);
b3.setDTimes(times);
c1.setDTimes(times);
c2.setDTimes(times);
c3.setDTimes(times);
a1.setEquipment("A相系统电压(V)");
a2.setEquipment("A相全电流(mA)");
a3.setEquipment("A相阻性电流(mA)");
b1.setEquipment("B相系统电压(V)");
b2.setEquipment("B相全电流(mA)");
b3.setEquipment("B相阻性电流(mA)");
c1.setEquipment("C相系统电压(V)");
c2.setEquipment("C相全电流(mA)");
c3.setEquipment("C相阻性电流(mA)");
List<ArrVo> lineDataList = new ArrayList<>();
lineDataList.add(a1);
lineDataList.add(a2);
lineDataList.add(a3);
lineDataList.add(b1);
lineDataList.add(b2);
lineDataList.add(b3);
lineDataList.add(c1);
lineDataList.add(c2);
lineDataList.add(c3);
return lineDataList;
}
List<SF6Vo> queryTableDataList3(Integer eqmid) {
String sql = "SELECT * FROM data_sf6_h WHERE eqmid=" + eqmid + " ORDER BY d_time DESC LIMIT 2";
List<SF6Vo> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(SF6Vo.class));
return list;
}
List<SF6LineVo> queryLineDataList3(Integer eqmid) {
String sql = "SELECT * FROM data_sf6_h WHERE eqmid=" + eqmid + " ORDER BY d_time DESC LIMIT 15";
List<SF6Vo> sf6DataList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(SF6Vo.class));
// A相温度
SF6LineVo aTemp = new SF6LineVo();
List<String> aTempValues = new ArrayList<>();
aTemp.setCurrentVals(aTempValues);
// A相压力
SF6LineVo aPressure = new SF6LineVo();
List<String> aPressureValues = new ArrayList<>();
aPressure.setCurrentVals(aPressureValues);
// A相微水
SF6LineVo aWater = new SF6LineVo();
List<String> aWaterValues = new ArrayList<>();
aWater.setCurrentVals(aWaterValues);
// B相温度
SF6LineVo bTemp = new SF6LineVo();
List<String> bTempValues = new ArrayList<>();
bTemp.setCurrentVals(bTempValues);
// B相压力
SF6LineVo bPressure = new SF6LineVo();
List<String> bPressureValues = new ArrayList<>();
bPressure.setCurrentVals(bPressureValues);
// B相微水
SF6LineVo bWater = new SF6LineVo();
List<String> bWaterValues = new ArrayList<>();
bWater.setCurrentVals(bWaterValues);
// C相温度
SF6LineVo cTemp = new SF6LineVo();
List<String> cTempValues = new ArrayList<>();
cTemp.setCurrentVals(cTempValues);
// C相压力
SF6LineVo cPressure = new SF6LineVo();
List<String> cPressureValues = new ArrayList<>();
cPressure.setCurrentVals(cPressureValues);
// C相微水
SF6LineVo cWater = new SF6LineVo();
List<String> cWaterValues = new ArrayList<>();
cWater.setCurrentVals(cWaterValues);
List<String> times = new ArrayList<>();
for (SF6Vo vo : sf6DataList) {
aTemp.getCurrentVals().add(vo.getTempA());
aPressure.getCurrentVals().add(vo.getPressureA());
aWater.getCurrentVals().add(vo.getPmA());
bTemp.getCurrentVals().add(vo.getTempB());
bPressure.getCurrentVals().add(vo.getPressureB());
bWater.getCurrentVals().add(vo.getPmB());
cTemp.getCurrentVals().add(vo.getTempC());
cPressure.getCurrentVals().add(vo.getPressureC());
cWater.getCurrentVals().add(vo.getPmC());
times.add(vo.getDTime());
}
aTemp.setDTimes(times);
aPressure.setDTimes(times);
aWater.setDTimes(times);
bTemp.setDTimes(times);
bPressure.setDTimes(times);
bWater.setDTimes(times);
cTemp.setDTimes(times);
cPressure.setDTimes(times);
cWater.setDTimes(times);
aTemp.setEquipment("A相温度(℃)");
aPressure.setEquipment("A相压力(kPa)");
aWater.setEquipment("A相微水(μL/L)");
bTemp.setEquipment("B相温度(℃)");
bPressure.setEquipment("B相压力(kPa)");
bWater.setEquipment("B相微水(μL/L)");
cTemp.setEquipment("C相温度(℃)");
cPressure.setEquipment("C相压力(kPa)");
cWater.setEquipment("C相微水(μL/L)");
List<SF6LineVo> lineDataList = new ArrayList<>();
lineDataList.add(aTemp);
lineDataList.add(aPressure);
lineDataList.add(aWater);
lineDataList.add(bTemp);
lineDataList.add(bPressure);
lineDataList.add(bWater);
lineDataList.add(cTemp);
lineDataList.add(cPressure);
lineDataList.add(cWater);
return lineDataList;
}
List<CableWarningVo> selectPages(CableWarningDto dto) {
String sql = "SELECT w.id,w.eqmid,w.warn_time,w.warning_value,w.threadval,w.warn_desc,w.warn_level," +
" w.state,w.process,w.process_user,w.process_time,COUNT(w.id) AS warningCount,v.NAME" +
" FROM warning w" +
" LEFT JOIN vw_sb v ON v.id = w.eqmid" +
" LEFT JOIN vw_jg j ON j.id = v.jgid" +
" LEFT JOIN i2relation i ON v.id = i.eqmid WHERE 1=1 ";
if (StringUtils.isNotBlank(dto.getState())) {
sql = sql + " AND w.state=" + dto.getState();
}
if (StringUtils.isNotBlank(dto.getStartTime())) {
sql = sql + " AND w.warn_time>='" + dto.getStartTime() + " 00:00:00'";
}
if (StringUtils.isNotBlank(dto.getEndTime())) {
sql = sql + " AND w.warn_time<='" + dto.getEndTime() + " 23:59:59'";
}
sql = sql + " GROUP BY w.eqmid";
List<CableWarningVo> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(CableWarningVo.class));
return list;
}
}

@ -0,0 +1,58 @@
package com.xydl.cac.old;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
public class Query implements Serializable {
public String page = "1";
public String limit = "10";
public String orderByField = "";
public String isAsc = "";
/**
*
*/
private String params;
public Integer getPage() {
return Integer.parseInt( page );
}
public void setPage(String page) {
this.page = page;
}
public Integer getLimit() {
return Integer.parseInt( limit );
}
public void setLimit(String limit) {
this.limit = limit;
}
public String getOrderByField() {
return orderByField;
}
public void setOrderByField(String orderByField) {
this.orderByField = orderByField;
}
public String getIsAsc() {
return isAsc;
}
public void setIsAsc(String isAsc) {
this.isAsc = isAsc;
}
public void setParams(String params) {
this.params = params;
}
}

@ -0,0 +1,43 @@
package com.xydl.cac.old;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags = "旧接口")
@RestController
@RequestMapping("SF6Controller")
public class SF6Controller{
@Resource
OldService service;
/**
* 线50511
*
* @param eqmid
* @return
*/
@ApiOperation(value = "查询GIS-SF6表格数据")
@GetMapping(value = "/queryTableData/{eqmid}")
public AjaxResult queryTableData(@PathVariable Integer eqmid) {
return AjaxResult.success(service.queryTableDataList3(eqmid));
}
/**
* 线50511
*
* @param eqmid
* @return
*/
@ApiOperation(value = "查询GIS-SF6趋势图数据")
@GetMapping(value = "/queryLineData/{eqmid}")
public AjaxResult queryLineData(@PathVariable Integer eqmid) {
return AjaxResult.success(service.queryLineDataList3(eqmid));
}
}

@ -0,0 +1,36 @@
package com.xydl.cac.old;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author
* @date
*/
@Data
public class SF6LineVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty(value = "观测字段", name = "equipment")
private String equipment;
/**
*
*/
@ApiModelProperty(value = "值集合", name = "currentVals")
private List<String> currentVals;
/**
*
*/
@ApiModelProperty(value = "时间集合", name = "dTimes")
private List<String> dTimes;
}

@ -0,0 +1,118 @@
package com.xydl.cac.old;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author Bobi_huo
* @date 2020-12-25 20:13
*/
@Data
public class SF6Vo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* @Fields id
*/
@ApiModelProperty(value="设备id", name="eqmId")
private Integer eqmId;
/**
* @Fields
*/
@ApiModelProperty(value="创建时间", name="dTime")
private String dTime;
/**
* @Fields A
*/
@ApiModelProperty(value="A相温度", name="tempA")
private String tempA;
/**
* @Fields A
*/
@ApiModelProperty(value="A相压力", name="pressureA")
private String pressureA;
/**
* @Fields A
*/
@ApiModelProperty(value="A相密度", name="mdA")
private String mdA;
/**
* @Fields A
*/
@ApiModelProperty(value="A相微水", name="pmA")
private String pmA;
/**
* @Fields A
*/
@ApiModelProperty(value="A相露点", name="dDtA")
private String dDtA;
/**
* @Fields B
*/
@ApiModelProperty(value="B相温度", name="tempB")
private String tempB;
/**
* @Fields B
*/
@ApiModelProperty(value="B相压力", name="pressureB")
private String pressureB;
/**
* @Fields B
*/
@ApiModelProperty(value="B相密度", name="mdB")
private String mdB;
/**
* @Fields B
*/
@ApiModelProperty(value="B相微水", name="pmB")
private String pmB;
/**
* @Fields B
*/
@ApiModelProperty(value="B相露点", name="dDtB")
private String dDtB;
/**
* @Fields C
*/
@ApiModelProperty(value="C相温度", name="tempC")
private String tempC;
/**
* @Fields C
*/
@ApiModelProperty(value="C相压力", name="pressureC")
private String pressureC;
/**
* @Fields C
*/
@ApiModelProperty(value="C相密度", name="mdC")
private String mdC;
/**
* @Fields C
*/
@ApiModelProperty(value="C相微水", name="pmC")
private String pmC;
/**
* @Fields C
*/
@ApiModelProperty(value="C相露点", name="dDtC")
private String dDtC;
}
Loading…
Cancel
Save