From a789c5916963b871442144eca8c131460975a373 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Fri, 18 Oct 2024 16:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=B1=BB=E5=9E=8B=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iocoder/yudao/common/RecordTypeEnum.java | 65 +++++++++++++++++++ .../tickets/utils/TicketsOperateUtil.java | 2 + 2 files changed, 67 insertions(+) create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/utils/TicketsOperateUtil.java diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java new file mode 100644 index 00000000..c3284401 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.common; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 维修工单状态枚举 + * + * @author vinjor-m + */ +@AllArgsConstructor +@Getter +public enum TicketsStatusEnum { + /** + * 未派工 + */ + NO_WORK("04","未派工"), + /** + * 施工中 + */ + WORKING("05","施工中"), + /** + * 未结账 + */ + NO_PAY("01","未结账"), + /** + * 挂单/记账 + */ + ACCOUNTING("06","挂单/记账"), + /** + * 已结账 + */ + CHECK_OUT("02","已结账"), + /** + * 已作废 + */ + CANCEL("03","已作废"); + + /** + * 角色code + */ + private String code; + /** + * 角色名称 + */ + private String name; + + /** + * 根据角色code返回对应的枚举 + * @author vinjor-M + * @date 14:23 2024/10/16 + * @param code 角色code + * @return cn.iocoder.yudao.common.SystemEnum + **/ + public static TicketsStatusEnum getRepairRole(String code) { + for (TicketsStatusEnum roleEnum : TicketsStatusEnum.values()) { + if (roleEnum.getCode().equalsIgnoreCase(code)) { + // 找到对应的枚举 + return roleEnum; + } + } + throw new IllegalArgumentException("无效的角色code:" + code); + } + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/utils/TicketsOperateUtil.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/utils/TicketsOperateUtil.java new file mode 100644 index 00000000..661fcee5 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/utils/TicketsOperateUtil.java @@ -0,0 +1,2 @@ +package cn.iocoder.yudao.module.tickets.utils;public class TicketsOprateUtil { +}