Commit aacc13d1cbbe5d99a311371728a73623cf6bb47c
1 parent
bd4c3b89b9
Exists in
master
and in
6 other branches
体重管理相关代码
Showing 2 changed files with 34 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java
View file @
aacc13d
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | @ResponseBody |
34 | 34 | @RequestMapping(method = RequestMethod.POST) |
35 | 35 | @TokenRequired |
36 | - public BaseResponse addOrUpdate(@RequestBody PatientWeight patientWeight, HttpServletRequest request) { | |
36 | + public BaseResponse addOrUpdate(PatientWeight patientWeight, HttpServletRequest request) { | |
37 | 37 | return patientWeightService.addOrUpdate(getUserId(request), patientWeight); |
38 | 38 | } |
39 | 39 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
aacc13d
1 | 1 | package com.lyms.platform.operate.web.service.impl; |
2 | 2 | |
3 | +import com.lyms.hospitalapi.pojo.ReportModel; | |
3 | 4 | import com.lyms.platform.common.enums.*; |
4 | 5 | import com.lyms.platform.common.result.BaseResponse; |
5 | 6 | import com.lyms.platform.common.result.PageResult; |
... | ... | @@ -136,6 +137,9 @@ |
136 | 137 | Map<String, Object> map = ReflectionUtils.beanToMap(patientWeight); |
137 | 138 | map.put("bregmatic", BregmaticEnums2.getName(patientWeight.getBregmatic())); |
138 | 139 | map.put("bim", patientWeight.getBmi()); // 体质指数(BMI)=体重(kg)÷身高^2(m) |
140 | + | |
141 | + setReport(map); | |
142 | + | |
139 | 143 | CollectionUtils.removeNullValue(map); |
140 | 144 | return RespBuilder.buildSuccess(map); |
141 | 145 | } |
... | ... | @@ -488,5 +492,34 @@ |
488 | 492 | } |
489 | 493 | } |
490 | 494 | |
495 | + public void setReport(Map<String,Object> report) { | |
496 | + Map<String, Object> xAxis = new HashMap<>(); | |
497 | + xAxis.put("type", "category"); | |
498 | + xAxis.put("boundaryGap", false); | |
499 | + List<Integer> datas = new ArrayList<>(); | |
500 | + for (int i = 1; i <= 40 ; i++) { | |
501 | + datas.add(i); | |
502 | + } | |
503 | + xAxis.put("data", datas); | |
504 | + | |
505 | + Map<String, Object> yAxis = new HashMap<>(); | |
506 | + yAxis.put("type", "value"); | |
507 | + yAxis.put("boundaryGap", Arrays.asList("0", "100%")); | |
508 | + | |
509 | + List<Map<String, Object>> series = new ArrayList<>(); | |
510 | + Map<String, Object> m1 = new HashMap<>(); | |
511 | + m1.put("name", "I"); | |
512 | + m1.put("type", "scatter"); | |
513 | + m1.put("xAxisIndex", 0); | |
514 | + m1.put("yAxisIndex", 0); | |
515 | + List<List<Integer>> seriesList = new ArrayList<>(); | |
516 | + | |
517 | + | |
518 | + | |
519 | + Map<String, Object> reportModel = new HashMap<>(); | |
520 | + report.put("xAxis", xAxis); | |
521 | + | |
522 | + report.put("reportModel", reportModel); | |
523 | + } | |
491 | 524 | } |