Commit e6601f81ff81a413553b937fdeb6f3941c41a82c
1 parent
b4a788eec8
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 45 additions and 14 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/PihParameterModel.java
View file @
e6601f8
... | ... | @@ -37,10 +37,20 @@ |
37 | 37 | private String hospitalId;//医院id |
38 | 38 | private String IDCard;//病人身份证号 |
39 | 39 | private Date created;//创建时间 |
40 | - | |
41 | 40 | private Date modified; //修改时间 |
42 | - | |
43 | 41 | private String yn; |
42 | + | |
43 | + //0.临时数据,1.院内数据 | |
44 | + private Integer state; | |
45 | + | |
46 | + | |
47 | + public Integer getState() { | |
48 | + return state; | |
49 | + } | |
50 | + | |
51 | + public void setState(Integer state) { | |
52 | + this.state = state; | |
53 | + } | |
44 | 54 | |
45 | 55 | public String getIDCard() { |
46 | 56 | return IDCard; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PihServiceImpl.java
View file @
e6601f8
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | import com.lyms.platform.pojo.Patients; |
16 | 16 | import com.lyms.platform.pojo.PihModel; |
17 | 17 | import com.lyms.platform.pojo.PihParameterModel; |
18 | +import com.lyms.platform.pojo.TemporaryUserModel; | |
18 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
19 | 20 | import org.springframework.data.domain.Sort; |
20 | 21 | import org.springframework.data.mongodb.core.MongoTemplate; |
21 | 22 | |
22 | 23 | |
... | ... | @@ -44,23 +45,43 @@ |
44 | 45 | |
45 | 46 | @Override |
46 | 47 | public void addPih(PihParameterModel parameterModel) { |
47 | - parameterModel.setYn("1"); | |
48 | - parameterModel.setCreated(new Date()); | |
49 | - mongoTemplate.save(parameterModel); | |
48 | + Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(parameterModel.getPatientId())), Patients.class); | |
49 | + if (patients != null) { | |
50 | + parameterModel.setYn("1"); | |
51 | + parameterModel.setCreated(new Date()); | |
52 | + mongoTemplate.save(parameterModel); | |
53 | + } | |
54 | + | |
55 | + | |
50 | 56 | } |
51 | 57 | |
52 | 58 | @Override |
53 | 59 | public BaseResponse queryInfo(String cardNo) { |
54 | 60 | Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("cardNo").is(cardNo)), Patients.class); |
55 | - Map<String, Object> map = new HashMap<>(); | |
56 | 61 | if (patients != null) { |
57 | - map.put("username", patients.getUsername()); | |
58 | - map.put("cardNo", patients.getCardNo()); | |
59 | - map.put("hospitalId", patients.getHospitalId()); | |
60 | - map.put("age", patients.getAge()); | |
61 | - map.put("phone", patients.getPhone()); | |
62 | - map.put("vcCardNo", patients.getVcCardNo()); | |
63 | - return RespBuilder.buildSuccess(map); | |
62 | + Map<String, Object> map = new HashMap<>(); | |
63 | + if (patients != null) { | |
64 | + map.put("username", patients.getUsername()); | |
65 | + map.put("cardNo", patients.getCardNo()); | |
66 | + map.put("hospitalId", patients.getHospitalId()); | |
67 | + map.put("age", patients.getAge()); | |
68 | + map.put("phone", patients.getPhone()); | |
69 | + map.put("vcCardNo", patients.getVcCardNo()); | |
70 | + return RespBuilder.buildSuccess(map); | |
71 | + } else { | |
72 | + TemporaryUserModel temporaryUser = mongoTemplate.findOne(Query.query(Criteria.where("cardID").is(cardNo)), TemporaryUserModel.class); | |
73 | + if (temporaryUser != null) { | |
74 | + Map<String, Object> temporaryMap = new HashMap<>(); | |
75 | + temporaryMap.put("username", temporaryUser.getUserName()); | |
76 | + temporaryMap.put("cardNo", temporaryUser.getCardID()); | |
77 | + temporaryMap.put("hospitalId", temporaryUser.getHospitalId()); | |
78 | + temporaryMap.put("age", DateUtil.getAge(temporaryUser.getBirth())); | |
79 | + temporaryMap.put("phone", temporaryUser.getPhone()); | |
80 | + return RespBuilder.buildSuccess(temporaryMap); | |
81 | + } else { | |
82 | + return RespBuilder.buildSuccess("请联系医院帮您建档"); | |
83 | + } | |
84 | + } | |
64 | 85 | } |
65 | 86 | return RespBuilder.buildSuccess("没有此人信息"); |
66 | 87 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryBloodSugarServiceImpl.java
View file @
e6601f8
... | ... | @@ -211,7 +211,7 @@ |
211 | 211 | temp.put("bloodSugarId", bloodSugar.getBloodSugarType()); |
212 | 212 | temp.put("status", getBloodSugarStatus(bloodSugar.getBloodSugarType(), bloodSugar.getBloodSugar())); |
213 | 213 | temp.put("bregmatic", bloodSugar.getBregmatic()); |
214 | - temp.put("cardNo", bloodSugar.getCardID()); | |
214 | + temp.put("cardNo", temporaryUser.getCardID()); | |
215 | 215 | } |
216 | 216 | restList.add(temp); |
217 | 217 | } |