From f16b89180f2b6a50d85c746d50c617d270cb9dfe Mon Sep 17 00:00:00 2001 From: zhangjunwen Date: Wed, 18 Sep 2024 10:10:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E5=85=B3=E4=BF=A1=E6=81=AF=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/task/Channel1DataProcess.java | 3 +- .../gatewayinfo/vo/GatewayInfoPageReqVO.java | 5 ++ .../gatewayinfo/vo/GatewayInfoRespVO.java | 19 +++++++ .../gatewayinfo/vo/GatewayInfoSaveReqVO.java | 5 ++ .../dataobject/gatewayinfo/GatewayInfoDO.java | 25 +++++++++ .../mysql/gatewayinfo/GatewayInfoMapper.java | 13 +++++ .../gatewayinfo/GatewayInfoServiceImpl.java | 11 ++-- .../mapper/gatewayinfo/GatewayInfoMapper.xml | 53 +++++++++++++++++++ 8 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/gatewayinfo/GatewayInfoMapper.xml diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/task/Channel1DataProcess.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/task/Channel1DataProcess.java index afe171c..e08c7b7 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/task/Channel1DataProcess.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/task/Channel1DataProcess.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; /** + * Ka1采集卡 * @Author zhangjunwen * @create 2024/9/4 */ @@ -24,7 +25,7 @@ public class Channel1DataProcess implements Runnable{ private void process() { String measurement = "gateway_channel_current_data"; - String equid = "2e3d0190e63eda526da89d6c751f08f3"; + String equid = "2e3d0190e63eda526da89d6c751f08f3";//修改为网关 InfluxDBService influxDBService = SpringUtils.getBean(InfluxDBService.class); AlarmRulesApi alarmRulesApi = SpringUtils.getBean(AlarmRulesApi.class); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoPageReqVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoPageReqVO.java index 33266b9..f6c0b91 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoPageReqVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoPageReqVO.java @@ -20,4 +20,9 @@ public class GatewayInfoPageReqVO extends PageParam { @Schema(description = "状态(0:正常,1:异常,2:停机)", example = "2") private Integer status; + @Schema(description = "设备id") + private String equipId; + + @Schema(description = "机床网关编号") + private String gatewayCode; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoRespVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoRespVO.java index f6bb1c4..515df2c 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoRespVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoRespVO.java @@ -59,4 +59,23 @@ public class GatewayInfoRespVO { @ExcelProperty("网关图片路径") private String gatewayPicPath; + @Schema(description = "设备id") + @ExcelProperty("设备id") + private String equipId; + + @Schema(description = "机床网关编号") + @ExcelProperty("机床网关编号") + private String gatewayCode; + + @Schema(description = "客户名称") + @ExcelProperty("客户名称") + private String customerName; + + @Schema(description = "设备编号") + @ExcelProperty("设备编号") + private String equipNo; + + @Schema(description = "机床型号") + @ExcelProperty("机床型号") + private String modelName; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoSaveReqVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoSaveReqVO.java index ce01345..9117824 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoSaveReqVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/vo/GatewayInfoSaveReqVO.java @@ -44,4 +44,9 @@ public class GatewayInfoSaveReqVO { @Schema(description = "网关图片路径") private String gatewayPicPath; + @Schema(description = "设备id") + private String equipId; + + @Schema(description = "机床网关编号") + private String gatewayCode; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/gatewayinfo/GatewayInfoDO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/gatewayinfo/GatewayInfoDO.java index 4ec6b1f..2c0b1ea 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/gatewayinfo/GatewayInfoDO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/gatewayinfo/GatewayInfoDO.java @@ -1,5 +1,6 @@ package com.inspur.module.system.dal.dataobject.gatewayinfo; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; import com.baomidou.mybatisplus.annotation.*; @@ -67,4 +68,28 @@ public class GatewayInfoDO extends BaseDO { */ private String gatewayPicPath; + /** + * 设备id + */ + private String equipId; + + /** + * 网关编号 + */ + private String gatewayCode; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 设备编号 + */ + private String equipNo; + + /** + * 机床型号 + */ + private String modelName; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayInfoMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayInfoMapper.java index a1f877d..bd65086 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayInfoMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayInfoMapper.java @@ -2,12 +2,16 @@ package com.inspur.module.system.dal.mysql.gatewayinfo; import java.util.*; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.inspur.framework.common.pojo.PageResult; import com.inspur.framework.mybatis.core.query.LambdaQueryWrapperX; import com.inspur.framework.mybatis.core.mapper.BaseMapperX; +import com.inspur.module.system.controller.admin.alarm.vo.EquipAlarmDataPageReqVO; +import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDO; import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDO; import org.apache.ibatis.annotations.Mapper; import com.inspur.module.system.controller.admin.gatewayinfo.vo.*; +import org.apache.ibatis.annotations.Param; /** * 机床网关信息 Mapper @@ -25,4 +29,13 @@ public interface GatewayInfoMapper extends BaseMapperX { .orderByDesc(GatewayInfoDO::getGatewayId)); } + /** + * 查询网关信息列表 + */ + public IPage selectGatewayList(IPage page, @Param("reqVO") GatewayInfoPageReqVO reqVO); + + /** + * 根据id查询网关信息 + */ + public GatewayInfoDO selectGatewayById(@Param("id") String id); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoServiceImpl.java index 7ef3955..2f14971 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoServiceImpl.java @@ -1,6 +1,9 @@ package com.inspur.module.system.service.gatewayinfo; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.inspur.framework.tenant.core.aop.TenantIgnore; +import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDO; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -65,7 +68,7 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { @TenantIgnore private void validateGatewayInfoExists(String id) { - if (gatewayInfoMapper.selectById(id) == null) { + if (gatewayInfoMapper.selectGatewayById(id) == null) { throw exception(GATEWAY_INFO_NOT_EXISTS); } } @@ -73,13 +76,15 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { @Override @TenantIgnore public GatewayInfoDO getGatewayInfo(String id) { - return gatewayInfoMapper.selectById(id); + return gatewayInfoMapper.selectGatewayById(id); } @Override @TenantIgnore public PageResult getGatewayInfoPage(GatewayInfoPageReqVO pageReqVO) { - return gatewayInfoMapper.selectPage(pageReqVO); + IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + gatewayInfoMapper.selectGatewayList(page, pageReqVO); + return new PageResult<>(page.getRecords(), page.getTotal()); } } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/gatewayinfo/GatewayInfoMapper.xml b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/gatewayinfo/GatewayInfoMapper.xml new file mode 100644 index 0000000..e3ecd1f --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/gatewayinfo/GatewayInfoMapper.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + select igi.gateway_id,igi.equip_id,igi.gateway_name,igi.gateway_model,igi.gateway_code,igi.gateway_mfg,igi.gateway_location,igi.firmware_version,igi.ip_address,igi.gateway_spn,igi.status,igi.gateway_pic_path,igi.remark,iei.equip_no,imi.model_name,ic.customer_name FROM `imt_gateway_info` igi + left join imt_equip_info iei on igi.equip_id = iei.equip_id + left join imt_model_info imi on iei.model_id = imi.model_id + left join imt_customer_info ic on iei.customer_id = ic.customer_id + + + + + + + + + + + + + + \ No newline at end of file