From 4a3da2fd85702b175047cf17cd9d24d129e0d439 Mon Sep 17 00:00:00 2001 From: "[wangbo]" Date: Wed, 28 Aug 2019 16:39:34 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=97=A0=E5=88=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/platform/common/enums/SieveEnums.java | 59 +++++++++++++--------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/platform-common/src/main/java/com/lyms/platform/common/enums/SieveEnums.java b/platform-common/src/main/java/com/lyms/platform/common/enums/SieveEnums.java index b00a9e4..e4fad59 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/enums/SieveEnums.java +++ b/platform-common/src/main/java/com/lyms/platform/common/enums/SieveEnums.java @@ -3,24 +3,27 @@ package com.lyms.platform.common.enums; import com.lyms.platform.common.utils.StringUtils; /** - * * 产筛枚举 - * + *

* Created by Administrator on 2016/6/29 0029. */ -public enum SieveEnums { - O("低风险",0),O1("临界值",1),O2("高风险",2); - private SieveEnums(String name,int id){ +public enum SieveEnums { + O("低风险", 0), O1("临界值", 1), O2("高风险", 2); + + private SieveEnums(String name, int id) { this.id - =id; - this.name=name; + = id; + this.name = name; } - public enum NotifyEnums{ - O("待产筛",0),O1("产筛未完成",1),O2("产筛已完成",2),O4("产诊已完成",4); - private NotifyEnums(String name,Integer id){ - this.name=name; - this.id=id; + + public enum NotifyEnums { + O("待产筛", 0), O1("产筛未完成", 1), O2("产筛已完成", 2), O4("产诊已完成", 4); + + private NotifyEnums(String name, Integer id) { + this.name = name; + this.id = id; } + private Integer id; private String name; @@ -39,17 +42,19 @@ public enum SieveEnums { public void setName(String name) { this.name = name; } - public static String getTitle(Integer id){ - for(NotifyEnums enums:values()){ - if(id==enums.getId()){ + + public static String getTitle(Integer id) { + for (NotifyEnums enums : values()) { + if (id == enums.getId()) { return enums.getName(); } } return null; } } - public enum SieveTypeEnums{ - XQSC("血清学筛查", "1"),WCSC("无创基因筛查", "2"), ALL("血清学+无创基因", "3"); + + public enum SieveTypeEnums { + XQSC("血清学筛查", "1"), WCSC("无创基因筛查", "2"), ALL("血清学+无创基因", "3"); private String id; private String name; @@ -88,9 +93,10 @@ public enum SieveEnums { } } - public enum CostTypeEnums{ + public enum CostTypeEnums { MF("1", "免费"), ZI("2", "自费"); - CostTypeEnums(String id, String name){ + + CostTypeEnums(String id, String name) { this.id = id; this.name = name; } @@ -106,6 +112,7 @@ public enum SieveEnums { } return null; } + private String id; private String name; @@ -126,8 +133,8 @@ public enum SieveEnums { } } - public enum ReportTypeEnums{ - ZSBG("1", "正式报告"), CQBG("2","重取报告"), SBBG("3", "失败报告"); + public enum ReportTypeEnums { + ZSBG("1", "正式报告"), CQBG("2", "重取报告"), SBBG("3", "失败报告"); ReportTypeEnums(String id, String name) { this.id = id; @@ -137,7 +144,7 @@ public enum SieveEnums { public static String getNameById(String id) { for (ReportTypeEnums enums : values()) { if (StringUtils.isEmpty(id)) { - return ReportTypeEnums.ZSBG.getName(); + return "-"; } if (id.equals(enums.getId())) { return enums.getName(); @@ -165,6 +172,7 @@ public enum SieveEnums { this.name = name; } } + private Integer id; private String name; @@ -183,9 +191,10 @@ public enum SieveEnums { public void setName(String name) { this.name = name; } - public static String getTitle(Integer id){ - for(SieveEnums enums:values()){ - if(id==enums.getId()){ + + public static String getTitle(Integer id) { + for (SieveEnums enums : values()) { + if (id == enums.getId()) { return enums.getName(); } } -- 1.8.3.1