Commit dcb50b957951ede84fffcb4322a25dec50293b70

Authored by zhangchao
1 parent 7f5a527ed0
Exists in dev

#fix:孕期营养报告,新增详情及患者报告接口,增加报告名称字段

Showing 7 changed files with 169 additions and 10 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/PostpartumReport.java View file @ dcb50b9
... ... @@ -18,7 +18,8 @@
18 18 private String id;
19 19 //医院ID
20 20 private String hospitalId;
21   -
  21 + //模版名称
  22 + private String name;
22 23 //每日食物推荐量
23 24 private List<Map> foodRecommends;
24 25 //一日食谱
... ... @@ -47,6 +48,13 @@
47 48 private Date created;
48 49 private Date modified;
49 50  
  51 + public String getName() {
  52 + return name;
  53 + }
  54 +
  55 + public void setName(String name) {
  56 + this.name = name;
  57 + }
50 58  
51 59 public Integer getDeliveryModel() {
52 60 return deliveryModel;
platform-dal/src/main/java/com/lyms/platform/pojo/PregnancyReport.java View file @ dcb50b9
... ... @@ -14,6 +14,8 @@
14 14 public class PregnancyReport extends BaseModel {
15 15 private static final long serialVersionUID = -1;
16 16 private String id;
  17 + //模版名称
  18 + private String name;
17 19 //医院ID
18 20 private String hospitalId;
19 21 //当前孕期 1是孕早期 14周之前 2是孕中期 14-27周+6 3是孕晚期28周及以后
... ... @@ -41,6 +43,14 @@
41 43  
42 44 private Date created;
43 45 private Date modified;
  46 +
  47 + public String getName() {
  48 + return name;
  49 + }
  50 +
  51 + public void setName(String name) {
  52 + this.name = name;
  53 + }
44 54  
45 55 public String getTips() {
46 56 return tips;
platform-dal/src/main/java/com/lyms/platform/query/PregnancyReportQuery.java View file @ dcb50b9
... ... @@ -11,6 +11,8 @@
11 11  
12 12 public class PregnancyReportQuery extends BaseQuery implements IConvertToNativeQuery {
13 13  
  14 + private String name;
  15 +
14 16 private String hospitalId;
15 17  
16 18 private Integer yn=-1;
... ... @@ -29,6 +31,14 @@
29 31 //体重类型 0为正常 1为轻 2为重
30 32 private Integer weightType;
31 33  
  34 + public String getName() {
  35 + return name;
  36 + }
  37 +
  38 + public void setName(String name) {
  39 + this.name = name;
  40 + }
  41 +
32 42 public String getHospitalId() {
33 43 return hospitalId;
34 44 }
... ... @@ -93,6 +103,9 @@
93 103 condition = condition.and("riskFactorId", rFactor, MongoOper.IN);
94 104 } else if (null != rFactorList && !rFactorList.isEmpty()) {
95 105 condition = condition.and("riskFactorId", rFactorList, MongoOper.IN);
  106 + }
  107 + if (StringUtils.isNotEmpty(name)){
  108 + condition=condition.and("name",name,MongoOper.IS);
96 109 }
97 110 if (-1 != yn) {
98 111 condition = condition.and("yn", yn, MongoOper.IS);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnancyReportController.java View file @ dcb50b9
... ... @@ -30,7 +30,6 @@
30 30 private PregnancyReportFacade pregnancyReportFacade;
31 31 @Autowired
32 32 private PregnancyReportMattersServiceFacade pregnancyReportMattersServiceFacade;
33   -
34 33 @Autowired
35 34 private PatientServiceFacade patientServiceFacade;
36 35  
... ... @@ -41,7 +40,6 @@
41 40 @RequestParam("limit") Integer limit,
42 41 @RequestParam(required = false) String queryNo
43 42 ,HttpServletRequest httpServletRequest){
44   -
45 43 PatientsQuery patientsQuery=new PatientsQuery();
46 44 patientsQuery.setPage(page);
47 45 patientsQuery.setLimit(limit);
... ... @@ -49,7 +47,6 @@
49 47 return patientServiceFacade.getPatientList(patientsQuery,((LoginContext) httpServletRequest.getAttribute("loginContext")).getId());
50 48 }
51 49  
52   -
53 50 /**
54 51 * 新增模板报告
55 52 * @return
56 53  
57 54  
58 55  
59 56  
60 57  
... ... @@ -74,21 +71,55 @@
74 71 }
75 72  
76 73 /**
77   - * 获取报告详情
  74 + * 获取患者体重报告
78 75 * @return
79 76 */
  77 + @RequestMapping(method = RequestMethod.GET, value = "/getPatientReport")
  78 + @ResponseBody
  79 + @TokenRequired
  80 + public BaseResponse getPatientReport(@RequestParam(required = false) String rFactor,
  81 + @RequestParam(required = false) Integer week,
  82 + @RequestParam(required = false) Integer weightType,
  83 + HttpServletRequest request){
  84 + PregnancyReportQuery pregnancyReportQuery=new PregnancyReportQuery();
  85 + pregnancyReportQuery.setWeek(week);
  86 + pregnancyReportQuery.setWeightType(weightType);
  87 + pregnancyReportQuery.setrFactor(rFactor);
  88 + return pregnancyReportFacade.getPatientReport(pregnancyReportQuery,getUserId(request));
  89 + }
  90 +
  91 +
  92 + @RequestMapping(method = RequestMethod.GET, value = "/getInfo")
  93 + @ResponseBody
  94 + @TokenRequired
  95 + public BaseResponse getInfo(@RequestParam String id,
  96 + @RequestParam Integer week){
  97 + return pregnancyReportFacade.getInfo(id,week);
  98 + }
  99 +
  100 +
  101 + /**
  102 + * 获取体重报告列表
  103 + * @return
  104 + */
80 105 @RequestMapping(method = RequestMethod.GET, value = "/getList")
81 106 @ResponseBody
82 107 @TokenRequired
83 108 public BaseResponse getList(@RequestParam(required = false) String rFactor,
  109 + @RequestParam(required = false) String name,
84 110 @RequestParam(required = false) Integer week,
85   - @RequestParam(required = false) Integer weightType
  111 + @RequestParam(required = false) Integer weightType,
  112 + @RequestParam("page") Integer page,
  113 + @RequestParam("limit") Integer limit
86 114 ,HttpServletRequest request){
87 115 PregnancyReportQuery pregnancyReportQuery=new PregnancyReportQuery();
88 116 pregnancyReportQuery.setWeek(week);
89 117 pregnancyReportQuery.setWeightType(weightType);
  118 + pregnancyReportQuery.setName(name);
90 119 pregnancyReportQuery.setrFactor(rFactor);
91   - return pregnancyReportFacade.getInfo(pregnancyReportQuery,getUserId(request));
  120 + pregnancyReportQuery.setPage(page);
  121 + pregnancyReportQuery.setLimit(limit);
  122 + return pregnancyReportFacade.getList(pregnancyReportQuery,getUserId(request));
92 123 }
93 124  
94 125 /**
... ... @@ -115,7 +146,7 @@
115 146 }
116 147  
117 148 /**
118   - * 获取报告详情
  149 + * 获取模版列表
119 150 * @return
120 151 */
121 152 @RequestMapping(method = RequestMethod.GET, value = "/matters/getList")
... ... @@ -133,6 +164,19 @@
133 164 postpartumReportQuery.setPage(page);
134 165 postpartumReportQuery.setLimit(limit);
135 166 return pregnancyReportMattersServiceFacade.getList(postpartumReportQuery,getUserId(request));
  167 + }
  168 +
  169 + /**
  170 + * 获取模版详情
  171 + * @return
  172 + */
  173 + @RequestMapping(method = RequestMethod.GET, value = "/matters/getInfo")
  174 + @ResponseBody
  175 + @TokenRequired
  176 + public BaseResponse getMattersList(String id){
  177 + BaseResponse baseResponse= new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  178 + baseResponse.setObject(pregnancyReportMattersServiceFacade.getPregnancyReport(id));
  179 + return baseResponse;
136 180 }
137 181  
138 182 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PregnancyReportFacade.java View file @ dcb50b9
... ... @@ -3,6 +3,7 @@
3 3 import com.lyms.platform.biz.service.PregnancyReportMattersService;
4 4 import com.lyms.platform.biz.service.PregnancyReportService;
5 5 import com.lyms.platform.common.constants.ErrorCodeConstants;
  6 +import com.lyms.platform.common.result.BaseListResponse;
6 7 import com.lyms.platform.common.result.BaseResponse;
7 8 import com.lyms.platform.operate.web.utils.CollectionUtils;
8 9 import com.lyms.platform.pojo.PregnancyReport;
9 10  
10 11  
... ... @@ -35,14 +36,70 @@
35 36 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
36 37 }
37 38  
38   - public BaseResponse getInfo(PregnancyReportQuery pregnancyReportQuery,Integer userId){
  39 + public BaseResponse getInfo(String id,Integer week){
  40 + PregnancyReport pregnancyReport= pregnancyReportService.getPregnancyReport(id);
  41 + if (pregnancyReport==null){
  42 + return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXPIRE).setErrormsg("模版不存在");
  43 + }
  44 + PregnancyReportMattersQuery postpartumReportQuery=new PregnancyReportMattersQuery();
  45 + postpartumReportQuery.setYn(1);
  46 + postpartumReportQuery.setHospitalId(pregnancyReport.getHospitalId());
  47 + postpartumReportQuery.setWeek(week);
  48 + Integer riskType=1;
  49 + if (pregnancyReport.getRiskFactorName().contains("健康")){
  50 + riskType=0;
  51 + }
  52 + postpartumReportQuery.setRiskType(riskType);
  53 + List<PregnancyReportMatters> mattersList= pregnancyReportMattersService.queryPregnancyReport(postpartumReportQuery);
  54 + if (CollectionUtils.isNotEmpty(mattersList)){
  55 + pregnancyReport.setMatters(mattersList.get(0).getMatters());
  56 + }
  57 + BaseResponse baseResponse= new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  58 + baseResponse.setObject(pregnancyReport);
  59 + return baseResponse;
  60 + }
  61 +
  62 +
  63 + public BaseResponse getPatientReport(PregnancyReportQuery pregnancyReportQuery,Integer userId){
39 64 String hospitalId= autoMatchFacade.getHospitalId(userId);
40 65 pregnancyReportQuery.setHospitalId(hospitalId);
41 66 pregnancyReportQuery.setYn(1);
42 67 Integer week= pregnancyReportQuery.getWeek();
43 68 pregnancyReportQuery.setWeek(getWeek(week));
44 69 List<PregnancyReport> list= pregnancyReportService.queryPregnancyReport(pregnancyReportQuery);
  70 + BaseResponse baseResponse=new BaseResponse();
45 71 if (CollectionUtils.isNotEmpty(list)){
  72 + PregnancyReport pregnancyReport= list.get(0);
  73 + PregnancyReportMattersQuery postpartumReportQuery=new PregnancyReportMattersQuery();
  74 + postpartumReportQuery.setYn(1);
  75 + postpartumReportQuery.setHospitalId(hospitalId);
  76 + postpartumReportQuery.setWeek(week);
  77 + Integer riskType=1;
  78 + if (pregnancyReport.getRiskFactorName().contains("健康")){
  79 + riskType=0;
  80 + }
  81 + postpartumReportQuery.setRiskType(riskType);
  82 + List<PregnancyReportMatters> mattersList= pregnancyReportMattersService.queryPregnancyReport(postpartumReportQuery);
  83 + if (CollectionUtils.isNotEmpty(mattersList)){
  84 + pregnancyReport.setMatters(mattersList.get(0).getMatters());
  85 + }
  86 + baseResponse.setObject(pregnancyReport);
  87 + }
  88 + baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  89 + baseResponse.setErrormsg("成功");
  90 + return baseResponse;
  91 + }
  92 +
  93 +
  94 + public BaseResponse getList(PregnancyReportQuery pregnancyReportQuery,Integer userId){
  95 + String hospitalId= autoMatchFacade.getHospitalId(userId);
  96 + pregnancyReportQuery.setHospitalId(hospitalId);
  97 + pregnancyReportQuery.setYn(1);
  98 + pregnancyReportQuery.setNeed("true");
  99 + Integer week= pregnancyReportQuery.getWeek();
  100 + pregnancyReportQuery.setWeek(getWeek(week));
  101 + List<PregnancyReport> list= pregnancyReportService.queryPregnancyReport(pregnancyReportQuery);
  102 + if (CollectionUtils.isNotEmpty(list)){
46 103 for (PregnancyReport pregnancyReport:list){
47 104 PregnancyReportMattersQuery postpartumReportQuery=new PregnancyReportMattersQuery();
48 105 postpartumReportQuery.setYn(1);
49 106  
... ... @@ -59,8 +116,9 @@
59 116 }
60 117 }
61 118 }
62   - BaseResponse baseResponse=new BaseResponse();
  119 + BaseListResponse baseResponse=new BaseListResponse();
63 120 baseResponse.setObject(list);
  121 + baseResponse.setPageInfo(pregnancyReportQuery.getPageInfo());
64 122 baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
65 123 baseResponse.setErrormsg("成功");
66 124 return baseResponse;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PregnancyReportMattersServiceFacade.java View file @ dcb50b9
... ... @@ -40,5 +40,9 @@
40 40 pregnancyReportMattersService.updateById(postpartumReport,postpartumReport.getId());
41 41 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
42 42 }
  43 +
  44 + public PregnancyReportMatters getPregnancyReport(String id){
  45 + return pregnancyReportMattersService.getPregnancyReport(id);
  46 + }
43 47 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ dcb50b9
... ... @@ -197,6 +197,9 @@
197 197 map.put("hospitalName", couponMapper.getHospitalName(hospitalId));
198 198 map.put("date", ymdDate);
199 199 map.put("nowWeight", nowWeight);
  200 + if ("2100002419".equals(hospitalId)){
  201 + map.put("riskFactorId", patients.getRiskFactorId());
  202 + }
200 203 }
201 204 }
202 205 if (flag) {
... ... @@ -206,6 +209,9 @@
206 209 m.put("date", ymdDate);
207 210 m.put("nowWeight", nowWeight);
208 211 /*m.put("doctorId", doctorId);*/
  212 + if ("2100002419".equals(hospitalId)){
  213 + m.put("riskFactorId", patients.getRiskFactorId());
  214 + }
209 215 dayWeights2.add(m);
210 216 }
211 217 pw.setDayWeights2(dayWeights2);
... ... @@ -242,6 +248,9 @@
242 248 m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
243 249 m.put("date", DateUtil.getyyyy_MM_dd(new Date()));
244 250 m.put("nowWeight", nowWeight);
  251 + if ("2100002419".equals(hospitalId)){
  252 + m.put("riskFactorId", patients.getRiskFactorId());
  253 + }
245 254 /*m.put("doctorId", doctorId);*/
246 255 dayWeights2.add(m);
247 256 patientWeight.setDayWeights2(dayWeights2);
... ... @@ -1347,6 +1356,7 @@
1347 1356 }
1348 1357 }
1349 1358 setAppReport(patients.getLastMenses(), patientWeight, map, weights);
  1359 + //TODO 编写大同体重营养报告逻辑
1350 1360 return RespBuilder.buildSuccess(map);
1351 1361 }
1352 1362 return RespBuilder.buildSuccess();
... ... @@ -1402,6 +1412,10 @@
1402 1412 map.put("hospitalName", couponMapper.getHospitalName(hospitalId));
1403 1413 map.put("date", ymdDate);
1404 1414 map.put("nowWeight", nowWeight);
  1415 + //如果是大同添加当前患者高危因素
  1416 + if ("2100002419".equals(hospitalId)){
  1417 + map.put("riskFactorId", patients.getRiskFactorId());
  1418 + }
1405 1419 } else {
1406 1420 map.put("hospitalId2", hospitalId);
1407 1421 map.put("nowWeight2", nowWeight);
... ... @@ -1414,6 +1428,10 @@
1414 1428 m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
1415 1429 m.put("date", ymdDate);
1416 1430 m.put("nowWeight", nowWeight);
  1431 + //如果是大同添加当前患者高危因素
  1432 + if ("2100002419".equals(hospitalId)){
  1433 + m.put("riskFactorId", patients.getRiskFactorId());
  1434 + }
1417 1435 dayWeights2.add(m);
1418 1436 }
1419 1437 pw.setDayWeights2(dayWeights2);
... ... @@ -1429,6 +1447,10 @@
1429 1447 m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
1430 1448 m.put("date", ymdDate);
1431 1449 m.put("nowWeight", nowWeight);
  1450 + //如果是大同添加当前患者高危因素
  1451 + if ("2100002419".equals(hospitalId)){
  1452 + m.put("riskFactorId", patients.getRiskFactorId());
  1453 + }
1432 1454 dayWeights2.add(m);
1433 1455 patientWeight.setDayWeights2(dayWeights2);
1434 1456 dayWeights.put(DateUtil.getyyyy_MM_dd(new Date()), nowWeight);