Commit b80bf8d8160528c330f4561a2fec15dd0b3e5e54
1 parent
5fdf93570a
Exists in
master
and in
6 other branches
新生儿访视明细
Showing 7 changed files with 102 additions and 4 deletions
- platform-common/src/main/java/com/lyms/platform/common/enums/BregmaticEnums.java
- platform-common/src/main/java/com/lyms/platform/common/enums/ComplexionEnums.java
- platform-common/src/main/java/com/lyms/platform/common/enums/FeedTypeEnums.java
- platform-common/src/main/java/com/lyms/platform/common/enums/SkinEnums.java
- platform-common/src/main/java/com/lyms/platform/common/enums/UmbilicalCordEnums.java
- platform-common/src/main/java/com/lyms/platform/common/enums/VomitEnums.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
platform-common/src/main/java/com/lyms/platform/common/enums/BregmaticEnums.java
View file @
b80bf8d
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import com.lyms.platform.common.utils.StringUtils; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 前囟 闭合/未闭合 |
5 | 7 | * Created by lt on 2017/7/18 0018 |
... | ... | @@ -11,6 +13,20 @@ |
11 | 13 | private Integer id; |
12 | 14 | private String name; |
13 | 15 | |
16 | + public static String getName(String id) { | |
17 | + if(StringUtils.isEmpty(id)) { | |
18 | + return null; | |
19 | + } | |
20 | + int i = Integer.parseInt(id); | |
21 | + BregmaticEnums[] values = BregmaticEnums.values(); | |
22 | + for (BregmaticEnums value : values) { | |
23 | + if (value.getId() == i) { | |
24 | + return value.getName(); | |
25 | + } | |
26 | + } | |
27 | + return null; | |
28 | + } | |
29 | + | |
14 | 30 | public static BregmaticEnums get(Integer id) { |
15 | 31 | BregmaticEnums[] values = BregmaticEnums.values(); |
16 | 32 | for (BregmaticEnums value : values) { |
platform-common/src/main/java/com/lyms/platform/common/enums/ComplexionEnums.java
View file @
b80bf8d
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import com.lyms.platform.common.utils.StringUtils; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 面色 红润/黄染/其他 |
5 | 7 | * Created by lt on 2017/7/18 0018 |
... | ... | @@ -41,6 +43,20 @@ |
41 | 43 | |
42 | 44 | public void setName(String name) { |
43 | 45 | this.name = name; |
46 | + } | |
47 | + | |
48 | + public static String getName(String id) { | |
49 | + if(StringUtils.isEmpty(id)) { | |
50 | + return null; | |
51 | + } | |
52 | + int i = Integer.parseInt(id); | |
53 | + ComplexionEnums[] values = ComplexionEnums.values(); | |
54 | + for (ComplexionEnums value : values) { | |
55 | + if (value.getId() == i) { | |
56 | + return value.getName(); | |
57 | + } | |
58 | + } | |
59 | + return null; | |
44 | 60 | } |
45 | 61 | } |
platform-common/src/main/java/com/lyms/platform/common/enums/FeedTypeEnums.java
View file @
b80bf8d
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import com.lyms.platform.common.utils.StringUtils; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 喂养方式 纯母乳/混合/人工 |
5 | 7 | * Created by lt on 2017/7/18 0018 |
... | ... | @@ -22,6 +24,20 @@ |
22 | 24 | return null; |
23 | 25 | } |
24 | 26 | |
27 | + public static String getName(String id) { | |
28 | + if(StringUtils.isEmpty(id)) { | |
29 | + return null; | |
30 | + } | |
31 | + int i = Integer.parseInt(id); | |
32 | + FeedTypeEnums[] values = FeedTypeEnums.values(); | |
33 | + for (FeedTypeEnums value : values) { | |
34 | + if (value.id == i) { | |
35 | + return value.name; | |
36 | + } | |
37 | + } | |
38 | + return null; | |
39 | + } | |
40 | + | |
25 | 41 | FeedTypeEnums(Integer id, String name){ |
26 | 42 | this.id = id; |
27 | 43 | this.name = name; |
... | ... | @@ -42,5 +58,6 @@ |
42 | 58 | public void setName(String name) { |
43 | 59 | this.name = name; |
44 | 60 | } |
61 | + | |
45 | 62 | } |
platform-common/src/main/java/com/lyms/platform/common/enums/SkinEnums.java
View file @
b80bf8d
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import com.lyms.platform.common.utils.StringUtils; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 皮肤枚举 未见异常/湿疹/糜烂/其他 |
5 | 7 | * Created by lt on 2017/7/18 0018 |
... | ... | @@ -13,9 +15,23 @@ |
13 | 15 | private Integer id; |
14 | 16 | private String name; |
15 | 17 | |
16 | - public static FeedTypeEnums get(Integer id) { | |
17 | - FeedTypeEnums[] values = FeedTypeEnums.values(); | |
18 | - for (FeedTypeEnums value : values) { | |
18 | + public static String getName(String id) { | |
19 | + if(StringUtils.isEmpty(id)) { | |
20 | + return null; | |
21 | + } | |
22 | + int i = Integer.parseInt(id); | |
23 | + SkinEnums[] values = SkinEnums.values(); | |
24 | + for (SkinEnums value : values) { | |
25 | + if (value.getId() == i) { | |
26 | + return value.getName(); | |
27 | + } | |
28 | + } | |
29 | + return null; | |
30 | + } | |
31 | + | |
32 | + public static SkinEnums get(Integer id) { | |
33 | + SkinEnums[] values = SkinEnums.values(); | |
34 | + for (SkinEnums value : values) { | |
19 | 35 | if (value.getId() == id) { |
20 | 36 | return value; |
21 | 37 | } |
platform-common/src/main/java/com/lyms/platform/common/enums/UmbilicalCordEnums.java
View file @
b80bf8d
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import com.lyms.platform.common.utils.StringUtils; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 脐带 未脱/脱落/脐部有渗出/其他 |
5 | 7 | * Created by lt on 2017/7/18 0018 |
... | ... | @@ -12,6 +14,20 @@ |
12 | 14 | |
13 | 15 | private Integer id; |
14 | 16 | private String name; |
17 | + | |
18 | + public static String getName(String id) { | |
19 | + if(StringUtils.isEmpty(id)) { | |
20 | + return null; | |
21 | + } | |
22 | + int i = Integer.parseInt(id); | |
23 | + UmbilicalCordEnums[] values = UmbilicalCordEnums.values(); | |
24 | + for (UmbilicalCordEnums value : values) { | |
25 | + if (value.getId() == i) { | |
26 | + return value.getName(); | |
27 | + } | |
28 | + } | |
29 | + return null; | |
30 | + } | |
15 | 31 | |
16 | 32 | public static UmbilicalCordEnums get(Integer id) { |
17 | 33 | UmbilicalCordEnums[] values = UmbilicalCordEnums.values(); |
platform-common/src/main/java/com/lyms/platform/common/enums/VomitEnums.java
View file @
b80bf8d
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import com.lyms.platform.common.utils.StringUtils; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 是否呕吐 |
5 | 7 | * Created by lt on 2017/7/18 0018 |
... | ... | @@ -26,6 +28,20 @@ |
26 | 28 | this.name = name; |
27 | 29 | } |
28 | 30 | |
31 | + public static String getName(String id) { | |
32 | + if(StringUtils.isEmpty(id)) { | |
33 | + return null; | |
34 | + } | |
35 | + int i = Integer.parseInt(id); | |
36 | + VomitEnums[] values = VomitEnums.values(); | |
37 | + for (VomitEnums value : values) { | |
38 | + if (value.getId() == i) { | |
39 | + return value.getName(); | |
40 | + } | |
41 | + } | |
42 | + return null; | |
43 | + } | |
44 | + | |
29 | 45 | public Integer getId() { |
30 | 46 | return id; |
31 | 47 | } |
... | ... | @@ -41,5 +57,6 @@ |
41 | 57 | public void setName(String name) { |
42 | 58 | this.name = name; |
43 | 59 | } |
60 | + | |
44 | 61 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
View file @
b80bf8d
... | ... | @@ -75,7 +75,7 @@ |
75 | 75 | public BaseObjectResponse addOrUpdate(Integer userId, NewbornVisit newbornVisit) { |
76 | 76 | newbornVisit.setFeedType(newbornVisit.getFeedType() == null ? null : FeedTypeEnums.get(Integer.parseInt(newbornVisit.getFeedType())).getName()); |
77 | 77 | newbornVisit.setSkin(newbornVisit.getSkin() == null ? null : SkinEnums.get(Integer.parseInt(newbornVisit.getSkin())).getName()); |
78 | - newbornVisit.setComplexion(newbornVisit.getComplexion() == null ? null : BregmaticEnums.get(Integer.parseInt(newbornVisit.getComplexion())).getName()); | |
78 | + newbornVisit.setComplexion(newbornVisit.getComplexion() == null ? null : ComplexionEnums.get(Integer.parseInt(newbornVisit.getComplexion())).getName()); | |
79 | 79 | newbornVisit.setUmbilicalCord(newbornVisit.getUmbilicalCord() == null ? null : UmbilicalCordEnums.get(Integer.parseInt(newbornVisit.getUmbilicalCord())).getName()); |
80 | 80 | newbornVisit.setHospitalId(autoMatchFacade.getHospitalId(userId)); |
81 | 81 | // newbornVisit.setNextVisitTime(newbornVisit.getUmbilicalCord() == null ? null : UmbilicalCordEnums.get(Integer.parseInt(newbornVisit.getUmbilicalCord())).getName()); |