diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/WlRecordTemplete.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/WlRecordTemplete.java index d3f5123..7cac37c 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/WlRecordTemplete.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/WlRecordTemplete.java @@ -16,106 +16,107 @@ import java.time.LocalDateTime; @Data 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; /** * 名称 */ - @Excel(name = "*名称", width = 15) + @Excel(name = "*名称", width = 25.0D) private String name; /** * 装置网关识别码 */ - @Excel(name = "*装置网关识别码", width = 15) + @Excel(name = "*装置网关识别码", width = 25.0D) private String ndid; /** * 监测点id */ - @Excel(name = "*监测点编号", width = 15) + @Excel(name = "*监测点编号", width = 25.0D) private String lineId; /** * 统计间隔 */ - @Excel(name = "*统计间隔", width = 15) + @Excel(name = "*统计间隔", width = 25.0D) private String statisticalInterval; /** * PT变比 */ - @Excel(name = "*PT变比", width = 15) + @Excel(name = "*PT变比", width = 25.0D) private String pt; /** * CT变比 */ - @Excel(name = "*CT变比", width = 15) + @Excel(name = "*CT变比", width = 25.0D) private Integer ct; /** * 电压等级 */ - @Excel(name = "*电压等级", width = 15) + @Excel(name = "*电压等级", width = 25.0D) private String voltageLevel; /** * 基准短路容量(MVA) */ - @Excel(name = "*基准短路容量(MVA)", width = 15) + @Excel(name = "*基准短路容量(MVA)", width = 25.0D) private String capacitySscb; /** * 最小短路容量(MVA) */ - @Excel(name = "*最小短路容量(MVA)", width = 15) + @Excel(name = "*最小短路容量(MVA)", width = 25.0D) private String capacitySscmin; /** * 供电设备容量(MVA) */ - @Excel(name = "*供电设备容量(MVA)", width = 15) + @Excel(name = "*供电设备容量(MVA)", width = 25.0D) private String capacitySt; /** * 用户协议容量(MVA) */ - @Excel(name = "*用户协议容量(MVA)", width = 15) + @Excel(name = "*用户协议容量(MVA)", width = 25.0D) private String capacitySi; /** - * 电压接线方式(星型、角型、V型) + * 接线方式 */ - @Excel(name = "*电压接线方式(星型、角型、V型)", width = 15) + @Excel(name = "*接线方式", width = 25.0D) 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; /** * 测试结束时间 */ - @Excel(name = "*测试结束时间", width = 15) + @Excel(name = "*测试结束时间", width = 25.0D) private LocalDateTime endTime; /** * 测试项监测位置 */ - @Excel(name = "测试项监测位置", width = 15) + @Excel(name = "测试项监测位置", width = 25.0D) private String location; } diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/PortableOfflLog.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/PortableOfflLog.java index c6ea5b7..d557f36 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/PortableOfflLog.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/PortableOfflLog.java @@ -2,8 +2,6 @@ package com.njcn.csdevice.pojo.po; import com.baomidou.mybatisplus.annotation.TableName; import com.njcn.db.bo.BaseEntity; -import java.io.Serializable; -import java.time.LocalDateTime; import lombok.Getter; import lombok.Setter; @@ -49,25 +47,4 @@ public class PortableOfflLog extends BaseEntity { */ private Integer realCount; - /** - * 创建用户 - */ - private String createBy; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - /** - * 更新用户 - */ - private String updateBy; - - /** - * 更新时间 - */ - private LocalDateTime updateTime; - - } diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/CsGroupController.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/CsGroupController.java index 805aff3..db94fd6 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/CsGroupController.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/CsGroupController.java @@ -13,6 +13,8 @@ import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO; import com.njcn.csdevice.service.ICsGroupService; import com.njcn.csharmonic.param.CommonStatisticalQueryParam; 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 io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -111,6 +113,15 @@ public class CsGroupController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); } + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @GetMapping("/getGroupPortableStatistical") + @ApiOperation("查询稳态指标并按照指标名称分组(A、B、...)") + public HttpResult>> getGroupPortableStatistical(){ + String methodDescribe = getMethodDescribe("getGroupPortableStatistical"); + List> list = csGroupService.getGroupPortableStatistical(); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); + } + @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("/deleteGroup") @ApiOperation("删除分组") diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/PortableOfflLogController.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/PortableOfflLogController.java index df9eab5..cd413bc 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/PortableOfflLogController.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/PortableOfflLogController.java @@ -12,7 +12,10 @@ import com.njcn.csdevice.pojo.param.WlRecordTemplete; import com.njcn.csdevice.pojo.po.PortableOfflLog; import com.njcn.csdevice.service.IPortableOfflLogService; import com.njcn.csdevice.utils.ExcelStyleUtil; +import com.njcn.poi.excel.ExcelUtil; 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 io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -25,6 +28,9 @@ import com.njcn.web.controller.BaseController; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; /** *

@@ -42,6 +48,8 @@ public class PortableOfflLogController extends BaseController { private final IPortableOfflLogService iPortableOfflLogService; + private final DicDataFeignClient dicDataFeignClient; + @ResponseBody @ApiOperation("导出设备基础数据模板") @GetMapping(value = "getExcelTemplate") @@ -49,8 +57,9 @@ public class PortableOfflLogController extends BaseController { ExportParams exportParams = new ExportParams("批量导入模板(请严格按照模板标准填入数据,带*表示必填)", "便携式终端基础数据录入信息"); exportParams.setStyle(ExcelStyleUtil.class); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, WlRecordTemplete.class, new ArrayList()); - //ExcelUtil.selectList(workbook, 2, 2, Stream.of("直连设备","网关设备").collect(Collectors.toList()).toArray(new String[]{})); - //ExcelUtil.selectList(workbook, 4, 4, Stream.of("MQTT","CLD").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, 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"; PoiUtil.exportFileByWorkbook(workbook, fileName, response); return null; diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsGroupMapper.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsGroupMapper.java index aa6e97d..7ab14c1 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsGroupMapper.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsGroupMapper.java @@ -27,5 +27,5 @@ public interface CsGroupMapper extends BaseMapper { Page getGroupDataList(IPage page, @Param("id") String id, @Param("searchValue") String searchValue); - Page getGroupEventList(IPage page, @Param("id") String id, @Param("searchValue") String searchValue); + Page getGroupEventList(IPage page, @Param("devId") String devId, @Param("lindId") String lindId); } diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsGroupMapper.xml b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsGroupMapper.xml index 91d0275..9fd8f75 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsGroupMapper.xml +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsGroupMapper.xml @@ -86,7 +86,7 @@ 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 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 diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/ICsGroupService.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/ICsGroupService.java index b7dc31b..cd7d257 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/ICsGroupService.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/ICsGroupService.java @@ -8,6 +8,9 @@ import com.njcn.csdevice.pojo.vo.CsGroupVO; import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO; import com.njcn.csharmonic.param.CommonStatisticalQueryParam; 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; /** @@ -56,6 +59,12 @@ public interface ICsGroupService extends IService { */ List getDeviceHarmonicSpectrumData(CommonStatisticalQueryParam commonStatisticalQueryParam); + /** + * 查询稳态指标并按照指标名称分组(A、B、...) + * @return + */ + List> getGroupPortableStatistical(); + /** * 删除组信息 * @param groupId 组id diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroupServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroupServiceImpl.java index e3b540f..9589d5b 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroupServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroupServiceImpl.java @@ -487,6 +487,23 @@ public class CsGroupServiceImpl extends ServiceImpl impl return result; } + @Override + public List> getGroupPortableStatistical() { + List> data = new ArrayList<>(); + CsStatisticalSetVO csStatisticalSetVO = csStatisticalSetFeignClient.queryStatistical(DataParam.portableDevStatisticalId).getData(); + List eleEpdPqds = new ArrayList<>(); + csStatisticalSetVO.getSelectedList().forEach(css->{ + for(EleEpdPqd epdPqd : css.getEleEpdPqdVOS()){ + eleEpdPqds.add(epdPqd); + } + }); + Map> map = eleEpdPqds.stream().collect(Collectors.groupingBy(EleEpdPqd::getName,LinkedHashMap::new,Collectors.toList())); + map.forEach((k,v)->{ + data.add(v); + }); + return data; + } + /*表名换成了id本方法做转换*/ private String getTableNameByClassId(String classId){ DictData data = dicDataFeignClient.getDicDataById(classId).getData(); diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PortableOfflLogServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PortableOfflLogServiceImpl.java index ff3d97a..586793c 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PortableOfflLogServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PortableOfflLogServiceImpl.java @@ -3,9 +3,10 @@ package com.njcn.csdevice.service.impl; import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import cn.hutool.core.util.IdUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.service.IPortableOfflLogService; 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.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; +import java.util.List; /** *

@@ -43,11 +45,20 @@ public class PortableOfflLogServiceImpl extends ServiceImpl terminalBaseList = ExcelImportUtil.importExcelMore (file.getInputStream ( ), DeviceExcelTemplete.class, params); + ExcelImportResult terminalBaseList = ExcelImportUtil.importExcelMore (file.getInputStream ( ), WlRecordTemplete.class, params); + List list = terminalBaseList.getList(); + //开始解析....... } catch (Exception e) { e.printStackTrace(); } //记录导入信息 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); } }