diff --git a/imt-server/imt-module-system/imt-module-system-biz/pom.xml b/imt-server/imt-module-system/imt-module-system-biz/pom.xml index fe229a6..156b480 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/pom.xml +++ b/imt-server/imt-module-system/imt-module-system-biz/pom.xml @@ -149,6 +149,12 @@ 6.8.0 compile + + com.inspur + imt-module-bpm-biz + 2.2.0-jdk8-snapshot + compile + diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmDataController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmDataController.java index 49c6fd9..c6e9f5c 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmDataController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmDataController.java @@ -104,4 +104,16 @@ public class AlarmDataController { BeanUtils.toBean(list, AlarmDataRespVO.class)); } + @GetMapping("/getAlarmCountByEquipId/{equipId}") + @Operation(summary = "根据设备id获取报警次数") + public CommonResult getAlarmCountByEquipId(@PathVariable("equipId") String equipId){ + return success(alarmDataService.getAlarmCountByEquipId(equipId)); + } + + @Operation(summary = "根据设备id获取故障次数") + @GetMapping("/getAlarmDataTimeLineByEquipId/{equipId}") + public CommonResult> getAlarmDataTimeLineByEquipId(@PathVariable("equipId") String equipId) { + return success(alarmDataService.getAlarmDataTimeLineByEquipId(equipId)); + } + } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/vo/AlarmDataTimeLineVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/vo/AlarmDataTimeLineVO.java new file mode 100644 index 0000000..fca489c --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/vo/AlarmDataTimeLineVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/EquipInfoController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/EquipInfoController.java index 6f1ae4f..ab1f5bd 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/EquipInfoController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/EquipInfoController.java @@ -144,4 +144,11 @@ public class EquipInfoController { return equipInfoService.cascader(); } + @GetMapping("/details/{id}") + @PreAuthorize("@ss.hasPermission('imt:equip-info:query')") + @Operation(summary = "设备详情") + public CommonResult getEquipInfoDetailsById(@PathVariable("id") String id) { + return success(equipInfoService.getEquipInfoDetailsById(id)); + } + } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/vo/EquipInfoDetailsVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/vo/EquipInfoDetailsVO.java new file mode 100644 index 0000000..be702b5 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/vo/EquipInfoDetailsVO.java @@ -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 paramList; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/vo/EquipTechnologyParamVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/vo/EquipTechnologyParamVO.java new file mode 100644 index 0000000..c209c01 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/vo/EquipTechnologyParamVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/ImtIndexController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/ImtIndexController.java new file mode 100644 index 0000000..8924a9d --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/ImtIndexController.java @@ -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> taskList() { + return success(imtIndexService.taskList()); + } + + @GetMapping("/alarmList") + @Operation(summary = "报警信息") + public CommonResult> alarmList() { + return success(imtIndexService.alarmList()); + } + + @GetMapping("/maintenanceOrderList") + @Operation(summary = "维修工单") + public CommonResult> maintenanceOrderList() { + return success(imtIndexService.maintenanceOrderList()); + } + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/vo/ImtIndexAlarmListVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/vo/ImtIndexAlarmListVO.java new file mode 100644 index 0000000..d565432 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/vo/ImtIndexAlarmListVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/vo/ImtIndexMaintenanceOrderListVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/vo/ImtIndexMaintenanceOrderListVO.java new file mode 100644 index 0000000..5427870 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/vo/ImtIndexMaintenanceOrderListVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/vo/ImtIndexTaskListVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/vo/ImtIndexTaskListVO.java new file mode 100644 index 0000000..aa1324a --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/imtIndex/vo/ImtIndexTaskListVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/LargeScreenController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/LargeScreenController.java new file mode 100644 index 0000000..5ac63ba --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/LargeScreenController.java @@ -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> equipInfoList(){ + return success(largeScreenService.equipInfoList()); + } + + @GetMapping("/dataCount") + @Operation(summary = "规模数量") + public CommonResult dataCount(){ + return success(largeScreenService.dataCount()); + } + + @GetMapping("/faultDataList") + @Operation(summary = "故障数据分析") + public CommonResult> faultDataList(){ + return success(largeScreenService.faultDataList()); + } + + @GetMapping("/alarmDataList") + @Operation(summary = "报警数据分析") + public CommonResult alarmDataList(){ + return success(largeScreenService.alarmDataList()); + } + + @GetMapping("/companyAndEquipCreate") + @Operation(summary = "企业和设备新增趋势") + public CommonResult> companyAndEquipCreate(){ + return success(largeScreenService.companyAndEquipCreate()); + } + + @GetMapping("/maintenanceOrder") + @Operation(summary = "在途维修工单") + public CommonResult> maintenanceOrder(){ + return success(largeScreenService.maintenanceOrder()); + } + + @GetMapping("/maintenanceOrderCount") + @Operation(summary = "维修工单统计") + public CommonResult> maintenanceOrderCount(){ + return success(largeScreenService.maintenanceOrderCount()); + } + + @GetMapping("/alarmList") + @Operation(summary = "告警信息") + public CommonResult> alarmList(){ + return success(largeScreenService.alarmList()); + } + + @GetMapping("/customerDistribution") + @Operation(summary = "客户分布") + public CommonResult> customerDistribution(){ + return success(largeScreenService.customerDistribution()); + } + + @GetMapping("/customerDistributionByProvinceCode/{provinceCode}") + @Operation(summary = "客户分布详情") + public CommonResult> customerDistributionByProvinceCode(@PathVariable("provinceCode") Integer provinceCode){ + return success(largeScreenService.customerDistributionByProvinceCode(provinceCode)); + } + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/dto/LargeScreenFaultCountDTO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/dto/LargeScreenFaultCountDTO.java new file mode 100644 index 0000000..f6acf4c --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/dto/LargeScreenFaultCountDTO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/dto/LargeScreenMonthCountDTO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/dto/LargeScreenMonthCountDTO.java new file mode 100644 index 0000000..9e2520a --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/dto/LargeScreenMonthCountDTO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenAlarmDataVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenAlarmDataVO.java new file mode 100644 index 0000000..16e40cf --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenAlarmDataVO.java @@ -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 x; + + private List y; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenAlarmListVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenAlarmListVO.java new file mode 100644 index 0000000..4c98fb9 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenAlarmListVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenCompanyAndEquipCreateListVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenCompanyAndEquipCreateListVO.java new file mode 100644 index 0000000..f777b41 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenCompanyAndEquipCreateListVO.java @@ -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 x; + + private List y; + + private String name; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenCustomerDistributionVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenCustomerDistributionVO.java new file mode 100644 index 0000000..352a8f9 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenCustomerDistributionVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenCustomerEquipCountVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenCustomerEquipCountVO.java new file mode 100644 index 0000000..3d0edde --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenCustomerEquipCountVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenDataCountVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenDataCountVO.java new file mode 100644 index 0000000..008b783 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenDataCountVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenEquipInfoListVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenEquipInfoListVO.java new file mode 100644 index 0000000..3e817f6 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenEquipInfoListVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenFaultDataListVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenFaultDataListVO.java new file mode 100644 index 0000000..5b7d8be --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenFaultDataListVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenMaintenanceOrderCountListVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenMaintenanceOrderCountListVO.java new file mode 100644 index 0000000..14cc676 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenMaintenanceOrderCountListVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenMaintenanceOrderListVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenMaintenanceOrderListVO.java new file mode 100644 index 0000000..c1f852d --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/largeScreen/vo/LargeScreenMaintenanceOrderListVO.java @@ -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; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java index 540d1c0..fce1542 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java @@ -115,4 +115,10 @@ public class MaintenanceOrderController { return maintenanceOrderService.submitApprove(id); } + @Operation(summary = "根据设备id获取故障次数") + @GetMapping("/getMaintenanceCountByEquipId/{equipId}") + public CommonResult getMaintenanceCountByEquipId(@PathVariable("equipId") String equipId){ + return success(maintenanceOrderService.getMaintenanceCountByEquipId(equipId)); + } + } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmDataMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmDataMapper.java index 096a671..ce62481 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmDataMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/AlarmDataMapper.java @@ -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 { * 根据规则id查询参数报警 */ public AlarmDataDTO selectAlarmDataByRulesId(@Param("alarmRulesId") String alarmRulesId); + + @TenantIgnore + List 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 + */ + @TenantIgnore + List getAlarmDataTimeLineByEquipId(@Param("equipId") String equipId); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/largeScreen/LargeScreenMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/largeScreen/LargeScreenMapper.java new file mode 100644 index 0000000..e3f4651 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/largeScreen/LargeScreenMapper.java @@ -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 + */ + List equipInfoList(); + + /** + * 获取故障类型各类型个数 + * + * @Author xusd + * @Date 9:56 2024/9/25 + * @return java.util.List + */ + List selectFaultCount(); + + /** + * 各月份报警次数 + * + * @Author xusd + * @Date 10:43 2024/9/25 + * @return java.util.List + */ + @TenantIgnore + List getAlarmMonthCount(); + + /** + * 各月份客户创建数 + * + * @Author xusd + * @Date 11:12 2024/9/25 + * @return java.util.List + */ + List getCustomerCreateMonthCount(); + + /** + * 各月份设备创建数 + * + * @Author xusd + * @Date 11:15 2024/9/25 + * @return java.util.List + */ + List getEquipCreateMonthCount(); + + /** + * 维修工单统计 + * + * @Author xusd + * @Date 14:50 2024/9/25 + * @return java.util.List + */ + List maintenanceOrderCount(); + + /** + * 告警信息 + * + * @Author xusd + * @Date 15:57 2024/9/25 + * @return java.util.List + */ + @TenantIgnore + List selectArmListTop4(); + + /** + * 客户分布 + * + * @Author xusd + * @Date 10:35 2024/9/26 + * @return java.util.List + */ + List customerDistribution(); + + /** + * 根据省编号获取客户分布详情 + * + * @Author xusd + * @Date 11:05 2024/9/26 + * @param provinceCode 省标识 + * @return java.util.List + */ + List customerDistributionByProvinceCode(@Param("provinceCode") Integer provinceCode); +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataService.java index 01da971..49b8b91 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataService.java @@ -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 + */ + List getAlarmDataTimeLineByEquipId(String equipId); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java index 7bfd2c8..6222715 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java @@ -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 getAlarmDataTimeLineByEquipId(String equipId) { + return alarmDataMapper.getAlarmDataTimeLineByEquipId(equipId); + } } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipInfoService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipInfoService.java index 9c8e578..f6f7331 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipInfoService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipInfoService.java @@ -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 */ List 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); } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/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 7edb365..6a2620f 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 @@ -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 split = Arrays.asList(modelSpn.split(";")); + if (CollUtil.isNotEmpty(split)){ + List list = new ArrayList<>(); + if (split.size() > 4) { + List 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); + } } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/imtIndex/ImtIndexService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/imtIndex/ImtIndexService.java new file mode 100644 index 0000000..7423ef0 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/imtIndex/ImtIndexService.java @@ -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 + */ + List taskList(); + + /** + * 报警信息 + * + * @Author xusd + * @Date 9:59 2024/9/23 + * @return java.util.List + */ + List alarmList(); + + /** + * 维修工单 + * + * @Author xusd + * @Date 10:00 2024/9/23 + * @return java.util.List + */ + List maintenanceOrderList(); +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/imtIndex/ImtIndexServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/imtIndex/ImtIndexServiceImpl.java new file mode 100644 index 0000000..99d0eb9 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/imtIndex/ImtIndexServiceImpl.java @@ -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 taskList() { + TaskQuery taskQuery = taskService.createTaskQuery() + .taskAssignee(String.valueOf(getLoginUserId())) // 分配给自己 + .active() + .includeProcessVariables() + .orderByTaskCreateTime().desc(); + List tasks = taskQuery.listPage(0, 5); + if (CollUtil.isEmpty(tasks)) { + return Collections.emptyList(); + } + // 拼接数据 + Map processInstanceMap = processInstanceService.getProcessInstanceMap( + convertSet(tasks, Task::getProcessInstanceId)); + Map 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 alarmList() { + return alarmDataMapper.selectListTop3(); + } + + @Override + public List maintenanceOrderList() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.orderByDesc(MaintenanceOrderDO::getCreateTime); + queryWrapper.last("limit 3"); + List maintenanceOrderDOS = maintenanceOrderMapper.selectList(queryWrapper); + if (CollUtil.isEmpty(maintenanceOrderDOS)) { + return Collections.emptyList(); + } + List customerList = customerInfoService.selection(true); + Map customerMap = customerList.stream().collect(Collectors.toMap(CustomerInfoSelectionVO::getCustomerId, CustomerInfoSelectionVO::getCustomerName)); + return BeanUtils.toBean(maintenanceOrderDOS, ImtIndexMaintenanceOrderListVO.class, vo -> { + vo.setCustomerName(customerMap.get(vo.getCustomerId())); + }); + } +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/largeScreen/LargeScreenService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/largeScreen/LargeScreenService.java new file mode 100644 index 0000000..f50ce00 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/largeScreen/LargeScreenService.java @@ -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 + */ + List 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 + */ + List 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 + */ + List companyAndEquipCreate(); + + /** + * 在途维修工单 + * + * @Author xusd + * @Date 14:42 2024/9/25 + * @return java.util.List + */ + List maintenanceOrder(); + + /** + * 维修工单统计 + * + * @Author xusd + * @Date 14:49 2024/9/25 + * @return java.util.List + */ + List maintenanceOrderCount(); + + /** + * 告警信息 + * + * @Author xusd + * @Date 15:45 2024/9/25 + * @return java.util.List + */ + List alarmList(); + + /** + * 客户分布 + * + * @Author xusd + * @Date 10:18 2024/9/26 + * @return java.util.List + */ + List customerDistribution(); + + /** + * 根据省编号获取客户分布详情 + * + * @Author xusd + * @Date 11:02 2024/9/26 + * @param provinceCode 省编号 + * @return java.util.List + */ + List customerDistributionByProvinceCode(Integer provinceCode); +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/largeScreen/LargeScreenServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/largeScreen/LargeScreenServiceImpl.java new file mode 100644 index 0000000..3ffc094 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/largeScreen/LargeScreenServiceImpl.java @@ -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 equipInfoList() { + List 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 faultDataList() { + List faultTypeList = dictDataService.getDictDataListByDictType("fault_type"); + if (CollUtil.isEmpty(faultTypeList)) { + return Collections.emptyList(); + } + //只保留4条 + if (faultTypeList.size() > 4) { + List subList = faultTypeList.subList(4, faultTypeList.size()); + subList.clear(); + } + List dtoList = largeScreenMapper.selectFaultCount(); + Map dtoMap = dtoList.stream().collect(Collectors.toMap(LargeScreenFaultCountDTO::getFaultValue, LargeScreenFaultCountDTO::getFaultCount)); + List 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 x = getFirstSixMonths(); + vo.setX(x); + List list = largeScreenMapper.getAlarmMonthCount(); + if (CollUtil.isNotEmpty(list)) { + List y = new ArrayList<>(); + Map 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 companyAndEquipCreate() { + List list = new ArrayList<>(); + List x = getFirstSixMonths(); + //客户 + LargeScreenCompanyAndEquipCreateListVO customer = new LargeScreenCompanyAndEquipCreateListVO(); + customer.setX(x); + customer.setName("企业"); + List customerList = largeScreenMapper.getCustomerCreateMonthCount(); + if (CollUtil.isNotEmpty(customerList)){ + List y = new ArrayList<>(); + Map 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 equipList = largeScreenMapper.getEquipCreateMonthCount(); + if (CollUtil.isNotEmpty(equipList)){ + List y = new ArrayList<>(); + Map 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 maintenanceOrder() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.orderByDesc(MaintenanceOrderDO::getCreateTime); + queryWrapper.last("limit 4"); + List maintenanceOrderDOS = maintenanceOrderMapper.selectList(queryWrapper); + if (CollUtil.isEmpty(maintenanceOrderDOS)) { + return Collections.emptyList(); + } + List customerList = customerInfoService.selection(true); + Map 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 maintenanceOrderCount() { + return largeScreenMapper.maintenanceOrderCount(); + } + + @Override + public List alarmList() { + return largeScreenMapper.selectArmListTop4(); + } + + @Override + public List customerDistribution() { + List 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 customerDistributionByProvinceCode(Integer provinceCode) { + return largeScreenMapper.customerDistributionByProvinceCode(provinceCode); + } + + /** + * 获取前六个月的月份 + * + * @return java.util.List + * @Author xusd + * @Date 10:30 2024/9/25 + */ + private List getFirstSixMonths() { + List list = new ArrayList<>(); + DateTime firstSixMonth = DateUtil.offsetMonth(new Date(), -5); + List dateTimes = DateUtil.rangeToList(firstSixMonth, new Date(), DateField.MONTH); + dateTimes.forEach(item -> list.add(DateUtil.format(item, "yyyy-MM"))); + return list; + } +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java index cff86fd..3d00040 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java @@ -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); } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java index 14f11d8..c1872c6 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java @@ -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); + } } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/AlarmDataMapper.xml b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/AlarmDataMapper.xml index 6ca6eac..f4c6ea9 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/AlarmDataMapper.xml +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/AlarmDataMapper.xml @@ -24,6 +24,13 @@ + + + + + + + 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' + + + \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml new file mode 100644 index 0000000..d381d60 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + 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 + + + + + \ No newline at end of file diff --git a/imt-ui/src/api/imtIndex.js b/imt-ui/src/api/imtIndex.js new file mode 100644 index 0000000..4f62073 --- /dev/null +++ b/imt-ui/src/api/imtIndex.js @@ -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' + }) +} diff --git a/imt-ui/src/api/system/alarm/alarmdata.js b/imt-ui/src/api/system/alarm/alarmdata.js index 7262c17..a66c8b1 100644 --- a/imt-ui/src/api/system/alarm/alarmdata.js +++ b/imt-ui/src/api/system/alarm/alarmdata.js @@ -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", + }); +} diff --git a/imt-ui/src/api/system/equip/equipInfo.js b/imt-ui/src/api/system/equip/equipInfo.js index 2e8431e..034c814 100644 --- a/imt-ui/src/api/system/equip/equipInfo.js +++ b/imt-ui/src/api/system/equip/equipInfo.js @@ -67,3 +67,11 @@ export function getEquipCascader() { method: 'get' }) } + +// 获得机床详情 +export function getEquipInfoDetails(id) { + return request({ + url: '/equip/equipInfo/details/' + id, + method: 'get' + }) +} diff --git a/imt-ui/src/api/system/largeScreen/largeScreen.js b/imt-ui/src/api/system/largeScreen/largeScreen.js new file mode 100644 index 0000000..329375c --- /dev/null +++ b/imt-ui/src/api/system/largeScreen/largeScreen.js @@ -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", + }); +} diff --git a/imt-ui/src/api/system/maintenance/maintenance.js b/imt-ui/src/api/system/maintenance/maintenance.js index a1cbbc1..930f65e 100644 --- a/imt-ui/src/api/system/maintenance/maintenance.js +++ b/imt-ui/src/api/system/maintenance/maintenance.js @@ -76,3 +76,11 @@ export function submitMaintenanceApprove(id) { method: 'get' }) } + +// 根据设备id获取故障次数 +export function getMaintenanceCountByEquipId(equipId) { + return request({ + url: '/maintenance/getMaintenanceCountByEquipId/' + equipId, + method: 'get' + }) +} diff --git a/imt-ui/src/views/imtIndex.vue b/imt-ui/src/views/imtIndex.vue index 9d4bb9d..2b776be 100644 --- a/imt-ui/src/views/imtIndex.vue +++ b/imt-ui/src/views/imtIndex.vue @@ -102,7 +102,7 @@ - + @@ -119,9 +119,9 @@ - - - + + + @@ -134,9 +134,17 @@ - - - + + + + + + + @@ -147,6 +155,8 @@