Commit 7e1e2bc011c83fcd3ba0f9636657bdd956d05551

Authored by Administrator
1 parent 9e4196351f

抚宁眼保健功能个性定制开发

Showing 2 changed files with 153 additions and 96 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/BabyEyeCheck.java View file @ 7e1e2bc
... ... @@ -10,7 +10,7 @@
10 10 /**
11 11 * 儿童眼保健检查
12 12 */
13   -@Document(collection="lyms_baby_eye_check")
  13 +@Document(collection = "lyms_baby_eye_check")
14 14 public class BabyEyeCheck extends BaseModel {
15 15  
16 16  
17 17  
... ... @@ -110,8 +110,11 @@
110 110 * 瞳孔红光反射(左)
111 111 */
112 112 private String redLeftReflex;
  113 + /**
  114 + * 红光反射医生判定阳性
  115 + */
  116 + private String redLeft2;
113 117  
114   -
115 118 /**
116 119 * 眼底检查结果
117 120 */
... ... @@ -164,6 +167,7 @@
164 167 private String r2;
165 168 private String l1;
166 169 private String l2;
  170 + private String y2;
167 171  
168 172 /**
169 173 * 验光
... ... @@ -198,6 +202,8 @@
198 202 */
199 203 private String eyePositionId;
200 204 private String eyePositionOther;
  205 + //医生判定判断阳性
  206 + private String eyePosition2;
201 207  
202 208 /**
203 209 * 双眼视觉
... ... @@ -216,6 +222,8 @@
216 222 */
217 223 private String lVision;
218 224 private String rVision;
  225 + //视力医生判定阳性
  226 + private String vision2;
219 227  
220 228 /**
221 229 * 屈光
... ... @@ -224,6 +232,7 @@
224 232 private String refractionL2;
225 233 private String refractionR1;
226 234 private String refractionR2;
  235 + private String refraction2;
227 236  
228 237 /**
229 238 * 视动性眼震
... ... @@ -234,6 +243,46 @@
234 243 * 选择性注视卡检查
235 244 */
236 245 private String fixationCard;
  246 +
  247 + public String getRedLeft2() {
  248 + return redLeft2;
  249 + }
  250 +
  251 + public void setRedLeft2(String redLeft2) {
  252 + this.redLeft2 = redLeft2;
  253 + }
  254 +
  255 + public String getY2() {
  256 + return y2;
  257 + }
  258 +
  259 + public void setY2(String y2) {
  260 + this.y2 = y2;
  261 + }
  262 +
  263 + public String getEyePosition2() {
  264 + return eyePosition2;
  265 + }
  266 +
  267 + public void setEyePosition2(String eyePosition2) {
  268 + this.eyePosition2 = eyePosition2;
  269 + }
  270 +
  271 + public String getVision2() {
  272 + return vision2;
  273 + }
  274 +
  275 + public void setVision2(String vision2) {
  276 + this.vision2 = vision2;
  277 + }
  278 +
  279 + public String getRefraction2() {
  280 + return refraction2;
  281 + }
  282 +
  283 + public void setRefraction2(String refraction2) {
  284 + this.refraction2 = refraction2;
  285 + }
237 286  
238 287 public String getErrormsg() {
239 288 return errormsg;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java View file @ 7e1e2bc
... ... @@ -39,7 +39,7 @@
39 39 * Created by lt on 2017/8/5 0005
40 40 */
41 41 @Service
42   -public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeCheckService {
  42 +public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeCheckService {
43 43 @Autowired
44 44 private BabyEyeCheckMapper babyEyeCheckMapper;
45 45  
... ... @@ -86,8 +86,8 @@
86 86 public BaseResponse addOrUpdate(Integer userId, BabyEyeCheck babyEyeCheck) {
87 87 String hospitalId = autoMatchFacade.getHospitalId(userId);
88 88  
89   - if(StringUtils.isEmpty(babyEyeCheck.getId())) {
90   - if(!mongoUtil.buildArchive(userId, babyEyeCheck.getBabyId())) {
  89 + if (StringUtils.isEmpty(babyEyeCheck.getId())) {
  90 + if (!mongoUtil.buildArchive(userId, babyEyeCheck.getBabyId())) {
91 91 return RespBuilder.buildSuccess(ResponseCode.NEED_BUILD);
92 92 }
93 93 babyEyeCheck.setCreated(new Date());
94 94  
... ... @@ -95,13 +95,13 @@
95 95 babyEyeCheck.setOperaterId(userId + "");
96 96 babyEyeCheck.setHospitalId(autoMatchFacade.getHospitalId(userId));
97 97 BabyModel babyModel = mongoTemplate.findById(babyEyeCheck.getBabyId(), BabyModel.class);
98   - if(babyModel != null) {
  98 + if (babyModel != null) {
99 99 babyEyeCheck.setPid(babyModel.getPid());
100 100 babyEyeCheck.setBirth(babyModel.getBirth());
101 101 }
102 102 syncData("ADD", babyEyeCheck, "");
103 103 mongoTemplate.save(babyEyeCheck);
104   -
  104 +
105 105 // 添加追访眼保检查
106 106 Date nextCheckTime = babyEyeCheck.getNextCheckTime();
107 107 if (null != nextCheckTime) {
... ... @@ -113,7 +113,7 @@
113 113 model.setId(babyEyeCheck.getBabyId());
114 114 babyAfterVisitService.addOrUpdateAfterVisitData(model, TYPE_STATISTICS, STATUS_TYPE_EYE_CHECK);
115 115  
116   - if(CollectionUtils.isNotEmpty(babyEyeCheck.getRiskFactorId())) {
  116 + if (CollectionUtils.isNotEmpty(babyEyeCheck.getRiskFactorId())) {
117 117 String riskFactor = org.apache.commons.lang3.StringUtils.join(babyEyeCheck.getRiskFactorId().toArray(), ",");
118 118 babyEyeCheck.setRiskFactor(riskFactor);
119 119 }
120 120  
121 121  
122 122  
... ... @@ -123,24 +123,23 @@
123 123  
124 124 } else {
125 125 babyEyeCheck.setOperaterId(userId.toString());
126   - List<BabyEyeCheck> before = mongoTemplate.find(Query.query(Criteria.where("id").is(babyEyeCheck.getId())), BabyEyeCheck.class);
  126 + List<BabyEyeCheck> before = mongoTemplate.find(Query.query(Criteria.where("id").is(babyEyeCheck.getId())), BabyEyeCheck.class);
127 127  
128 128 Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(babyEyeCheck));
129 129 mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(babyEyeCheck.getId())), update, BabyEyeCheck.class);
130 130  
131 131 syncData("UPDATE", babyEyeCheck, babyEyeCheck.getId());
132 132  
133   - if(CollectionUtils.isNotEmpty(babyEyeCheck.getRiskFactorId())) {
  133 + if (CollectionUtils.isNotEmpty(babyEyeCheck.getRiskFactorId())) {
134 134 String riskFactor = org.apache.commons.lang3.StringUtils.join(babyEyeCheck.getRiskFactorId().toArray(), ",");
135 135 babyEyeCheck.setRiskFactor(riskFactor);
136 136 }
137 137 babyEyeCheckMapper.update(babyEyeCheck);
138 138  
139   - List<BabyEyeCheck> after = mongoTemplate.find(Query.query(Criteria.where("id").is(babyEyeCheck.getId())), BabyEyeCheck.class);
  139 + List<BabyEyeCheck> after = mongoTemplate.find(Query.query(Criteria.where("id").is(babyEyeCheck.getId())), BabyEyeCheck.class);
140 140  
141   - if (CollectionUtils.isNotEmpty(before) && CollectionUtils.isNotEmpty(after))
142   - {
143   - operateLogFacade.addModifyOptLog(userId, Integer.valueOf(hospitalId), before.get(0),after.get(0), OptActionEnums.UPDATE.getId(), "修改儿童眼保检查");
  141 + if (CollectionUtils.isNotEmpty(before) && CollectionUtils.isNotEmpty(after)) {
  142 + operateLogFacade.addModifyOptLog(userId, Integer.valueOf(hospitalId), before.get(0), after.get(0), OptActionEnums.UPDATE.getId(), "修改儿童眼保检查");
144 143 }
145 144  
146 145 // 添加追访眼保检查
... ... @@ -158,7 +157,7 @@
158 157 @Override
159 158 public BaseResponse info(String id) {
160 159 BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class);
161   - if(babyEyeCheck == null) {
  160 + if (babyEyeCheck == null) {
162 161 return RespBuilder.buildSuccess();
163 162 }
164 163 Map<String, Object> map = ReflectionUtils.beanToMap(babyEyeCheck);
165 164  
166 165  
167 166  
168 167  
169 168  
170 169  
171 170  
172 171  
173 172  
174 173  
175 174  
176 175  
177 176  
178 177  
179 178  
180 179  
... ... @@ -167,72 +166,72 @@
167 166 map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime()));
168 167 map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime()));
169 168 String doctor = babyEyeCheck.getDoctor();
170   - if(StringUtils.isNotEmpty(doctor)) {
  169 + if (StringUtils.isNotEmpty(doctor)) {
171 170 map.put("doctor", couponMapper.getUserName(doctor));
172 171 }
173 172 map.put("handleOpinionsId", HandleOpinionsEnums.getName(babyEyeCheck.getHandleOpinionsId()));
174 173 List<String> riskFactorNames = EyeHighRiskEnums.getName(babyEyeCheck.getRiskFactorId());
175   - if(CollectionUtils.isNotEmpty(riskFactorNames)) {
  174 + if (CollectionUtils.isNotEmpty(riskFactorNames)) {
176 175 for (int i = 0; i < riskFactorNames.size(); i++) {
177   - if("其他".equals(riskFactorNames.get(i))) {
  176 + if ("其他".equals(riskFactorNames.get(i))) {
178 177 riskFactorNames.set(i, "其他:" + (babyEyeCheck.getRiskFactorIdOther() == null ? "" : map.get("riskFactorIdOther").toString()));
179 178 }
180 179 }
181 180 }
182 181  
183 182 StringBuilder refractometer = new StringBuilder();
184   - if(StringUtils.isNotEmpty(babyEyeCheck.getR1())) {
185   - refractometer.append("R:S( ").append(babyEyeCheck.getR1()).append( " )");
  183 + if (StringUtils.isNotEmpty(babyEyeCheck.getR1())) {
  184 + refractometer.append("R:S( ").append(babyEyeCheck.getR1()).append(" )");
186 185 }
187   - if(StringUtils.isNotEmpty(babyEyeCheck.getR2())) {
188   - if(refractometer.length() != 0) {
  186 + if (StringUtils.isNotEmpty(babyEyeCheck.getR2())) {
  187 + if (refractometer.length() != 0) {
189 188 refractometer.append(" ");
190 189 }
191   - refractometer.append("R:DC( ").append(babyEyeCheck.getR2()).append( " ) D");
  190 + refractometer.append("R:DC( ").append(babyEyeCheck.getR2()).append(" ) D");
192 191 }
193 192 boolean flag = false;
194   - if(StringUtils.isNotEmpty(babyEyeCheck.getL1())) {
195   - if(refractometer.length() != 0) {
  193 + if (StringUtils.isNotEmpty(babyEyeCheck.getL1())) {
  194 + if (refractometer.length() != 0) {
196 195 refractometer.append(", ");
197 196 flag = true;
198 197 }
199   - refractometer.append("L:S( ").append(babyEyeCheck.getL1()).append( " ) ");
  198 + refractometer.append("L:S( ").append(babyEyeCheck.getL1()).append(" ) ");
200 199 }
201   - if(StringUtils.isNotEmpty(babyEyeCheck.getL2())) {
202   - if(!flag) {
203   - if(StringUtils.isNotEmpty(babyEyeCheck.getR1()) || StringUtils.isNotEmpty(babyEyeCheck.getR2())) {
  200 + if (StringUtils.isNotEmpty(babyEyeCheck.getL2())) {
  201 + if (!flag) {
  202 + if (StringUtils.isNotEmpty(babyEyeCheck.getR1()) || StringUtils.isNotEmpty(babyEyeCheck.getR2())) {
204 203 refractometer.append(", ");
205 204 }
206 205 }
207   - refractometer.append("L:DC( ").append(babyEyeCheck.getL2()).append( " ) D");
  206 + refractometer.append("L:DC( ").append(babyEyeCheck.getL2()).append(" ) D");
208 207 }
209 208 map.put("refractometer", refractometer.toString());
210 209  
211 210 StringBuilder refraction = new StringBuilder();
212   - if(StringUtils.isNotEmpty(babyEyeCheck.getRefractionR1())) {
213   - refraction.append("R:S( ").append(babyEyeCheck.getRefractionR1()).append( " )");
  211 + if (StringUtils.isNotEmpty(babyEyeCheck.getRefractionR1())) {
  212 + refraction.append("R:S( ").append(babyEyeCheck.getRefractionR1()).append(" )");
214 213 }
215   - if(StringUtils.isNotEmpty(babyEyeCheck.getRefractionR2())) {
216   - if(refraction.length() != 0) {
  214 + if (StringUtils.isNotEmpty(babyEyeCheck.getRefractionR2())) {
  215 + if (refraction.length() != 0) {
217 216 refraction.append(" ");
218 217 }
219   - refraction.append("R:DC( ").append(babyEyeCheck.getRefractionR2()).append( " ) D");
  218 + refraction.append("R:DC( ").append(babyEyeCheck.getRefractionR2()).append(" ) D");
220 219 }
221 220 boolean flag2 = false;
222   - if(StringUtils.isNotEmpty(babyEyeCheck.getRefractionL1())) {
223   - if(refraction.length() != 0) {
  221 + if (StringUtils.isNotEmpty(babyEyeCheck.getRefractionL1())) {
  222 + if (refraction.length() != 0) {
224 223 refraction.append(", ");
225 224 flag2 = true;
226 225 }
227   - refraction.append("L:S( ").append(babyEyeCheck.getRefractionL1()).append( " ) ");
  226 + refraction.append("L:S( ").append(babyEyeCheck.getRefractionL1()).append(" ) ");
228 227 }
229   - if(StringUtils.isNotEmpty(babyEyeCheck.getRefractionL2())) {
230   - if(!flag2) {
231   - if(StringUtils.isNotEmpty(babyEyeCheck.getRefractionR1()) || StringUtils.isNotEmpty(babyEyeCheck.getRefractionR2())) {
  228 + if (StringUtils.isNotEmpty(babyEyeCheck.getRefractionL2())) {
  229 + if (!flag2) {
  230 + if (StringUtils.isNotEmpty(babyEyeCheck.getRefractionR1()) || StringUtils.isNotEmpty(babyEyeCheck.getRefractionR2())) {
232 231 refraction.append(", ");
233 232 }
234 233 }
235   - refraction.append("L:DC( ").append(babyEyeCheck.getRefractionL2()).append( " ) D");
  234 + refraction.append("L:DC( ").append(babyEyeCheck.getRefractionL2()).append(" ) D");
236 235 }
237 236 map.put("refraction", refraction.toString());
238 237  
... ... @@ -254,6 +253,12 @@
254 253 map.put("conjunctiva", parseYinYang(babyEyeCheck.getConjunctiva(), babyEyeCheck.getConjunctivaOther()));
255 254 map.put("corneal", parseYinYang(babyEyeCheck.getCorneal(), babyEyeCheck.getCornealOther()));
256 255 map.put("lacrimalApparatus", parseYinYang(babyEyeCheck.getLacrimalApparatus(), babyEyeCheck.getLacrimalApparatusOther()));
  256 + //一下都是医生选定阳性
  257 + map.put("eyePosition2", babyEyeCheck.getEyePosition2());
  258 + map.put("redLeft2", babyEyeCheck.getRedLeft2());
  259 + map.put("vision2", babyEyeCheck.getVision2());
  260 + map.put("y2", babyEyeCheck.getY2());
  261 + map.put("refraction2", babyEyeCheck.getRefraction2());
257 262 //
258 263 CollectionUtils.removeNullValue(map);
259 264 return RespBuilder.buildSuccess(map);
260 265  
261 266  
262 267  
... ... @@ -264,17 +269,17 @@
264 269 }
265 270  
266 271 private String parseYinYang(String s, String other) {
267   - if(StringUtils.isNotEmpty(s)) {
268   - if(StringUtils.isNotEmpty(other)) {
269   - if("yin".equals(s)) {
  272 + if (StringUtils.isNotEmpty(s)) {
  273 + if (StringUtils.isNotEmpty(other)) {
  274 + if ("yin".equals(s)) {
270 275 return "- (" + other + ")";
271   - } else if("yang".equals(s)) {
  276 + } else if ("yang".equals(s)) {
272 277 return "+ (" + other + ")";
273 278 }
274 279 } else {
275   - if("yin".equals(s)) {
  280 + if ("yin".equals(s)) {
276 281 return "-";
277   - } else if("yang".equals(s)) {
  282 + } else if ("yang".equals(s)) {
278 283 return "+";
279 284 }
280 285 }
281 286  
... ... @@ -287,11 +292,11 @@
287 292 BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class);
288 293 Map<String, Object> map = ReflectionUtils.beanToMap(babyEyeCheck);
289 294 map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime()));
290   - if(StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) {
  295 + if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) {
291 296 map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + "");
292 297 }
293 298 map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime()));
294   - if(babyEyeCheck.getRiskFactorId() != null) {
  299 + if (babyEyeCheck.getRiskFactorId() != null) {
295 300 List<String> riskFactorId = babyEyeCheck.getRiskFactorId();
296 301 List<Map<String, Object>> rest = new ArrayList<>();
297 302 for (String s : riskFactorId) {
298 303  
... ... @@ -307,15 +312,14 @@
307 312 }
308 313  
309 314 @Override
310   - public BaseResponse delete(String id,Integer userId) {
  315 + public BaseResponse delete(String id, Integer userId) {
311 316 String hospitalId = autoMatchFacade.getHospitalId(userId);
312 317  
313 318 mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(id)), Update.update("yn", "0"), BabyEyeCheck.class);
314 319 babyEyeCheckMapper.deleteById(id);
315 320  
316   - List<BabyEyeCheck> list = mongoTemplate.find(Query.query(Criteria.where("id").is(id)),BabyEyeCheck.class);
317   - if (CollectionUtils.isNotEmpty(list))
318   - {
  321 + List<BabyEyeCheck> list = mongoTemplate.find(Query.query(Criteria.where("id").is(id)), BabyEyeCheck.class);
  322 + if (CollectionUtils.isNotEmpty(list)) {
319 323 operateLogFacade.addDeleteOptLog(userId, Integer.parseInt(hospitalId), list.get(0), OptActionEnums.DELETE.getId(), "删除眼保健检查");
320 324 }
321 325  
322 326  
323 327  
324 328  
325 329  
326 330  
327 331  
328 332  
329 333  
... ... @@ -326,40 +330,40 @@
326 330 public BaseResponse list(Integer userId, Date startDate, Date endDate, String doctor, String key, Integer currentMonthStart, Integer currentMonthEnd, String chechMonth, boolean positive, String positiveIds, Integer page, Integer limit, Date bookStartDate, Date bookEndDate) {
327 331 String hospitalId = autoMatchFacade.getHospitalId(userId);
328 332 Criteria criteria = Criteria.where("yn").ne("0").and("hospitalId").is(hospitalId);
329   - if(startDate != null && endDate != null) {
  333 + if (startDate != null && endDate != null) {
330 334 criteria.and("checkTime").gte(startDate).lt(DateUtil.addDay(endDate, 1));
331 335 }
332   - if(bookStartDate != null && bookEndDate != null) {
  336 + if (bookStartDate != null && bookEndDate != null) {
333 337 criteria.and("nextCheckTime").gte(bookStartDate).lt(DateUtil.addDay(bookEndDate, 1));
334 338 }
335   - if(org.apache.commons.lang.StringUtils.isNotBlank(doctor)) {
  339 + if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)) {
336 340 criteria.and("doctor").is(doctor);
337 341 }
338   - if(StringUtils.isNotEmpty(chechMonth)) {
  342 + if (StringUtils.isNotEmpty(chechMonth)) {
339 343 criteria.and("checkMonthId").is(chechMonth);
340 344 }
341   - if(currentMonthStart != null && currentMonthEnd != null) {
  345 + if (currentMonthStart != null && currentMonthEnd != null) {
342 346 Date start = DateUtil.getBirthStart(currentMonthEnd);
343 347 Date end = DateUtil.getBirthEnd(currentMonthStart);
344 348 criteria.and("birth").gte(start).lt(end);
345 349 }
346 350  
347   - if(org.apache.commons.lang.StringUtils.isNotBlank(key)) {
  351 + if (org.apache.commons.lang.StringUtils.isNotBlank(key)) {
348 352 Criteria c = new Criteria();
349 353 c.orOperator(Criteria.where("mphone").is(key), Criteria.where("name").regex(key), Criteria.where("mcertNo").is(key)).and("yn").ne(0);
350 354 List<BabyModel> babyModels = mongoUtil.findField(BabyModel.class, c, "id");
351 355 List<String> babyIds = CollectionUtils.getId(babyModels, "id", String.class);
352 356 criteria.and("babyId").in(babyIds);
353 357 }
354   - if(positive) {
  358 + if (positive) {
355 359 Query query = new Query(criteria);
356 360 query.with(new Sort(Sort.Direction.DESC, "checkTime"));
357 361 List<BabyEyeCheck> babyEyeChecks = mongoTemplate.find(query, BabyEyeCheck.class);
358 362 doFilter(babyEyeChecks);
359 363  
360   - if(StringUtils.isNotEmpty(positiveIds)) {
  364 + if (StringUtils.isNotEmpty(positiveIds)) {
361 365 List<String> ids = CollectionUtils.asList(positiveIds, String.class);
362   - if(CollectionUtils.isNotEmpty(ids)) {
  366 + if (CollectionUtils.isNotEmpty(ids)) {
363 367 doFilter(babyEyeChecks, ids);
364 368 }
365 369 }
... ... @@ -381,7 +385,7 @@
381 385 for (BabyEyeCheck babyEyeCheck : babyEyeChecks) {
382 386 for (String id : ids) {
383 387 String value = (String) ReflectUtil.invoke(babyEyeCheck, "get" + StringUtils.captureName(id));
384   - if(!"yang".equals(value)) {
  388 + if (!"yang".equals(value)) {
385 389 deleteList.add(babyEyeCheck);
386 390 }
387 391 }
388 392  
389 393  
390 394  
391 395  
392 396  
393 397  
394 398  
395 399  
396 400  
397 401  
398 402  
399 403  
400 404  
401 405  
402 406  
403 407  
404 408  
405 409  
406 410  
... ... @@ -397,69 +401,69 @@
397 401 temp.put("babyId", babyEyeCheck.getBabyId());
398 402 temp.put("pid", babyEyeCheck.getPid());
399 403 BabyModel babyModel = mongoTemplate.findById(babyEyeCheck.getBabyId(), BabyModel.class);
400   - if(babyModel != null) {
  404 + if (babyModel != null) {
401 405 temp.put("mCardNo", babyModel.getMcertNo()); /** 母亲证件号 */
402 406 temp.put("vcCardNo", babyModel.getVcCardNo()); /** 就诊卡号 */
403 407 temp.put("pcerteTypeId", babyModel.getMcertTypeId()); /** 证件类型 */
404 408  
405 409 temp.put("name", babyModel.getName());
406   - if(babyModel.getSex() != null) {
  410 + if (babyModel.getSex() != null) {
407 411 temp.put("sex", SexEnum.getTextById(babyModel.getSex()));
408 412 }
409 413 String parentId = babyModel.getParentId();
410   - if(StringUtils.isNotEmpty(parentId)) {
  414 + if (StringUtils.isNotEmpty(parentId)) {
411 415 Patients patients = mongoTemplate.findById(parentId, Patients.class);
412   - if(patients != null) {
  416 + if (patients != null) {
413 417 temp.put("mname", patients.getUsername());
414 418 }
415 419 }
416   - temp.put("birth", DateUtil.getYyyyMmDd( babyModel.getBirth()));
  420 + temp.put("birth", DateUtil.getYyyyMmDd(babyModel.getBirth()));
417 421 }
418   - if(StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) {
  422 + if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) {
419 423 temp.put("checkMonth", CheckMonthEnums.getName(babyEyeCheck.getCheckMonthId())); /** 检查月龄 */;
420 424 }
421 425  
422 426 StringBuilder positive = new StringBuilder(); /** 阳性项目 */
423   - if("yang".equals(babyEyeCheck.getExtRightEyelook())) {
  427 + if ("yang".equals(babyEyeCheck.getExtRightEyelook())) {
424 428 positive.append("外眼观察(右) ");
425 429 }
426   - if("yang".equals(babyEyeCheck.getExtLeftEyelook())) {
  430 + if ("yang".equals(babyEyeCheck.getExtLeftEyelook())) {
427 431 positive.append("外眼观察(左) ");
428 432 }
429   - if("yang".equals(babyEyeCheck.getBlinkRightReflex())) {
  433 + if ("yang".equals(babyEyeCheck.getBlinkRightReflex())) {
430 434 positive.append("瞬目反射(右) ");
431 435 }
432   - if("yang".equals(babyEyeCheck.getBlinkLefttReflex())) {
  436 + if ("yang".equals(babyEyeCheck.getBlinkLefttReflex())) {
433 437 positive.append("瞬目反射(左) ");
434 438 }
435   - if("yang".equals(babyEyeCheck.getPupillaryRightReflex())) {
  439 + if ("yang".equals(babyEyeCheck.getPupillaryRightReflex())) {
436 440 positive.append("瞳孔对光反射(右) ");
437 441 }
438   - if("yang".equals(babyEyeCheck.getPupillaryLeftReflex())) {
  442 + if ("yang".equals(babyEyeCheck.getPupillaryLeftReflex())) {
439 443 positive.append("瞳孔对光反射(左) ");
440 444 }
441   - if("yang".equals(babyEyeCheck.getRedRightReflex())) {
  445 + if ("yang".equals(babyEyeCheck.getRedRightReflex())) {
442 446 positive.append("瞳孔红光反射(右) ");
443 447 }
444   - if("yang".equals(babyEyeCheck.getRedLeftReflex())) {
  448 + if ("yang".equals(babyEyeCheck.getRedLeftReflex())) {
445 449 positive.append("瞳孔红光反射(左) ");
446 450 }
447   - if("yang".equals(babyEyeCheck.getRedReflex())) {
  451 + if ("yang".equals(babyEyeCheck.getRedReflex())) {
448 452 positive.append("红光反射 ");
449 453 }
450   - if("yang".equals(babyEyeCheck.getConjunctiva())) {
  454 + if ("yang".equals(babyEyeCheck.getConjunctiva())) {
451 455 positive.append("结膜 ");
452 456 }
453   - if("yang".equals(babyEyeCheck.getCorneal())) {
  457 + if ("yang".equals(babyEyeCheck.getCorneal())) {
454 458 positive.append("角膜 ");
455 459 }
456   - if("yang".equals(babyEyeCheck.getLacrimalApparatus())) {
  460 + if ("yang".equals(babyEyeCheck.getLacrimalApparatus())) {
457 461 positive.append("泪器 ");
458 462 }
459   - if("yang".equals(babyEyeCheck.getNystagmus())) {
  463 + if ("yang".equals(babyEyeCheck.getNystagmus())) {
460 464 positive.append("视动性眼震 ");
461 465 }
462   - if("yang".equals(babyEyeCheck.getExtEyelook())) {
  466 + if ("yang".equals(babyEyeCheck.getExtEyelook())) {
463 467 positive.append("外眼观察 ");
464 468 }
465 469  
... ... @@ -476,7 +480,7 @@
476 480 Iterator<BabyEyeCheck> iterator = babyEyeChecks.iterator();
477 481 while (iterator.hasNext()) {
478 482 BabyEyeCheck babyEyeCheck = iterator.next();
479   - if(!"yang".equals(babyEyeCheck.getExtRightEyelook())
  483 + if (!"yang".equals(babyEyeCheck.getExtRightEyelook())
480 484 && !"yang".equals(babyEyeCheck.getExtLeftEyelook())
481 485 && !"yang".equals(babyEyeCheck.getBlinkRightReflex())
482 486 && !"yang".equals(babyEyeCheck.getBlinkLefttReflex())
... ... @@ -489,7 +493,13 @@
489 493 && !"yang".equals(babyEyeCheck.getCorneal())
490 494 && !"yang".equals(babyEyeCheck.getExtEyelook())
491 495 && !"yang".equals(babyEyeCheck.getNystagmus())
492   - && !"yang".equals(babyEyeCheck.getLacrimalApparatus())) {
  496 + && !"yang".equals(babyEyeCheck.getLacrimalApparatus())
  497 + && !"yang".equals(babyEyeCheck.getEyePosition2())
  498 + && !"yang".equals(babyEyeCheck.getRedLeft2())
  499 + && !"yang".equals(babyEyeCheck.getVision2())
  500 + && !"yang".equals(babyEyeCheck.getY2())
  501 + && !"yang".equals(babyEyeCheck.getRefraction2())
  502 + ) {
493 503 iterator.remove();
494 504 }
495 505 }
... ... @@ -498,7 +508,7 @@
498 508 @Override
499 509 public BaseResponse query(Integer userId, String babyId) {
500 510 List<String> hospitalIds = organizationGroupsFacade.findGroupHospital(userId, false);
501   - if(CollectionUtils.isEmpty(hospitalIds)) {
  511 + if (CollectionUtils.isEmpty(hospitalIds)) {
502 512 return RespBuilder.buildSuccess();
503 513 }
504 514 List<BabyEyeCheck> babyEyeChecks = mongoTemplate.find(Query.query(Criteria.where("babyId").is(babyId).and("hospitalId").in(hospitalIds).and("yn").ne("0"))
505 515  
... ... @@ -511,9 +521,9 @@
511 521 temp.put("pid", babyEyeCheck.getPid());
512 522 temp.put("checkMonth", CheckMonthEnums.getName(babyEyeCheck.getCheckMonthId()));
513 523 BabyModel babyModel = mongoTemplate.findById(babyEyeCheck.getBabyId(), BabyModel.class);
514   - if(babyModel != null) {
  524 + if (babyModel != null) {
515 525 temp.put("name", babyModel.getName());
516   - if(babyModel.getSex() != null) {
  526 + if (babyModel.getSex() != null) {
517 527 temp.put("sex", SexEnum.getTextById(babyModel.getSex()));
518 528 }
519 529 }
... ... @@ -619,8 +629,8 @@
619 629 cnames.put("doctor", "检查医生");
620 630 cnames.put("checkTime", "检查日期");
621 631  
622   - List<Map<String,Object>> results = new ArrayList<>();
623   - if(org.apache.commons.collections.CollectionUtils.isNotEmpty(datas)) {
  632 + List<Map<String, Object>> results = new ArrayList<>();
  633 + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(datas)) {
624 634 int i = 0;
625 635 for (Map<String, Object> data : datas) {
626 636 Map<String, Object> result = new LinkedHashMap<>();
... ... @@ -640,8 +650,7 @@
640 650 ResponseUtil.responseExcel(cnames, results, response);
641 651 }
642 652  
643   - private void syncData(String action,Object data,String id)
644   - {
  653 + private void syncData(String action, Object data, String id) {
645 654 try {
646 655 SyncDataModel model = new SyncDataModel();
647 656 model.setAction(action);
... ... @@ -657,9 +666,8 @@
657 666 }
658 667 model.setStatus(1);
659 668 mongoTemplate.insert(model);
660   - }catch (Exception e)
661   - {
662   - ExceptionUtils.catchException(e,"眼保健数据同步");
  669 + } catch (Exception e) {
  670 + ExceptionUtils.catchException(e, "眼保健数据同步");
663 671 }
664 672 }
665 673 }