diff --git a/pqs-auth/src/main/resources/bootstrap.yml b/pqs-auth/src/main/resources/bootstrap.yml index d8f7ef266..91954b70a 100644 --- a/pqs-auth/src/main/resources/bootstrap.yml +++ b/pqs-auth/src/main/resources/bootstrap.yml @@ -21,6 +21,7 @@ spring: cloud: nacos: discovery: + ip: @server.url@ server-addr: @nacos.url@ namespace: @nacos.namespace@ config: diff --git a/pqs-common/common-influxdb/src/main/java/com/njcn/influxdb/utils/InfluxDBCommUtils.java b/pqs-common/common-influxdb/src/main/java/com/njcn/influxdb/utils/InfluxDBCommUtils.java new file mode 100644 index 000000000..d19fb9778 --- /dev/null +++ b/pqs-common/common-influxdb/src/main/java/com/njcn/influxdb/utils/InfluxDBCommUtils.java @@ -0,0 +1,33 @@ +package com.njcn.influxdb.utils; + +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * pqs + * + * @author cdf + * @date 2022/7/1 + */ +@Component +public class InfluxDBCommUtils { + + /** + * 组装为influxdb监测点参数 + * + * @param lineIds 监测点参数 + * @return StringBuilder + */ + public static StringBuilder assToInfluxParam(List lineIds){ + StringBuilder lineIdsStr = new StringBuilder("("); + for (int i = 0; i < lineIds.size(); i++) { + if (lineIds.size() - i != 1) { + lineIdsStr.append("line_id ='").append(lineIds.get(i)).append("' or "); + } else { + lineIdsStr.append("line_id ='").append(lineIds.get(i)).append("') "); + } + } + return lineIdsStr; + } +} diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/api/LineFeignClient.java b/pqs-device/device-api/src/main/java/com/njcn/device/api/LineFeignClient.java index 4426cf8b3..64162fb92 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/api/LineFeignClient.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/api/LineFeignClient.java @@ -172,4 +172,21 @@ public interface LineFeignClient { */ @PostMapping("getOverLimitByList") HttpResult> getOverLimitByList(@RequestBody PollutionParamDTO pollutionParamDTO); + + + /** + * 区域监测点以及上级一些信息 + * @param list 监测点id集合 + * @return + */ + @PostMapping("getBaseLineAreaInfo") + HttpResult> getBaseLineAreaInfo(@RequestBody List list); + + /** + * 获取监测点基本信息 + * @param list 监测点id集合 + * @return + */ + @PostMapping("getBaseLineList") + HttpResult> getBaseLineList(@RequestBody List list); } diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/api/TerminalBaseClient.java b/pqs-device/device-api/src/main/java/com/njcn/device/api/TerminalBaseClient.java index 5032dd7c3..513b1662f 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/api/TerminalBaseClient.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/api/TerminalBaseClient.java @@ -5,10 +5,14 @@ import com.njcn.common.pojo.response.HttpResult; import com.njcn.device.api.fallback.GeneralDeviceInfoClientFallbackFactory; import com.njcn.device.api.fallback.TerminalBaseClientFallbackFactory; import com.njcn.device.pojo.dto.GeneralDeviceDTO; +import com.njcn.device.pojo.po.Device; import com.njcn.device.pojo.po.Line; +import com.njcn.device.pojo.vo.AreaLineInfoVO; +import com.njcn.device.pojo.vo.TerminalBaseVO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; 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; @@ -33,4 +37,13 @@ public interface TerminalBaseClient { @GetMapping("/getSubstationById") HttpResult> getSubstationById(@RequestParam("list") List list); + + /** + * 获取监测点限值 + * @param list 设备id集合 + * @return 监测点限值信息 + */ + @PostMapping("getDevInfoByIds") + HttpResult> getDeviceByIdOnOrOff(@RequestBody List list); + } diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/api/fallback/LineFeignClientFallbackFactory.java b/pqs-device/device-api/src/main/java/com/njcn/device/api/fallback/LineFeignClientFallbackFactory.java index d2c645632..ad99572ba 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/api/fallback/LineFeignClientFallbackFactory.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/api/fallback/LineFeignClientFallbackFactory.java @@ -135,6 +135,21 @@ public class LineFeignClientFallbackFactory implements FallbackFactory> getBaseLineAreaInfo(List list) { + log.error("{}异常,降级处理,异常为:{}", "获取监测点详情 ", throwable.toString()); + throw new BusinessException(finalExceptionEnum); + } + + @Override + public HttpResult> getBaseLineList(List list) { + log.error("{}异常,降级处理,异常为:{}", "获取监测点详情 ", throwable.toString()); + throw new BusinessException(finalExceptionEnum); + } + + + + }; } } diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/api/fallback/TerminalBaseClientFallbackFactory.java b/pqs-device/device-api/src/main/java/com/njcn/device/api/fallback/TerminalBaseClientFallbackFactory.java index 58a7ef0a4..d45aa78b7 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/api/fallback/TerminalBaseClientFallbackFactory.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/api/fallback/TerminalBaseClientFallbackFactory.java @@ -6,7 +6,9 @@ import com.njcn.common.pojo.response.HttpResult; import com.njcn.device.api.GeneralDeviceInfoClient; import com.njcn.device.api.TerminalBaseClient; import com.njcn.device.pojo.dto.GeneralDeviceDTO; +import com.njcn.device.pojo.po.Device; import com.njcn.device.pojo.po.Line; +import com.njcn.device.pojo.vo.TerminalBaseVO; import com.njcn.device.utils.DeviceEnumUtil; import feign.hystrix.FallbackFactory; import lombok.extern.slf4j.Slf4j; @@ -38,6 +40,12 @@ public class TerminalBaseClientFallbackFactory implements FallbackFactory> getDeviceByIdOnOrOff(List list) { + log.error("{}异常,降级处理,异常为:{}", "根据设备ids获取设备详情", throwable.toString()); + throw new BusinessException(finalExceptionEnum); + } }; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/AreaLineInfoVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/AreaLineInfoVO.java new file mode 100644 index 000000000..794a3a2c5 --- /dev/null +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/AreaLineInfoVO.java @@ -0,0 +1,73 @@ +package com.njcn.device.pojo.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 监测点详细信息 + * @author cdf + * @date 2022/6/29 + */ +@Data +public class AreaLineInfoVO implements Serializable { + + @ApiModelProperty(name = "lineId",value = "监测点id") + private String lineId; + + @ApiModelProperty(name = "lineName",value = "监测点名称") + private String lineName; + + @ApiModelProperty(name = "subId",value = "变电站id") + private String subId; + + @ApiModelProperty(name = "subName",value = "变电站名称") + private String subName; + + @ApiModelProperty(name = "gdId",value = "供电公司id") + private String gdId; + + @ApiModelProperty(name = "gdName",value = "供电公司名称") + private String gdName; + + @ApiModelProperty(name = "voltageId",value = "母线id") + private String voltageId; + + @ApiModelProperty(name = "voltageName",value = "母线名称") + private String voltageName; + + @ApiModelProperty(name = "noDealCount",value = "未处理暂降事件") + private Integer noDealCount; + + @ApiModelProperty(name = "ct1",value = "ct1") + private Integer ct1; + + @ApiModelProperty(name = "ct2",value = "ct2") + private Integer ct2; + + @ApiModelProperty(name = "pt1",value = "pt1") + private Integer pt1; + + @ApiModelProperty(name = "pt2",value = "pt2") + private Integer pt2; + + @ApiModelProperty(name = "runFlag",value = "运行状态") + private Integer runFlag; + + @ApiModelProperty(name = "comFlag",value = "通讯状态") + private Integer comFlag; + + @ApiModelProperty(name = "ip",value = "装置ip") + private String ip; + + @ApiModelProperty(name = "lat",value = "维度") + private BigDecimal lat; + + @ApiModelProperty(name = "lng",value = "经度") + private BigDecimal lng; + + @ApiModelProperty(name = "manufacturer",value = "供应商名称") + private String manufacturer; +} diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/DeviceVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/DeviceVO.java index b5fcae245..353da7e9d 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/DeviceVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/DeviceVO.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; +import java.io.Serializable; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Date; @@ -18,7 +19,7 @@ import java.util.List; * @date 2021/6/23 */ @Data -public class DeviceVO { +public class DeviceVO implements Serializable { private String devIndex; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/LineMarkVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/LineMarkVO.java index 74a32b39b..eb9f75986 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/LineMarkVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/LineMarkVO.java @@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * pqs * @@ -13,7 +15,7 @@ import lombok.NoArgsConstructor; */ @Data @ApiModel -public class LineMarkVO { +public class LineMarkVO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(name = "省份") private String province; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/LineVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/LineVO.java index 61530c05f..ad3d5298d 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/LineVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/LineVO.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; +import java.io.Serializable; import java.util.Date; /** @@ -15,7 +16,7 @@ import java.util.Date; */ @Data @ApiModel -public class LineVO { +public class LineVO implements Serializable { @ApiModelProperty(name = "id",value = "监测点索引") private String lineIndex; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/ProjectVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/ProjectVO.java index 52f4aa8fa..517a373df 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/ProjectVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/ProjectVO.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; +import java.io.Serializable; /** @@ -16,7 +17,7 @@ import javax.validation.constraints.NotNull; */ @Data @ApiModel -public class ProjectVO { +public class ProjectVO implements Serializable { /** * 表Id diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/ProvinceVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/ProvinceVO.java index 23177504f..c868880c5 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/ProvinceVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/ProvinceVO.java @@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; +import java.io.Serializable; /** * pqs @@ -20,7 +21,7 @@ import javax.validation.constraints.Pattern; */ @Data @ApiModel -public class ProvinceVO { +public class ProvinceVO implements Serializable { /** * 表Id diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/SubStationVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/SubStationVO.java index 865685ac6..dbd6626f9 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/SubStationVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/SubStationVO.java @@ -3,6 +3,7 @@ package com.njcn.device.pojo.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; /** @@ -12,7 +13,7 @@ import java.math.BigDecimal; * @date 2021/7/20 */ @Data -public class SubStationVO { +public class SubStationVO implements Serializable { @ApiModelProperty(name ="subIndex",value = "变电站索引") private String subIndex; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/SubVoltageVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/SubVoltageVO.java index 366701d25..59d6b8e64 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/SubVoltageVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/SubVoltageVO.java @@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; import java.util.List; /** @@ -14,7 +15,7 @@ import java.util.List; */ @Data @ApiModel -public class SubVoltageVO { +public class SubVoltageVO implements Serializable { @ApiModelProperty(name = "subIndex",value = "母线索引") private String subvIndex; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalAlarmVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalAlarmVO.java index 907891b09..465d774a7 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalAlarmVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalAlarmVO.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import lombok.Data; +import java.io.Serializable; import java.time.LocalDateTime; /** @@ -16,7 +17,7 @@ import java.time.LocalDateTime; */ @Data @ApiModel -public class TerminalAlarmVO { +public class TerminalAlarmVO implements Serializable { private String subName; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalBaseVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalBaseVO.java new file mode 100644 index 000000000..0a09a6e53 --- /dev/null +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalBaseVO.java @@ -0,0 +1,54 @@ +package com.njcn.device.pojo.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * pqs + * + * @author cdf + * @date 2022/6/30 + */ +@Data +public class TerminalBaseVO { + + @ApiModelProperty("监测点名称") + private String lineName; + + @ApiModelProperty("监测点id") + private String lineId; + + @ApiModelProperty("母线名称") + private String voltage; + + @ApiModelProperty("母线id") + private String voltageId; + + @ApiModelProperty("设备名称") + private String devName; + + @ApiModelProperty("设备id") + private String devId; + + @ApiModelProperty("变电站名称") + private String subName; + + @ApiModelProperty("变电站id") + private String subId; + + @ApiModelProperty("供电名称") + private String gdName; + + @ApiModelProperty("供电id") + private String gdId; + + @ApiModelProperty("装置ip") + private String ip; + + @ApiModelProperty("数据更新时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String updateTime; + + +} diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalLedgerVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalLedgerVO.java index 9fa279e2b..daaa8baba 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalLedgerVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalLedgerVO.java @@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; import java.util.List; /** @@ -14,7 +15,7 @@ import java.util.List; */ @Data @ApiModel -public class TerminalLedgerVO { +public class TerminalLedgerVO implements Serializable { @ApiModelProperty(name = "areaIndex",value = "区域索引") private String areaIndex; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalMaintainVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalMaintainVO.java index 82c9fe989..2d7447de0 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalMaintainVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalMaintainVO.java @@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; import java.util.List; /** @@ -14,7 +15,7 @@ import java.util.List; */ @Data @ApiModel -public class TerminalMaintainVO { +public class TerminalMaintainVO implements Serializable { @ApiModelProperty(name="序号") private Integer index; @ApiModelProperty(name = "拓扑名称") diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalTree.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalTree.java index 3c53b44a5..89e95a9b5 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalTree.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalTree.java @@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -15,7 +16,7 @@ import java.util.List; */ @ApiModel @Data -public class TerminalTree { +public class TerminalTree implements Serializable { private String id; @ApiModelProperty(name = "parentId",value = "父id") private String pid; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalVO.java index db9d2aa1f..acfdbfd9c 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalVO.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; import java.util.List; /** @@ -16,7 +17,7 @@ import java.util.List; */ @Data @ApiModel -public class TerminalVO { +public class TerminalVO implements Serializable { @ApiModelProperty(name = "projectVO",value = "项目实体") private ProjectVO projectVO; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalVersionVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalVersionVO.java index b541b2499..4c4faec4f 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalVersionVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/TerminalVersionVO.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; import java.util.List; /** @@ -15,7 +16,7 @@ import java.util.List; */ @Data @ApiModel -public class TerminalVersionVO { +public class TerminalVersionVO implements Serializable { @ApiModelProperty(name="序号") private Integer index; @ApiModelProperty(name = "拓扑名称") diff --git a/pqs-device/device-boot/src/main/java/com/njcn/device/controller/LineController.java b/pqs-device/device-boot/src/main/java/com/njcn/device/controller/LineController.java index f93d7bc15..8763cb028 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/device/controller/LineController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/device/controller/LineController.java @@ -10,6 +10,7 @@ import com.njcn.device.mapper.DeviceMapper; import com.njcn.device.mapper.LineMapper; import com.njcn.device.pojo.dto.*; import com.njcn.device.pojo.po.Device; +import com.njcn.device.pojo.po.Line; import com.njcn.device.pojo.po.Overlimit; import com.njcn.device.pojo.vo.*; import com.njcn.device.service.LineService; @@ -227,4 +228,32 @@ public class LineController extends BaseController { List result = lineService.getOverLimitByList(pollutionParamDTO); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); } + + /** + * 获取监测点及以上层的基础信息(含区域信息) + */ + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/getBaseLineAreaInfo") + @ApiOperation("获取监测点及以上层的基础信息(含区域信息)") + @ApiImplicitParams({ + @ApiImplicitParam(name = "lineIndex", value = "监测点集合", required = true) + }) + public HttpResult> getBaseLineAreaInfo(@RequestBody List lineIndex) { + String methodDescribe = getMethodDescribe("getBaseLineAreaInfo"); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineService.getBaseLineAreaInfo(lineIndex), methodDescribe); + } + + /** + * 根据监测点ids获取监测点基本信息 + * @author cdf + * @date 2022/6/30 + */ + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/getBaseLineList") + @ApiOperation("根据监测点ids获取监测点基本信息") + @ApiImplicitParam(name = "lineIndex", value = "监测点集合", required = true) + public HttpResult> getBaseLineList(@RequestBody List lineIndex) { + String methodDescribe = getMethodDescribe("getBaseLineList"); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineService.getBaseLineList(lineIndex), methodDescribe); + } } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/device/controller/TerminalBaseController.java b/pqs-device/device-boot/src/main/java/com/njcn/device/controller/TerminalBaseController.java index 07b8d9bbd..d5a1c747d 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/device/controller/TerminalBaseController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/device/controller/TerminalBaseController.java @@ -12,17 +12,19 @@ import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.LogUtil; import com.njcn.device.enums.DeviceResponseEnum; +import com.njcn.device.pojo.bo.DeviceType; import com.njcn.device.pojo.bo.excel.TerminalBaseExcel; import com.njcn.device.pojo.param.*; +import com.njcn.device.pojo.po.Device; import com.njcn.device.pojo.po.Line; +import com.njcn.device.pojo.vo.AreaLineInfoVO; +import com.njcn.device.pojo.vo.TerminalBaseVO; import com.njcn.device.pojo.vo.TerminalVO; import com.njcn.device.service.TerminalBaseService; import com.njcn.poi.excel.ExcelUtil; import com.njcn.poi.util.PoiUtil; import com.njcn.web.controller.BaseController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.annotations.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.Workbook; @@ -32,6 +34,7 @@ import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -178,6 +181,23 @@ public class TerminalBaseController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, subList, methodDescribe); } + + /** + * 根据设备id集获取设备集信息 + * @param list 设备集合 + * @author cdf + * @date 2022/6/29 + */ + @ApiOperation("获取装置信息") + @OperateInfo + @PostMapping("/getDevInfoByIds") + public HttpResult> getDevInfoByIds(@RequestBody List list) { + String methodDescribe = getMethodDescribe("getDevInfoByIds"); + LogUtil.njcnDebug(log, "{},设备集合为:{}", methodDescribe, list); + List devList = terminalBaseService.getDeviceByIdOnOrOff(list,new DeviceType(),0); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, devList, methodDescribe); + } + /** * 批量导入oracle中的原始数据 * @@ -223,16 +243,15 @@ public class TerminalBaseController extends BaseController { * @author cdf * @date 2022/5/17 */ - @ApiOperation("下载台账信息") - @GetMapping(value = "downTerminalBase") - public void downTerminalBase(HttpServletResponse response) { - String fileName = "台账信息.xls"; -/* - ExportParams exportExcel = new ExportParams("批量导入模板(请严格按照模板标准填入数据)","台账信息"); - Workbook workbook = ExcelExportUtil.exportExcel(exportExcel,TerminalBaseExcel.class, baseExcelList); - PoiUtil.exportFileByWorkbook(workbook,fileName,response);*/ - - + @ApiOperation("导出台账模板") + @GetMapping(value = "downTerminalTemplate") + public void downTerminalTemplate(HttpServletResponse response) { + ExportParams exportExcel = new ExportParams("批量导入模板(请严格按照模板标准填入数据)","台账信息"); + Workbook workbook = ExcelExportUtil.exportExcel(exportExcel,TerminalBaseExcel.class,new ArrayList()); + //这里是自己加的 带下拉框的代码 + ExcelUtil.selectList(workbook, 4, 4, new String[]{"斤","两","个","袋","份"}); + ExcelUtil.selectList(workbook, 0, 0, new String[]{"蔬菜","水果","主食","熟食","调料"}); + PoiUtil.exportFileByWorkbook(workbook, "菜品管理", response); } /** @@ -248,4 +267,6 @@ public class TerminalBaseController extends BaseController { terminalBaseService.importTerminalBase(file,response); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } + + } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/device/mapper/LineMapper.java b/pqs-device/device-boot/src/main/java/com/njcn/device/mapper/LineMapper.java index 2a5339536..cf00b97ee 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/device/mapper/LineMapper.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/device/mapper/LineMapper.java @@ -81,62 +81,6 @@ public interface LineMapper extends BaseMapper { */ List getProvinceList(@Param("pids") List pids, @Param("type") Integer type); - /** - * 通过id集合获取终端信息 - * - * @param ids - * @author cdf - * @date 2022/2/28 - */ - List getInfoByIdList(@Param("ids") List ids); - - - /** - * 通过id集合获取终端信息 - * - * @param pids - * @author cdf - * @date 2022/2/28 - */ - List getInfoByPidList(@Param("pids") List pids); - - - /** - * 获取指定id集的设备 - * - * @return TerminalTree 终端树数据 - * @author cdf - * @date 2022/2/25 - */ - List getAllDeviceList(@Param("ids") List ids); - - /** - * 获取所有id集的母线 - * - * @return TerminalTree 终端树数据 - * @author cdf - * @date 2022/2/25 - */ - List getAllVolList(@Param("ids") List ids); - - /** - * 获取所有id集的监测点 - * - * @return TerminalTree 终端树数据 - * @author cdf - * @date 2022/2/25 - */ - List getAllLineList(@Param("ids") List ids); - - - /** - * 通过监测点集合获取所有母线 - * - * @author cdf - * @date 2022/2/28 - */ - List getVoltageListByLineIds(@Param("ids") List ids); - /** * 返回未绑定的监测点 @@ -165,6 +109,9 @@ public interface LineMapper extends BaseMapper { List getDeviceById(@Param("devIds") List devIds, @Param("deviceType") DeviceType deviceType); + List getDeviceByIdOnOrOff(@Param("devIds") List devIds, @Param("deviceType") DeviceType deviceType,@Param("comFlag")Integer comFlag); + + List getLineDetail(@Param("ids") List ids); /** @@ -233,6 +180,14 @@ public interface LineMapper extends BaseMapper { */ List getBaseLineInfo(@Param("list")List lineIndex); + + /** + * 获取监测点区域详细信息(原基础上添加监测点区域经纬度信息) + * @param lineIndex 监测点结合 + * @date 2022/6/29 + */ + List getBaseLineAreaInfo(@Param("list")List lineIndex); + /** * 返回监测点信息及通讯状态 * @param lineIndex 监测点集合 diff --git a/pqs-device/device-boot/src/main/java/com/njcn/device/mapper/mapping/LineMapper.xml b/pqs-device/device-boot/src/main/java/com/njcn/device/mapper/mapping/LineMapper.xml index a311f07bf..779a7ad9a 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/device/mapper/mapping/LineMapper.xml +++ b/pqs-device/device-boot/src/main/java/com/njcn/device/mapper/mapping/LineMapper.xml @@ -87,7 +87,7 @@ order by sort - select a.id,a.pid,a.name,a.level,a.sort from pq_line where pid in @@ -266,6 +266,48 @@ + + + + + +