Commit 92b5736d4b372e05ed3935b464ffe47e761c1161

Authored by jesse.wang
1 parent e75ba75f71

孤独症初筛根据月龄查询套餐内容

Showing 3 changed files with 120 additions and 1 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/PrimaryScreening.java View file @ 92b5736
  1 +package com.lyms.platform.pojo;
  2 +
  3 +import com.lyms.platform.common.result.BaseModel;
  4 +
  5 +/**
  6 + * 孤独症初筛记录
  7 + */
  8 +public class PrimaryScreening extends BaseModel {
  9 +
  10 +
  11 +
  12 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PrimaryScreeningController.java View file @ 92b5736
1 1 package com.lyms.platform.operate.web.controller;
2 2  
  3 +import com.lyms.platform.common.annotation.TokenRequired;
3 4 import com.lyms.platform.common.base.BaseMap;
4 5 import com.lyms.platform.common.constants.PrimaryScreeningConstants;
5 6 import com.lyms.platform.common.result.BaseResponse;
6 7 import com.lyms.platform.common.result.RespBuilder;
  8 +import com.lyms.platform.operate.web.facade.PrimaryScreeningFacade;
7 9 import org.slf4j.Logger;
8 10 import org.slf4j.LoggerFactory;
  11 +import org.springframework.beans.factory.annotation.Autowired;
9 12 import org.springframework.stereotype.Controller;
10 13 import org.springframework.web.bind.annotation.RequestMapping;
11 14 import org.springframework.web.bind.annotation.RequestMethod;
12 15  
... ... @@ -25,7 +28,10 @@
25 28 //日志调测器
26 29 private static final Logger logger = LoggerFactory.getLogger(PrimaryScreeningController.class);
27 30  
  31 + @Autowired
  32 + private PrimaryScreeningFacade primaryScreeningFacade;
28 33  
  34 +
29 35 /**
30 36 * 根据月龄套餐获取相应数据
31 37 * B(3, "3月龄"),
... ... @@ -44,7 +50,7 @@
44 50 * @param monthAge
45 51 * @return
46 52 */
47   - @RequestMapping(value = "/queryMonthAgeInfo", method = RequestMethod.GET)
  53 + @RequestMapping(value = "/getMonthAgeInfo", method = RequestMethod.GET)
48 54 @ResponseBody
49 55 public BaseResponse queryMonthAgeInfo(HttpServletRequest request,
50 56 String monthAge) {
... ... @@ -127,6 +133,17 @@
127 133 return RespBuilder.buildSuccess(res);
128 134 }
129 135  
  136 + /**
  137 + * 检查记录展示(含儿童档案)
  138 + * @param id
  139 + * @return
  140 + */
  141 + @ResponseBody
  142 + @TokenRequired
  143 + @RequestMapping(value = "/queryDateList",method = RequestMethod.GET)
  144 + public BaseResponse queryDateList(String id) {
  145 + return primaryScreeningFacade.queryDateList(id);
  146 + }
130 147  
131 148 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PrimaryScreeningFacade.java View file @ 92b5736
  1 +package com.lyms.platform.operate.web.facade;
  2 +
  3 +import com.lyms.platform.common.constants.ErrorCodeConstants;
  4 +import com.lyms.platform.common.enums.YnEnums;
  5 +import com.lyms.platform.common.result.BaseObjectResponse;
  6 +import com.lyms.platform.common.result.BaseResponse;
  7 +import com.lyms.platform.common.utils.DateUtil;
  8 +import com.lyms.platform.operate.web.service.impl.BaseServiceImpl;
  9 +import com.lyms.platform.permission.model.Organization;
  10 +import com.lyms.platform.permission.service.OrganizationService;
  11 +import com.lyms.platform.pojo.BabyModel;
  12 +import com.lyms.platform.query.LhBabyEyelCheckQuery;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.data.mongodb.core.MongoTemplate;
  15 +import org.springframework.stereotype.Component;
  16 +
  17 +import java.util.ArrayList;
  18 +import java.util.HashMap;
  19 +import java.util.List;
  20 +import java.util.Map;
  21 +
  22 +/**
  23 + * 孤独症初筛业务
  24 + */
  25 +@Component
  26 +public class PrimaryScreeningFacade extends BaseServiceImpl {
  27 +
  28 + @Autowired
  29 + private MongoTemplate mongoTemplate;
  30 +
  31 + @Autowired
  32 + private OrganizationService organizationService;
  33 +
  34 + /**
  35 + * 查询历史记录
  36 + * @param babyId
  37 + * @return
  38 + */
  39 + public BaseResponse queryDateList(String babyId) {
  40 +
  41 + List<Map<String, Object>> rest = new ArrayList<>();
  42 + //儿童档案
  43 + BabyModel babyModel = mongoTemplate.findById(babyId, BabyModel.class);
  44 + if (null!=babyModel) {
  45 + Map<String, Object> babyRecord = new HashMap<>();
  46 + babyRecord.put("id", babyModel.getId());
  47 + babyRecord.put("pid", babyModel.getPid());
  48 + babyRecord.put("buildDate", DateUtil.getyyyy_MM_dd(babyModel.getBuildDate()));
  49 + String monthAge = DateUtil.getBabyMonthAge(babyModel.getBirth(), babyModel.getBuildDate());
  50 + babyRecord.put("monthAge", monthAge);
  51 + babyRecord.put("buildId", babyModel.getId());
  52 + babyRecord.put("blNo", babyModel.getBlNo());
  53 + babyRecord.put("type", "1");//展示区分(1:档案2:检查记录)
  54 + babyRecord.put("hospitalId", babyModel.getHospitalId());
  55 + //查询建档医院
  56 + Organization org = organizationService.getOrganization(Integer.valueOf(babyModel.getHospitalId()));
  57 + if (org != null) {
  58 + babyRecord.put("hospitalName", org.getName());
  59 + } else {
  60 + babyRecord.put("hospitalName", "");
  61 + }
  62 + rest.add(babyRecord);
  63 + }
  64 + LhBabyEyelCheckQuery checkQuery=new LhBabyEyelCheckQuery();
  65 + checkQuery.setBabyId(babyId);
  66 + checkQuery.setYn(YnEnums.YES.getId());
  67 +// List<LhBabyEyeCheck> babyChecks=lhBabyEyeCheckService.queryList(checkQuery, Sort.Direction.ASC,new String[]{"eyeCheckTime","created"});
  68 +// for (LhBabyEyeCheck babyCheck : babyChecks) {
  69 +// Map<String, Object> temp = new HashMap<>();
  70 +// temp.put("id", babyCheck.getId());
  71 +// temp.put("hospitalId", babyCheck.getHospitalId());
  72 +// temp.put("pid", babyCheck.getPid());
  73 +// temp.put("CheckMonthId", EyeCheckMonthEnums.getName(babyCheck.getCheckMonthId()));
  74 +// if (babyModel != null) {
  75 +// temp.put("name", babyModel.getName());
  76 +// if (babyModel.getSex() != null) {
  77 +// temp.put("sex", SexEnum.getTextById(babyModel.getSex()));
  78 +// }
  79 +// }
  80 +// temp.put("eyeCheckTime", DateUtil.getYyyyMmDd(babyCheck.getEyeCheckTime()));
  81 +// temp.put("type", "2");//展示区分(1:档案2:检查记录)
  82 +// rest.add(temp);
  83 +// }
  84 + BaseObjectResponse br = new BaseObjectResponse();
  85 + br.setErrorcode(ErrorCodeConstants.SUCCESS);
  86 + br.setData(rest);
  87 + br.setErrormsg("成功");
  88 + return br;
  89 + }
  90 +}