feat:完成大屏各任务统计、各任务列表接口。
parent
d8c5f86c59
commit
121c447608
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.dashboard.vo.dashboard;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 大屏各任务数统计 VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class EventStatisticsVO {
|
||||
|
||||
@Schema(description = "设备点检")
|
||||
private int deviceInspection;
|
||||
|
||||
@Schema(description = "设备点检占比")
|
||||
private String deviceInspectionProportion;
|
||||
|
||||
@Schema(description = "模具点检")
|
||||
private int moldInspection;
|
||||
|
||||
@Schema(description = "模具点检占比")
|
||||
private String moldInspectionProportion;
|
||||
|
||||
@Schema(description = "设备保养")
|
||||
private int deviceMaintenance;
|
||||
|
||||
@Schema(description = "设备保养占比")
|
||||
private String deviceMaintenanceProportion;
|
||||
|
||||
@Schema(description = "模具保养")
|
||||
private int moldMaintenance;
|
||||
|
||||
@Schema(description = "模具保养占比")
|
||||
private String moldMaintenanceProportion;
|
||||
|
||||
@Schema(description = "设备维修")
|
||||
private int deviceRepair;
|
||||
|
||||
@Schema(description = "设备维修占比")
|
||||
private String deviceRepairProportion;
|
||||
|
||||
@Schema(description = "模具维修")
|
||||
private int moldRepair;
|
||||
|
||||
@Schema(description = "模具维修占比")
|
||||
private String moldRepairProportion;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.dashboard.vo.dashboard;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 大屏任务返回 VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class TaskVO {
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "完成状态 0-待完成 1-已完成 2-已取消")
|
||||
private String finishStatus;
|
||||
|
||||
@Schema(description = "完成结果 1-通过 2-不通过")
|
||||
private int resultStatus;
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.ticketmanagement.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 作业状态枚举
|
||||
* 0-待完成 1-已完成 2-已取消
|
||||
*/
|
||||
@Getter
|
||||
public enum JobStatusEnum {
|
||||
|
||||
PENDING(0, "待完成"),
|
||||
COMPLETED(1, "已完成"),
|
||||
CANCELED(2, "已取消");
|
||||
|
||||
private final Integer code;
|
||||
private final String description;
|
||||
|
||||
JobStatusEnum(Integer code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 code 获取枚举
|
||||
*/
|
||||
public static JobStatusEnum getByCode(Integer code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (JobStatusEnum status : values()) {
|
||||
if (status.getCode().equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 code 获取描述
|
||||
*/
|
||||
public static String getDescriptionByCode(Integer code) {
|
||||
JobStatusEnum status = getByCode(code);
|
||||
return status != null ? status.getDescription() : "未知";
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验 code 是否有效
|
||||
*/
|
||||
public static boolean isValidCode(Integer code) {
|
||||
return getByCode(code) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有 code 列表
|
||||
*/
|
||||
public static List<Integer> getAllCodes() {
|
||||
return Arrays.stream(values())
|
||||
.map(JobStatusEnum::getCode)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有描述列表
|
||||
*/
|
||||
public static List<String> getAllDescriptions() {
|
||||
return Arrays.stream(values())
|
||||
.map(JobStatusEnum::getDescription)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 code -> 描述 映射
|
||||
*/
|
||||
public static Map<Integer, String> getCodeDescriptionMap() {
|
||||
Map<Integer, String> map = new LinkedHashMap<>();
|
||||
for (JobStatusEnum status : values()) {
|
||||
map.put(status.getCode(), status.getDescription());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue