diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java index efcb862..b94dc3a 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java @@ -6,6 +6,7 @@ import com.inspur.module.data.service.InfluxDBService; import com.inspur.module.system.api.alarm.AlarmRulesApi; import com.inspur.module.system.api.alarm.dto.AlarmRulesRespDTO; import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDO; +import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDetailsDTO; import com.inspur.module.system.service.gatewayinfo.GatewayInfoService; import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; import org.eclipse.paho.client.mqttv3.MqttCallback; @@ -139,7 +140,7 @@ public class MyMqttCallback implements MqttCallback { */ private Map getGatewayMapping(String gatewayCode) { GatewayInfoService gatewayInfoService = SpringUtils.getBean(GatewayInfoService.class); - GatewayInfoDO gatewayInfo = gatewayInfoService.getGatewayInfoByGatewayCode(gatewayCode); + GatewayInfoDetailsDTO gatewayInfo = gatewayInfoService.getGatewayInfoByGatewayCode(gatewayCode); if(gatewayInfo == null){ return null; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/api/alarm/AlarmRulesApiImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/api/alarm/AlarmRulesApiImpl.java index 73839d1..b79047d 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/api/alarm/AlarmRulesApiImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/api/alarm/AlarmRulesApiImpl.java @@ -11,6 +11,7 @@ import com.inspur.module.system.controller.equip.vo.EquipInfoSaveReqVO; import com.inspur.module.system.dal.dataobject.alarm.AlarmDataDO; import com.inspur.module.system.dal.dataobject.alarm.AlarmDataDTO; import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDO; +import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDTO; import com.inspur.module.system.service.alarm.AlarmDataService; import com.inspur.module.system.service.alarm.AlarmRulesService; import com.inspur.module.system.service.alarm.EquipAlarmDataService; @@ -169,7 +170,7 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{ */ private String refreshEquipAlarmData(AlarmRulesRespDTO rule){ //TODO 查询时要查询趋势报警信息 - List equipAlarmData = equipAlarmDataService.getEquipAlarmDataByEquipId(rule.getEquipId(),0); + List equipAlarmData = equipAlarmDataService.getEquipAlarmDataByEquipId(rule.getEquipId(),0); if(equipAlarmData == null || equipAlarmData.size() == 0){ return equipAlarmDataService.createEquipAlarmData(new EquipAlarmDataSaveReqVO(null,rule.getEquipId(), rule.getComponentId(),rule.getAlarmLevel(),0,LocalDateTime.now(),LocalDateTime.now(),0,null)); @@ -188,7 +189,7 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{ */ private String changeEquipStatusByRule(AlarmRulesRespDTO rule){ - List equipAlarmData = equipAlarmDataService.getEquipAlarmDataByEquipId(rule.getEquipId(),null); + List equipAlarmData = equipAlarmDataService.getEquipAlarmDataByEquipId(rule.getEquipId(),null); if(equipAlarmData == null || equipAlarmData.size() == 0){ return equipAlarmDataService.createEquipAlarmData(new EquipAlarmDataSaveReqVO(null,rule.getEquipId(), rule.getComponentId(),rule.getAlarmLevel(),1,LocalDateTime.now(),LocalDateTime.now(),0,judgeEquipAnalyzeStatusByAlarmLevel(rule.getAlarmLevel()))); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmRulesController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmRulesController.java index 06062de..dd2212a 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmRulesController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmRulesController.java @@ -1,5 +1,6 @@ package com.inspur.module.system.controller.admin.alarm; +import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDTO; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -56,7 +57,7 @@ public class AlarmRulesController { @Operation(summary = "改变报警规则状态") @PreAuthorize("@ss.hasPermission('imt:alarm-rules:change')") public CommonResult changeAlarmRulesStatus(@Valid @RequestBody AlarmRulesSaveReqVO updateReqVO) { - AlarmRulesDO alarmRules = alarmRulesService.getAlarmRules(updateReqVO.getAlarmId()); + AlarmRulesDTO alarmRules = alarmRulesService.getAlarmRules(updateReqVO.getAlarmId()); updateReqVO.setStatus(alarmRules.getStatus() == 0 ? 1 : 0); alarmRulesService.updateAlarmRules(updateReqVO); return success(true); @@ -76,7 +77,7 @@ public class AlarmRulesController { @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('imt:alarm-rules:query')") public CommonResult getAlarmRules(@RequestParam("id") String id) { - AlarmRulesDO alarmRules = alarmRulesService.getAlarmRules(id); + AlarmRulesDTO alarmRules = alarmRulesService.getAlarmRules(id); return success(BeanUtils.toBean(alarmRules, AlarmRulesRespVO.class)); } @@ -84,7 +85,7 @@ public class AlarmRulesController { @Operation(summary = "获得机床报警规则分页") @PreAuthorize("@ss.hasPermission('imt:alarm-rules:query')") public CommonResult> getAlarmRulesPage(@Valid AlarmRulesPageReqVO pageReqVO) { - PageResult pageResult = alarmRulesService.getAlarmRulesPage(pageReqVO); + PageResult pageResult = alarmRulesService.getAlarmRulesPage(pageReqVO); return success(BeanUtils.toBean(pageResult, AlarmRulesRespVO.class)); } @@ -95,7 +96,7 @@ public class AlarmRulesController { public void exportAlarmRulesExcel(@Valid AlarmRulesPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = alarmRulesService.getAlarmRulesPage(pageReqVO).getList(); + List list = alarmRulesService.getAlarmRulesPage(pageReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "机床报警规则.xls", "数据", AlarmRulesRespVO.class, BeanUtils.toBean(list, AlarmRulesRespVO.class)); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java index 7e14ff6..3f90cfe 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java @@ -1,6 +1,7 @@ package com.inspur.module.system.controller.admin.alarm; +import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDTO; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -72,7 +73,7 @@ public class EquipAlarmDataController { @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('imt:equip-alarm-data:query')") public CommonResult getEquipAlarmData(@RequestParam("id") String id) { - EquipAlarmDataDO equipAlarmData = equipAlarmDataService.getEquipAlarmData(id); + EquipAlarmDataDTO equipAlarmData = equipAlarmDataService.getEquipAlarmData(id); return success(BeanUtils.toBean(equipAlarmData, EquipAlarmDataRespVO.class)); } @@ -80,7 +81,7 @@ public class EquipAlarmDataController { @Operation(summary = "获得机床设备报警数据分页") @PreAuthorize("@ss.hasPermission('imt:equip-alarm-data:query')") public CommonResult> getEquipAlarmDataPage(@Valid EquipAlarmDataPageReqVO pageReqVO) { - PageResult pageResult = equipAlarmDataService.getEquipAlarmDataPage(pageReqVO); + PageResult pageResult = equipAlarmDataService.getEquipAlarmDataPage(pageReqVO); return success(BeanUtils.toBean(pageResult, EquipAlarmDataRespVO.class)); } @@ -91,7 +92,7 @@ public class EquipAlarmDataController { public void exportEquipAlarmDataExcel(@Valid EquipAlarmDataPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = equipAlarmDataService.getEquipAlarmDataPage(pageReqVO).getList(); + List list = equipAlarmDataService.getEquipAlarmDataPage(pageReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "机床设备报警数据.xls", "数据", EquipAlarmDataRespVO.class, BeanUtils.toBean(list, EquipAlarmDataRespVO.class)); @@ -100,7 +101,7 @@ public class EquipAlarmDataController { @Operation(summary = "获取报警提交维修工单详情") @GetMapping("/getSubmitOrderDetails/{alarmId}") @PreAuthorize("@ss.hasPermission('imt:equip-alarm-data:query')") - public CommonResult getSubmitOrderDetails(@PathVariable("alarmId") String alarmId) { + public CommonResult getSubmitOrderDetails(@PathVariable("alarmId") String alarmId) { return success(equipAlarmDataService.getSubmitOrderDetails(alarmId)); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/GatewayInfoController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/GatewayInfoController.java index e2ea745..82a8eb3 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/GatewayInfoController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/GatewayInfoController.java @@ -1,5 +1,6 @@ package com.inspur.module.system.controller.admin.gatewayinfo; +import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDetailsDTO; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -10,7 +11,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import javax.validation.constraints.*; import javax.validation.*; import javax.servlet.http.*; import java.util.*; @@ -71,7 +71,7 @@ public class GatewayInfoController { @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('imt:gateway-info:query')") public CommonResult getGatewayInfo(@RequestParam("id") String id) { - GatewayInfoDO gatewayInfo = gatewayInfoService.getGatewayInfo(id); + GatewayInfoDetailsDTO gatewayInfo = gatewayInfoService.getGatewayInfo(id); return success(BeanUtils.toBean(gatewayInfo, GatewayInfoRespVO.class)); } @@ -79,7 +79,7 @@ public class GatewayInfoController { @Operation(summary = "获得机床网关信息分页") @PreAuthorize("@ss.hasPermission('imt:gateway-info:query')") public CommonResult> getGatewayInfoPage(@Valid GatewayInfoPageReqVO pageReqVO) { - PageResult pageResult = gatewayInfoService.getGatewayInfoPage(pageReqVO); + PageResult pageResult = gatewayInfoService.getGatewayInfoPage(pageReqVO); return success(BeanUtils.toBean(pageResult, GatewayInfoRespVO.class)); } @@ -90,7 +90,7 @@ public class GatewayInfoController { public void exportGatewayInfoExcel(@Valid GatewayInfoPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = gatewayInfoService.getGatewayInfoPage(pageReqVO).getList(); + List list = gatewayInfoService.getGatewayInfoPage(pageReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "机床网关信息.xls", "数据", GatewayInfoRespVO.class, BeanUtils.toBean(list, GatewayInfoRespVO.class)); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmDataDTO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmDataDTO.java index 9a10673..6dfe17b 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmDataDTO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmDataDTO.java @@ -96,6 +96,11 @@ public class AlarmDataDTO { */ private String equipNo; + /** + * 设备名称 + */ + private String equipName; + /** * 组件名称 */ diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmRulesDO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmRulesDO.java index c5514bf..f51055a 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmRulesDO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmRulesDO.java @@ -89,10 +89,4 @@ public class AlarmRulesDO extends BaseDO { * 排序 */ private Integer sort; - - private String equipNo; - - private String customerName; - - private String componentName; } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmRulesDTO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmRulesDTO.java new file mode 100644 index 0000000..91538e7 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/AlarmRulesDTO.java @@ -0,0 +1,106 @@ +package com.inspur.module.system.dal.dataobject.alarm; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @Author zhangjunwen + * @create 2024/10/11 + */ +@Data +public class AlarmRulesDTO { + + /** + * 报警规则信息id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String alarmId; + /** + * 报警信息的key + */ + private String alarmNameKey; + /** + * 报警规则信息名称 + */ + private String alarmName; + /** + * 报警规则信息单位 + */ + private String alarmInfoUnit; + /** + * 机床设备id + */ + private String equipId; + /** + * 机床组件id + */ + private String componentId; + /** + * 报警规则上限值 + */ + private BigDecimal alertUpperBound; + /** + * 报警规则下限值 + */ + private BigDecimal alertLowerBound; + /** + * 报警规则信息的类型(0:阈值报警,1:趋势报警) + */ + private Integer type; + /** + * 状态(0:启用,1:停用) + */ + private Integer status; + /** + * 报警可能原因描述 + */ + private String reasonDescription; + /** + * 备注 + */ + private String remark; + /** + * 规则描述 + */ + private String referenceName; + /** + * 判断规则 + */ + private String referenceCon; + /** + * 等级 + */ + private Integer alarmLevel; + /** + * 排序 + */ + private Integer sort; + + /** + * 设备编号 + */ + private String equipNo; + + /** + * 设备型号 + */ + private String modelName; + + /** + * 设备名称 + */ + private String equipName; + + /** + * 客户名 + */ + private String customerName; + + /** + * 组件名 + */ + private String componentName; +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/EquipAlarmDataDO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/EquipAlarmDataDO.java index b12e313..3e457bb 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/EquipAlarmDataDO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/EquipAlarmDataDO.java @@ -62,23 +62,4 @@ public class EquipAlarmDataDO extends BaseDO { */ private Integer equipAnalyseStatus; - /** - * 客户名 - */ - private String customerName; - - /** - * 设备编号 - */ - private String equipNo; - - /** - * 设备型号 - */ - private String modelName; - - /** - * 组件名 - */ - private String componentName; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/EquipAlarmDataDTO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/EquipAlarmDataDTO.java new file mode 100644 index 0000000..005830a --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/alarm/EquipAlarmDataDTO.java @@ -0,0 +1,76 @@ +package com.inspur.module.system.dal.dataobject.alarm; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @Author zhangjunwen + * @create 2024/10/11 + */ +@Data +public class EquipAlarmDataDTO { + + private String equipAlarmId; + /** + * 机床设备id + */ + private String equipId; + /** + * 机床组件id + */ + private String componentId; + /** + * 报警等级(1:1级,2:2级,3:3级) + *

+ * 枚举 {@link TODO alarm_level 对应的类} + */ + private Integer alarmLevel; + /** + * 报警类型(0:阈值报警 1:趋势报警) + */ + private Integer alarmType; + /** + * 首次报警时间 + */ + private LocalDateTime firstAlarmTime; + /** + * 最新报警时间 + */ + private LocalDateTime latestAlarmTime; + /** + * 状态(0:待处理,1:已处理) + */ + private Integer status; + /** + * 机床分析状态(0:正常,1:磨损中,2:磨损严重) + */ + private Integer equipAnalyseStatus; + + /** + * 客户名 + */ + private String customerName; + + /** + * 设备编号 + */ + private String equipNo; + + /** + * 设备名称 + */ + private String equipName; + + /** + * 设备型号 + */ + private String modelName; + + /** + * 组件名 + */ + private String componentName; +} 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 2c0b1ea..4d3a332 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 @@ -78,18 +78,4 @@ public class GatewayInfoDO extends BaseDO { */ 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/dataobject/gatewayinfo/GatewayInfoDetailsDTO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/gatewayinfo/GatewayInfoDetailsDTO.java new file mode 100644 index 0000000..dbc66f0 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/gatewayinfo/GatewayInfoDetailsDTO.java @@ -0,0 +1,86 @@ +package com.inspur.module.system.dal.dataobject.gatewayinfo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +/** + * @Author zhangjunwen + * @create 2024/10/10 + */ +@Data +public class GatewayInfoDetailsDTO { + + /** + * 机床网关id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String gatewayId; + /** + * 机床网关名称 + */ + private String gatewayName; + /** + * 机床网关型号 + */ + private String gatewayModel; + /** + * 机床网关生产厂商 + */ + private String gatewayMfg; + /** + * 机床网关位置 + */ + private String gatewayLocation; + /** + * 固件版本 + */ + private String firmwareVersion; + /** + * ip地址 + */ + private String ipAddress; + /** + * 规格参数 + */ + private String gatewaySpn; + /** + * 状态(0:正常,1:异常,2:停机) + *

+ */ + private Integer status; + /** + * 备注 + */ + private String remark; + /** + * 网关图片路径 + */ + 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/alarm/AlarmDataMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmDataMapper.java index ce62481..45ac335 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmDataMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmDataMapper.java @@ -8,11 +8,17 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; 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.framework.mybatis.core.query.MPJLambdaWrapperX; import com.inspur.framework.tenant.core.aop.TenantIgnore; import com.inspur.module.system.controller.imtIndex.vo.ImtIndexAlarmListVO; import com.inspur.module.system.dal.dataobject.alarm.AlarmDataDO; import com.inspur.module.system.dal.dataobject.alarm.AlarmDataDTO; import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDO; +import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDTO; +import com.inspur.module.system.dal.dataobject.baseData.CustomerInfoDO; +import com.inspur.module.system.dal.dataobject.baseData.ModelInfoDO; +import com.inspur.module.system.dal.dataobject.equip.ComponentInfoDO; +import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO; import org.apache.ibatis.annotations.Mapper; import com.inspur.module.system.controller.admin.alarm.vo.*; import org.apache.ibatis.annotations.Param; @@ -64,17 +70,90 @@ public interface AlarmDataMapper extends BaseMapperX { } + /** + * 分页查询参数报警列表 + */ + default PageResult selectAlarmDataDetailsList(AlarmDataPageReqVO reqVO) { + MPJLambdaWrapperX wrapper = new MPJLambdaWrapperX<>(); + wrapper.selectAll(AlarmDataDO.class) + .selectAs(EquipInfoDO::getEquipNo, AlarmDataDTO::getEquipNo) + .selectAs(EquipInfoDO::getEquipName, AlarmDataDTO::getEquipName) + .selectAs(ModelInfoDO::getModelName, AlarmDataDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, AlarmDataDTO::getCustomerName) + .selectAs(ComponentInfoDO::getComponentName, AlarmDataDTO::getComponentName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, AlarmDataDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .leftJoin(ComponentInfoDO.class, ComponentInfoDO::getComponentId, AlarmDataDO::getComponentId) + .eq(AlarmDataDO::getStatus, 0) + .eqIfExists(AlarmDataDO::getAlarmRulesId, reqVO.getAlarmRulesId()) + .eqIfExists(AlarmDataDO::getEquipId, reqVO.getEquipId()) + .eqIfExists(AlarmDataDO::getComponentId, reqVO.getComponentId()) + .eqIfExists(AlarmDataDO::getNameKey, reqVO.getNameKey()) + .eqIfExists(AlarmDataDO::getAlarmType, reqVO.getAlarmType()) + .orderByDesc(AlarmDataDO::getCreateTime); + if(Objects.nonNull(reqVO.getFirstAlarmTime())){ + wrapper.geIfExists(AlarmDataDO::getFirstAlarmTime, reqVO.getFirstAlarmTime()[0]) + .leIfExists(AlarmDataDO::getFirstAlarmTime, reqVO.getFirstAlarmTime()[1]); + } + if(Objects.nonNull(reqVO.getLastAlarmTime())){ + wrapper.geIfExists(AlarmDataDO::getLastAlarmTime, reqVO.getLastAlarmTime()[0]) + .leIfExists(AlarmDataDO::getLastAlarmTime, reqVO.getLastAlarmTime()[1]); + } + return selectJoinPage(reqVO, AlarmDataDTO.class, wrapper); + } + /** * 查询参数报警列表 */ public IPage selectAlarmDataList(IPage page, @Param("reqVO") AlarmDataPageReqVO reqVO); + /** + * 根据id查询参数报警详情 + */ + default AlarmDataDTO selectAlarmDataDetailsById(Long id){ + return selectJoinOne(AlarmDataDTO.class, new MPJLambdaWrapperX() + .selectAll(AlarmDataDO.class) + .selectAs(EquipInfoDO::getEquipNo, AlarmDataDTO::getEquipNo) + .selectAs(EquipInfoDO::getEquipName, AlarmDataDTO::getEquipName) + .selectAs(ModelInfoDO::getModelName, AlarmDataDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, AlarmDataDTO::getCustomerName) + .selectAs(ComponentInfoDO::getComponentName, AlarmDataDTO::getComponentName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, AlarmDataDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .leftJoin(ComponentInfoDO.class, ComponentInfoDO::getComponentId, AlarmDataDO::getComponentId) + .eq(AlarmDataDO::getStatus, 0) + .eq(AlarmDataDO::getAlarmDataId, id) + ); + } + /** * 根据id查询参数报警 */ @TenantIgnore public AlarmDataDTO selectAlarmDataById(@Param("id") Long id); + /** + * 根据规则id查询参数报警 + */ + default AlarmDataDTO selectAlarmDataListByRulesId(@Param("alarmRulesId") String alarmRulesId) { + return selectJoinOne(AlarmDataDTO.class, new MPJLambdaWrapperX() + .selectAll(AlarmDataDO.class) + .selectAs(EquipInfoDO::getEquipNo, AlarmDataDTO::getEquipNo) + .selectAs(EquipInfoDO::getEquipName, AlarmDataDTO::getEquipName) + .selectAs(ModelInfoDO::getModelName, AlarmDataDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, AlarmDataDTO::getCustomerName) + .selectAs(ComponentInfoDO::getComponentName, AlarmDataDTO::getComponentName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, AlarmDataDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .leftJoin(ComponentInfoDO.class, ComponentInfoDO::getComponentId, AlarmDataDO::getComponentId) + .eq(AlarmDataDO::getStatus, 0) + .eq(AlarmDataDO::getAlarmRulesId, alarmRulesId) + ); + } + /** * 根据规则id查询参数报警 */ diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmRulesMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmRulesMapper.java index 9dcb143..540eee1 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmRulesMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmRulesMapper.java @@ -4,7 +4,16 @@ 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.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.inspur.module.system.controller.admin.gatewayinfo.vo.GatewayInfoPageReqVO; import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDO; +import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDTO; +import com.inspur.module.system.dal.dataobject.baseData.CustomerInfoDO; +import com.inspur.module.system.dal.dataobject.baseData.ModelInfoDO; +import com.inspur.module.system.dal.dataobject.equip.ComponentInfoDO; +import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO; +import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDO; +import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDetailsDTO; import org.apache.ibatis.annotations.Mapper; import com.inspur.module.system.controller.admin.alarm.vo.*; import org.apache.ibatis.annotations.Param; @@ -40,16 +49,74 @@ public interface AlarmRulesMapper extends BaseMapperX { .orderByDesc(AlarmRulesDO::getAlarmId)); } + /** + * 分页查询设备报警规则列表 + */ + default PageResult selectAlarmRulesDetailsList(@Param("reqVO") AlarmRulesPageReqVO reqVO) { + return selectJoinPage(reqVO, AlarmRulesDTO.class, new MPJLambdaWrapperX() + .selectAll(AlarmRulesDO.class) + .selectAs(EquipInfoDO::getEquipNo, AlarmRulesDTO::getEquipNo) + .selectAs(EquipInfoDO::getEquipName, AlarmRulesDTO::getEquipName) + .selectAs(ModelInfoDO::getModelName, AlarmRulesDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, AlarmRulesDTO::getCustomerName) + .selectAs(ComponentInfoDO::getComponentName, AlarmRulesDTO::getComponentName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, AlarmRulesDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .leftJoin(ComponentInfoDO.class, ComponentInfoDO::getComponentId, AlarmRulesDO::getComponentId) + .eqIfExists(AlarmRulesDO::getEquipId, reqVO.getEquipId()) + .eqIfExists(AlarmRulesDO::getType, reqVO.getType()) + .eqIfExists(AlarmRulesDO::getAlarmLevel, reqVO.getAlarmLevel()) + .likeIfExists(AlarmRulesDO::getAlarmName, reqVO.getAlarmName()) + .likeIfExists(AlarmRulesDO::getAlarmNameKey, reqVO.getAlarmNameKey()) + ); + } /** * 查询设备报警规则列表 */ public IPage selectAlarmRulesList(IPage page, @Param("reqVO") AlarmRulesPageReqVO reqVO); + /** + * 根据id查询报警规则信息 + */ + default AlarmRulesDTO selectAlarmRulesDetailsById(String id){ + return selectJoinOne(AlarmRulesDTO.class,new MPJLambdaWrapperX() + .selectAll(AlarmRulesDO.class) + .selectAs(EquipInfoDO::getEquipNo, AlarmRulesDTO::getEquipNo) + .selectAs(ModelInfoDO::getModelName, AlarmRulesDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, AlarmRulesDTO::getCustomerName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, AlarmRulesDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .eq(AlarmRulesDO::getAlarmId, id) + ); + } + /** * 根据id查询报警规则 */ public AlarmRulesDO selectAlarmRulesById(@Param("id") String id); + /** + * 根据设备id查询报警规则 + */ + default List getAlarmRulesDetailsListByEquipId(String equipId){ + return selectJoinList(AlarmRulesDTO.class,new MPJLambdaWrapperX() + .selectAll(AlarmRulesDO.class) + .selectAs(EquipInfoDO::getEquipNo, AlarmRulesDTO::getEquipNo) + .selectAs(EquipInfoDO::getEquipName, AlarmRulesDTO::getEquipName) + .selectAs(ModelInfoDO::getModelName, AlarmRulesDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, AlarmRulesDTO::getCustomerName) + .selectAs(ComponentInfoDO::getComponentName, AlarmRulesDTO::getComponentName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, AlarmRulesDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .leftJoin(ComponentInfoDO.class, ComponentInfoDO::getComponentId, AlarmRulesDO::getComponentId) + .eq(AlarmRulesDO::getStatus, 0) + .eq(AlarmRulesDO::getEquipId, equipId) + ); + } + /** * 根据设备id查询报警规则 */ diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/EquipAlarmDataMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/EquipAlarmDataMapper.java index 7449936..d9b54e4 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/EquipAlarmDataMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/EquipAlarmDataMapper.java @@ -4,8 +4,15 @@ 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.framework.mybatis.core.query.MPJLambdaWrapperX; import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDO; +import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDTO; import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDO; +import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDTO; +import com.inspur.module.system.dal.dataobject.baseData.CustomerInfoDO; +import com.inspur.module.system.dal.dataobject.baseData.ModelInfoDO; +import com.inspur.module.system.dal.dataobject.equip.ComponentInfoDO; +import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO; import org.apache.ibatis.annotations.Mapper; import com.inspur.module.system.controller.admin.alarm.vo.*; import org.apache.ibatis.annotations.Param; @@ -33,22 +40,95 @@ public interface EquipAlarmDataMapper extends BaseMapperX { .orderByDesc(EquipAlarmDataDO::getEquipAlarmId)); } + /** + * 分页查询设备报警列表 + */ + default PageResult selectEquipAlarmDetailsList(@Param("reqVO") EquipAlarmDataPageReqVO reqVO) { + MPJLambdaWrapperX wrapper = new MPJLambdaWrapperX<>(); + wrapper.selectAll(EquipAlarmDataDO.class) + .selectAs(EquipInfoDO::getEquipNo, EquipAlarmDataDTO::getEquipNo) + .selectAs(EquipInfoDO::getEquipName, EquipAlarmDataDTO::getEquipName) + .selectAs(ModelInfoDO::getModelName, EquipAlarmDataDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, EquipAlarmDataDTO::getCustomerName) + .selectAs(ComponentInfoDO::getComponentName, EquipAlarmDataDTO::getComponentName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, EquipAlarmDataDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .leftJoin(ComponentInfoDO.class, ComponentInfoDO::getComponentId, EquipAlarmDataDO::getComponentId) + .eq(EquipAlarmDataDO::getStatus, 0) + .eqIfExists(EquipAlarmDataDO::getEquipId, reqVO.getEquipId()) + .eqIfExists(EquipAlarmDataDO::getComponentId, reqVO.getComponentId()) + .eqIfExists(EquipAlarmDataDO::getAlarmLevel, reqVO.getAlarmLevel()) + .eqIfExists(EquipAlarmDataDO::getAlarmType, reqVO.getAlarmType()) + .orderByDesc(EquipAlarmDataDO::getFirstAlarmTime); + if(reqVO.getFirstAlarmTime() != null){ + wrapper.geIfExists(EquipAlarmDataDO::getFirstAlarmTime, reqVO.getFirstAlarmTime()[0]) + .leIfExists(EquipAlarmDataDO::getFirstAlarmTime, reqVO.getFirstAlarmTime()[1]); + } + return selectJoinPage(reqVO, EquipAlarmDataDTO.class, wrapper); + } + /** * 查询设备报警列表 */ public IPage selectEquipAlarmList(IPage page, @Param("reqVO") EquipAlarmDataPageReqVO reqVO); + /** + * 根据id查询设备报警信息 + */ + default EquipAlarmDataDTO selectEquipAlarmDetailsById(String id){ + return selectJoinOne(EquipAlarmDataDTO.class,new MPJLambdaWrapperX() + .selectAll(EquipAlarmDataDO.class) + .selectAs(EquipInfoDO::getEquipNo, EquipAlarmDataDTO::getEquipNo) + .selectAs(EquipInfoDO::getEquipName, EquipAlarmDataDTO::getEquipName) + .selectAs(ModelInfoDO::getModelName, EquipAlarmDataDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, EquipAlarmDataDTO::getCustomerName) + .selectAs(ComponentInfoDO::getComponentName, EquipAlarmDataDTO::getComponentName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, EquipAlarmDataDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .leftJoin(ComponentInfoDO.class, ComponentInfoDO::getComponentId, EquipAlarmDataDO::getComponentId) + .eq(EquipAlarmDataDO::getEquipAlarmId, id) + ); + } + /** * 根据id查询设备报警 */ public EquipAlarmDataDO selectEquipAlarmById(@Param("id") String id); + /** + * 通过设备id查询设备报警列表 + */ + default List getEquipAlarmDataDetailsByEquipIdAndAlarmType(@Param("equipId") String equipId, + @Param("alarmType") Integer alarmType){ + return selectJoinList(EquipAlarmDataDTO.class,new MPJLambdaWrapperX() + .selectAll(EquipAlarmDataDO.class) + .selectAs(EquipInfoDO::getEquipNo, EquipAlarmDataDTO::getEquipNo) + .selectAs(EquipInfoDO::getEquipName, EquipAlarmDataDTO::getEquipName) + .selectAs(ModelInfoDO::getModelName, EquipAlarmDataDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, EquipAlarmDataDTO::getCustomerName) + .selectAs(ComponentInfoDO::getComponentName, EquipAlarmDataDTO::getComponentName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, EquipAlarmDataDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .leftJoin(ComponentInfoDO.class, ComponentInfoDO::getComponentId, EquipAlarmDataDO::getComponentId) + .eq(EquipAlarmDataDO::getEquipId, equipId) + .eq(EquipAlarmDataDO::getAlarmType, alarmType) + ); + } + /** * 通过设备id查询设备报警数据 */ List getEquipAlarmDataByEquipIdAndAlarmType(@Param("equipId") String equipId, @Param("alarmType") Integer alarmType); + /** + * 获取报警提交维修工单详情 + */ + + /** * 获取报警提交维修工单详情 * 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 e3b5126..c866d51 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 @@ -6,9 +6,12 @@ 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.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.inspur.module.system.dal.dataobject.baseData.CustomerInfoDO; +import com.inspur.module.system.dal.dataobject.baseData.ModelInfoDO; +import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO; import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDO; +import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDetailsDTO; import org.apache.ibatis.annotations.Mapper; import com.inspur.module.system.controller.admin.gatewayinfo.vo.*; import org.apache.ibatis.annotations.Param; @@ -29,21 +32,82 @@ public interface GatewayInfoMapper extends BaseMapperX { .orderByDesc(GatewayInfoDO::getGatewayId)); } + /** + * 联合查询网关信息列表 + */ + default PageResult selectGatewayDetailsList(@Param("reqVO") GatewayInfoPageReqVO reqVO) { + return selectJoinPage(reqVO, GatewayInfoDetailsDTO.class, new MPJLambdaWrapperX() + .selectAll(GatewayInfoDO.class) + .selectAs(EquipInfoDO::getEquipNo, GatewayInfoDetailsDTO::getEquipNo) + .selectAs(ModelInfoDO::getModelName, GatewayInfoDetailsDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, GatewayInfoDetailsDTO::getCustomerName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, GatewayInfoDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .eqIfExists(GatewayInfoDO::getEquipId, reqVO.getEquipId()) + .likeIfExists(GatewayInfoDO::getGatewayName, reqVO.getGatewayName()) + .likeIfExists(GatewayInfoDO::getGatewayModel, reqVO.getGatewayModel()) + .likeIfExists(GatewayInfoDO::getGatewayCode, reqVO.getGatewayCode()) + ); + } + /** * 查询网关信息列表 */ public IPage selectGatewayList(IPage page, @Param("reqVO") GatewayInfoPageReqVO reqVO); - /** - * 根据id查询网关信息 - */ + default GatewayInfoDetailsDTO selectGatewayDetailsById(String id){ + return selectJoinOne(GatewayInfoDetailsDTO.class,new MPJLambdaWrapperX() + .selectAll(GatewayInfoDO.class) + .selectAs(EquipInfoDO::getEquipNo, GatewayInfoDetailsDTO::getEquipNo) + .selectAs(ModelInfoDO::getModelName, GatewayInfoDetailsDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, GatewayInfoDetailsDTO::getCustomerName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, GatewayInfoDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .eq(GatewayInfoDO::getGatewayId, id) + ); + } + public GatewayInfoDO selectGatewayById(@Param("id") String id); + /** + * 根据网关编号查询网关信息 + */ + default GatewayInfoDetailsDTO selectGatewayDetailsByGatewayCode(String gatewayCode){ + return selectJoinOne(GatewayInfoDetailsDTO.class,new MPJLambdaWrapperX() + .selectAll(GatewayInfoDO.class) + .selectAs(EquipInfoDO::getEquipNo, GatewayInfoDetailsDTO::getEquipNo) + .selectAs(ModelInfoDO::getModelName, GatewayInfoDetailsDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, GatewayInfoDetailsDTO::getCustomerName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, GatewayInfoDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + .eq(GatewayInfoDO::getGatewayCode, gatewayCode) + .eq(GatewayInfoDO::getStatus, 0) + ); + } + /** * 根据网关编号查询网关信息 */ public GatewayInfoDO selectGatewayByGatewayCode(@Param("gatewayCode") String gatewayCode); + /** + * 获取网关信息列表 + */ + default List selectAllGatewayDetailsList(){ + return selectJoinList(GatewayInfoDetailsDTO.class,new MPJLambdaWrapperX() + .selectAll(GatewayInfoDO.class) + .selectAs(EquipInfoDO::getEquipNo, GatewayInfoDetailsDTO::getEquipNo) + .selectAs(ModelInfoDO::getModelName, GatewayInfoDetailsDTO::getModelName) + .selectAs(CustomerInfoDO::getCustomerName, GatewayInfoDetailsDTO::getCustomerName) + .leftJoin(EquipInfoDO.class, EquipInfoDO::getEquipId, GatewayInfoDO::getEquipId) + .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) + .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) + ); + } + /** * 获取网关信息列表 */ diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java index 6222715..5c76941 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java @@ -41,7 +41,6 @@ public class AlarmDataServiceImpl implements AlarmDataService { private EquipAlarmDataService equipAlarmDataService; @Override - @TenantIgnore public Long createAlarmData(AlarmDataSaveReqVO createReqVO) { // 插入 AlarmDataDO alarmData = BeanUtils.toBean(createReqVO, AlarmDataDO.class); @@ -51,7 +50,6 @@ public class AlarmDataServiceImpl implements AlarmDataService { } @Override - @TenantIgnore public void updateAlarmData(AlarmDataSaveReqVO updateReqVO) { // 校验存在 validateAlarmDataExists(updateReqVO.getAlarmDataId()); @@ -61,7 +59,6 @@ public class AlarmDataServiceImpl implements AlarmDataService { } @Override - @TenantIgnore public void deleteAlarmData(Long id) { // 校验存在 validateAlarmDataExists(id); @@ -69,25 +66,23 @@ public class AlarmDataServiceImpl implements AlarmDataService { alarmDataMapper.deleteById(id); } - @TenantIgnore private void validateAlarmDataExists(Long id) { - if (alarmDataMapper.selectAlarmDataById(id) == null) { + if (alarmDataMapper.selectAlarmDataDetailsById(id) == null) { throw exception(ALARM_DATA_NOT_EXISTS); } } @Override - @TenantIgnore public AlarmDataDTO getAlarmData(Long id) { - return alarmDataMapper.selectAlarmDataById(id); + return alarmDataMapper.selectAlarmDataDetailsById(id); } @Override - @TenantIgnore public PageResult getAlarmDataPage(AlarmDataPageReqVO pageReqVO) { - IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - alarmDataMapper.selectAlarmDataList(page, pageReqVO); - return new PageResult<>(page.getRecords(), page.getTotal()); +// IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); +// alarmDataMapper.selectAlarmDataList(page, pageReqVO); +// return new PageResult<>(page.getRecords(), page.getTotal()); + return alarmDataMapper.selectAlarmDataDetailsList(pageReqVO); } /** @@ -95,7 +90,6 @@ public class AlarmDataServiceImpl implements AlarmDataService { * @return 参数报警列表数据 */ @Override - @TenantIgnore public List getAlarmDataList(String equipAlarmId){ AlarmDataPageReqVO alarmData = new AlarmDataPageReqVO(); alarmData.setEquipAlarmId(equipAlarmId); @@ -106,7 +100,6 @@ public class AlarmDataServiceImpl implements AlarmDataService { * 关闭制定设备报警id下的所有参数报警记录 */ @Override - @TenantIgnore @Transactional public int closeAllAlarmDataByEquipAlarmId(String equipAlarmId){ List alarmDataList = alarmDataMapper.selectAlarmDatas(new AlarmDataPageReqVO().setEquipAlarmId(equipAlarmId)); @@ -119,9 +112,8 @@ public class AlarmDataServiceImpl implements AlarmDataService { } @Override - @TenantIgnore public AlarmDataDTO getAlarmDataByRulesId(String ruleId){ - return alarmDataMapper.selectAlarmDataByRulesId(ruleId); + return alarmDataMapper.selectAlarmDataListByRulesId(ruleId); } @Override diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmRulesService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmRulesService.java index 801292a..a8a499d 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmRulesService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmRulesService.java @@ -4,6 +4,7 @@ import javax.validation.*; import com.inspur.module.system.controller.admin.alarm.vo.*; import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDO; import com.inspur.framework.common.pojo.PageResult; +import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDTO; import java.util.List; @@ -42,7 +43,7 @@ public interface AlarmRulesService { * @param id 编号 * @return 机床报警规则 */ - AlarmRulesDO getAlarmRules(String id); + AlarmRulesDTO getAlarmRules(String id); /** * 获得机床报警规则分页 @@ -50,10 +51,10 @@ public interface AlarmRulesService { * @param pageReqVO 分页查询 * @return 机床报警规则分页 */ - PageResult getAlarmRulesPage(AlarmRulesPageReqVO pageReqVO); + PageResult getAlarmRulesPage(AlarmRulesPageReqVO pageReqVO); /** * 根据设备id查询报警规则 */ - List getAlarmRulesListByEquipId(String equipId); + List getAlarmRulesListByEquipId(String equipId); } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmRulesServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmRulesServiceImpl.java index de779fc..8afa4e5 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmRulesServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmRulesServiceImpl.java @@ -3,6 +3,7 @@ package com.inspur.module.system.service.alarm; 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.AlarmRulesDTO; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -36,7 +37,6 @@ public class AlarmRulesServiceImpl implements AlarmRulesService { private StringRedisTemplate stringRedisTemplate; @Override - @TenantIgnore public String createAlarmRules(AlarmRulesSaveReqVO createReqVO) { // 插入 AlarmRulesDO alarmRules = BeanUtils.toBean(createReqVO, AlarmRulesDO.class); @@ -48,7 +48,6 @@ public class AlarmRulesServiceImpl implements AlarmRulesService { } @Override - @TenantIgnore public void updateAlarmRules(AlarmRulesSaveReqVO updateReqVO) { // 校验存在 validateAlarmRulesExists(updateReqVO.getAlarmId()); @@ -58,7 +57,6 @@ public class AlarmRulesServiceImpl implements AlarmRulesService { } @Override - @TenantIgnore public void deleteAlarmRules(String id) { // 校验存在 validateAlarmRulesExists(id); @@ -66,9 +64,8 @@ public class AlarmRulesServiceImpl implements AlarmRulesService { alarmRulesMapper.deleteById(id); } - @TenantIgnore private void validateAlarmRulesExists(String id) { - AlarmRulesDO alarmRule = alarmRulesMapper.selectAlarmRulesById(id); + AlarmRulesDTO alarmRule = alarmRulesMapper.selectAlarmRulesDetailsById(id); if (alarmRule == null) { throw exception(ALARM_RULES_NOT_EXISTS); }else{ @@ -77,23 +74,21 @@ public class AlarmRulesServiceImpl implements AlarmRulesService { } @Override - @TenantIgnore - public AlarmRulesDO getAlarmRules(String id) { - return alarmRulesMapper.selectAlarmRulesById(id); + public AlarmRulesDTO getAlarmRules(String id) { + return alarmRulesMapper.selectAlarmRulesDetailsById(id); } @Override - @TenantIgnore - public PageResult getAlarmRulesPage(AlarmRulesPageReqVO pageReqVO) { - IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - alarmRulesMapper.selectAlarmRulesList(page, pageReqVO); - return new PageResult<>(page.getRecords(), page.getTotal()); + public PageResult getAlarmRulesPage(AlarmRulesPageReqVO pageReqVO) { +// IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); +// alarmRulesMapper.selectAlarmRulesList(page, pageReqVO); +// return new PageResult<>(page.getRecords(), page.getTotal()); + return alarmRulesMapper.selectAlarmRulesDetailsList(pageReqVO); } @Override - @TenantIgnore - public List getAlarmRulesListByEquipId(String equipId){ - return alarmRulesMapper.getAlarmRulesListByEquipId(equipId); + public List getAlarmRulesListByEquipId(String equipId){ + return alarmRulesMapper.getAlarmRulesDetailsListByEquipId(equipId); } } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java index 268100f..2efad6e 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java @@ -7,6 +7,7 @@ import com.inspur.module.system.controller.admin.alarm.vo.*; import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDO; import com.inspur.framework.common.pojo.PageResult; import com.inspur.framework.common.pojo.PageParam; +import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDTO; /** * 机床设备报警数据 Service 接口 @@ -43,7 +44,7 @@ public interface EquipAlarmDataService { * @param id 编号 * @return 机床设备报警数据 */ - EquipAlarmDataDO getEquipAlarmData(String id); + EquipAlarmDataDTO getEquipAlarmData(String id); /** * 获得机床设备报警数据分页 @@ -51,12 +52,12 @@ public interface EquipAlarmDataService { * @param pageReqVO 分页查询 * @return 机床设备报警数据分页 */ - PageResult getEquipAlarmDataPage(EquipAlarmDataPageReqVO pageReqVO); + PageResult getEquipAlarmDataPage(EquipAlarmDataPageReqVO pageReqVO); /** * 通过设备id查询设备报警数据 */ - List getEquipAlarmDataByEquipId(String equipId,Integer alarmType); + List getEquipAlarmDataByEquipId(String equipId,Integer alarmType); /** * 获取报警提交维修工单详情 @@ -66,7 +67,7 @@ public interface EquipAlarmDataService { * @param alarmId 报警id * @return com.inspur.module.system.controller.admin.alarm.vo.AlarmSubmitOrderDetailsVO */ - AlarmSubmitOrderDetailsVO getSubmitOrderDetails(String alarmId); + EquipAlarmDataDTO getSubmitOrderDetails(String alarmId); /** * 判断报警是否已经提交工单 diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java index e029a9a..75dcc8c 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java @@ -7,6 +7,7 @@ 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 com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDTO; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper; import org.springframework.stereotype.Service; @@ -45,7 +46,6 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService { private MaintenanceOrderMapper maintenanceOrderMapper; @Override - @TenantIgnore public String createEquipAlarmData(EquipAlarmDataSaveReqVO createReqVO) { // 插入 EquipAlarmDataDO equipAlarmData = BeanUtils.toBean(createReqVO, EquipAlarmDataDO.class); @@ -55,7 +55,6 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService { } @Override - @TenantIgnore public void updateEquipAlarmData(EquipAlarmDataSaveReqVO updateReqVO) { // 校验存在 validateEquipAlarmDataExists(updateReqVO.getEquipAlarmId()); @@ -65,7 +64,6 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService { } @Override - @TenantIgnore public void deleteEquipAlarmData(String id) { // 校验存在 validateEquipAlarmDataExists(id); @@ -73,41 +71,36 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService { equipAlarmDataMapper.deleteById(id); } - @TenantIgnore private void validateEquipAlarmDataExists(String id) { - if (equipAlarmDataMapper.selectEquipAlarmById(id) == null) { + if (equipAlarmDataMapper.selectEquipAlarmDetailsById(id) == null) { throw exception(EQUIP_ALARM_DATA_NOT_EXISTS); } } @Override - @TenantIgnore - public EquipAlarmDataDO getEquipAlarmData(String id) { - return equipAlarmDataMapper.selectEquipAlarmById(id); + public EquipAlarmDataDTO getEquipAlarmData(String id) { + return equipAlarmDataMapper.selectEquipAlarmDetailsById(id); } @Override - @TenantIgnore - public PageResult getEquipAlarmDataPage(EquipAlarmDataPageReqVO pageReqVO) { - IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - equipAlarmDataMapper.selectEquipAlarmList(page, pageReqVO); - return new PageResult<>(page.getRecords(), page.getTotal()); + public PageResult getEquipAlarmDataPage(EquipAlarmDataPageReqVO pageReqVO) { +// IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); +// equipAlarmDataMapper.selectEquipAlarmList(page, pageReqVO); +// return new PageResult<>(page.getRecords(), page.getTotal()); + return equipAlarmDataMapper.selectEquipAlarmDetailsList(pageReqVO); } @Override - @TenantIgnore - public List getEquipAlarmDataByEquipId(String equipId,Integer alarmType) { - return equipAlarmDataMapper.getEquipAlarmDataByEquipIdAndAlarmType(equipId,alarmType); + public List getEquipAlarmDataByEquipId(String equipId,Integer alarmType) { + return equipAlarmDataMapper.getEquipAlarmDataDetailsByEquipIdAndAlarmType(equipId,alarmType); } @Override - @TenantIgnore - public AlarmSubmitOrderDetailsVO getSubmitOrderDetails(String alarmId) { - return equipAlarmDataMapper.getSubmitOrderDetails(alarmId); + public EquipAlarmDataDTO getSubmitOrderDetails(String alarmId) { + return equipAlarmDataMapper.selectEquipAlarmDetailsById(alarmId); } @Override - @TenantIgnore public String isSubmitOrder(String alarmId) { List list = maintenanceOrderMapper.selectList(new LambdaQueryWrapper() .eq(MaintenanceOrderDO::getAlarmId, alarmId) diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoService.java index 565deb8..c737da0 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoService.java @@ -6,7 +6,7 @@ import javax.validation.*; import com.inspur.module.system.controller.admin.gatewayinfo.vo.*; import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDO; import com.inspur.framework.common.pojo.PageResult; -import com.inspur.framework.common.pojo.PageParam; +import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDetailsDTO; /** * 机床网关信息 Service 接口 @@ -43,7 +43,7 @@ public interface GatewayInfoService { * @param id 编号 * @return 机床网关信息 */ - GatewayInfoDO getGatewayInfo(String id); + GatewayInfoDetailsDTO getGatewayInfo(String id); /** * 获得机床网关信息分页 @@ -51,17 +51,17 @@ public interface GatewayInfoService { * @param pageReqVO 分页查询 * @return 机床网关信息分页 */ - PageResult getGatewayInfoPage(GatewayInfoPageReqVO pageReqVO); + PageResult getGatewayInfoPage(GatewayInfoPageReqVO pageReqVO); /** * 获取机床网关列表 */ - List getGatewayInfoList(); + List getGatewayInfoList(); /** * 根据机床网关编号获取机床网关信息 */ - GatewayInfoDO getGatewayInfoByGatewayCode(String gatewayCode); + GatewayInfoDetailsDTO getGatewayInfoByGatewayCode(String gatewayCode); /** * 根据网关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 1d2040c..e852678 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,12 +1,10 @@ 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.common.util.json.JsonUtils; import com.inspur.framework.tenant.core.aop.TenantIgnore; -import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDO; import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayCardInfoDO; import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayCardParamsDO; +import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDetailsDTO; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; @@ -14,14 +12,12 @@ import javax.annotation.PostConstruct; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.inspur.module.system.controller.admin.gatewayinfo.vo.*; import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDO; import com.inspur.framework.common.pojo.PageResult; -import com.inspur.framework.common.pojo.PageParam; import com.inspur.framework.common.util.object.BeanUtils; import com.inspur.module.system.dal.mysql.gatewayinfo.GatewayInfoMapper; @@ -52,9 +48,9 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { @PostConstruct public void init() { - List gatewayInfoList = getGatewayInfoList(); + List gatewayInfoList = getGatewayInfoList(); - for (GatewayInfoDO gatewayInfo : gatewayInfoList) { + for (GatewayInfoDetailsDTO gatewayInfo : gatewayInfoList) { getGatewayCardAndParamByCatch(gatewayInfo.getGatewayId()); } } @@ -91,31 +87,32 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { @TenantIgnore private void validateGatewayInfoExists(String id) { - if (gatewayInfoMapper.selectGatewayById(id) == null) { + if (gatewayInfoMapper.selectGatewayDetailsById(id) == null) { throw exception(GATEWAY_INFO_NOT_EXISTS); } } @Override @TenantIgnore - public GatewayInfoDO getGatewayInfo(String id) { - return gatewayInfoMapper.selectGatewayById(id); + public GatewayInfoDetailsDTO getGatewayInfo(String id) { + return gatewayInfoMapper.selectGatewayDetailsById(id); } @Override @TenantIgnore - public PageResult getGatewayInfoPage(GatewayInfoPageReqVO pageReqVO) { - IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - gatewayInfoMapper.selectGatewayList(page, pageReqVO); - return new PageResult<>(page.getRecords(), page.getTotal()); + public PageResult getGatewayInfoPage(GatewayInfoPageReqVO pageReqVO) { +// IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); +// gatewayInfoMapper.selectGatewayList(page, pageReqVO); +// return new PageResult<>(page.getRecords(), page.getTotal()); + return gatewayInfoMapper.selectGatewayDetailsList(pageReqVO); } /** * 获取机床网关列表 */ @Override - public List getGatewayInfoList(){ - return gatewayInfoMapper.selectAllGatewayList(); + public List getGatewayInfoList(){ + return gatewayInfoMapper.selectAllGatewayDetailsList(); } /** @@ -123,8 +120,8 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { */ @Override @TenantIgnore - public GatewayInfoDO getGatewayInfoByGatewayCode(String gatewayCode){ - return gatewayInfoMapper.selectGatewayByGatewayCode(gatewayCode); + public GatewayInfoDetailsDTO getGatewayInfoByGatewayCode(String gatewayCode){ + return gatewayInfoMapper.selectGatewayDetailsByGatewayCode(gatewayCode); } /** 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 index 6c7c94e..63d49db 100644 --- 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 @@ -21,7 +21,7 @@ - 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 + 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 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 diff --git a/imt-server/imt-server/src/main/resources/application.yaml b/imt-server/imt-server/src/main/resources/application.yaml index 81921d7..5cd0677 100644 --- a/imt-server/imt-server/src/main/resources/application.yaml +++ b/imt-server/imt-server/src/main/resources/application.yaml @@ -287,6 +287,7 @@ imt: - rep_demo_jianpiao - tmp_report_data_1 - tmp_report_data_income + - imt_model_info ignore-caches: - permission_menu_ids - oauth_client diff --git a/imt-ui/src/views/system/alarm/alarmrules/index.vue b/imt-ui/src/views/system/alarm/alarmrules/index.vue index fd7aca7..a953897 100644 --- a/imt-ui/src/views/system/alarm/alarmrules/index.vue +++ b/imt-ui/src/views/system/alarm/alarmrules/index.vue @@ -42,13 +42,17 @@ @keyup.enter.native="handleQuery" /> - + + @change="cascaderChange" + > - + /> --> - + + @change="cascaderChange" + > import * as AlarmRulesApi from "@/api/system/alarm/alarmrules"; import AlarmRulesForm from "./AlarmRulesForm.vue"; -import {getEquipCascader, getEquipSelection} from "@/api/system/equip/equipInfo"; +import { + getEquipCascader, + getEquipSelection, +} from "@/api/system/equip/equipInfo"; export default { name: "AlarmRules", components: { @@ -593,7 +604,7 @@ export default { }, data() { return { - cascaderValue:[], + cascaderValue: [], equipCascader: [], // 遮罩层 loading: true, @@ -692,24 +703,24 @@ export default { this.loading = true; this.queryParams.type = this.activeName === "threshold" ? 0 : 1; const res = await AlarmRulesApi.getAlarmRulesPage(this.queryParams); - await getEquipCascader().then(res=>{ - res.forEach(item=>{ - if (item.children == null){ + await getEquipCascader().then((res) => { + res.forEach((item) => { + if (item.children == null) { item.disabled = true; } - }) + }); this.equipCascader = res; - }) + }); this.list = res.data.list; this.total = res.data.total; } finally { this.loading = false; } }, - cascaderChange(value){ - if (value.length > 0){ + cascaderChange(value) { + if (value.length > 0) { this.queryParams.equipId = value[1]; - }else { + } else { this.queryParams.equipId = null; } }, diff --git a/imt-ui/src/views/system/baseData/customerInfo/CustomerInfoForm.vue b/imt-ui/src/views/system/baseData/customerInfo/CustomerInfoForm.vue index f8a32df..03acb63 100644 --- a/imt-ui/src/views/system/baseData/customerInfo/CustomerInfoForm.vue +++ b/imt-ui/src/views/system/baseData/customerInfo/CustomerInfoForm.vue @@ -99,6 +99,27 @@ + + + + + + + + + import * as CustomerInfoApi from "@/api/system/baseData/customerInfo"; import { getAreaTree } from "@/api/system/area"; +import { getTenantList } from "@/api/system/tenant"; export default { name: "CustomerInfoForm", @@ -167,6 +189,8 @@ export default { { required: true, message: "请选择所属行业", trigger: "change" }, ], }, + + tenantLists: [], }; }, mounted() { @@ -174,8 +198,14 @@ export default { const list = res.data; this.areaTree = this.handleTreeList(list); }); + this.getTenantLists(); }, methods: { + getTenantLists() { + getTenantList().then((res) => { + this.tenantLists = res.data; + }); + }, areaTreeChange(value) { console.log(value); },