设备监控接口相关调整

This commit is contained in:
guofeihu
2024-07-05 16:38:14 +08:00
parent 815b90f47f
commit 33155a534f
9 changed files with 87 additions and 52 deletions

View File

@@ -16,106 +16,107 @@ import java.time.LocalDateTime;
@Data @Data
public class WlRecordTemplete extends BaseEntity { public class WlRecordTemplete extends BaseEntity {
/**
* 工程名称
*/
@Excel(name = "*工程名称", width = 25.0D)
private String gcName;
/** /**
* 测试项名称 * 测试项名称
*/ */
@Excel(name = "测试项名称", width = 15) @Excel(name = "测试项名称", width = 25.0D)
private String itemName; private String itemName;
/** /**
* 名称 * 名称
*/ */
@Excel(name = "*名称", width = 15) @Excel(name = "*名称", width = 25.0D)
private String name; private String name;
/** /**
* 装置网关识别码 * 装置网关识别码
*/ */
@Excel(name = "*装置网关识别码", width = 15) @Excel(name = "*装置网关识别码", width = 25.0D)
private String ndid; private String ndid;
/** /**
* 监测点id * 监测点id
*/ */
@Excel(name = "*监测点编号", width = 15) @Excel(name = "*监测点编号", width = 25.0D)
private String lineId; private String lineId;
/** /**
* 统计间隔 * 统计间隔
*/ */
@Excel(name = "*统计间隔", width = 15) @Excel(name = "*统计间隔", width = 25.0D)
private String statisticalInterval; private String statisticalInterval;
/** /**
* PT变比 * PT变比
*/ */
@Excel(name = "*PT变比", width = 15) @Excel(name = "*PT变比", width = 25.0D)
private String pt; private String pt;
/** /**
* CT变比 * CT变比
*/ */
@Excel(name = "*CT变比", width = 15) @Excel(name = "*CT变比", width = 25.0D)
private Integer ct; private Integer ct;
/** /**
* 电压等级 * 电压等级
*/ */
@Excel(name = "*电压等级", width = 15) @Excel(name = "*电压等级", width = 25.0D)
private String voltageLevel; private String voltageLevel;
/** /**
* 基准短路容量MVA * 基准短路容量MVA
*/ */
@Excel(name = "*基准短路容量(MVA)", width = 15) @Excel(name = "*基准短路容量(MVA)", width = 25.0D)
private String capacitySscb; private String capacitySscb;
/** /**
* 最小短路容量MVA * 最小短路容量MVA
*/ */
@Excel(name = "*最小短路容量(MVA)", width = 15) @Excel(name = "*最小短路容量(MVA)", width = 25.0D)
private String capacitySscmin; private String capacitySscmin;
/** /**
* 供电设备容量MVA * 供电设备容量MVA
*/ */
@Excel(name = "*供电设备容量(MVA)", width = 15) @Excel(name = "*供电设备容量(MVA)", width = 25.0D)
private String capacitySt; private String capacitySt;
/** /**
* 用户协议容量MVA * 用户协议容量MVA
*/ */
@Excel(name = "*用户协议容量(MVA)", width = 15) @Excel(name = "*用户协议容量(MVA)", width = 25.0D)
private String capacitySi; private String capacitySi;
/** /**
* 电压接线方式(星型、角型、V型) * 接线方式
*/ */
@Excel(name = "*电压接线方式(星型、角型、V型)", width = 15) @Excel(name = "*接线方式", width = 25.0D)
private String volConType; private String volConType;
/**
* 电流接线方式(正常、合成IB、合成IC)
*/
@Excel(name = "*电流接线方式(正常、合成IB、合成IC)", width = 15)
private String curConSel;
/** /**
* 测试起始时间 * 测试起始时间
*/ */
@Excel(name = "*测试起始时间", width = 15) @Excel(name = "*测试起始时间", width = 25.0D)
private String startTime; private String startTime;
/** /**
* 测试结束时间 * 测试结束时间
*/ */
@Excel(name = "*测试结束时间", width = 15) @Excel(name = "*测试结束时间", width = 25.0D)
private LocalDateTime endTime; private LocalDateTime endTime;
/** /**
* 测试项监测位置 * 测试项监测位置
*/ */
@Excel(name = "测试项监测位置", width = 15) @Excel(name = "测试项监测位置", width = 25.0D)
private String location; private String location;
} }

View File

@@ -2,8 +2,6 @@ package com.njcn.csdevice.pojo.po;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity; import com.njcn.db.bo.BaseEntity;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -49,25 +47,4 @@ public class PortableOfflLog extends BaseEntity {
*/ */
private Integer realCount; private Integer realCount;
/**
* 创建用户
*/
private String createBy;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 更新用户
*/
private String updateBy;
/**
* 更新时间
*/
private LocalDateTime updateTime;
} }

View File

@@ -13,6 +13,8 @@ import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
import com.njcn.csdevice.service.ICsGroupService; import com.njcn.csdevice.service.ICsGroupService;
import com.njcn.csharmonic.param.CommonStatisticalQueryParam; import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
import com.njcn.csharmonic.pojo.vo.ThdDataVO; import com.njcn.csharmonic.pojo.vo.ThdDataVO;
import com.njcn.system.pojo.po.EleEpdPqd;
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -111,6 +113,15 @@ public class CsGroupController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
} }
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/getGroupPortableStatistical")
@ApiOperation("查询稳态指标并按照指标名称分组(A、B、...)")
public HttpResult<List<List<EleEpdPqd>>> getGroupPortableStatistical(){
String methodDescribe = getMethodDescribe("getGroupPortableStatistical");
List<List<EleEpdPqd>> list = csGroupService.getGroupPortableStatistical();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/deleteGroup") @PostMapping("/deleteGroup")
@ApiOperation("删除分组") @ApiOperation("删除分组")

View File

@@ -12,7 +12,10 @@ import com.njcn.csdevice.pojo.param.WlRecordTemplete;
import com.njcn.csdevice.pojo.po.PortableOfflLog; import com.njcn.csdevice.pojo.po.PortableOfflLog;
import com.njcn.csdevice.service.IPortableOfflLogService; import com.njcn.csdevice.service.IPortableOfflLogService;
import com.njcn.csdevice.utils.ExcelStyleUtil; import com.njcn.csdevice.utils.ExcelStyleUtil;
import com.njcn.poi.excel.ExcelUtil;
import com.njcn.poi.util.PoiUtil; import com.njcn.poi.util.PoiUtil;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.pojo.po.DictData;
import com.njcn.web.pojo.param.BaseParam; import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -25,6 +28,9 @@ import com.njcn.web.controller.BaseController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* <p> * <p>
@@ -42,6 +48,8 @@ public class PortableOfflLogController extends BaseController {
private final IPortableOfflLogService iPortableOfflLogService; private final IPortableOfflLogService iPortableOfflLogService;
private final DicDataFeignClient dicDataFeignClient;
@ResponseBody @ResponseBody
@ApiOperation("导出设备基础数据模板") @ApiOperation("导出设备基础数据模板")
@GetMapping(value = "getExcelTemplate") @GetMapping(value = "getExcelTemplate")
@@ -49,8 +57,9 @@ public class PortableOfflLogController extends BaseController {
ExportParams exportParams = new ExportParams("批量导入模板(请严格按照模板标准填入数据,带*表示必填)", "便携式终端基础数据录入信息"); ExportParams exportParams = new ExportParams("批量导入模板(请严格按照模板标准填入数据,带*表示必填)", "便携式终端基础数据录入信息");
exportParams.setStyle(ExcelStyleUtil.class); exportParams.setStyle(ExcelStyleUtil.class);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, WlRecordTemplete.class, new ArrayList<WlRecordTemplete>()); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, WlRecordTemplete.class, new ArrayList<WlRecordTemplete>());
//ExcelUtil.selectList(workbook, 2, 2, Stream.of("直连设备","网关设备").collect(Collectors.toList()).toArray(new String[]{})); ExcelUtil.selectList(workbook, 5, 5, Stream.of("1分钟","3分钟","5分钟","10分钟").collect(Collectors.toList()).toArray(new String[]{}));
//ExcelUtil.selectList(workbook, 4, 4, Stream.of("MQTT","CLD").collect(Collectors.toList()).toArray(new String[]{})); ExcelUtil.selectList(workbook, 8, 8, Stream.of(dicDataFeignClient.getDicDataByTypeCode("Dev_Voltage").getData().stream().map(DictData::getName).collect(Collectors.toList())).collect(Collectors.toList()).get(0).toArray(new String[]{}));
ExcelUtil.selectList(workbook, 13, 13, Stream.of(dicDataFeignClient.getDicDataByTypeCode("Dev_Connect").getData().stream().map(DictData::getName).collect(Collectors.toList())).collect(Collectors.toList()).get(0).toArray(new String[]{}));
String fileName = "便携式设备模板.xlsx"; String fileName = "便携式设备模板.xlsx";
PoiUtil.exportFileByWorkbook(workbook, fileName, response); PoiUtil.exportFileByWorkbook(workbook, fileName, response);
return null; return null;

View File

@@ -27,5 +27,5 @@ public interface CsGroupMapper extends BaseMapper<CsGroup> {
Page<DataGroupTemplateVO> getGroupDataList(IPage<DataGroupTemplateVO> page, @Param("id") String id, @Param("searchValue") String searchValue); Page<DataGroupTemplateVO> getGroupDataList(IPage<DataGroupTemplateVO> page, @Param("id") String id, @Param("searchValue") String searchValue);
Page<DataGroupEventVO> getGroupEventList(IPage<DataGroupEventVO> page, @Param("id") String id, @Param("searchValue") String searchValue); Page<DataGroupEventVO> getGroupEventList(IPage<DataGroupEventVO> page, @Param("devId") String devId, @Param("lindId") String lindId);
} }

View File

@@ -86,7 +86,7 @@
inner join wl_record w4 on w3.data_id = w4.id inner join wl_record w4 on w3.data_id = w4.id
inner join cs_event ce on w4.dev_id = ce.device_id and w4.line_id = ce.line_id inner join cs_event ce on w4.dev_id = ce.device_id and w4.line_id = ce.line_id
where ce.type = 0 and w1.state = 1 and w2.state = 1 and w4.state = 1 where ce.type = 0 and w1.state = 1 and w2.state = 1 and w4.state = 1
and ce.device_id = '893446032df751a48683a662691265e6' and ce.line_id = '0008C0A801C81' and ce.device_id = #{devId} and ce.line_id = #{lindId}
order by w1.item_name order by w1.item_name
</select> </select>

View File

@@ -8,6 +8,9 @@ import com.njcn.csdevice.pojo.vo.CsGroupVO;
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO; import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
import com.njcn.csharmonic.param.CommonStatisticalQueryParam; import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
import com.njcn.csharmonic.pojo.vo.ThdDataVO; import com.njcn.csharmonic.pojo.vo.ThdDataVO;
import com.njcn.system.pojo.po.EleEpdPqd;
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
import java.util.List; import java.util.List;
/** /**
@@ -56,6 +59,12 @@ public interface ICsGroupService extends IService<CsGroup> {
*/ */
List<ThdDataVO> getDeviceHarmonicSpectrumData(CommonStatisticalQueryParam commonStatisticalQueryParam); List<ThdDataVO> getDeviceHarmonicSpectrumData(CommonStatisticalQueryParam commonStatisticalQueryParam);
/**
* 查询稳态指标并按照指标名称分组(A、B、...)
* @return
*/
List<List<EleEpdPqd>> getGroupPortableStatistical();
/** /**
* 删除组信息 * 删除组信息
* @param groupId 组id * @param groupId 组id

View File

@@ -487,6 +487,23 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
return result; return result;
} }
@Override
public List<List<EleEpdPqd>> getGroupPortableStatistical() {
List<List<EleEpdPqd>> data = new ArrayList<>();
CsStatisticalSetVO csStatisticalSetVO = csStatisticalSetFeignClient.queryStatistical(DataParam.portableDevStatisticalId).getData();
List<EleEpdPqd> eleEpdPqds = new ArrayList<>();
csStatisticalSetVO.getSelectedList().forEach(css->{
for(EleEpdPqd epdPqd : css.getEleEpdPqdVOS()){
eleEpdPqds.add(epdPqd);
}
});
Map<String,List<EleEpdPqd>> map = eleEpdPqds.stream().collect(Collectors.groupingBy(EleEpdPqd::getName,LinkedHashMap::new,Collectors.toList()));
map.forEach((k,v)->{
data.add(v);
});
return data;
}
/*表名换成了id本方法做转换*/ /*表名换成了id本方法做转换*/
private String getTableNameByClassId(String classId){ private String getTableNameByClassId(String classId){
DictData data = dicDataFeignClient.getDicDataById(classId).getData(); DictData data = dicDataFeignClient.getDicDataById(classId).getData();

View File

@@ -3,9 +3,10 @@ package com.njcn.csdevice.service.impl;
import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.csdevice.mapper.PortableOfflLogMapper; import com.njcn.csdevice.mapper.PortableOfflLogMapper;
import com.njcn.csdevice.pojo.param.DeviceExcelTemplete; import com.njcn.csdevice.pojo.param.WlRecordTemplete;
import com.njcn.csdevice.pojo.po.PortableOfflLog; import com.njcn.csdevice.pojo.po.PortableOfflLog;
import com.njcn.csdevice.service.IPortableOfflLogService; import com.njcn.csdevice.service.IPortableOfflLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -13,6 +14,7 @@ import com.njcn.web.pojo.param.BaseParam;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* <p> * <p>
@@ -43,11 +45,20 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
params.setStartSheetIndex(0); params.setStartSheetIndex(0);
params.setSheetNum(1); params.setSheetNum(1);
try { try {
ExcelImportResult<DeviceExcelTemplete> terminalBaseList = ExcelImportUtil.importExcelMore (file.getInputStream ( ), DeviceExcelTemplete.class, params); ExcelImportResult<WlRecordTemplete> terminalBaseList = ExcelImportUtil.importExcelMore (file.getInputStream ( ), WlRecordTemplete.class, params);
List<WlRecordTemplete> list = terminalBaseList.getList();
//开始解析.......
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
//记录导入信息 //记录导入信息
PortableOfflLog portableOfflLog = new PortableOfflLog(); PortableOfflLog portableOfflLog = new PortableOfflLog();
portableOfflLog.setName(file.getOriginalFilename());
portableOfflLog.setDataPath("D//file//"+file.getOriginalFilename());
portableOfflLog.setLogsIndex(IdUtil.simpleUUID());
portableOfflLog.setAllCount(100);
portableOfflLog.setRealCount(70);
portableOfflLog.setState(1);
this.baseMapper.insert(portableOfflLog);
} }
} }