Commit a36eacf4f69d287ef660868f3522476530f13293

Authored by litao@lymsh.com
1 parent 3c987c3559

gai

Showing 4 changed files with 25 additions and 1 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ a36eacf
... ... @@ -118,6 +118,13 @@
118 118 private BabyBookbuildingService babyBookbuildingService;
119 119  
120 120 @ResponseBody
  121 + @RequestMapping("/init/patient/weight")
  122 + public BaseResponse initPatientWeight() {
  123 + return bloodPressureService.initPatientWeight();
  124 + }
  125 +
  126 +
  127 + @ResponseBody
121 128 @RequestMapping("/init/blood/pressure")
122 129 public BaseResponse initBloodPressure(@RequestParam Map<String, String> param) {
123 130 return bloodPressureService.initBloodPressure(param);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RemoteFacade.java View file @ a36eacf
... ... @@ -157,7 +157,7 @@
157 157 temp.put("desc", desc);
158 158 temp.put("ckz", ckz);
159 159 temp.put("type", errorPatientEnums.getId());
160   - temp.put("modified", modified);
  160 + temp.put("modified", modified.getTime()/1000);
161 161 temp.put("patientId", null); // 小程序那边要这个key 不然解析不了
162 162 }
163 163  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IBloodPressureService.java View file @ a36eacf
... ... @@ -19,5 +19,7 @@
19 19 BaseResponse initBloodPressure(Map<String, String> param);
20 20  
21 21 BaseResponse wxAdd(BloodPressure bloodPressure);
  22 +
  23 + BaseResponse initPatientWeight();
22 24 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java View file @ a36eacf
... ... @@ -4,6 +4,7 @@
4 4 import com.alibaba.fastjson.JSONObject;
5 5 import com.lyms.platform.biz.service.BloodPressureService;
6 6 import com.lyms.platform.biz.service.CommonService;
  7 +import com.lyms.platform.biz.service.PatientWeightService2;
7 8 import com.lyms.platform.common.enums.YnEnums;
8 9 import com.lyms.platform.common.result.BaseResponse;
9 10 import com.lyms.platform.common.result.PageResult;
... ... @@ -16,6 +17,7 @@
16 17 import com.lyms.platform.operate.web.utils.CollectionUtils;
17 18 import com.lyms.platform.operate.web.utils.MongoUtil;
18 19 import com.lyms.platform.pojo.BloodPressure;
  20 +import com.lyms.platform.pojo.PatientWeight;
19 21 import com.lyms.platform.pojo.Patients;
20 22 import org.springframework.beans.factory.annotation.Autowired;
21 23 import org.springframework.data.domain.Sort;
22 24  
... ... @@ -47,7 +49,10 @@
47 49 @Autowired
48 50 private AccessPermissionFacade accessPermissionFacade;
49 51  
  52 + @Autowired
  53 + private PatientWeightService2 patientWeightService2;
50 54  
  55 +
51 56 public BaseResponse addOrUpdate(Integer userId, BloodPressure bloodPressure) {
52 57 String hospitalId = autoMatchFacade.getHospitalId(userId);
53 58 Map<String, Object> temp = new LinkedHashMap<>();
... ... @@ -245,6 +250,16 @@
245 250 bloodPressure.setInfos(infos);
246 251 bloodPressure.setId(bp.getId());
247 252 bloodPressureService.update(bloodPressure);
  253 + }
  254 + return RespBuilder.buildSuccess();
  255 + }
  256 +
  257 + @Override
  258 + public BaseResponse initPatientWeight() {
  259 + List<PatientWeight> pws = mongoTemplate.findAll(PatientWeight.class);
  260 + for (PatientWeight pw : pws) {
  261 + pw.setModified(pw.getCreated());
  262 + patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw);
248 263 }
249 264 return RespBuilder.buildSuccess();
250 265 }