From 6e05c6c840fece148e7f20dddaa16d3f143be6fa Mon Sep 17 00:00:00 2001 From: "litao@lymsh.com" Date: Mon, 28 Aug 2017 14:47:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/common/enums/CheckMonthEnums2.java | 130 +++++++++++++++++++++ .../web/service/impl/BabyEyeCheckServiceImpl.java | 6 +- 2 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 platform-common/src/main/java/com/lyms/platform/common/enums/CheckMonthEnums2.java diff --git a/platform-common/src/main/java/com/lyms/platform/common/enums/CheckMonthEnums2.java b/platform-common/src/main/java/com/lyms/platform/common/enums/CheckMonthEnums2.java new file mode 100644 index 0000000..63607f8 --- /dev/null +++ b/platform-common/src/main/java/com/lyms/platform/common/enums/CheckMonthEnums2.java @@ -0,0 +1,130 @@ +package com.lyms.platform.common.enums; + +import com.lyms.platform.common.utils.StringUtils; + +/** + * 检查月龄 + */ +public enum CheckMonthEnums2 { + I1(1, "1月龄"), + I2(2, "2月龄"), + I3(3, "3月龄"), + I4(4, "4月龄"), + I5(5, "5月龄"), + I6(6, "6月龄"), + I7(7, "7月龄"), + I8(8, "8月龄"), + I9(9, "9月龄"), + I10(10, "10月龄"), + I11(11, "11月龄"), + I12(12, "12月龄"), + I13(13, "13月龄"), + I14(14, "14月龄"), + I15(15, "15月龄"), + I16(16, "16月龄"), + I17(17, "17月龄"), + I18(18, "18月龄"), + I19(19, "19月龄"), + I20(20, "20月龄"), + I21(21, "21月龄"), + I22(22, "22月龄"), + I23(23, "23月龄"), + I24(24, "24月龄"), + I25(25, "25月龄"), + I26(26, "26月龄"), + I27(27, "27月龄"), + I28(28, "28月龄"), + I29(29, "29月龄"), + I30(30, "30月龄"), + I31(31, "31月龄"), + I32(32, "32月龄"), + I33(33, "33月龄"), + I34(34, "34月龄"), + I35(35, "35月龄"), + I36(36, "36月龄"), + I37(37, "37月龄"), + I38(38, "38月龄"), + I39(39, "39月龄"), + I40(40, "40月龄"), + I41(41, "41月龄"), + I42(42, "42月龄"), + I43(43, "43月龄"), + I44(44, "44月龄"), + I45(45, "45月龄"), + I46(46, "46月龄"), + I47(47, "47月龄"), + I48(48, "48月龄"), + I49(49, "49月龄"), + I50(50, "50月龄"), + I51(51, "51月龄"), + I52(52, "52月龄"), + I53(53, "53月龄"), + I54(54, "54月龄"), + I55(55, "55月龄"), + I56(56, "56月龄"), + I57(57, "57月龄"), + I58(58, "58月龄"), + I59(59, "59月龄"), + I60(60, "60月龄"), + I61(61, "61月龄"), + I62(62, "62月龄"), + I63(63, "63月龄"), + I64(64, "64月龄"), + I65(65, "65月龄"), + I66(66, "66月龄"), + I67(67, "67月龄"), + I68(68, "68月龄"), + I69(69, "69月龄"), + I70(70, "70月龄"), + I71(71, "71月龄"), + I72(72, "72月龄"); + + private Integer id; + private String name; + + public static CheckMonthEnums2 get(Integer id) { + CheckMonthEnums2[] values = CheckMonthEnums2.values(); + for (CheckMonthEnums2 value : values) { + if (value.getId() == id) { + return value; + } + } + return null; + } + + public static String getName(String id) { + if(StringUtils.isEmpty(id)) { + return null; + } + int i = Integer.parseInt(id); + CheckMonthEnums2[] values = CheckMonthEnums2.values(); + for (CheckMonthEnums2 value : values) { + if (value.id == i) { + return value.name; + } + } + return null; + } + + CheckMonthEnums2(Integer id, String name){ + this.id = id; + this.name = name; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java index d9b2f4d..856c95f 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java @@ -192,7 +192,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEye map.put("pupillaryRightReflex", parseYinYang(babyEyeCheck.getPupillaryRightReflex())); map.put("pupillaryLeftReflex", parseYinYang(babyEyeCheck.getPupillaryLeftReflex())); map.put("redRightReflex", parseYinYang(babyEyeCheck.getRedRightReflex())); - map.put("eyePositionId", EyePositionEnums.getName(babyEyeCheck.getEyePositionId())); + map.put("eyePositionId", EyePositionEnums.getName(babyEyeCheck.getEyePositionId()) + (StringUtils.isNotEmpty(babyEyeCheck.getEyePositionOther()) ? ":" + babyEyeCheck.getEyePositionOther() : "")); map.put("redLeftReflex", parseYinYang(babyEyeCheck.getRedLeftReflex())); map.put("redReflex", parseYinYang(babyEyeCheck.getRedReflex(), babyEyeCheck.getRedReflexOther())); map.put("conjunctiva", parseYinYang(babyEyeCheck.getConjunctiva(), babyEyeCheck.getConjunctivaOther())); @@ -426,7 +426,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEye return RespBuilder.buildSuccess(); } List babyEyeChecks = mongoTemplate.find(Query.query(Criteria.where("babyId").is(babyId).and("hospitalId").in(hospitalIds).and("yn").ne("0")) - .with(new Sort(Sort.Direction.DESC, "checkTime")), BabyEyeCheck.class); + .with(new Sort(Sort.Direction.ASC, "checkTime")), BabyEyeCheck.class); List> rest = new ArrayList<>(); for (BabyEyeCheck babyEyeCheck : babyEyeChecks) { Map temp = new HashMap<>(); @@ -450,7 +450,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEye @Override public BaseResponse listInit() { - List> checkMonth = EnumUtil.toJson(CheckMonthEnums.class); /** 检查月龄 */ + List> checkMonth = EnumUtil.toJson(CheckMonthEnums2.class); /** 检查月龄 */ List> positive = new ArrayList<>(); /** 阳性项目 */ Map extEyelookMap = new HashMap<>(); -- 1.8.3.1