From 2e1e18f36772abdb2ea76a034cdc419ef0db835b Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 5 Sep 2024 11:37:53 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=AE=9E=E6=97=B6=E6=95=B0=E6=8D=AEfeign?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/real/vo/RealDeviceParamVo.java | 31 ++++++++++++++++++++ .../real/controller/RealDeviceController.java | 34 ++++++++++++++++++++++ .../hzims/real/service/IRealDeviceService.java | 12 ++++++++ .../real/service/impl/RealDeviceServiceImpl.java | 33 +++++++++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/real/vo/RealDeviceParamVo.java create mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/real/controller/RealDeviceController.java create mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/real/service/IRealDeviceService.java create mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/real/service/impl/RealDeviceServiceImpl.java diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/real/vo/RealDeviceParamVo.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/real/vo/RealDeviceParamVo.java new file mode 100644 index 0000000..fe5272e --- /dev/null +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/real/vo/RealDeviceParamVo.java @@ -0,0 +1,31 @@ +package com.hnac.hzims.real.vo; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Map; + +/** + * @author ysj + */ +@Data +@ApiModel(value = "设备历史查询参数") +public class RealDeviceParamVo { + + @ApiModelProperty(value = "站点Id") + private String projectId; + + @ApiModelProperty(value = "厂租ID") + private String deviceId; + + @ApiModelProperty(value = "厂租点名称") + private String attrName; + + @ApiModelProperty(value = "页码") + private Integer current; + + @ApiModelProperty(value = "页码条数") + private Integer size; +} \ No newline at end of file diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/real/controller/RealDeviceController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/real/controller/RealDeviceController.java new file mode 100644 index 0000000..d395d0a --- /dev/null +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/real/controller/RealDeviceController.java @@ -0,0 +1,34 @@ +package com.hnac.hzims.real.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.real.service.IRealDeviceService; +import com.hnac.hzims.real.vo.RealDeviceParamVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author ysj + */ +@RestController +@AllArgsConstructor +@RequestMapping("/real") +@Api(value = "厂租点实时数据", tags = "厂租点实时数据") +public class RealDeviceController extends BladeController { + + private final IRealDeviceService service; + + + @PostMapping("/realAttrsData") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "厂租点实时数据列表", notes = "获取厂租点实时数据列表") + public R realAttrsData(@RequestBody RealDeviceParamVo param) { + return R.data(service.realAttrsData(param)); + } +} \ No newline at end of file diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/real/service/IRealDeviceService.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/real/service/IRealDeviceService.java new file mode 100644 index 0000000..31bc828 --- /dev/null +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/real/service/IRealDeviceService.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.real.service; + +import com.hnac.hzims.real.vo.RealDeviceParamVo; +import org.springblade.core.tool.api.R; + +/** + * @author ysj + */ +public interface IRealDeviceService { + + R realAttrsData(RealDeviceParamVo param); +} \ No newline at end of file diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/real/service/impl/RealDeviceServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/real/service/impl/RealDeviceServiceImpl.java new file mode 100644 index 0000000..249bf0e --- /dev/null +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/real/service/impl/RealDeviceServiceImpl.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.real.service.impl; + +import com.hnac.hzims.real.service.IRealDeviceService; +import com.hnac.hzims.real.vo.RealDeviceParamVo; +import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; +import lombok.AllArgsConstructor; +import org.springblade.core.tool.api.R; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @author ysj + */ +@Service +@AllArgsConstructor +public class RealDeviceServiceImpl implements IRealDeviceService { + + + private final DeviceDataClient deviceDataClient; + + /** + * 获取厂租点实时数据列表 + * @param param + * @return + */ + @Override + public R realAttrsData(RealDeviceParamVo param) { + return deviceDataClient.getRealAttrsData(param.getProjectId(), 0,param.getDeviceId(), + param.getAttrName(),param.getCurrent(),param.getSize()); + } +} \ No newline at end of file