Merge branch 'master' into zjw

This commit is contained in:
zhangjunwen 2024-09-29 17:11:03 +08:00
commit 981bb9e51e
47 changed files with 2035 additions and 304 deletions

View File

@ -149,6 +149,12 @@
<version>6.8.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.inspur</groupId>
<artifactId>imt-module-bpm-biz</artifactId>
<version>2.2.0-jdk8-snapshot</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -104,4 +104,16 @@ public class AlarmDataController {
BeanUtils.toBean(list, AlarmDataRespVO.class));
}
@GetMapping("/getAlarmCountByEquipId/{equipId}")
@Operation(summary = "根据设备id获取报警次数")
public CommonResult<Long> getAlarmCountByEquipId(@PathVariable("equipId") String equipId){
return success(alarmDataService.getAlarmCountByEquipId(equipId));
}
@Operation(summary = "根据设备id获取故障次数")
@GetMapping("/getAlarmDataTimeLineByEquipId/{equipId}")
public CommonResult<List<AlarmDataTimeLineVO>> getAlarmDataTimeLineByEquipId(@PathVariable("equipId") String equipId) {
return success(alarmDataService.getAlarmDataTimeLineByEquipId(equipId));
}
}

View File

@ -0,0 +1,43 @@
package com.inspur.module.system.controller.admin.alarm.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import static com.inspur.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static com.inspur.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
/**
* 报警数据时间轴
*
* @Author xusd
* @Date 2024/9/27 10:31
**/
@Data
public class AlarmDataTimeLineVO {
/**
* 报警id
*/
private String alarmDataId;
/**
* 报警内容
*/
private String content;
/**
* 报警规则信息名称
*/
private String alarmName;
/**
* 报警时间
*/
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date alarmTime;
/**
* 状态
*/
private Integer status;
}

View File

@ -144,4 +144,11 @@ public class EquipInfoController {
return equipInfoService.cascader();
}
@GetMapping("/details/{id}")
@PreAuthorize("@ss.hasPermission('imt:equip-info:query')")
@Operation(summary = "设备详情")
public CommonResult<EquipInfoDetailsVO> getEquipInfoDetailsById(@PathVariable("id") String id) {
return success(equipInfoService.getEquipInfoDetailsById(id));
}
}

View File

@ -0,0 +1,56 @@
package com.inspur.module.system.controller.equip.vo;
import lombok.Data;
import java.util.List;
/**
* 设备详情
*
* @Author xusd
* @Date 2024/9/26 15:18
**/
@Data
public class EquipInfoDetailsVO {
/**
* 设备id
*/
private String equipId;
/**
* 设备编号
*/
private String equipNo;
/**
* 客户信息id
*/
private String customerId;
/**
* 客户信息
*/
private String customerName;
/**
* 机床型号id
*/
private String modelId;
/**
* 机床型号
*/
private String modelName;
/**
* 机床状态
*/
private Integer status;
/**
* 技术参数
*/
private List<EquipTechnologyParamVO> paramList;
}

View File

@ -0,0 +1,22 @@
package com.inspur.module.system.controller.equip.vo;
import lombok.Data;
/**
* 技术参数
*
* @Author xusd
* @Date 2024/9/27 14:44
**/
@Data
public class EquipTechnologyParamVO {
/**
* 参数名
*/
private String name;
/**
* 参数值
*/
private String value;
}

View File

@ -0,0 +1,54 @@
package com.inspur.module.system.controller.imtIndex;
import com.inspur.framework.common.pojo.CommonResult;
import com.inspur.module.system.controller.imtIndex.vo.ImtIndexAlarmListVO;
import com.inspur.module.system.controller.imtIndex.vo.ImtIndexMaintenanceOrderListVO;
import com.inspur.module.system.controller.imtIndex.vo.ImtIndexTaskListVO;
import com.inspur.module.system.service.imtIndex.ImtIndexService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import static com.inspur.framework.common.pojo.CommonResult.success;
/**
* 首页
*
* @Author xusd
* @Date 2024/9/23 9:50
**/
@Tag(name = "首页")
@RestController
@RequestMapping("/admin-api/imt/imtIndex")
@Validated
public class ImtIndexController {
@Resource
private ImtIndexService imtIndexService;
@GetMapping("/taskList")
@Operation(summary = "我的待办")
public CommonResult<List<ImtIndexTaskListVO>> taskList() {
return success(imtIndexService.taskList());
}
@GetMapping("/alarmList")
@Operation(summary = "报警信息")
public CommonResult<List<ImtIndexAlarmListVO>> alarmList() {
return success(imtIndexService.alarmList());
}
@GetMapping("/maintenanceOrderList")
@Operation(summary = "维修工单")
public CommonResult<List<ImtIndexMaintenanceOrderListVO>> maintenanceOrderList() {
return success(imtIndexService.maintenanceOrderList());
}
}

View File

@ -0,0 +1,27 @@
package com.inspur.module.system.controller.imtIndex.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import static com.inspur.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static com.inspur.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
/**
* @Author xusd
* @Date 2024/9/23 10:01
**/
@Data
public class ImtIndexAlarmListVO {
private String content;
private String customerName;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date firstAlarmTime;
private String equipNo;
}

View File

@ -0,0 +1,29 @@
package com.inspur.module.system.controller.imtIndex.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import static com.inspur.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static com.inspur.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
/**
* @Author xusd
* @Date 2024/9/23 10:01
**/
@Data
public class ImtIndexMaintenanceOrderListVO {
private String customerId;
private String customerName;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date createTime;
private Integer faultType;
private Integer status;
}

View File

@ -0,0 +1,29 @@
package com.inspur.module.system.controller.imtIndex.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import static com.inspur.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static com.inspur.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
/**
* @Author xusd
* @Date 2024/9/23 9:54
**/
@Data
public class ImtIndexTaskListVO {
private String processName;
private String name;
private String starter;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date createTime;
private String processInstanceId;
}

View File

@ -0,0 +1,93 @@
package com.inspur.module.system.controller.largeScreen;
import com.inspur.framework.common.pojo.CommonResult;
import com.inspur.module.system.controller.largeScreen.vo.*;
import com.inspur.module.system.service.largeScreen.LargeScreenService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import static com.inspur.framework.common.pojo.CommonResult.success;
/**
* @Author xusd
* @Date 2024/9/24 16:04
**/
@Tag(name = "大屏")
@RestController
@RequestMapping("/admin-api/imt/largeScreen")
@Validated
public class LargeScreenController {
@Resource
private LargeScreenService largeScreenService;
@GetMapping("/equipInfoList")
@Operation(summary = "设备信息")
public CommonResult<List<LargeScreenEquipInfoListVO>> equipInfoList(){
return success(largeScreenService.equipInfoList());
}
@GetMapping("/dataCount")
@Operation(summary = "规模数量")
public CommonResult<LargeScreenDataCountVO> dataCount(){
return success(largeScreenService.dataCount());
}
@GetMapping("/faultDataList")
@Operation(summary = "故障数据分析")
public CommonResult<List<LargeScreenFaultDataListVO>> faultDataList(){
return success(largeScreenService.faultDataList());
}
@GetMapping("/alarmDataList")
@Operation(summary = "报警数据分析")
public CommonResult<LargeScreenAlarmDataVO> alarmDataList(){
return success(largeScreenService.alarmDataList());
}
@GetMapping("/companyAndEquipCreate")
@Operation(summary = "企业和设备新增趋势")
public CommonResult<List<LargeScreenCompanyAndEquipCreateListVO>> companyAndEquipCreate(){
return success(largeScreenService.companyAndEquipCreate());
}
@GetMapping("/maintenanceOrder")
@Operation(summary = "在途维修工单")
public CommonResult<List<LargeScreenMaintenanceOrderListVO>> maintenanceOrder(){
return success(largeScreenService.maintenanceOrder());
}
@GetMapping("/maintenanceOrderCount")
@Operation(summary = "维修工单统计")
public CommonResult<List<LargeScreenMaintenanceOrderCountListVO>> maintenanceOrderCount(){
return success(largeScreenService.maintenanceOrderCount());
}
@GetMapping("/alarmList")
@Operation(summary = "告警信息")
public CommonResult<List<LargeScreenAlarmListVO>> alarmList(){
return success(largeScreenService.alarmList());
}
@GetMapping("/customerDistribution")
@Operation(summary = "客户分布")
public CommonResult<List<LargeScreenCustomerDistributionVO>> customerDistribution(){
return success(largeScreenService.customerDistribution());
}
@GetMapping("/customerDistributionByProvinceCode/{provinceCode}")
@Operation(summary = "客户分布详情")
public CommonResult<List<LargeScreenCustomerEquipCountVO>> customerDistributionByProvinceCode(@PathVariable("provinceCode") Integer provinceCode){
return success(largeScreenService.customerDistributionByProvinceCode(provinceCode));
}
}

View File

@ -0,0 +1,23 @@
package com.inspur.module.system.controller.largeScreen.dto;
import lombok.Data;
/**
* 各故障类型个数
*
* @Author xusd
* @Date 2024/9/25 9:54
**/
@Data
public class LargeScreenFaultCountDTO {
/**
* 故障类型
*/
private String faultValue;
/**
* 故障类型数量
*/
private Integer faultCount;
}

View File

@ -0,0 +1,22 @@
package com.inspur.module.system.controller.largeScreen.dto;
import lombok.Data;
/**
* 各月份报警次数
*
* @Author xusd
* @Date 2024/9/25 10:38
**/
@Data
public class LargeScreenMonthCountDTO {
/**
* 报警月份
*/
private String month;
/**
* 报警次数
*/
private Integer monthCount;
}

View File

@ -0,0 +1,20 @@
package com.inspur.module.system.controller.largeScreen.vo;
import lombok.Data;
import java.util.List;
/**
* 报警数据分析
*
* @Author xusd
* @Date 2024/9/25 10:05
**/
@Data
public class LargeScreenAlarmDataVO {
private List<String> x;
private List<Integer> y;
}

View File

@ -0,0 +1,29 @@
package com.inspur.module.system.controller.largeScreen.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import static com.inspur.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static com.inspur.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
/**
* 告警信息
*
* @Author xusd
* @Date 2024/9/25 15:45
**/
@Data
public class LargeScreenAlarmListVO {
private String content;
private String customerName;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date lastAlarmTime;
private String equipNo;
}

View File

@ -0,0 +1,22 @@
package com.inspur.module.system.controller.largeScreen.vo;
import lombok.Data;
import java.util.List;
/**
* 企业和设备新增趋势
*
* @Author xusd
* @Date 2024/9/25 11:02
**/
@Data
public class LargeScreenCompanyAndEquipCreateListVO {
private List<String> x;
private List<Integer> y;
private String name;
}

View File

@ -0,0 +1,27 @@
package com.inspur.module.system.controller.largeScreen.vo;
import lombok.Data;
/**
* 客户分布
*
* @Author xusd
* @Date 2024/9/26 10:14
**/
@Data
public class LargeScreenCustomerDistributionVO {
/**
* 省份code
*/
private Integer provinceCode;
/**
* 省份
*/
private String provinceName;
/**
* 客户总数
*/
private Integer data;
}

View File

@ -0,0 +1,22 @@
package com.inspur.module.system.controller.largeScreen.vo;
import lombok.Data;
/**
* 客户分布详情客户设备数
*
* @Author xusd
* @Date 2024/9/26 11:03
**/
@Data
public class LargeScreenCustomerEquipCountVO {
/**
* 客户名称
*/
private String name;
/**
* 设备数量
*/
private Integer value;
}

View File

@ -0,0 +1,27 @@
package com.inspur.module.system.controller.largeScreen.vo;
import lombok.Data;
/**
* 规模数量
*
* @Author xusd
* @Date 2024/9/25 9:28
**/
@Data
public class LargeScreenDataCountVO {
/**
* 客户规模
*/
private Long customerCount;
/**
* 设备规模
*/
private Long equipCount;
/**
* 在线设备
*/
private Long onlineEquipCount;
}

View File

@ -0,0 +1,35 @@
package com.inspur.module.system.controller.largeScreen.vo;
import lombok.Data;
/**
* 设备信息
*
* @Author xusd
* @Date 2024/9/24 16:11
**/
@Data
public class LargeScreenEquipInfoListVO {
/**
* 客户id
*/
private String customerId;
/**
* 客户名称
*/
private String customerName;
/**
* 设备数
*/
private Integer equipNum;
/**
* 运行中
*/
private Integer equipRun;
/**
* 报警数
*/
private Integer alarmNum;
}

View File

@ -0,0 +1,27 @@
package com.inspur.module.system.controller.largeScreen.vo;
import lombok.Data;
/**
* 故障数据分析
*
* @Author xusd
* @Date 2024/9/25 9:37
**/
@Data
public class LargeScreenFaultDataListVO {
/**
* 故障类型
*/
private String faultValue;
/**
* 故障类型名称
*/
private String faultLabel;
/**
* 故障类型数量
*/
private Integer faultCount;
}

View File

@ -0,0 +1,20 @@
package com.inspur.module.system.controller.largeScreen.vo;
import lombok.Data;
/**
* 维修工单统计
*
* @Author xusd
* @Date 2024/9/25 14:45
**/
@Data
public class LargeScreenMaintenanceOrderCountListVO {
private String customerId;
private String customerName;
private Integer orderCount;
}

View File

@ -0,0 +1,31 @@
package com.inspur.module.system.controller.largeScreen.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import static com.inspur.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static com.inspur.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
/**
* 在途维修工单
*
* @Author xusd
* @Date 2024/9/25 14:40
**/
@Data
public class LargeScreenMaintenanceOrderListVO {
private String customerId;
private String customerName;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date createTime;
private Integer faultType;
private Integer status;
}

View File

@ -115,4 +115,10 @@ public class MaintenanceOrderController {
return maintenanceOrderService.submitApprove(id);
}
@Operation(summary = "根据设备id获取故障次数")
@GetMapping("/getMaintenanceCountByEquipId/{equipId}")
public CommonResult<Long> getMaintenanceCountByEquipId(@PathVariable("equipId") String equipId){
return success(maintenanceOrderService.getMaintenanceCountByEquipId(equipId));
}
}

View File

@ -9,6 +9,7 @@ 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.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;
@ -78,4 +79,31 @@ public interface AlarmDataMapper extends BaseMapperX<AlarmDataDO> {
* 根据规则id查询参数报警
*/
public AlarmDataDTO selectAlarmDataByRulesId(@Param("alarmRulesId") String alarmRulesId);
@TenantIgnore
List<ImtIndexAlarmListVO> selectListTop3();
/**
* 根据设备id获取报警次数
*
* @Author xusd
* @Date 10:15 2024/9/27
* @param equipId 设备id
* @return java.lang.Long
*/
@TenantIgnore
default Long getAlarmCountByEquipId(String equipId) {
return selectCount(AlarmDataDO::getEquipId, equipId);
}
/**
* 根据设备id获取故障次数
*
* @Author xusd
* @Date 10:37 2024/9/27
* @param equipId 设备id
* @return java.util.List<com.inspur.module.system.controller.admin.alarm.vo.AlarmDataTimeLineVO>
*/
@TenantIgnore
List<AlarmDataTimeLineVO> getAlarmDataTimeLineByEquipId(@Param("equipId") String equipId);
}

View File

@ -0,0 +1,102 @@
package com.inspur.module.system.dal.mysql.largeScreen;
import com.inspur.framework.tenant.core.aop.TenantIgnore;
import com.inspur.module.system.controller.largeScreen.dto.LargeScreenMonthCountDTO;
import com.inspur.module.system.controller.largeScreen.dto.LargeScreenFaultCountDTO;
import com.inspur.module.system.controller.largeScreen.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author xusd
* @Date 2024/9/24 16:25
**/
@Mapper
public interface LargeScreenMapper {
/**
* 设备信息
*
* @Author xusd
* @Date 16:28 2024/9/24
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenEquipInfoListVO>
*/
List<LargeScreenEquipInfoListVO> equipInfoList();
/**
* 获取故障类型各类型个数
*
* @Author xusd
* @Date 9:56 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.dto.LargeScreenFaultCountDTO>
*/
List<LargeScreenFaultCountDTO> selectFaultCount();
/**
* 各月份报警次数
*
* @Author xusd
* @Date 10:43 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.dto.LargeScreenAlarmDataDTO>
*/
@TenantIgnore
List<LargeScreenMonthCountDTO> getAlarmMonthCount();
/**
* 各月份客户创建数
*
* @Author xusd
* @Date 11:12 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.dto.LargeScreenMonthCountDTO>
*/
List<LargeScreenMonthCountDTO> getCustomerCreateMonthCount();
/**
* 各月份设备创建数
*
* @Author xusd
* @Date 11:15 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.dto.LargeScreenMonthCountDTO>
*/
List<LargeScreenMonthCountDTO> getEquipCreateMonthCount();
/**
* 维修工单统计
*
* @Author xusd
* @Date 14:50 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenMaintenanceOrderCountListVO>
*/
List<LargeScreenMaintenanceOrderCountListVO> maintenanceOrderCount();
/**
* 告警信息
*
* @Author xusd
* @Date 15:57 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenAlarmListVO>
*/
@TenantIgnore
List<LargeScreenAlarmListVO> selectArmListTop4();
/**
* 客户分布
*
* @Author xusd
* @Date 10:35 2024/9/26
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenCustomerDistributionVO>
*/
List<LargeScreenCustomerDistributionVO> customerDistribution();
/**
* 根据省编号获取客户分布详情
*
* @Author xusd
* @Date 11:05 2024/9/26
* @param provinceCode 省标识
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenCustomerEquipCountVO>
*/
List<LargeScreenCustomerEquipCountVO> customerDistributionByProvinceCode(@Param("provinceCode") Integer provinceCode);
}

View File

@ -71,4 +71,24 @@ public interface AlarmDataService {
* @return 参数报警记录
*/
AlarmDataDTO getAlarmDataByRulesId(String ruleId);
/**
* 根据设备id获取报警次数
*
* @Author xusd
* @Date 10:13 2024/9/27
* @param equipId 设备id
* @return java.lang.Long
*/
Long getAlarmCountByEquipId(String equipId);
/**
* 根据设备id获取故障次数
*
* @Author xusd
* @Date 10:36 2024/9/27
* @param equipId 设备id
* @return java.util.List<com.inspur.module.system.controller.admin.alarm.vo.AlarmDataTimeLineVO>
*/
List<AlarmDataTimeLineVO> getAlarmDataTimeLineByEquipId(String equipId);
}

View File

@ -123,4 +123,14 @@ public class AlarmDataServiceImpl implements AlarmDataService {
public AlarmDataDTO getAlarmDataByRulesId(String ruleId){
return alarmDataMapper.selectAlarmDataByRulesId(ruleId);
}
@Override
public Long getAlarmCountByEquipId(String equipId) {
return alarmDataMapper.getAlarmCountByEquipId(equipId);
}
@Override
public List<AlarmDataTimeLineVO> getAlarmDataTimeLineByEquipId(String equipId) {
return alarmDataMapper.getAlarmDataTimeLineByEquipId(equipId);
}
}

View File

@ -1,10 +1,7 @@
package com.inspur.module.system.service.equip;
import com.inspur.framework.common.pojo.PageResult;
import com.inspur.module.system.controller.equip.vo.EquipCascaderVO;
import com.inspur.module.system.controller.equip.vo.EquipInfoPageReqVO;
import com.inspur.module.system.controller.equip.vo.EquipInfoSaveReqVO;
import com.inspur.module.system.controller.equip.vo.EquipSelectionVO;
import com.inspur.module.system.controller.equip.vo.*;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import javax.validation.*;
@ -72,4 +69,14 @@ public interface EquipInfoService {
* @return java.util.List<com.inspur.module.system.controller.equip.vo.EquipCascaderVO>
*/
List<EquipCascaderVO> cascader();
/**
* 设备详情
*
* @Author xusd
* @Date 15:21 2024/9/26
* @param id 设备id
* @return com.inspur.module.system.controller.equip.vo.EquipInfoDetailsVO
*/
EquipInfoDetailsVO getEquipInfoDetailsById(String id);
}

View File

@ -1,26 +1,24 @@
package com.inspur.module.system.service.equip;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.inspur.framework.common.pojo.PageResult;
import com.inspur.framework.tenant.core.aop.TenantIgnore;
import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO;
import com.inspur.module.system.controller.equip.vo.EquipCascaderVO;
import com.inspur.module.system.controller.equip.vo.EquipInfoPageReqVO;
import com.inspur.module.system.controller.equip.vo.EquipInfoSaveReqVO;
import com.inspur.module.system.controller.equip.vo.EquipSelectionVO;
import com.inspur.module.system.controller.equip.vo.*;
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.mysql.equip.EquipInfoMapper;
import com.inspur.module.system.enums.ErrorCodeConstants;
import com.inspur.module.system.service.baseData.CustomerInfoService;
import com.inspur.module.system.service.baseData.ModelInfoService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import com.inspur.framework.common.util.object.BeanUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import static com.inspur.framework.common.exception.util.ServiceExceptionUtil.exception;
@ -40,6 +38,9 @@ public class EquipInfoServiceImpl implements EquipInfoService {
@Resource
private CustomerInfoService customerInfoService;
@Resource
private ModelInfoService modelInfoService;
@Override
public String createEquipInfo(EquipInfoSaveReqVO createReqVO) {
// 插入
@ -121,4 +122,51 @@ public class EquipInfoServiceImpl implements EquipInfoService {
}
return list;
}
@Override
public EquipInfoDetailsVO getEquipInfoDetailsById(String id) {
EquipInfoDO equipInfoDO = equipInfoMapper.selectById(id);
if(Objects.nonNull(equipInfoDO)){
EquipInfoDetailsVO vo = BeanUtils.toBean(equipInfoDO, EquipInfoDetailsVO.class);
//设置客户名称
if (Objects.nonNull(vo.getCustomerId())){
CustomerInfoDO customerInfo = customerInfoService.getCustomerInfo(vo.getCustomerId());
if (Objects.nonNull(customerInfo)){
vo.setCustomerName(customerInfo.getCustomerName());
}
}
//设置设备型号
if (Objects.nonNull(vo.getModelId())){
ModelInfoDO modelInfo = modelInfoService.getModelInfo(vo.getModelId());
if (Objects.nonNull(modelInfo)){
//设置设备型号
vo.setModelName(modelInfo.getModelName());
//设置技术参数
String modelSpn = modelInfo.getModelSpn();
if (StrUtil.isNotBlank(modelSpn)){
List<String> split = Arrays.asList(modelSpn.split(";"));
if (CollUtil.isNotEmpty(split)){
List<EquipTechnologyParamVO> list = new ArrayList<>();
if (split.size() > 4) {
List<String> subList = split.subList(4, split.size());
subList.clear();
}
split.forEach(item->{
String[] strings = item.split(":");
if (strings.length == 2){
EquipTechnologyParamVO equipTechnologyParamVO = new EquipTechnologyParamVO();
equipTechnologyParamVO.setName(strings[0]);
equipTechnologyParamVO.setValue(strings[1]);
list.add(equipTechnologyParamVO);
}
});
vo.setParamList(list);
}
}
}
}
return vo;
}
throw exception(ErrorCodeConstants.EQUIP_INFO_NOT_EXISTS);
}
}

View File

@ -0,0 +1,41 @@
package com.inspur.module.system.service.imtIndex;
import com.inspur.module.system.controller.imtIndex.vo.ImtIndexAlarmListVO;
import com.inspur.module.system.controller.imtIndex.vo.ImtIndexMaintenanceOrderListVO;
import com.inspur.module.system.controller.imtIndex.vo.ImtIndexTaskListVO;
import java.util.List;
/**
* @Author xusd
* @Date 2024/9/23 9:51
**/
public interface ImtIndexService {
/**
* 我的待办
*
* @Author xusd
* @Date 9:58 2024/9/23
* @return java.util.List<com.inspur.module.system.controller.imtIndex.vo.ImtIndexTaskListVO>
*/
List<ImtIndexTaskListVO> taskList();
/**
* 报警信息
*
* @Author xusd
* @Date 9:59 2024/9/23
* @return java.util.List<com.inspur.module.system.controller.imtIndex.vo.ImtIndexAlarmListVO>
*/
List<ImtIndexAlarmListVO> alarmList();
/**
* 维修工单
*
* @Author xusd
* @Date 10:00 2024/9/23
* @return java.util.List<com.inspur.module.system.controller.imtIndex.vo.ImtIndexMaintenanceOrderListVO>
*/
List<ImtIndexMaintenanceOrderListVO> maintenanceOrderList();
}

View File

@ -0,0 +1,108 @@
package com.inspur.module.system.service.imtIndex;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.inspur.framework.common.util.number.NumberUtils;
import com.inspur.framework.common.util.object.BeanUtils;
import com.inspur.module.bpm.service.task.BpmProcessInstanceService;
import com.inspur.module.system.api.user.AdminUserApi;
import com.inspur.module.system.api.user.dto.AdminUserRespDTO;
import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO;
import com.inspur.module.system.controller.imtIndex.vo.ImtIndexAlarmListVO;
import com.inspur.module.system.controller.imtIndex.vo.ImtIndexMaintenanceOrderListVO;
import com.inspur.module.system.controller.imtIndex.vo.ImtIndexTaskListVO;
import com.inspur.module.system.dal.dataobject.alarm.AlarmDataDO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
import com.inspur.module.system.dal.mysql.alarm.AlarmDataMapper;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper;
import com.inspur.module.system.service.baseData.CustomerInfoService;
import org.aspectj.weaver.ast.Var;
import org.flowable.engine.TaskService;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskQuery;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.inspur.framework.common.util.collection.CollectionUtils.convertSet;
import static com.inspur.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
/**
* @Author xusd
* @Date 2024/9/23 9:52
**/
@Service
public class ImtIndexServiceImpl implements ImtIndexService {
@Resource
private TaskService taskService;
@Resource
private BpmProcessInstanceService processInstanceService;
@Resource
private AdminUserApi adminUserApi;
@Resource
private CustomerInfoService customerInfoService;
@Resource
private MaintenanceOrderMapper maintenanceOrderMapper;
@Resource
private AlarmDataMapper alarmDataMapper;
@Override
public List<ImtIndexTaskListVO> taskList() {
TaskQuery taskQuery = taskService.createTaskQuery()
.taskAssignee(String.valueOf(getLoginUserId())) // 分配给自己
.active()
.includeProcessVariables()
.orderByTaskCreateTime().desc();
List<Task> tasks = taskQuery.listPage(0, 5);
if (CollUtil.isEmpty(tasks)) {
return Collections.emptyList();
}
// 拼接数据
Map<String, ProcessInstance> processInstanceMap = processInstanceService.getProcessInstanceMap(
convertSet(tasks, Task::getProcessInstanceId));
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
convertSet(processInstanceMap.values(), instance -> Long.valueOf(instance.getStartUserId())));
return BeanUtils.toBean(tasks, ImtIndexTaskListVO.class, taskVO -> {
ProcessInstance processInstance = processInstanceMap.get(taskVO.getProcessInstanceId());
if (processInstance == null) {
return;
}
taskVO.setProcessName(processInstance.getName());
AdminUserRespDTO startUser = userMap.get(NumberUtils.parseLong(processInstance.getStartUserId()));
taskVO.setStarter(startUser.getNickname());
});
}
@Override
public List<ImtIndexAlarmListVO> alarmList() {
return alarmDataMapper.selectListTop3();
}
@Override
public List<ImtIndexMaintenanceOrderListVO> maintenanceOrderList() {
LambdaQueryWrapper<MaintenanceOrderDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.orderByDesc(MaintenanceOrderDO::getCreateTime);
queryWrapper.last("limit 3");
List<MaintenanceOrderDO> maintenanceOrderDOS = maintenanceOrderMapper.selectList(queryWrapper);
if (CollUtil.isEmpty(maintenanceOrderDOS)) {
return Collections.emptyList();
}
List<CustomerInfoSelectionVO> customerList = customerInfoService.selection(true);
Map<String, String> customerMap = customerList.stream().collect(Collectors.toMap(CustomerInfoSelectionVO::getCustomerId, CustomerInfoSelectionVO::getCustomerName));
return BeanUtils.toBean(maintenanceOrderDOS, ImtIndexMaintenanceOrderListVO.class, vo -> {
vo.setCustomerName(customerMap.get(vo.getCustomerId()));
});
}
}

View File

@ -0,0 +1,103 @@
package com.inspur.module.system.service.largeScreen;
import com.inspur.module.system.controller.largeScreen.vo.*;
import java.util.List;
/**
* @Author xusd
* @Date 2024/9/24 16:13
**/
public interface LargeScreenService {
/**
* 设备信息
*
* @Author xusd
* @Date 16:18 2024/9/24
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenEquipInfoListVO>
*/
List<LargeScreenEquipInfoListVO> equipInfoList();
/**
* 规模数量
*
* @Author xusd
* @Date 9:32 2024/9/25
* @return com.inspur.module.system.controller.largeScreen.vo.LargeScreenDataCountVO
*/
LargeScreenDataCountVO dataCount();
/**
* 故障数据分析
*
* @Author xusd
* @Date 9:40 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenFaultDataListVO>
*/
List<LargeScreenFaultDataListVO> faultDataList();
/**
* 报警数据分析
*
* @Author xusd
* @Date 10:06 2024/9/25
* @return com.inspur.module.system.controller.largeScreen.vo.LargeScreenAlarmDataListVO
*/
LargeScreenAlarmDataVO alarmDataList();
/**
* 企业和设备新增趋势
*
* @Author xusd
* @Date 11:05 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenCompanyAndEquipCreateListVO>
*/
List<LargeScreenCompanyAndEquipCreateListVO> companyAndEquipCreate();
/**
* 在途维修工单
*
* @Author xusd
* @Date 14:42 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenMaintenanceOrderListVO>
*/
List<LargeScreenMaintenanceOrderListVO> maintenanceOrder();
/**
* 维修工单统计
*
* @Author xusd
* @Date 14:49 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenMaintenanceOrderCountListVO>
*/
List<LargeScreenMaintenanceOrderCountListVO> maintenanceOrderCount();
/**
* 告警信息
*
* @Author xusd
* @Date 15:45 2024/9/25
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenAlarmListVO>
*/
List<LargeScreenAlarmListVO> alarmList();
/**
* 客户分布
*
* @Author xusd
* @Date 10:18 2024/9/26
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenCustomerDistributionVO>
*/
List<LargeScreenCustomerDistributionVO> customerDistribution();
/**
* 根据省编号获取客户分布详情
*
* @Author xusd
* @Date 11:02 2024/9/26
* @param provinceCode 省编号
* @return java.util.List<com.inspur.module.system.controller.largeScreen.vo.LargeScreenCustomerEquipCountVO>
*/
List<LargeScreenCustomerEquipCountVO> customerDistributionByProvinceCode(Integer provinceCode);
}

View File

@ -0,0 +1,200 @@
package com.inspur.module.system.service.largeScreen;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.inspur.framework.common.util.object.BeanUtils;
import com.inspur.framework.ip.core.Area;
import com.inspur.framework.ip.core.utils.AreaUtils;
import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO;
import com.inspur.module.system.controller.imtIndex.vo.ImtIndexMaintenanceOrderListVO;
import com.inspur.module.system.controller.largeScreen.dto.LargeScreenMonthCountDTO;
import com.inspur.module.system.controller.largeScreen.dto.LargeScreenFaultCountDTO;
import com.inspur.module.system.controller.largeScreen.vo.*;
import com.inspur.module.system.dal.dataobject.dict.DictDataDO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
import com.inspur.module.system.dal.mysql.baseData.CustomerInfoMapper;
import com.inspur.module.system.dal.mysql.equip.EquipInfoMapper;
import com.inspur.module.system.dal.mysql.largeScreen.LargeScreenMapper;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper;
import com.inspur.module.system.service.baseData.CustomerInfoService;
import com.inspur.module.system.service.dict.DictDataService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author xusd
* @Date 2024/9/24 16:14
**/
@Service
public class LargeScreenServiceImpl implements LargeScreenService {
@Resource
private LargeScreenMapper largeScreenMapper;
@Resource
private CustomerInfoMapper customerInfoMapper;
@Resource
private EquipInfoMapper equipInfoMapper;
@Resource
private DictDataService dictDataService;
@Resource
private MaintenanceOrderMapper maintenanceOrderMapper;
@Resource
private CustomerInfoService customerInfoService;
@Override
public List<LargeScreenEquipInfoListVO> equipInfoList() {
List<LargeScreenEquipInfoListVO> list = largeScreenMapper.equipInfoList();
if (CollUtil.isEmpty(list)) {
return Collections.emptyList();
}
return list;
}
@Override
public LargeScreenDataCountVO dataCount() {
LargeScreenDataCountVO vo = new LargeScreenDataCountVO();
vo.setCustomerCount(customerInfoMapper.selectCount());
vo.setEquipCount(equipInfoMapper.selectCount());
vo.setOnlineEquipCount(0L);
return vo;
}
@Override
public List<LargeScreenFaultDataListVO> faultDataList() {
List<DictDataDO> faultTypeList = dictDataService.getDictDataListByDictType("fault_type");
if (CollUtil.isEmpty(faultTypeList)) {
return Collections.emptyList();
}
//只保留4条
if (faultTypeList.size() > 4) {
List<DictDataDO> subList = faultTypeList.subList(4, faultTypeList.size());
subList.clear();
}
List<LargeScreenFaultCountDTO> dtoList = largeScreenMapper.selectFaultCount();
Map<String, Integer> dtoMap = dtoList.stream().collect(Collectors.toMap(LargeScreenFaultCountDTO::getFaultValue, LargeScreenFaultCountDTO::getFaultCount));
List<LargeScreenFaultDataListVO> list = new ArrayList<>();
faultTypeList.forEach(item -> {
LargeScreenFaultDataListVO vo = new LargeScreenFaultDataListVO();
vo.setFaultValue(item.getValue());
vo.setFaultLabel(item.getLabel());
vo.setFaultCount(Objects.nonNull(dtoMap.get(item.getValue())) ? dtoMap.get(item.getValue()) : 0);
list.add(vo);
});
return list;
}
@Override
public LargeScreenAlarmDataVO alarmDataList() {
LargeScreenAlarmDataVO vo = new LargeScreenAlarmDataVO();
List<String> x = getFirstSixMonths();
vo.setX(x);
List<LargeScreenMonthCountDTO> list = largeScreenMapper.getAlarmMonthCount();
if (CollUtil.isNotEmpty(list)) {
List<Integer> y = new ArrayList<>();
Map<String, Integer> map = list.stream().collect(Collectors.toMap(LargeScreenMonthCountDTO::getMonth, LargeScreenMonthCountDTO::getMonthCount));
x.forEach(item -> y.add(Objects.nonNull(map.get(item)) ? map.get(item) : 0));
vo.setY(y);
}
return vo;
}
@Override
public List<LargeScreenCompanyAndEquipCreateListVO> companyAndEquipCreate() {
List<LargeScreenCompanyAndEquipCreateListVO> list = new ArrayList<>();
List<String> x = getFirstSixMonths();
//客户
LargeScreenCompanyAndEquipCreateListVO customer = new LargeScreenCompanyAndEquipCreateListVO();
customer.setX(x);
customer.setName("企业");
List<LargeScreenMonthCountDTO> customerList = largeScreenMapper.getCustomerCreateMonthCount();
if (CollUtil.isNotEmpty(customerList)){
List<Integer> y = new ArrayList<>();
Map<String, Integer> customerMap = customerList.stream().collect(Collectors.toMap(LargeScreenMonthCountDTO::getMonth, LargeScreenMonthCountDTO::getMonthCount));
x.forEach(item -> y.add(Objects.nonNull(customerMap.get(item)) ? customerMap.get(item) : 0));
customer.setY(y);
}
list.add(customer);
//设备
LargeScreenCompanyAndEquipCreateListVO equip = new LargeScreenCompanyAndEquipCreateListVO();
equip.setX(x);
equip.setName("设备");
List<LargeScreenMonthCountDTO> equipList = largeScreenMapper.getEquipCreateMonthCount();
if (CollUtil.isNotEmpty(equipList)){
List<Integer> y = new ArrayList<>();
Map<String, Integer> equipMap = equipList.stream().collect(Collectors.toMap(LargeScreenMonthCountDTO::getMonth, LargeScreenMonthCountDTO::getMonthCount));
x.forEach(item -> y.add(Objects.nonNull(equipMap.get(item)) ? equipMap.get(item) : 0));
equip.setY(y);
}
list.add(equip);
return list;
}
@Override
public List<LargeScreenMaintenanceOrderListVO> maintenanceOrder() {
LambdaQueryWrapper<MaintenanceOrderDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.orderByDesc(MaintenanceOrderDO::getCreateTime);
queryWrapper.last("limit 4");
List<MaintenanceOrderDO> maintenanceOrderDOS = maintenanceOrderMapper.selectList(queryWrapper);
if (CollUtil.isEmpty(maintenanceOrderDOS)) {
return Collections.emptyList();
}
List<CustomerInfoSelectionVO> customerList = customerInfoService.selection(true);
Map<String, String> customerMap = customerList.stream().collect(Collectors.toMap(CustomerInfoSelectionVO::getCustomerId, CustomerInfoSelectionVO::getCustomerName));
return BeanUtils.toBean(maintenanceOrderDOS, LargeScreenMaintenanceOrderListVO.class, vo -> vo.setCustomerName(customerMap.get(vo.getCustomerId())));
}
@Override
public List<LargeScreenMaintenanceOrderCountListVO> maintenanceOrderCount() {
return largeScreenMapper.maintenanceOrderCount();
}
@Override
public List<LargeScreenAlarmListVO> alarmList() {
return largeScreenMapper.selectArmListTop4();
}
@Override
public List<LargeScreenCustomerDistributionVO> customerDistribution() {
List<LargeScreenCustomerDistributionVO> list = largeScreenMapper.customerDistribution();
if (CollUtil.isNotEmpty(list)) {
list.forEach(item -> {
Area area = AreaUtils.getArea(item.getProvinceCode());
if (Objects.nonNull(area)) {
item.setProvinceName(area.getName());
}
});
}
return list;
}
@Override
public List<LargeScreenCustomerEquipCountVO> customerDistributionByProvinceCode(Integer provinceCode) {
return largeScreenMapper.customerDistributionByProvinceCode(provinceCode);
}
/**
* 获取前六个月的月份
*
* @return java.util.List<java.lang.String>
* @Author xusd
* @Date 10:30 2024/9/25
*/
private List<String> getFirstSixMonths() {
List<String> list = new ArrayList<>();
DateTime firstSixMonth = DateUtil.offsetMonth(new Date(), -5);
List<DateTime> dateTimes = DateUtil.rangeToList(firstSixMonth, new Date(), DateField.MONTH);
dateTimes.forEach(item -> list.add(DateUtil.format(item, "yyyy-MM")));
return list;
}
}

View File

@ -102,4 +102,14 @@ public interface MaintenanceOrderService {
* @return java.lang.Boolean
*/
Boolean submitApprove(String id);
/**
* 根据设备id获取故障次数
*
* @Author xusd
* @Date 10:08 2024/9/27
* @param equipId 设备id
* @return java.lang.Long
*/
Long getMaintenanceCountByEquipId(String equipId);
}

View File

@ -255,4 +255,9 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
.setStatus(1)
.setApproveStatus(1)) > 0;
}
@Override
public Long getMaintenanceCountByEquipId(String equipId) {
return maintenanceOrderMapper.selectCount(MaintenanceOrderDO::getEquipId,equipId);
}
}

View File

@ -24,6 +24,13 @@
<result property="componentName" column="component_name" />
</resultMap>
<resultMap id="selectListTop3" type="com.inspur.module.system.controller.imtIndex.vo.ImtIndexAlarmListVO">
<result property="content" column="content" />
<result property="firstAlarmTime" column="first_alarm_time" />
<result property="customerName" column="customer_name" />
<result property="equipNo" column="equip_no" />
</resultMap>
<sql id="selectAlarmDataVo">
select ad.alarm_data_id, ad.alarm_rules_id, ad.equip_id, ad.component_id, ad.name_key, ad.content, ad.alarm_value, ad.first_alarm_time, ad.last_alarm_time, ad.result, ad.status, ad.operator_id, ad.alarm_level, ad.reason_description, ad.equip_alarm_id,ad.alarm_type, ei.equip_no, ci.component_name, cui.customer_name,mi.model_name from imt_alarm_data ad
left join imt_equip_info ei on ad.equip_id = ei.equip_id
@ -57,4 +64,28 @@
and ad.status = 0
and ad.deleted = '0'
</select>
<select id="selectListTop3" resultMap="selectListTop3">
<include refid="selectAlarmDataVo"/>
where ad.status = 0
and ad.deleted = '0'
ORDER BY ad.first_alarm_time desc
limit 3
</select>
<select id="getAlarmDataTimeLineByEquipId"
resultType="com.inspur.module.system.controller.admin.alarm.vo.AlarmDataTimeLineVO">
SELECT
iad.alarm_data_id AS alarmDataId,
iad.content AS content,
iad.first_alarm_time AS alarmTime,
iad.status AS status,
CONCAT( iar.alarm_name, '异常故障' ) AS alarmName
FROM
imt_alarm_data AS iad
LEFT JOIN imt_alarm_rules AS iar ON iar.alarm_id = iad.alarm_rules_id
WHERE
iad.equip_id = #{equipId}
ORDER BY alarmTime
limit 5
</select>
</mapper>

View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.inspur.module.system.dal.mysql.largeScreen.LargeScreenMapper">
<select id="equipInfoList"
resultType="com.inspur.module.system.controller.largeScreen.vo.LargeScreenEquipInfoListVO">
SELECT
ici.customer_id as customerId,
ici.customer_name as customerName,
COUNT( iei.equip_id ) as equipNum,
0 as equipRun,
0 as alarmNum
FROM
imt_customer_info AS ici
LEFT JOIN imt_equip_info AS iei ON ici.customer_id = iei.customer_id
AND iei.deleted = '0'
WHERE
ici.deleted = '0'
GROUP BY
ici.customer_id
ORDER BY
COUNT( iei.equip_id ) DESC
LIMIT 4
</select>
<select id="selectFaultCount"
resultType="com.inspur.module.system.controller.largeScreen.dto.LargeScreenFaultCountDTO">
SELECT
fault_type as faultValue,
count( maintenance_order_id ) as faultCount
FROM
imt_maintenance_order
GROUP BY
fault_type
</select>
<select id="getAlarmMonthCount"
resultType="com.inspur.module.system.controller.largeScreen.dto.LargeScreenMonthCountDTO">
SELECT
DATE_FORMAT( first_alarm_time, '%Y-%m' ) AS month,
COUNT( alarm_data_id ) AS monthCount
FROM
imt_alarm_data
WHERE
first_alarm_time >= DATE_SUB( CURDATE(), INTERVAL 6 MONTH )
GROUP BY
month
ORDER BY
month
</select>
<select id="getCustomerCreateMonthCount"
resultType="com.inspur.module.system.controller.largeScreen.dto.LargeScreenMonthCountDTO">
SELECT
DATE_FORMAT( create_time, '%Y-%m' ) AS month,
COUNT( customer_id ) AS monthCount
FROM
imt_customer_info
WHERE
create_time >= DATE_SUB( CURDATE(), INTERVAL 6 MONTH )
GROUP BY
month
ORDER BY
month
</select>
<select id="getEquipCreateMonthCount"
resultType="com.inspur.module.system.controller.largeScreen.dto.LargeScreenMonthCountDTO">
SELECT
DATE_FORMAT( create_time, '%Y-%m' ) AS month,
COUNT( equip_id ) AS monthCount
FROM
imt_equip_info
WHERE
create_time >= DATE_SUB( CURDATE(), INTERVAL 6 MONTH )
GROUP BY
month
ORDER BY
month
</select>
<select id="maintenanceOrderCount"
resultType="com.inspur.module.system.controller.largeScreen.vo.LargeScreenMaintenanceOrderCountListVO">
SELECT
imo.customer_id AS customerId,
ici.customer_name AS customerName,
count( imo.maintenance_order_id ) AS orderCount
FROM
imt_maintenance_order AS imo
LEFT JOIN imt_customer_info AS ici ON imo.customer_id = ici.customer_id
WHERE
imo.customer_id IS NOT NULL
GROUP BY
imo.customer_id
ORDER BY
orderCount DESC
LIMIT 4
</select>
<resultMap id="selectListTop4" type="com.inspur.module.system.controller.largeScreen.vo.LargeScreenAlarmListVO">
<result property="content" column="content"/>
<result property="lastAlarmTime" column="last_alarm_time"/>
<result property="customerName" column="customer_name"/>
<result property="equipNo" column="equip_no"/>
</resultMap>
<sql id="selectAlarmDataVo">
select ad.alarm_data_id, ad.alarm_rules_id, ad.equip_id, ad.component_id, ad.name_key, ad.content,
ad.alarm_value, ad.first_alarm_time, ad.last_alarm_time, ad.result, ad.status, ad.operator_id, ad.alarm_level,
ad.reason_description, ad.equip_alarm_id,ad.alarm_type, ei.equip_no, ci.component_name,
cui.customer_name,mi.model_name from imt_alarm_data ad
left join imt_equip_info ei on ad.equip_id = ei.equip_id
left join imt_customer_info cui on ei.customer_id = cui.customer_id
left join imt_component_info ci on ad.component_id = ci.component_id
left join imt_model_info mi on ei.model_id = mi.model_id
</sql>
<select id="selectArmListTop4" resultMap="selectListTop4">
<include refid="selectAlarmDataVo"/>
where ad.status = 0
and ad.deleted = '0'
ORDER BY ad.last_alarm_time desc
limit 4
</select>
<select id="customerDistribution"
resultType="com.inspur.module.system.controller.largeScreen.vo.LargeScreenCustomerDistributionVO">
SELECT
ici.province_code as provinceCode,
COUNT( iei.equip_id ) as data
FROM
imt_customer_info AS ici
LEFT JOIN imt_equip_info AS iei ON ici.customer_id = iei.customer_id
WHERE
ici.province_code IS NOT NULL
GROUP BY
ici.province_code HAVING data > 0
</select>
<select id="customerDistributionByProvinceCode"
resultType="com.inspur.module.system.controller.largeScreen.vo.LargeScreenCustomerEquipCountVO">
SELECT
ici.customer_name AS name,
COUNT( iei.equip_id ) AS value
FROM
imt_customer_info AS ici
LEFT JOIN imt_equip_info AS iei ON ici.customer_id = iei.customer_id
WHERE
ici.province_code = #{provinceCode}
GROUP BY
ici.customer_id
</select>
</mapper>

View File

@ -0,0 +1,25 @@
import request from '@/utils/request'
// 我的待办
export function getTaskList() {
return request({
url: '/imt/imtIndex/taskList',
method: 'get'
})
}
// 维修工单
export function getMaintenanceOrderList() {
return request({
url: '/imt/imtIndex/maintenanceOrderList',
method: 'get'
})
}
// 维修工单
export function getAlarmList() {
return request({
url: '/imt/imtIndex/alarmList',
method: 'get'
})
}

View File

@ -59,3 +59,19 @@ export function exportAlarmDataExcel(params) {
responseType: "blob",
});
}
// 根据设备id获取报警次数
export function getAlarmCountByEquipId(equipId) {
return request({
url: "/imt/alarm-data/getAlarmCountByEquipId/" + equipId,
method: "get",
});
}
// 根据设备id获取故障次数
export function getAlarmDataTimeLineByEquipId(equipId) {
return request({
url: "/imt/alarm-data/getAlarmDataTimeLineByEquipId/" + equipId,
method: "get",
});
}

View File

@ -67,3 +67,11 @@ export function getEquipCascader() {
method: 'get'
})
}
// 获得机床详情
export function getEquipInfoDetails(id) {
return request({
url: '/equip/equipInfo/details/' + id,
method: 'get'
})
}

View File

@ -0,0 +1,81 @@
import request from "@/utils/request";
// 设备信息
export function getEquipInfoList() {
return request({
url: "/imt/largeScreen/equipInfoList",
method: "get",
});
}
// 规模数量
export function getDataCount() {
return request({
url: "/imt/largeScreen/dataCount",
method: "get",
});
}
// 故障数据分析
export function getFaultDataList() {
return request({
url: "/imt/largeScreen/faultDataList",
method: "get",
});
}
// 报警数据分析
export function getAlarmDataList() {
return request({
url: "/imt/largeScreen/alarmDataList",
method: "get",
});
}
// 企业和设备新增趋势
export function getCompanyAndEquipCreate() {
return request({
url: "/imt/largeScreen/companyAndEquipCreate",
method: "get",
});
}
// 在途维修工单
export function getMaintenanceOrder() {
return request({
url: "/imt/largeScreen/maintenanceOrder",
method: "get",
});
}
// 维修工单统计
export function getMaintenanceOrderCount() {
return request({
url: "/imt/largeScreen/maintenanceOrderCount",
method: "get",
});
}
// 告警信息
export function getAlarmList() {
return request({
url: "/imt/largeScreen/alarmList",
method: "get",
});
}
// 客户分布
export function getCustomerDistribution() {
return request({
url: "/imt/largeScreen/customerDistribution",
method: "get",
});
}
// 客户分布详情
export function getCustomerDistributionByProvinceCode(provinceCode) {
return request({
url: "/imt/largeScreen/customerDistributionByProvinceCode/" + provinceCode,
method: "get",
});
}

View File

@ -76,3 +76,11 @@ export function submitMaintenanceApprove(id) {
method: 'get'
})
}
// 根据设备id获取故障次数
export function getMaintenanceCountByEquipId(equipId) {
return request({
url: '/maintenance/getMaintenanceCountByEquipId/' + equipId,
method: 'get'
})
}

View File

@ -102,7 +102,7 @@
</div>
<el-table :data="taskList" :border="false" class="taskTable">
<el-table-column label="流程名称" align="center" prop="processName" :show-overflow-tooltip="true" />
<el-table-column label="任务名称" align="center" prop="taskName" :show-overflow-tooltip="true" />
<el-table-column label="任务名称" align="center" prop="name" :show-overflow-tooltip="true" />
<el-table-column label="发起人" align="center" prop="starter" :show-overflow-tooltip="true" />
<el-table-column label="任务时间" align="center" prop="createTime" width="180" :show-overflow-tooltip="true" />
</el-table>
@ -119,9 +119,9 @@
</div>
<el-table :data="alarmList" :border="false" class="taskTable">
<el-table-column label="客户名称" align="center" prop="customerName" :show-overflow-tooltip="true" />
<el-table-column label="设备名称" align="center" prop="deviceName" :show-overflow-tooltip="true" />
<el-table-column label="报警信息" align="center" prop="alarmInfo" :show-overflow-tooltip="true" />
<el-table-column label="报警时间" align="center" prop="alarmTime" width="180" :show-overflow-tooltip="true" />
<el-table-column label="设备编号" align="center" prop="equipNo" :show-overflow-tooltip="true" />
<el-table-column label="报警信息" align="center" prop="content" :show-overflow-tooltip="true" />
<el-table-column label="报警时间" align="center" prop="firstAlarmTime" width="180" :show-overflow-tooltip="true" />
</el-table>
</el-card>
</el-col>
@ -134,9 +134,17 @@
</div>
<el-table :data="orderList" :border="false" class="taskTable">
<el-table-column label="客户名称" align="center" prop="customerName" :show-overflow-tooltip="true" />
<el-table-column label="故障时间" align="center" prop="failureTime" :show-overflow-tooltip="true" />
<el-table-column label="故障类型" align="center" prop="failureType" :show-overflow-tooltip="true" />
<el-table-column label="进度" align="center" prop="progress" width="180" :show-overflow-tooltip="true" />
<el-table-column label="故障时间" align="center" prop="createTime" :show-overflow-tooltip="true" />
<el-table-column label="故障类型" align="center" prop="faultType" :show-overflow-tooltip="true" >
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.FAULT_TYPE" :value="scope.row.faultType"/>
</template>
</el-table-column>
<el-table-column label="进度" align="center" prop="status" width="180" :show-overflow-tooltip="true" >
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.MAINTENANCE_STATUS" :value="scope.row.status"/>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
@ -147,6 +155,8 @@
<script>
import LineChart from './home/LineChart'
import CountTo from 'vue-count-to'
import {getTaskList,getMaintenanceOrderList,getAlarmList} from '@/api/imtIndex'
import {DICT_TYPE} from "@/utils/dict";
const lineChartData = {
yData: [28, 27, 25, 26, 28, 22, 25, 25, 23, 27],
@ -155,6 +165,11 @@ const lineChartData = {
export default {
name: 'Index',
computed: {
DICT_TYPE() {
return DICT_TYPE
}
},
components: {
LineChart,
CountTo
@ -162,15 +177,9 @@ export default {
data() {
return {
lineChartData: lineChartData,
taskList: [{processName:'设备维修',taskName:'维修派单',starter:'张帆',createTime:'2024-09-13 10:56:27'},
{processName:'设备维修',taskName:'维修审批',starter:'吴恒',createTime:'2024-09-12 18:13:10'},
{processName:'设备维修',taskName:'维修评价',starter:'李科',createTime:'2024-09-12 16:29:12'}],
alarmList: [{customerName:'机加工一厂',deviceName:'钻工机床',alarmInfo:'X轴轴承电流过载',alarmTime:'2024-09-13 11:07:58'},
{customerName:'机加工二厂',deviceName:'硬轨机床',alarmInfo:'X轴排屑温度过高',alarmTime:'2024-09-13 10:27:28'},
{customerName:'机加工三厂',deviceName:'线轨机床',alarmInfo:'z轴轴承温度过高',alarmTime:'2024-09-12 15:09:18'}],
orderList: [{customerName:'机加工一厂',failureType:'轴承磨损',progress:'派工',failureTime:'2024-09-13 11:07:58'},
{customerName:'机加工二厂',failureType:'排屑堵塞',progress:'维修中',failureTime:'2024-09-13 10:27:28'},
{customerName:'机加工三厂',failureType:'机床底座不稳',progress:'待确认',failureTime:'2024-09-12 15:09:18'}],
taskList:[],
alarmList: [],
orderList: [],
groupData: {
customer: 5,
device: 28,
@ -188,11 +197,24 @@ export default {
titleImage:require('../assets/png/title.png'),
}
},
created() {
this.initData();
},
methods: {
/*handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
}*/
initData(){
getTaskList().then(res=>{
this.taskList = res.data;
})
getMaintenanceOrderList().then(res=>{
this.orderList = res.data;
})
getAlarmList().then(res=>{
this.alarmList = res.data;
})
},
goMytodo(){
this.$router.push({ path: "/bpm/task/todo" });
},

View File

@ -48,19 +48,25 @@
<div class="item-title">
<span class="title-font">故障数据分析</span>
</div>
<div class="item-content fault-data">
<div class="fault-icon"></div>
<div class="fault-content">
<div
v-for="(item, index) in faultList"
:key="index"
class="fault-item"
>
<div :class="changeMark(index)">
<span style="font-size:14px;font-weight:600;margin-left:11px">{{ item.name }}</span>
</div>
<div class="fault-num">
<span style="font-family:'BIAOTI';font-size:24px"> {{ item.num }}</span>
<div class="item-content">
<!-- <div-->
<!-- ref="faultChart"-->
<!-- style="height:100%;margin-left: -100px"-->
<!-- ></div>-->
<div class="item-content fault-data">
<div class="fault-icon"></div>
<div class="fault-content">
<div
v-for="(item, index) in faultList"
:key="index"
class="fault-item"
>
<div :class="changeMark(index)">
<span style="font-size:14px;font-weight:600;margin-left:11px">{{ item.faultLabel }}</span>
</div>
<div class="fault-num">
<span style="font-family:'BIAOTI';font-size:24px"> {{ item.faultCount }}</span>
</div>
</div>
</div>
</div>
@ -72,16 +78,16 @@
<div class="middle-header">
<div class="customer-overall">
<div class="head-info">客户规模</div>
<div class="head-value">28</div>
<div class="head-value">{{dataCount.customerCount}}</div>
</div>
<div class="equip-num-overall">
<div class="head-info">设备规模</div>
<div class="head-value">1200</div>
<div class="head-value">{{dataCount.equipCount}}</div>
</div>
<div class="equip-online-overall">
<div class="head-info">在线设备</div>
<div class="head-value">930</div>
<div class="head-value">{{dataCount.onlineEquipCount}}</div>
</div>
</div>
<div
@ -119,23 +125,23 @@
<div class="item-content alarm-lists">
<el-table
v-loading="loading2"
:data="maintenanceList"
:data="alarmList"
>
<el-table-column
prop="customerName"
label="客户名称"
/>
<el-table-column
prop="maintenanceTime"
label="维修时间"
prop="equipNo"
label="设备编号"
/>
<el-table-column
prop="type"
label="故障类型"
prop="content"
label="报警信息"
/>
<el-table-column
prop="progress"
label="进度"
prop="lastAlarmTime"
label="最后报警时间"
/>
</el-table>
</div>
@ -168,17 +174,26 @@
label="客户名称"
/>
<el-table-column
prop="maintenanceTime"
label="维修时间"
prop="createTime"
label="工单创建时间"
width="140px"
/>
<el-table-column
prop="type"
prop="faultType"
label="故障类型"
/>
>
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.FAULT_TYPE" :value="scope.row.faultType"/>
</template>
</el-table-column>
<el-table-column
prop="progress"
prop="status"
label="进度"
/>
>
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.MAINTENANCE_STATUS" :value="scope.row.status"/>
</template>
</el-table-column>
</el-table>
</div>
</div>
@ -198,7 +213,7 @@
{{ item.customerName }}
</div>
<el-progress
:percentage="Number(item.orderNum)"
:percentage="Number(item.orderCount)"
:format="progressFormat"
define-back-color="#1A3050"
></el-progress>
@ -213,152 +228,154 @@
import * as echarts from "echarts";
import _ from "lodash";
import chinaMap from "../../../assets/map/china.json";
import {
getEquipInfoList,
getDataCount,
getFaultDataList,
getAlarmDataList,
getCompanyAndEquipCreate,
getMaintenanceOrder,
getMaintenanceOrderCount,
getAlarmList,
getCustomerDistribution,
getCustomerDistributionByProvinceCode
} from '@/api/system/largeScreen/largeScreen';
import {DICT_TYPE} from "@/utils/dict";
export default {
computed: {
DICT_TYPE() {
return DICT_TYPE
}
},
data() {
return {
alarmList:[],
companyAndEquipCreate:[],
alarmData:{},
dataCount: {
customerCount: 0,
equipCount: 0,
onlineEquipCount: 0
},
loading1: false,
equipList: [
{
customerName: "客户1",
equipNum: 2,
equipRun: 2,
alarmNum: 2,
},
{
customerName: "客户2",
equipNum: 5,
equipRun: 3,
alarmNum: 3,
},
{
customerName: "客户3",
equipNum: 10,
equipRun: 2,
alarmNum: 2,
},
{
customerName: "客户4",
equipNum: 6,
equipRun: 3,
alarmNum: 2,
},
// {
// customerName: "5",
// equipNum: 7,
// equipRun: 2,
// alarmNum: 2,
// },
],
faultList: [
{
name: "故障1",
num: 55,
},
{
name: "故障2",
num: 80,
},
{
name: "故障3",
num: 32,
},
{
name: "故障4",
num: 17,
},
],
equipList: [],
faultList: [],
loading2: false,
maintenanceList: [
{
customerName: "客户1",
maintenanceTime: "2024-01-18",
type: "传感器损坏",
progress: "报工",
},
{
customerName: "客户2",
maintenanceTime: "2024-03-15",
type: "轴承磨损",
progress: "维修中",
},
{
customerName: "客户3",
maintenanceTime: "2024-01-05",
type: "轴承不对称",
progress: "维修中",
},
{
customerName: "客户4",
maintenanceTime: "2024-01-05",
type: "轴承底座不稳",
progress: "待确认",
},
],
orderList: [
{
customerName: "客户1",
orderNum: 150,
},
{
customerName: "客户2",
orderNum: 78,
},
{
customerName: "客户3",
orderNum: 180,
},
{
customerName: "客户4",
orderNum: 220,
},
],
maintenanceList: [],
orderList: [],
myChart: null,
provinceName: [],
selectedProvince: "",
series: [],
customerEquNumList: [
{
name: "客户1",
value: 12,
},
{
name: "客户2",
value: 34,
},
{
name: "客户3",
value: 27,
},
],
customerEquNumList: [],
showPanel: false,
firstMark: false,
};
},
created() {
this.getAlarmCharts();
// this.getFaultChart();
this.getCompanyAndEquipGrowTrend();
this.mapRender();
this.initData();
},
methods: {
initData(){
getEquipInfoList().then(res=>{
this.equipList = res.data;
})
getDataCount().then(res=>{
this.dataCount = res.data;
})
getMaintenanceOrder().then(res => {
this.maintenanceList = res.data;
})
getMaintenanceOrderCount().then(res=>{
this.orderList = res.data
})
getAlarmList().then(res=>{
this.alarmList = res.data
})
getFaultDataList().then(res=>{
this.faultList = res.data;
})
},
closePanel() {
this.showPanel = false;
},
progressFormat(count) {
return `${count}`;
return `${count}`;
},
changeMark(index) {
return "fault-mark" + (index + 1);
},
async getFaultChart(){
await getFaultDataList().then(res=>{
this.faultList = res.data;
})
this.initFaultChart(this.faultList);
},
initFaultChart(data){
let p = new Promise((resolve) => {
resolve();
});
let chartData = []
data.forEach(item=>{
const fault = {
name: item.faultLabel,
value: item.faultCount
};
chartData.push(fault)
})
p.then(() => {
this.faultChart = echarts.init(this.$refs.faultChart);
let option = {
tooltip: {
trigger: 'item'
},
legend: {
orient: 'vertical',
right: 10,
top: 'center',
textStyle: {
color:'#fff'
}
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: false,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: chartData
}
]
};
this.faultChart.setOption(option);
});
},
/**报警数据分析echart */
getAlarmCharts() {
async getAlarmCharts() {
// let chart1 = echarts.init(this.$refs.chart1);
// chart1.showLoading();
//
var data = {
x: ["1月", "2月", "3月", "4月", "5月", "6月"],
y: [12, 5, 11, 24, 18, 19],
};
this.initAlarmCharts(data);
await getAlarmDataList().then(res=>{
this.alarmData = res.data;
})
this.initAlarmCharts(this.alarmData);
},
initAlarmCharts(data) {
let p = new Promise((resolve) => {
@ -392,7 +409,7 @@ export default {
},
yAxis: {
type: "value",
name: "单位:",
name: "单位:",
nameLocation: "end",
interval: 5,
nameTextStyle: {
@ -436,20 +453,11 @@ export default {
this.chart1.hideLoading();
});
},
getCompanyAndEquipGrowTrend() {
let data = [
{
x: ["1月", "2月", "3月", "4月", "5月", "6月"],
y: [1, 2, 3, 4, 5, 6],
name: "企业",
},
{
x: ["1月", "2月", "3月", "4月", "5月", "6月"],
y: [15, 45, 55, 60, 70, 88],
name: "设备",
},
];
this.initTrendChart(data);
async getCompanyAndEquipGrowTrend() {
await getCompanyAndEquipCreate().then(res => {
this.companyAndEquipCreate = res.data;
})
this.initTrendChart(this.companyAndEquipCreate);
},
initTrendChart(data) {
let p = new Promise((resolve) => {
@ -608,41 +616,29 @@ export default {
let p = new Promise((resolve) => {
resolve();
});
p.then(() => {
p.then(async () => {
const _this = this;
echarts.registerMap("china", { geoJSON: chinaMap });
echarts.registerMap("china", {geoJSON: chinaMap});
this.myChart = echarts.init(this.$refs.mapChart);
// getEquNumByProvince().then((res) => {
let showdata = [];
let provinceData = [
{
provinceName: "山东省",
data: 120,
},
{
provinceName: "上海市",
data: 55,
},
{
provinceName: "广东省",
data: 89,
},
];
if (provinceData != null && provinceData.length > 0) {
let mapData = chinaMap.features;
provinceData.forEach((e) => {
let selectData = mapData.filter(
(md) => md.properties.name === e.provinceName
);
showdata.push({
name: e.provinceName,
value: selectData[0].properties.center,
num: e.data,
await getCustomerDistribution().then((res) => {
let provinceData = res.data;
if (provinceData != null && provinceData.length > 0) {
let mapData = chinaMap.features;
provinceData.forEach((e) => {
let selectData = mapData.filter(
(md) => md.properties.name === e.provinceName
);
showdata.push({
name: e.provinceName,
code: e.provinceCode,
value: selectData[0].properties.center,
num: e.data,
});
this.provinceName.push(e.provinceName);
});
this.provinceName.push(e.provinceName);
});
}
}
})
// // console.log("selectData:", selectData);
// // console.log("showdata:", showdata);
// });
@ -786,7 +782,7 @@ export default {
this.myChart.on("click", (e) => {
if (this.provinceName.includes(e.name)) {
console.log("ddd:", e);
// this.customerEquNumList = [];
this.customerEquNumList = [];
this.selectedProvince = e.name;
//
this.showPanel = true;
@ -796,16 +792,9 @@ export default {
var panel = document.getElementById("popPanel");
panel.style.left = dx + "px";
panel.style.top = dy + "px";
// getEquNumByCity(e.name).then((res) => {
// let citydata = res.data;
// citydata.forEach((e) => {
// this.customerEquNumList.push({
// name: e.regionName,
// value: e.data,
// });
// this.eqpNums += e.data;
// });
// });
getCustomerDistributionByProvinceCode(e.data.code).then(res=>{
this.customerEquNumList = res.data;
})
}
});
});

View File

@ -80,6 +80,9 @@
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['imt:equip-info:delete']">删除
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDetails(scope.row.equipId)"
v-hasPermi="['imt:equip-info:query']">设备详情
</el-button>
</template>
</el-table-column>
</el-table>
@ -143,6 +146,9 @@ export default {
})
},
methods: {
handleDetails(equipId){
this.$router.push({ path: "/equip/equipdetails", query: { equipId: equipId}});
},
/** 查询列表 */
async getList() {
try {

View File

@ -60,6 +60,9 @@
<div>{{ item.value }}</div>
</div>
</div>
<div v-if="!techParamsList.length" style="text-align: center">
暂无数据
</div>
</div>
</div>
<div>
@ -158,8 +161,10 @@
<div class="main-column">
<div class="select-info">
<el-cascader
v-model="value"
v-model="cascaderValue"
:disabled="cascaderDisabled"
:options="options"
:props="{ value: 'id',label: 'name',children: 'children'}"
@change="handleChange"
style="width:50%"
></el-cascader>
@ -279,7 +284,7 @@
<div class="right-column">
<div>
<div class="item-title">
<div class="title"><span style="margin-left:3%">设备运行状态</span>
<div class="title"><span style="margin-left:3%">故障历史信息</span>
</div>
<div class="underline"></div>
</div>
@ -288,15 +293,18 @@
<el-timeline-item
v-for="(item,index) in timeLineList"
:key="index"
:timestamp="item.time"
:timestamp="item.alarmTime"
:type="tranStatusToType(item.status)"
placement="top"
>
<el-card>
<span style="font-weight:bolder;font-size:18px">{{ item.title }}</span>
<span style="font-weight:bolder;font-size:18px">{{ item.alarmName }}</span>
<p>{{ item.content }}</p>
</el-card>
</el-timeline-item>
<el-timeline-item v-if="!timeLineList.length">
暂无数据
</el-timeline-item>
<!-- <el-timeline-item
timestamp="2018/4/12"
placement="top"
@ -334,50 +342,22 @@
import { merge } from "lodash";
import * as EquipAlarmDataApi from "@/api/system/alarm/equipalarmdata";
import * as echarts from "echarts";
import {getEquipCascader, getEquipInfoDetails} from "@/api/system/equip/equipInfo";
import {getAlarmCountByEquipId, getAlarmDataTimeLineByEquipId} from "@/api/system/alarm/alarmdata";
import {getMaintenanceCountByEquipId} from "@/api/system/maintenance/maintenance";
export default {
name: "EquipDetail2",
dicts: ["equip_tags", "equip_class", "equip_status"],
data() {
return {
equipInfo: {
customerName: "智能车床",
modelName: "ZNCC001",
equipNo: "370020001",
status: 0,
},
alarmTimes: 183,
faultTimes: 165,
techParamsList: [
{
name: "技术参数1",
value: 1,
},
{
name: "技术参数2",
value: 2,
},
{
name: "技术参数3",
value: 3,
},
{
name: "技术参数4",
value: 4,
},
],
cascaderDisabled: false,
cascaderValue:{},
equipInfo: {},
alarmTimes: 0,
faultTimes: 0,
techParamsList: [],
equipAlarmList: [],
options: [
{
value: "1",
label: "客户1",
children: [
{
value: "",
label: "MK9820机床液压设备",
},
],
},
],
options: [],
echarts1: null,
echarts2: null,
echarts3: null,
@ -385,36 +365,12 @@ export default {
echarts5: null,
echarts6: null,
echarts7: null,
timeLineList: [
{
time: "2024/9/5 13:00:00",
status: 0,
title: "电流异常故障",
content: "X轴轴承温度超过报警值",
},
{
time: "2024/9/7 19:10:00",
status: 0,
title: "温度异常故障",
content: "Y轴排屑温度超过报警值",
},
{
time: "2024/9/9 15:23:20",
status: 0,
title: "温度异常故障",
content: "Z轴排屑温度超过报警值",
},
{
time: "2024/9/12 10:17:53",
status: 0,
title: "液压异常故障",
content: "X轴润滑液压超过报警值",
},
],
timeLineList: [],
};
},
created() {
this.getEquipAlarmList();
this.initEquipDetails();
},
mounted() {
this.initCharts();
@ -423,6 +379,63 @@ export default {
computed: {},
watch: {},
methods: {
initEquipDetails() {
getEquipCascader().then(res=>{
res.forEach(item=>{
if (item.children == null){
item.disabled = true;
}else {
item.disabled = false;
}
})
this.options = res;
if (this.$route.query.equipId != null){
this.cascaderValue = this.$route.query.equipId;
this.getEquipDetails(this.$route.query.equipId);
this.getAlarmCountByEquipId(this.$route.query.equipId);
this.getMaintenanceCountByEquipId(this.$route.query.equipId);
this.getAlarmDataTimeLineByEquipId(this.$route.query.equipId);
this.cascaderDisabled = true;
}else {
this.options.every(item => {
if (item.disabled === false) {
this.cascaderValue = item.children[0].id;
this.getEquipDetails(item.children[0].id);
this.getAlarmCountByEquipId(item.children[0].id);
this.getMaintenanceCountByEquipId(item.children[0].id);
this.getAlarmDataTimeLineByEquipId(item.children[0].id);
this.cascaderDisabled = false;
return false;
}
})
}
})
},
//
getMaintenanceCountByEquipId(equipId){
getMaintenanceCountByEquipId(equipId).then(res=>{
this.faultTimes = res.data;
})
},
//
getAlarmCountByEquipId(equipId){
getAlarmCountByEquipId(equipId).then(res=>{
this.alarmTimes = res.data;
})
},
//
getAlarmDataTimeLineByEquipId(equipId){
getAlarmDataTimeLineByEquipId(equipId).then(res=>{
this.timeLineList = res.data;
})
},
getEquipDetails(id) {
getEquipInfoDetails(id).then(res => {
console.log("res.data",res.data);
this.equipInfo = res.data;
this.techParamsList = res.data.paramList;
})
},
async getEquipAlarmList() {
var equipAlarmQuery = {
pageSize: 5,
@ -434,15 +447,32 @@ export default {
this.equipAlarmList = res.data.list;
},
handleChange() {},
handleChange(value) {
if (value.length > 0){
this.getEquipDetails(value[1])
this.getAlarmCountByEquipId(value[1]);
this.getMaintenanceCountByEquipId(value[1]);
this.getAlarmDataTimeLineByEquipId(value[1]);
}else {
this.$message.error("请选择一个设备");
}
},
tranStatusToType(status) {
// switch (status) {
// case 0:
// return "success";
// case 1:
// return "warning ";
// case 2:
// return "danger ";
// }
switch (status) {
case 0:
return "success";
return "danger";
case 1:
return "warning ";
return "success";
case 2:
return "danger ";
return "warning";
}
},
initCharts() {