Commit bff95241757171d2abf8c8fd37d28b97316040b2

Authored by wangbo
1 parent 3606887350

update

Showing 4 changed files with 21 additions and 16 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/PihParameterModel.java View file @ bff9524
... ... @@ -33,7 +33,7 @@
33 33 private String pulse;//脉搏波形
34 34 private String measureEnd;//测量结束
35 35 private String exit;//非正常退出
36   - private String pid;//病人id
  36 + private String patientId;// patient的主键
37 37 private String hospitalId;//医院id
38 38 private String IDCard;//病人身份证号
39 39 private Date created;//创建时间
40 40  
... ... @@ -74,12 +74,12 @@
74 74 this.yn = yn;
75 75 }
76 76  
77   - public String getPid() {
78   - return pid;
  77 + public String getPatientId() {
  78 + return patientId;
79 79 }
80 80  
81   - public void setPid(String pid) {
82   - this.pid = pid;
  81 + public void setPatientId(String patientId) {
  82 + this.patientId = patientId;
83 83 }
84 84  
85 85 public String getHospitalId() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/pihController.java View file @ bff9524
... ... @@ -52,8 +52,8 @@
52 52  
53 53 @RequestMapping(value = "/report/{id}", method = RequestMethod.GET)
54 54 @ResponseBody
55   - public BaseResponse getPinReport(@PathVariable(value = "id") String id) {
56   - return pihService.getPinReport(id);
  55 + public BaseResponse getPinReport(@PathVariable(value = "id") String id, HttpServletRequest request) {
  56 + return pihService.getPinReport(id, getUserId(request));
57 57 }
58 58  
59 59 protected Integer getUserId(HttpServletRequest request) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PihService.java View file @ bff9524
... ... @@ -10,7 +10,7 @@
10 10  
11 11 public BaseResponse queyAll(String key, Integer weekStart, Integer weekEnd, Integer age, String type, Integer page, Integer limit, Integer userId);
12 12  
13   - public BaseResponse getPinReport(String id);
  13 + public BaseResponse getPinReport(String id, Integer userId);
14 14  
15 15 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PihServiceImpl.java View file @ bff9524
1 1 package com.lyms.platform.operate.web.service.impl;
2 2  
3   -import com.alibaba.druid.proxy.jdbc.JdbcParameter;
4   -import com.lyms.platform.biz.dal.IFolicAcidDao;
5 3 import com.lyms.platform.biz.service.CommonService;
6 4 import com.lyms.platform.common.enums.PihEnums;
7 5 import com.lyms.platform.common.result.BaseResponse;
8 6  
... ... @@ -9,10 +7,11 @@
9 7 import com.lyms.platform.common.result.RespBuilder;
10 8 import com.lyms.platform.common.utils.DateUtil;
11 9 import com.lyms.platform.common.utils.StringUtils;
  10 +import com.lyms.platform.operate.web.facade.AutoMatchFacade;
  11 +import com.lyms.platform.operate.web.facade.HealthChargeFacade;
12 12 import com.lyms.platform.operate.web.facade.OrganizationGroupsFacade;
13 13 import com.lyms.platform.operate.web.service.PihService;
14 14 import com.lyms.platform.operate.web.utils.CollectionUtils;
15   -import com.lyms.platform.operate.web.utils.MongoUtil;
16 15 import com.lyms.platform.pojo.Patients;
17 16 import com.lyms.platform.pojo.PihModel;
18 17 import com.lyms.platform.pojo.PihParameterModel;
19 18  
... ... @@ -37,7 +36,12 @@
37 36 @Autowired
38 37 private CommonService commonService;
39 38  
  39 + @Autowired
  40 + private HealthChargeFacade healthChargeFacade;
40 41  
  42 + @Autowired
  43 + private AutoMatchFacade autoMatchFacade;
  44 +
41 45 @Override
42 46 public void addPih(PihParameterModel parameterModel) {
43 47 parameterModel.setYn("1");
44 48  
... ... @@ -94,14 +98,14 @@
94 98 ids.add(pih.getId());
95 99 }
96 100 }
97   - criteria.and("pid").in(ids);
  101 + criteria.and("patientId").in(ids);
98 102 }
99 103 PageResult pageResult = findMongoPage(PihParameterModel.class, new Query(criteria).with(new Sort(Sort.Direction.DESC, "modified")), page, limit);
100 104 List<PihParameterModel> pihParameterModelList = (List<PihParameterModel>) pageResult.getGrid();
101 105 List<Map<String, Object>> restList = new ArrayList<>();
102 106 for (PihParameterModel pihParameterModel : pihParameterModelList) {
103 107 Map<String, Object> map = new HashMap();
104   - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(pihParameterModel.getPid())), Patients.class);
  108 + Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(pihParameterModel.getPatientId())), Patients.class);
105 109 if (null != patients) {
106 110 map.put("id", pihParameterModel.getId());
107 111 map.put("username", patients.getUsername());
108 112  
109 113  
... ... @@ -140,12 +144,13 @@
140 144 * 妊高症报告
141 145 */
142 146 @Override
143   - public BaseResponse getPinReport(String id) {
  147 + public BaseResponse getPinReport(String id, Integer userId) {
144 148 if (StringUtils.isNotEmpty(id)) {
  149 + String hospitalId = autoMatchFacade.getHospitalId(userId);
145 150 Map<String, Object> datas = new HashMap<>();
146 151 PihParameterModel parameterModel = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(id)), PihParameterModel.class);
147 152 if (null != parameterModel) {
148   - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(parameterModel.getPid())), Patients.class);
  153 + Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(parameterModel.getPatientId())), Patients.class);
149 154 if (patients != null) {
150 155 Map<String, Object> userInfo = new HashMap<>();
151 156 userInfo.put("username", patients.getUsername());
152 157  
... ... @@ -223,11 +228,11 @@
223 228 }
224 229 }
225 230 }
226   -
227 231 }
228 232 }
229 233 }
230 234 }
  235 + healthChargeFacade.addHealthCharge(hospitalId, 4, id, 1, 2, userId);
231 236 return RespBuilder.buildSuccess(datas);
232 237 }
233 238 return RespBuilder.buildSuccess("请选择一条记录");