diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/DataQueryController.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/DataQueryController.java index 1156d2f..ba82754 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/DataQueryController.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/DataQueryController.java @@ -5,7 +5,7 @@ import com.inspur.framework.common.pojo.CommonResult; import com.inspur.framework.common.pojo.PageParam; import com.inspur.framework.common.util.object.BeanUtils; import com.inspur.framework.excel.core.util.ExcelUtils; -import com.inspur.module.data.controller.admin.query.vo.CurrentDataRespVO; +import com.inspur.module.data.controller.admin.query.vo.*; import com.inspur.module.data.service.IDataQueryService; import com.inspur.module.system.controller.admin.alarm.vo.AlarmDataPageReqVO; import com.inspur.module.system.controller.admin.alarm.vo.AlarmDataRespVO; @@ -66,4 +66,51 @@ public class DataQueryController { BeanUtils.toBean(list, CurrentDataRespVO.class)); } + @GetMapping("/export-press-excel") + @Operation(summary = "导出机床液压传感器参数 Excel") + @PreAuthorize("@ss.hasPermission('data:query:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportPressDataExcel(String equipId,String tableName, String startTime, String endTime, + HttpServletResponse response) throws IOException, ParseException { + List list = (List)dataQueryService.selectDataListByPages(equipId,tableName,startTime,endTime,null,null).get("list"); + // 导出 Excel + ExcelUtils.write(response, "机床液压参数报警记录.xls", "液压数据", PressDataRespVO.class, + BeanUtils.toBean(list, PressDataRespVO.class)); + } + + @GetMapping("/export-vibr-excel") + @Operation(summary = "导出机床振动传感器参数 Excel") + @PreAuthorize("@ss.hasPermission('data:query:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportVibrDataExcel(String equipId,String tableName, String startTime, String endTime, + HttpServletResponse response) throws IOException, ParseException { + List list = (List)dataQueryService.selectDataListByPages(equipId,tableName,startTime,endTime,null,null).get("list"); + // 导出 Excel + ExcelUtils.write(response, "机床振动参数报警记录.xls", "振动数据", VibrDataRespVO.class, + BeanUtils.toBean(list, VibrDataRespVO.class)); + } + + @GetMapping("/export-temp-excel") + @Operation(summary = "导出机床温度传感器参数 Excel") + @PreAuthorize("@ss.hasPermission('data:query:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportTempDataExcel(String equipId,String tableName, String startTime, String endTime, + HttpServletResponse response) throws IOException, ParseException { + List list = (List)dataQueryService.selectDataListByPages(equipId,tableName,startTime,endTime,null,null).get("list"); + // 导出 Excel + ExcelUtils.write(response, "机床温度参数报警记录.xls", "温度数据", TempDataRespVO.class, + BeanUtils.toBean(list, TempDataRespVO.class)); + } + + @GetMapping("/export-process-excel") + @Operation(summary = "导出机床加工参数 Excel") + @PreAuthorize("@ss.hasPermission('data:query:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportProcessDataExcel(String equipId,String tableName, String startTime, String endTime, + HttpServletResponse response) throws IOException, ParseException { + List list = (List)dataQueryService.selectDataListByPages(equipId,tableName,startTime,endTime,null,null).get("list"); + // 导出 Excel + ExcelUtils.write(response, "机床加工参数报警记录.xls", "加工数据", ProcessDataRespVO.class, + BeanUtils.toBean(list, ProcessDataRespVO.class)); + } } diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/PressDataRespVO.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/PressDataRespVO.java new file mode 100644 index 0000000..d4ff859 --- /dev/null +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/PressDataRespVO.java @@ -0,0 +1,26 @@ +package com.inspur.module.data.controller.admin.query.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +/** + * 液压传感器数据 + * @Author zhangjunwen + * @create 2024/9/6 + */ +@Data +public class PressDataRespVO { + + + @ExcelProperty("时间") + private String time; + + @ExcelProperty("x轴润滑压力") + private String x_lube_press; + + @ExcelProperty("y轴润滑压力") + private String y_lube_press; + + @ExcelProperty("z轴润滑压力") + private String z_lube_press; +} diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/ProcessDataRespVO.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/ProcessDataRespVO.java new file mode 100644 index 0000000..39e87ab --- /dev/null +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/ProcessDataRespVO.java @@ -0,0 +1,28 @@ +package com.inspur.module.data.controller.admin.query.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +/** + * 机床加工数据 + * @Author zhangjunwen + * @create 2024/9/6 + */ +@Data +public class ProcessDataRespVO { + + @ExcelProperty("时间") + private String time; + + @ExcelProperty("加工总件数") + private String work_total; + + @ExcelProperty("加工时长") + private String work_time; + + @ExcelProperty("通电时间") + private String on_time; + + @ExcelProperty("加工件数") + private String work_items; +} diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/TempDataRespVO.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/TempDataRespVO.java new file mode 100644 index 0000000..5a46d0f --- /dev/null +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/TempDataRespVO.java @@ -0,0 +1,25 @@ +package com.inspur.module.data.controller.admin.query.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +/** + * 温度传感器数据 + * @Author zhangjunwen + * @create 2024/9/6 + */ +@Data +public class TempDataRespVO { + + @ExcelProperty("时间") + private String time; + + @ExcelProperty("x轴轴承温度") + private String x_bear_temp; + + @ExcelProperty("y轴轴承温度") + private String y_bear_temp; + + @ExcelProperty("x轴轴承温度") + private String z_bear_temp; +} diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/VibrDataRespVO.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/VibrDataRespVO.java new file mode 100644 index 0000000..ab78a6b --- /dev/null +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/VibrDataRespVO.java @@ -0,0 +1,19 @@ +package com.inspur.module.data.controller.admin.query.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +/** + * 振动传感器数据 + * @Author zhangjunwen + * @create 2024/9/6 + */ +@Data +public class VibrDataRespVO { + + @ExcelProperty("时间") + private String time; + + @ExcelProperty("y轴熵值") + private String x_entropy; +} diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/task/Channel4DataProcess.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/task/Channel4DataProcess.java index 610978d..2e9674a 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/task/Channel4DataProcess.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/task/Channel4DataProcess.java @@ -33,6 +33,7 @@ public class Channel4DataProcess implements Runnable{ Map tags = new HashMap<>(); fields.put("x_bear_temp", Math.random()); fields.put("y_bear_temp", Math.random()); + fields.put("z_bear_temp", Math.random()); fields.put("x_debris_temp", Math.random()); fields.put("z_debris_temp", Math.random()); fields.put("at_temp", Math.random()); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/vo/AlarmDataRespVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/vo/AlarmDataRespVO.java index e8ff2a4..d5936a8 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/vo/AlarmDataRespVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/vo/AlarmDataRespVO.java @@ -72,4 +72,21 @@ public class AlarmDataRespVO { @Schema(description = "报警类型") @ExcelProperty("报警类型") private String alarmType; + + @Schema(description = "机床型号") + @ExcelProperty("机床型号") + private String modelName; + + @Schema(description = "客户名") + @ExcelProperty("客户名") + private String customerName; + + @Schema(description = "设备编号") + @ExcelProperty("设备编号") + private String equipNo; + + @Schema(description = "机床组件") + @ExcelProperty("机床组件") + private String componentName; + } 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 e2ca6c8..b089a52 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 @@ -55,6 +55,7 @@ public class AlarmDataServiceImpl implements AlarmDataService { } @Override + @TenantIgnore public void deleteAlarmData(Long id) { // 校验存在 validateAlarmDataExists(id); @@ -70,11 +71,13 @@ public class AlarmDataServiceImpl implements AlarmDataService { } @Override + @TenantIgnore public AlarmDataDO getAlarmData(Long id) { return alarmDataMapper.selectAlarmDataById(id); } @Override + @TenantIgnore public PageResult getAlarmDataPage(AlarmDataPageReqVO pageReqVO) { IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); alarmDataMapper.selectAlarmDataList(page, pageReqVO); 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 b35706f..aa2ea53 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 @@ -36,6 +36,7 @@ public class AlarmRulesServiceImpl implements AlarmRulesService { private StringRedisTemplate stringRedisTemplate; @Override + @TenantIgnore public String createAlarmRules(AlarmRulesSaveReqVO createReqVO) { // 插入 AlarmRulesDO alarmRules = BeanUtils.toBean(createReqVO, AlarmRulesDO.class); @@ -47,6 +48,7 @@ public class AlarmRulesServiceImpl implements AlarmRulesService { } @Override + @TenantIgnore public void updateAlarmRules(AlarmRulesSaveReqVO updateReqVO) { // 校验存在 validateAlarmRulesExists(updateReqVO.getAlarmId()); @@ -56,6 +58,7 @@ public class AlarmRulesServiceImpl implements AlarmRulesService { } @Override + @TenantIgnore public void deleteAlarmRules(String id) { // 校验存在 validateAlarmRulesExists(id); @@ -63,6 +66,7 @@ public class AlarmRulesServiceImpl implements AlarmRulesService { alarmRulesMapper.deleteById(id); } + @TenantIgnore private void validateAlarmRulesExists(String id) { AlarmRulesDO alarmRule = alarmRulesMapper.selectAlarmRulesById(id); if (alarmRule == null) { @@ -73,11 +77,13 @@ public class AlarmRulesServiceImpl implements AlarmRulesService { } @Override + @TenantIgnore public AlarmRulesDO getAlarmRules(String id) { return alarmRulesMapper.selectAlarmRulesById(id); } @Override + @TenantIgnore public PageResult getAlarmRulesPage(AlarmRulesPageReqVO pageReqVO) { IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); alarmRulesMapper.selectAlarmRulesList(page, pageReqVO); 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 ab45d3c..9af8da6 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 @@ -37,6 +37,7 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService { private EquipAlarmDataMapper equipAlarmDataMapper; @Override + @TenantIgnore public String createEquipAlarmData(EquipAlarmDataSaveReqVO createReqVO) { // 插入 EquipAlarmDataDO equipAlarmData = BeanUtils.toBean(createReqVO, EquipAlarmDataDO.class); @@ -56,6 +57,7 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService { } @Override + @TenantIgnore public void deleteEquipAlarmData(String id) { // 校验存在 validateEquipAlarmDataExists(id); @@ -71,11 +73,13 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService { } @Override + @TenantIgnore public EquipAlarmDataDO getEquipAlarmData(String id) { return equipAlarmDataMapper.selectEquipAlarmById(id); } @Override + @TenantIgnore public PageResult getEquipAlarmDataPage(EquipAlarmDataPageReqVO pageReqVO) { IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); equipAlarmDataMapper.selectEquipAlarmList(page, pageReqVO); 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 6041756..7ef3955 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 @@ -34,6 +34,7 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { private GatewayInfoMapper gatewayInfoMapper; @Override + @TenantIgnore public String createGatewayInfo(GatewayInfoSaveReqVO createReqVO) { createReqVO.setStatus(0);//默认正常 // 插入 @@ -44,6 +45,7 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { } @Override + @TenantIgnore public void updateGatewayInfo(GatewayInfoSaveReqVO updateReqVO) { // 校验存在 validateGatewayInfoExists(updateReqVO.getGatewayId()); @@ -53,6 +55,7 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { } @Override + @TenantIgnore public void deleteGatewayInfo(String id) { // 校验存在 validateGatewayInfoExists(id); @@ -60,6 +63,7 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { gatewayInfoMapper.deleteById(id); } + @TenantIgnore private void validateGatewayInfoExists(String id) { if (gatewayInfoMapper.selectById(id) == null) { throw exception(GATEWAY_INFO_NOT_EXISTS); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/AlarmDataMapper.xml b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/AlarmDataMapper.xml index f0f5914..0ba6830 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/AlarmDataMapper.xml +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/AlarmDataMapper.xml @@ -18,6 +18,10 @@ + + + + @@ -30,7 +34,8 @@ where iead.deleted = '0' + and iead.status = 0 and iead.equip_id = #{reqVO.equipId} and iead.component_id = #{reqVO.componentId} and iead.alarm_level = #{reqVO.alarmLevel} diff --git a/imt-ui/src/api/data/query.js b/imt-ui/src/api/data/query.js index d83a8ec..515ad9d 100644 --- a/imt-ui/src/api/data/query.js +++ b/imt-ui/src/api/data/query.js @@ -18,3 +18,43 @@ export function exportCurrentDataExcel(params) { responseType: "blob", }); } + +// 导出机床液压参数报警记录 Excel +export function exportPressDataExcel(params) { + return request({ + url: "/data/query/export-press-excel", + method: "get", + params, + responseType: "blob", + }); +} + +// 导出机床液压参数报警记录 Excel +export function exportVibrDataExcel(params) { + return request({ + url: "/data/query/export-vibr-excel", + method: "get", + params, + responseType: "blob", + }); +} + +// 导出机床温度参数报警记录 Excel +export function exportTempDataExcel(params) { + return request({ + url: "/data/query/export-temp-excel", + method: "get", + params, + responseType: "blob", + }); +} + +// 导出机床液压参数报警记录 Excel +export function exportProcessDataExcel(params) { + return request({ + url: "/data/query/export-process-excel", + method: "get", + params, + responseType: "blob", + }); +} diff --git a/imt-ui/src/views/system/data/monitordata/index.vue b/imt-ui/src/views/system/data/monitordata/index.vue index 13b7c19..75afb2e 100644 --- a/imt-ui/src/views/system/data/monitordata/index.vue +++ b/imt-ui/src/views/system/data/monitordata/index.vue @@ -86,7 +86,7 @@ :show-overflow-tooltip="true" /> - + + +
+ 导出 +
+ + + 查 询 + 重置 +
+
+ + + + + + + + + + + + + +
+ +
+ 导出 +
+ + + 查 询 + 重置 +
+
+ + + + + + + + + + + +