Commit d794827571a785688cefa94032f320183fe4564a
1 parent
e18fd1c7d1
Exists in
master
and in
6 other branches
肌萎缩
Showing 2 changed files with 82 additions and 1 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/WomanArchive.java
View file @
d794827
| 1 | +package com.lyms.platform.pojo; | |
| 2 | + | |
| 3 | +import org.springframework.data.mongodb.core.mapping.Document; | |
| 4 | + | |
| 5 | +import java.util.Date; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +@Document(collection = "lyms_woman_archive") | |
| 9 | +public class WomanArchive { | |
| 10 | + private String cardNo; | |
| 11 | + | |
| 12 | + private String hospitalId; | |
| 13 | + | |
| 14 | + private Map<String,Object> data; | |
| 15 | + | |
| 16 | + private Date created; | |
| 17 | + | |
| 18 | + public String getHospitalId() { | |
| 19 | + return hospitalId; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public void setHospitalId(String hospitalId) { | |
| 23 | + this.hospitalId = hospitalId; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public Date getCreated() { | |
| 27 | + return created; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setCreated(Date created) { | |
| 31 | + this.created = created; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public String getCardNo() { | |
| 35 | + return cardNo; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setCardNo(String cardNo) { | |
| 39 | + this.cardNo = cardNo; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public Map<String, Object> getData() { | |
| 43 | + return data; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setData(Map<String, Object> data) { | |
| 47 | + this.data = data; | |
| 48 | + } | |
| 49 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java
View file @
d794827
| ... | ... | @@ -18,6 +18,7 @@ |
| 18 | 18 | import com.lyms.platform.pojo.ArchiveData; |
| 19 | 19 | import com.lyms.platform.pojo.AssistBuildUserModel; |
| 20 | 20 | import com.lyms.platform.pojo.Patients; |
| 21 | +import com.lyms.platform.pojo.WomanArchive; | |
| 21 | 22 | import com.lyms.platform.query.ArchiveDataQuery; |
| 22 | 23 | import com.lyms.platform.query.PatientsQuery; |
| 23 | 24 | import net.sf.json.JSONObject; |
| ... | ... | @@ -25,6 +26,9 @@ |
| 25 | 26 | import org.apache.commons.httpclient.HttpClient; |
| 26 | 27 | import org.springframework.beans.factory.annotation.Autowired; |
| 27 | 28 | import org.springframework.data.domain.Sort; |
| 29 | +import org.springframework.data.mongodb.core.MongoTemplate; | |
| 30 | +import org.springframework.data.mongodb.core.query.Criteria; | |
| 31 | +import org.springframework.data.mongodb.core.query.Query; | |
| 28 | 32 | import org.springframework.stereotype.Controller; |
| 29 | 33 | import org.springframework.web.bind.annotation.*; |
| 30 | 34 | |
| 31 | 35 | |
| ... | ... | @@ -46,8 +50,9 @@ |
| 46 | 50 | |
| 47 | 51 | @Autowired |
| 48 | 52 | private ArchiveDataServicer archiveDataServicer; |
| 49 | - | |
| 50 | 53 | @Autowired |
| 54 | + private MongoTemplate mongoTemplate; | |
| 55 | + @Autowired | |
| 51 | 56 | private AssistBuildService assistBuildService; |
| 52 | 57 | |
| 53 | 58 | @Autowired |
| ... | ... | @@ -267,6 +272,33 @@ |
| 267 | 272 | } |
| 268 | 273 | writeString(response,"success"); |
| 269 | 274 | } |
| 275 | + | |
| 276 | + | |
| 277 | + @RequestMapping(value = "/womanBookArchive",method = RequestMethod.POST) | |
| 278 | + public void womanBookArchive(HttpServletResponse response, | |
| 279 | + @RequestBody WomanArchive womanArchive | |
| 280 | + ) { | |
| 281 | + try { | |
| 282 | + womanArchive.setCreated(new Date()); | |
| 283 | + mongoTemplate.save(womanArchive); | |
| 284 | + } | |
| 285 | + catch (Exception e) | |
| 286 | + { | |
| 287 | + writeString(response,"fail"); | |
| 288 | + } | |
| 289 | + writeString(response,"success"); | |
| 290 | + } | |
| 291 | + | |
| 292 | + @ResponseBody | |
| 293 | + @RequestMapping(value = "/getWomanBookArchive",method = RequestMethod.GET) | |
| 294 | + public BaseObjectResponse queryBookArchive(HttpServletResponse response, String cardNo) { | |
| 295 | + Query query = new Query(); | |
| 296 | + query.with(new Sort(Sort.Direction.DESC, "created")); | |
| 297 | + query.addCriteria(Criteria.where("cardNo").is(cardNo)); | |
| 298 | + List<WomanArchive> list = mongoTemplate.find(query,WomanArchive.class); | |
| 299 | + return new BaseObjectResponse().setData(CollectionUtils.isNotEmpty(list) ? list.get(0) : null).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 300 | + } | |
| 301 | + | |
| 270 | 302 | |
| 271 | 303 | @RequestMapping(value = "/queryYunChanQiRenShu", method = RequestMethod.GET) |
| 272 | 304 | @TokenRequired |