Commit 328c001cd4dfa393b687d105ec54b83273a0d69d

Authored by litao@lymsh.com
1 parent 4da79a4628

1

Showing 3 changed files with 89 additions and 4 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/BabyEyeCheck.java View file @ 328c001
... ... @@ -53,6 +53,7 @@
53 53 * 外眼观察(右)
54 54 */
55 55 private String extRightEyelook;
  56 + private String extRightEyelookOther;
56 57  
57 58 /**
58 59 * 瞬目反射(右)
... ... @@ -74,6 +75,7 @@
74 75 * 外眼观察(左)
75 76 */
76 77 private String extLeftEyelook;
  78 + private String extLeftEyelookOther;
77 79  
78 80 /**
79 81 * 瞬目反射(左)
... ... @@ -213,6 +215,22 @@
213 215 * 选择性注视卡检查
214 216 */
215 217 private String fixationCard;
  218 +
  219 + public String getExtLeftEyelookOther() {
  220 + return extLeftEyelookOther;
  221 + }
  222 +
  223 + public void setExtLeftEyelookOther(String extLeftEyelookOther) {
  224 + this.extLeftEyelookOther = extLeftEyelookOther;
  225 + }
  226 +
  227 + public String getExtRightEyelookOther() {
  228 + return extRightEyelookOther;
  229 + }
  230 +
  231 + public void setExtRightEyelookOther(String extRightEyelookOther) {
  232 + this.extRightEyelookOther = extRightEyelookOther;
  233 + }
216 234  
217 235 public String getOptometry() {
218 236 return optometry;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java View file @ 328c001
... ... @@ -88,10 +88,47 @@
88 88 Map<String, Object> map = ReflectionUtils.beanToMap(babyEyeCheck);
89 89 map.put("handleOpinionsId", HandleOpinionsEnums.getName(babyEyeCheck.getHandleOpinionsId()));
90 90 map.put("riskFactorId", EyeHighRiskEnums.getName(babyEyeCheck.getRiskFactorId()));
  91 + map.put("checkMonthId", CheckMonthEnums.getName(babyEyeCheck.getCheckMonthId()));
  92 + map.put("nextCheckMonthId", babyEyeCheck.getNextCheckMonthId());
  93 + map.put("extRightEyelook", parseYinYang(babyEyeCheck.getExtRightEyelook(), babyEyeCheck.getExtEyelookOther()));
  94 + map.put("extLeftEyelook", parseYinYang(babyEyeCheck.getExtLeftEyelook(), babyEyeCheck.getExtLeftEyelookOther()));
  95 + map.put("blinkRightReflex", parseYinYang(babyEyeCheck.getBlinkRightReflex()));
  96 + map.put("blinkLefttReflex", parseYinYang(babyEyeCheck.getBlinkLefttReflex()));
  97 + map.put("pupillaryRightReflex", parseYinYang(babyEyeCheck.getPupillaryRightReflex()));
  98 + map.put("pupillaryLeftReflex", parseYinYang(babyEyeCheck.getPupillaryLeftReflex()));
  99 + map.put("redRightReflex", parseYinYang(babyEyeCheck.getRedRightReflex()));
  100 + map.put("redLeftReflex", parseYinYang(babyEyeCheck.getRedLeftReflex()));
  101 + map.put("redReflex", parseYinYang(babyEyeCheck.getRedReflex(), babyEyeCheck.getRedReflexOther()));
  102 + map.put("conjunctiva", parseYinYang(babyEyeCheck.getConjunctiva(), babyEyeCheck.getConjunctivaOther()));
  103 + map.put("corneal", parseYinYang(babyEyeCheck.getCorneal(), babyEyeCheck.getCornealOther()));
  104 + map.put("lacrimalApparatus", parseYinYang(babyEyeCheck.getLacrimalApparatus(), babyEyeCheck.getLacrimalApparatusOther()));
91 105 CollectionUtils.removeNullValue(map);
92 106 return RespBuilder.buildSuccess(map);
93 107 }
94 108  
  109 + private String parseYinYang(String s) {
  110 + return parseYinYang(s, null);
  111 + }
  112 +
  113 + private String parseYinYang(String s, String other) {
  114 + if(StringUtils.isNotEmpty(s)) {
  115 + if(StringUtils.isNotEmpty(other)) {
  116 + if("yin".equals(s)) {
  117 + return "阴 (" + other + ")";
  118 + } else if("yang".equals(s)) {
  119 + return "阳 (" + other + ")";
  120 + }
  121 + } else {
  122 + if("yin".equals(s)) {
  123 + return "阴";
  124 + } else if("yang".equals(s)) {
  125 + return "阳";
  126 + }
  127 + }
  128 + }
  129 + return "";
  130 + }
  131 +
95 132 @Override
96 133 public BaseResponse edit(String id) {
97 134 BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class);
98 135  
... ... @@ -127,9 +164,19 @@
127 164 Query query = new Query(criteria);
128 165 query.with(new Sort(Sort.Direction.DESC, "checkTime"));
129 166 List<BabyEyeCheck> babyEyeChecks = mongoTemplate.find(query, BabyEyeCheck.class);
  167 + Integer count = babyEyeChecks.size();
  168 + doFilter(babyEyeChecks);
  169 +
  170 + List<BabyEyeCheck> datas = CollectionUtils.getPageIds(babyEyeChecks, page, limit);
  171 + return RespBuilder.buildSuccess(count, page, limit, setDatas(datas));
130 172 }
131 173 PageResult pageResult = findMongoPage(BabyEyeCheck.class, new Query(criteria).with(new Sort(Sort.Direction.DESC, "checkTime")), page, limit);
132 174 List<BabyEyeCheck> babyEyeChecks = (List<BabyEyeCheck>) pageResult.getGrid();
  175 + pageResult.setGrid(setDatas(babyEyeChecks));
  176 + return RespBuilder.buildSuccess(pageResult);
  177 + }
  178 +
  179 + private List<Map<String, Object>> setDatas(List<BabyEyeCheck> babyEyeChecks) {
133 180 List<Map<String, Object>> restMap = new ArrayList<>();
134 181 for (BabyEyeCheck babyEyeCheck : babyEyeChecks) {
135 182 Map<String, Object> temp = new HashMap<>();
136 183  
... ... @@ -153,10 +200,28 @@
153 200 temp.put("checkMonth", CheckMonthEnums.getName(babyEyeCheck.getCheckMonthId())); /** 检查月龄 */;
154 201 }
155 202 CollectionUtils.removeNullValue(temp);
156   - restMap.add(temp);
  203 + restMap.add(temp);
157 204 }
158   - pageResult.setGrid(restMap);
159   - return RespBuilder.buildSuccess(pageResult);
  205 + return null;
  206 + }
  207 +
  208 + private void doFilter(List<BabyEyeCheck> babyEyeChecks) {
  209 + for (BabyEyeCheck babyEyeCheck : babyEyeChecks) {
  210 + if(!"yang".equals(babyEyeCheck.getExtRightEyelook())
  211 + || !"yang".equals(babyEyeCheck.getExtLeftEyelook())
  212 + || !"yang".equals(babyEyeCheck.getBlinkRightReflex())
  213 + || !"yang".equals(babyEyeCheck.getBlinkLefttReflex())
  214 + || !"yang".equals(babyEyeCheck.getPupillaryRightReflex())
  215 + || !"yang".equals(babyEyeCheck.getPupillaryLeftReflex())
  216 + || !"yang".equals(babyEyeCheck.getRedRightReflex())
  217 + || !"yang".equals(babyEyeCheck.getRedLeftReflex())
  218 + || !"yang".equals(babyEyeCheck.getRedReflex())
  219 + || !"yang".equals(babyEyeCheck.getConjunctiva())
  220 + || !"yang".equals(babyEyeCheck.getCorneal())
  221 + || !"yang".equals(babyEyeCheck.getLacrimalApparatus())) {
  222 + babyEyeChecks.remove(babyEyeCheck);
  223 + }
  224 + }
160 225 }
161 226  
162 227 @Override
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java View file @ 328c001
1 1 package com.lyms.platform.operate.web.utils;
2 2  
3 3 import org.apache.commons.collections.MapUtils;
  4 +import org.apache.commons.collections.map.HashedMap;
4 5 import org.apache.commons.lang3.StringUtils;
5 6 import org.springframework.util.Assert;
6 7  
... ... @@ -36,7 +37,8 @@
36 37 while (iterator.hasNext()) {
37 38 Map.Entry<String, Object> set = iterator.next();
38 39 if(set.getValue() == null) {
39   - iterator.remove();
  40 +// iterator.remove();
  41 + set.setValue("");
40 42 }
41 43 }
42 44 }