From cacf21776c504f0c444b6aab3c7927bbb0ae6a28 Mon Sep 17 00:00:00 2001 From: zhangjunwen Date: Wed, 9 Oct 2024 18:01:26 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/data/mqtt/MyMqttCallback.java | 4 +- .../module/data/service/DataQueryService.java | 168 +++++++++--------- .../admin/notice/NoticeController.java | 2 + .../dal/mysql/notify/NotifyMessageMapper.java | 10 +- 4 files changed, 95 insertions(+), 89 deletions(-) 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 16db6af..efcb862 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 @@ -244,7 +244,7 @@ public class MyMqttCallback implements MqttCallback { fields.put(v,(Double.parseDouble(msg.get(k).toString()) - 400) * 1.25); break; case "temp": - fields.put(v,Double.parseDouble(msg.get(k).toString()) * 0.1); + fields.put(v,Double.parseDouble(msg.get(k).toString()) / 10.0); break; default: fields.put(v,msg.get(k)); @@ -258,7 +258,7 @@ public class MyMqttCallback implements MqttCallback { int alarmNum = alarmRulesApi.alarmRulesFilter(fields, rules); logger.info("本次产生报警{}条",alarmNum); } - influxDBService.insert(measurement,tags, fields); + influxDBService.insert(measurement, tags, fields); logger.info("数据已插入{}表中!",measurement); } diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/DataQueryService.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/DataQueryService.java index db95a7e..d2bd006 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/DataQueryService.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/DataQueryService.java @@ -23,16 +23,16 @@ import java.util.stream.Collectors; @Service @Validated @Slf4j -public class DataQueryService implements IDataQueryService{ +public class DataQueryService implements IDataQueryService { @Autowired private InfluxDBService influxDBService; @Override - public Map selectDataListByPages(String equipId,String tableName,String startTime,String endTime, Integer pageSize, Integer pageNum){ + public Map selectDataListByPages(String equipId, String tableName, String startTime, String endTime, Integer pageSize, Integer pageNum) { Map resMap = new HashMap<>(); //TODO 分页查找条数,根据设备id、表名、时间范围、页码、每页条数 - List> dataList = queryDataByTime(tableName, null, startTime, endTime, pageNum, pageSize); + List> dataList = queryDataByTime(tableName, equipId, startTime, endTime, pageNum, pageSize); dataList.forEach(map -> { try { String time = map.get("time").toString(); @@ -41,10 +41,14 @@ public class DataQueryService implements IDataQueryService{ throw new RuntimeException(e); } }); - //TODO 时间需要将查询到的UTC时间转为系统时间(北京时间) + //TODO 时间需要将查询到的UTC时间转为系统时间(北京时间) // DateUtils.tranUTC2LocalDateTime("2024-08-28T08:00:00Z"); //TODO 查询数据总条数 - long total = countDataList(tableName, "x_push_temp", null, startTime, endTime); + long total = 0L; + if (dataList.size() != 0) { + List keys = new ArrayList<>(dataList.get(0).keySet()); + total = countDataList(tableName, keys.get(0), null, startTime, endTime); + } resMap.put("list", dataList); resMap.put("total", total); return resMap; @@ -70,13 +74,13 @@ public class DataQueryService implements IDataQueryService{ // } List> list = selectDataByColumnNameandDateSegmentation(equipId, tableName, columnName, startTime, endTime, intervalHours); Map resMap = new HashMap<>(); - if (list.size() == 0){ + if (list.size() == 0) { return null; } List columnList = new ArrayList<>(); - List timelist = new ArrayList<>(); - if(intervalHours > 6){ + List timelist = new ArrayList<>(); + if (intervalHours > 6) { columnName = "mean"; } for (Map data : list) { @@ -93,49 +97,49 @@ public class DataQueryService implements IDataQueryService{ /** * 根据设备id获取排屑电流数据 */ - public Map getCurrentData(String equipId, String startTime, String endTime){ + public Map getCurrentData(String equipId, String startTime, String endTime) { String tableName = "gateway_current_data"; String columnName = "chip_removal_1,chip_removal_2"; - return getAllData2ChartData(equipId,tableName,columnName, startTime, endTime); + return getAllData2ChartData(equipId, tableName, columnName, startTime, endTime); } /** * 根据设备id获取液压数据 */ - public Map getPressData(String equipId, String startTime, String endTime){ + public Map getPressData(String equipId, String startTime, String endTime) { String tableName = "gateway_hy_data"; String columnName = "hy_1,hy_2,hy_3"; - return getAllData2ChartData(equipId,tableName,columnName, startTime, endTime); + return getAllData2ChartData(equipId, tableName, columnName, startTime, endTime); } /** * 根据设备id获取温度数据 */ - public Map getTempData(String equipId, String startTime, String endTime){ + public Map getTempData(String equipId, String startTime, String endTime) { String tableName = "gateway_temp_data"; String columnName = "cr1_temp,cr2_temp,x0_temp,xp_temp,xn_temp,y0_temp,yp_temp,yn_temp,z0_temp,zp_temp,zn_temp"; - return getAllData2ChartData(equipId,tableName,columnName, startTime, endTime); + return getAllData2ChartData(equipId, tableName, columnName, startTime, endTime); } /** * 根据设备id获取振动数据 */ - public Map getVibrData(String equipId, String startTime, String endTime){ + public Map getVibrData(String equipId, String startTime, String endTime) { String tableName = "gateway_aclr_data"; String columnName = "x_aclr_rms,x_speed_rms,x_dis_rms,y_aclr_rms,y_speed_rms,y_dis_rms,z_aclr_rms,z_speed_rms,z_dis_rms," + "x_aclr_peak,x_speed_peak,x_dis_peak,y_aclr_peak,y_speed_peak,y_dis_peak,z_aclr_peak,z_speed_peak,z_dis_peak"; - return getAllData2ChartData(equipId,tableName,columnName, startTime, endTime); + return getAllData2ChartData(equipId, tableName, columnName, startTime, endTime); } /** * 根据设备id获取工作数据 */ - public Map getWorkData(String equipId, String startTime, String endTime){ + public Map getWorkData(String equipId, String startTime, String endTime) { String tableName = "gateway_fanuc_data"; String columnName = "power_time,process_num,total_process,work_time"; - Map resultMap = getAllData2ChartData(equipId,tableName,columnName, startTime, endTime); - if(resultMap == null){ + Map resultMap = getAllData2ChartData(equipId, tableName, columnName, startTime, endTime); + if (resultMap == null) { return null; } List workTimeList = (List) resultMap.get("work_time"); @@ -145,42 +149,42 @@ public class DataQueryService implements IDataQueryService{ return resultMap; } - public Map getAllData2ChartData(String equipId,String tableName,String columns, String startTime, String endTime){ + public Map getAllData2ChartData(String equipId, String tableName, String columns, String startTime, String endTime) { LocalDateTime stime = DateUtils.tranUTCtoLocalDateTime(startTime); LocalDateTime etime = DateUtils.tranUTCtoLocalDateTime(endTime); long intervalHours = ChronoUnit.HOURS.between(stime, etime); List> list = selectDataByColumnNameandDateSegmentation(equipId, tableName, columns, startTime, endTime, intervalHours); Map resMap = new HashMap<>(); - if (list.size() == 0){ + if (list.size() == 0) { return null; } List columnList = new ArrayList<>(); - List timelist = new ArrayList<>(); + List timelist = new ArrayList<>(); String[] columnName = columns.split(","); - if(intervalHours > 6){ - for(int i=0;i < columnName.length;i++){ + if (intervalHours > 6) { + for (int i = 0; i < columnName.length; i++) { columnName[i] = "mean_" + columnName[i]; } } for (String cn : columnName) { - if(cn.trim().length() == 0){ + if (cn.trim().length() == 0) { continue; } String realCn = cn; - if(cn.startsWith("mean")){ + if (cn.startsWith("mean")) { realCn = cn.replaceFirst("mean_", ""); } - resMap.put(realCn, list.stream().map(map->{ - Double data = (Double)map.get(cn); - if("gateway_temp_data".equals(tableName)){//温度处理 - return data/10.0; - } - if("work_time".equals(columnName) || "power_time".equals(columnName)){//时间转小时 - return data/60.0; - } - return data; + resMap.put(realCn, list.stream().map(map -> { + Double data = (Double) map.get(cn); + if ("gateway_temp_data".equals(tableName)) {//温度处理 + return data / 10.0; + } + if ("work_time".equals(columnName) || "power_time".equals(columnName)) {//时间转小时 + return data / 60.0; + } + return data; }).collect(Collectors.toList())); resMap.put("time", list.stream().map(map -> DateUtils.utcToCst(map.get("time").toString())).collect(Collectors.toList())); } @@ -189,19 +193,18 @@ public class DataQueryService implements IDataQueryService{ } /** - *按照策略分段查询数据列表 + * 按照策略分段查询数据列表 */ - private List> selectDataByColumnNameandDateSegmentation(String equipId, String tableName, String columnName, String startTime, String endTime,long intervalHours) - { + private List> selectDataByColumnNameandDateSegmentation(String equipId, String tableName, String columnName, String startTime, String endTime, long intervalHours) { List> list = new ArrayList<>(); - if(intervalHours <= 6){//6小时内全查 - list = selectDataByColumnNameandDate(null,tableName, columnName, startTime, endTime); - }else if(intervalHours <= 7*24 ){//7天内,每30s一个 - list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "30s"); - }else if(intervalHours <= 30*24 ){//30天内,每2min一个 - list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "2m"); - }else if (intervalHours <= 90*24){//90天以上,每6min一个 - list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "6m"); + if (intervalHours <= 6) {//6小时内全查 + list = selectDataByColumnNameandDate(null, tableName, columnName, startTime, endTime); + } else if (intervalHours <= 7 * 24) {//7天内,每30s一个 + list = selectLongTimeDataByColumnNameandDate(null, tableName, columnName, startTime, endTime, "30s"); + } else if (intervalHours <= 30 * 24) {//30天内,每2min一个 + list = selectLongTimeDataByColumnNameandDate(null, tableName, columnName, startTime, endTime, "2m"); + } else if (intervalHours <= 90 * 24) {//90天以上,每6min一个 + list = selectLongTimeDataByColumnNameandDate(null, tableName, columnName, startTime, endTime, "6m"); } return list; } @@ -209,26 +212,26 @@ public class DataQueryService implements IDataQueryService{ private List> queryDataByTime(String tableName, String equipId, String beginTime, String endTime, Integer pageNum, Integer pageSize) { StringBuilder sql = new StringBuilder("select * from ") .append("\"").append(tableName).append("\""); - if(equipId != null){ + if (equipId != null) { sql.append(" where equip_id = '").append(equipId).append("'"); } - if(beginTime != null){ - if(!sql.toString().contains("where")){ + if (beginTime != null) { + if (!sql.toString().contains("where")) { sql.append(" where"); - }else{ + } else { sql.append(" and"); } sql.append(" time >= '").append(beginTime).append("'"); } - if(endTime != null){ - if(!sql.toString().contains("where")){ + if (endTime != null) { + if (!sql.toString().contains("where")) { sql.append(" where"); - }else{ + } else { sql.append(" and"); } sql.append(" time <= '").append(endTime).append("'"); } - if(pageNum != null || pageSize != null) { + if (pageNum != null || pageSize != null) { sql.append(" order by time desc ") .append(" limit ").append(pageSize) .append(" offset ").append((pageNum - 1) * pageSize); @@ -238,24 +241,24 @@ public class DataQueryService implements IDataQueryService{ return influxDBService.queryResultProcess(influxDBService.query(sql.toString())); } - private long countDataList(String tableName,String field, String equipId, String beginTime, String endTime){ + private long countDataList(String tableName, String field, String equipId, String beginTime, String endTime) { StringBuilder sql = new StringBuilder("select count(").append(field).append(") from ") .append("\"").append(tableName).append("\""); - if(equipId != null){ + if (equipId != null) { sql.append(" where equip_id = '").append(equipId).append("'"); } - if(beginTime != null){ - if(!sql.toString().contains("where")){ + if (beginTime != null) { + if (!sql.toString().contains("where")) { sql.append(" where"); - }else{ + } else { sql.append(" and"); } sql.append(" time >= '").append(beginTime).append("'"); } - if(endTime != null){ - if(!sql.toString().contains("where")){ + if (endTime != null) { + if (!sql.toString().contains("where")) { sql.append(" where"); - }else{ + } else { sql.append(" and"); } sql.append(" time <= '").append(endTime).append("'"); @@ -266,30 +269,31 @@ public class DataQueryService implements IDataQueryService{ /** * 根据字段名称和起止时间查询数据 - * @param tableName 表名 + * + * @param tableName 表名 * @param columnName 字段名称 - * @param beginTime 起始时间 - * @param endTime 结束时间 + * @param beginTime 起始时间 + * @param endTime 结束时间 * @return 数据 */ - private List> selectDataByColumnNameandDate(String equipId, String tableName, String columnName, String beginTime, String endTime){ + private List> selectDataByColumnNameandDate(String equipId, String tableName, String columnName, String beginTime, String endTime) { StringBuilder sql = new StringBuilder("select time,").append(columnName).append(" from ") .append("\"").append(tableName).append("\"");//TODO 修改时间 - if(equipId != null){ + if (equipId != null) { sql.append(" where equip_id = '").append(equipId).append("'"); } - if(beginTime != null){ - if(!sql.toString().contains("where")){ + if (beginTime != null) { + if (!sql.toString().contains("where")) { sql.append(" where"); - }else{ + } else { sql.append(" and"); } sql.append(" time >= '").append(beginTime).append("'"); } - if(endTime != null){ - if(!sql.toString().contains("where")){ + if (endTime != null) { + if (!sql.toString().contains("where")) { sql.append(" where"); - }else{ + } else { sql.append(" and"); } sql.append(" time <= '").append(endTime).append("'"); @@ -300,27 +304,27 @@ public class DataQueryService implements IDataQueryService{ /** * 查询长时间数据,每分钟取一条展示(最长3个月) */ - private List> selectLongTimeDataByColumnNameandDate(String equipId,String tableName, String columnName, String beginTime, String endTime, String interval){ - if(columnName.split(",").length > 1){ + private List> selectLongTimeDataByColumnNameandDate(String equipId, String tableName, String columnName, String beginTime, String endTime, String interval) { + if (columnName.split(",").length > 1) { columnName = "*"; } StringBuilder sql = new StringBuilder("select time, mean(").append(columnName).append(") from ") .append("\"").append(tableName).append("\""); - if(equipId != null){ + if (equipId != null) { sql.append(" where equip_id = '").append(equipId).append("'"); } - if(beginTime != null){ - if(!sql.toString().contains("where")){ + if (beginTime != null) { + if (!sql.toString().contains("where")) { sql.append(" where"); - }else{ + } else { sql.append(" and"); } sql.append(" time >= '").append(beginTime).append("'"); } - if(endTime != null){ - if(!sql.toString().contains("where")){ + if (endTime != null) { + if (!sql.toString().contains("where")) { sql.append(" where"); - }else{ + } else { sql.append(" and"); } sql.append(" time <= '").append(endTime).append("'"); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/notice/NoticeController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/notice/NoticeController.java index 1bf4158..77e4e34 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/notice/NoticeController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/notice/NoticeController.java @@ -104,6 +104,8 @@ public class NoticeController { Assert.notNull(notice, "公告不能为空"); // 直接插入站内信表 notice.setId(null); + notice.setCreateTime(null); + notice.setUpdateTime(null); NotifyMessageDO notifyMessage = BeanUtils.toBean(notice, NotifyMessageDO.class); notifyMessage.setTemplateNickname(SecurityFrameworkUtils.getLoginUserNickname()); notifyMessage.setTemplateType(notice.getType()); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/notify/NotifyMessageMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/notify/NotifyMessageMapper.java index fbf6b13..8287b55 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/notify/NotifyMessageMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/notify/NotifyMessageMapper.java @@ -55,17 +55,17 @@ public interface NotifyMessageMapper extends BaseMapperX { default List selectUnreadListByUserIdAndUserType(Long userId, Integer userType, Integer size) { return selectList(new QueryWrapperX() // 由于要使用 limitN 语句,所以只能用 QueryWrapperX - .eq("user_id", userId) - .eq("user_type", userType) +// .eq("user_id", userId) +// .eq("user_type", userType) .eq("read_status", false) .orderByDesc("id").limitN(size)); } default Long selectUnreadCountByUserIdAndUserType(Long userId, Integer userType) { return selectCount(new LambdaQueryWrapperX() - .eq(NotifyMessageDO::getReadStatus, false) - .eq(NotifyMessageDO::getUserId, userId) - .eq(NotifyMessageDO::getUserType, userType)); + .eq(NotifyMessageDO::getReadStatus, false)); +// .eq(NotifyMessageDO::getUserId, userId) +// .eq(NotifyMessageDO::getUserType, userType)); } } From c29371e319fb8965cdcb709c87a9c885b94b835c Mon Sep 17 00:00:00 2001 From: zhangjunwen Date: Thu, 10 Oct 2024 10:13:45 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=9B=91=E6=8E=A7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=B7=BB=E5=8A=A0=E8=AE=BE=E5=A4=87=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/query/DataQueryController.java | 2 +- .../admin/query/vo/CurrentDataRespVO.java | 8 +- .../admin/query/vo/PressDataRespVO.java | 12 +- .../admin/query/vo/ProcessDataRespVO.java | 16 +- .../admin/query/vo/TempDataRespVO.java | 36 ++- .../admin/query/vo/VibrDataRespVO.java | 55 +++- .../service/equip/EquipInfoServiceImpl.java | 7 +- .../src/layout/components/Message/index.vue | 99 +++++-- .../views/system/data/monitordata/index.vue | 257 +++++++++++++++--- 9 files changed, 390 insertions(+), 102 deletions(-) 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 6865416..6a808e7 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 @@ -149,7 +149,7 @@ public class DataQueryController { 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, + ExcelUtils.write(response, "机床加速度参数报警记录.xls", "加速度数据", VibrDataRespVO.class, BeanUtils.toBean(list, VibrDataRespVO.class)); } diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/CurrentDataRespVO.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/CurrentDataRespVO.java index 6bf9d50..815524b 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/CurrentDataRespVO.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/vo/CurrentDataRespVO.java @@ -14,10 +14,10 @@ public class CurrentDataRespVO { @ExcelProperty("时间") private String time; - @ExcelProperty("x轴推屑电流") - private String x_push_temp; + @ExcelProperty("排屑1电流(A)") + private String chip_removal_1; - @ExcelProperty("y轴推屑电流") - private String y_push_temp; + @ExcelProperty("排屑2电流(A)") + private String chip_removal_2; } 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 index d4ff859..b00b21a 100644 --- 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 @@ -15,12 +15,12 @@ public class PressDataRespVO { @ExcelProperty("时间") private String time; - @ExcelProperty("x轴润滑压力") - private String x_lube_press; + @ExcelProperty("液压1(bar)") + private String hy_1; - @ExcelProperty("y轴润滑压力") - private String y_lube_press; + @ExcelProperty("液压2(bar)") + private String hy_2; - @ExcelProperty("z轴润滑压力") - private String z_lube_press; + @ExcelProperty("液压3(bar)") + private String hy_3; } 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 index 39e87ab..3932ba7 100644 --- 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 @@ -14,15 +14,15 @@ public class ProcessDataRespVO { @ExcelProperty("时间") private String time; - @ExcelProperty("加工总件数") - private String work_total; + @ExcelProperty("加工总件数(件)") + private String total_process; - @ExcelProperty("加工时长") + @ExcelProperty("加工件数(件)") + private String process_num; + + @ExcelProperty("加工时长(分钟)") private String work_time; - @ExcelProperty("通电时间") - private String on_time; - - @ExcelProperty("加工件数") - private String work_items; + @ExcelProperty("通电时间(分钟)") + private String power_time; } 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 index 5a46d0f..f81c863 100644 --- 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 @@ -14,12 +14,36 @@ public class TempDataRespVO { @ExcelProperty("时间") private String time; - @ExcelProperty("x轴轴承温度") - private String x_bear_temp; + @ExcelProperty("X+温度(℃)") + private String xp_temp; - @ExcelProperty("y轴轴承温度") - private String y_bear_temp; + @ExcelProperty("X0温度(℃)") + private String x0_temp; - @ExcelProperty("x轴轴承温度") - private String z_bear_temp; + @ExcelProperty("X-温度(℃)") + private String xn_temp; + + @ExcelProperty("Y+温度(℃)") + private String yp_temp; + + @ExcelProperty("Y0温度(℃)") + private String y0_temp; + + @ExcelProperty("Y-温度(℃)") + private String yn_temp; + + @ExcelProperty("Z+温度(℃)") + private String zp_temp; + + @ExcelProperty("Z0温度(℃)") + private String z0_temp; + + @ExcelProperty("Z-温度(℃)") + private String zn_temp; + + @ExcelProperty("排屑1温度(℃)") + private String cr1_temp; + + @ExcelProperty("排屑2温度(℃)") + private String cr2_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 index ab78a6b..ed36607 100644 --- 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 @@ -14,6 +14,57 @@ public class VibrDataRespVO { @ExcelProperty("时间") private String time; - @ExcelProperty("y轴熵值") - private String x_entropy; + @ExcelProperty("X加速度RMS") + private String x_aclr_rms; + + @ExcelProperty("Y加速度RMS") + private String y_aclr_rms; + + @ExcelProperty("Z加速度RMS") + private String z_aclr_rms; + + @ExcelProperty("X速度RMS") + private String x_speed_rms; + + @ExcelProperty("Y速度RMS") + private String y_speed_rms; + + @ExcelProperty("Z速度RMS") + private String z_speed_rms; + + @ExcelProperty("X位移RMS") + private String x_dis_rms; + + @ExcelProperty("Y位移RMS") + private String y_dis_rms; + + @ExcelProperty("Z位移RMS") + private String z_dis_rms; + + @ExcelProperty("X加速度峰值") + private String x_aclr_peak; + + @ExcelProperty("Y加速度峰值") + private String y_aclr_peak; + + @ExcelProperty("Z加速度峰值") + private String z_aclr_peak; + + @ExcelProperty("X速度峰值") + private String x_speed_peak; + + @ExcelProperty("Y速度峰值") + private String y_speed_peak; + + @ExcelProperty("Z速度峰值") + private String z_speed_peak; + + @ExcelProperty("X位移峰值") + private String x_dis_peak; + + @ExcelProperty("Y位移峰值") + private String y_dis_peak; + + @ExcelProperty("Z位移峰值") + private String z_dis_peak; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipInfoServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipInfoServiceImpl.java index 30ee677..d7c58fc 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipInfoServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipInfoServiceImpl.java @@ -2,6 +2,7 @@ package com.inspur.module.system.service.equip; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.inspur.framework.common.pojo.PageResult; import com.inspur.framework.tenant.core.aop.TenantIgnore; import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO; @@ -97,7 +98,9 @@ public class EquipInfoServiceImpl implements EquipInfoService { List list = new ArrayList<>(); if (CollUtil.isNotEmpty(customerList)){ //所有机床信息 - List equipInfoList = equipInfoMapper.selectList(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.orderBy(true,true,"create_time"); + List equipInfoList = equipInfoMapper.selectList(queryWrapper); Map> equipInfoMap = equipInfoList.stream().collect(Collectors.groupingBy(EquipInfoDO::getCustomerId)); customerList.forEach(item -> { EquipCascaderVO vo = new EquipCascaderVO(); @@ -109,7 +112,7 @@ public class EquipInfoServiceImpl implements EquipInfoService { equipInfoDOList.forEach(equip -> { EquipCascaderVO equipCascaderVO = new EquipCascaderVO(); equipCascaderVO.setId(equip.getEquipId()); - equipCascaderVO.setName(equip.getEquipNo()); + equipCascaderVO.setName(equip.getEquipName()); children.add(equipCascaderVO); }); if (CollUtil.isNotEmpty(children)){ diff --git a/imt-ui/src/layout/components/Message/index.vue b/imt-ui/src/layout/components/Message/index.vue index c27e8ee..7b30246 100644 --- a/imt-ui/src/layout/components/Message/index.vue +++ b/imt-ui/src/layout/components/Message/index.vue @@ -1,40 +1,81 @@