Commit 9c38ef22132df006fd9d2f1bf6096be5cee0c5f5
1 parent
20740765e7
Exists in
master
and in
6 other branches
妇女模块
Showing 2 changed files with 25 additions and 0 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/WomanArchive.java
View file @
9c38ef2
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | |
8 | 8 | @Document(collection = "lyms_woman_archive") |
9 | 9 | public class WomanArchive { |
10 | + private String id; | |
10 | 11 | private String cardNo; |
11 | 12 | |
12 | 13 | private String hospitalId; |
... | ... | @@ -14,6 +15,14 @@ |
14 | 15 | private Map<String,Object> data; |
15 | 16 | |
16 | 17 | private Date created; |
18 | + | |
19 | + public String getId() { | |
20 | + return id; | |
21 | + } | |
22 | + | |
23 | + public void setId(String id) { | |
24 | + this.id = id; | |
25 | + } | |
17 | 26 | |
18 | 27 | public String getHospitalId() { |
19 | 28 | return hospitalId; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java
View file @
9c38ef2
... | ... | @@ -280,6 +280,22 @@ |
280 | 280 | @RequestBody WomanArchive womanArchive |
281 | 281 | ) { |
282 | 282 | try { |
283 | + | |
284 | + Query query = new Query(); | |
285 | + query.addCriteria(Criteria.where("data.type").is(String.valueOf(womanArchive.getData().get("type")))); | |
286 | + query.addCriteria(Criteria.where("cardNo").is(womanArchive.getCardNo())); | |
287 | + List<WomanArchive> list = mongoTemplate.find(query,WomanArchive.class); | |
288 | + if (CollectionUtils.isNotEmpty(list)) | |
289 | + { | |
290 | + for (WomanArchive archive : list) | |
291 | + { | |
292 | + if (DateUtil.getyyyy_MM_dd(archive.getCreated()).equals(DateUtil.getyyyy_MM_dd(new Date()))) | |
293 | + { | |
294 | + mongoTemplate.remove(new Query(Criteria.where("id").is(archive.getId())),WomanArchive.class); | |
295 | + } | |
296 | + } | |
297 | + } | |
298 | + | |
283 | 299 | womanArchive.setCreated(new Date()); |
284 | 300 | mongoTemplate.save(womanArchive); |
285 | 301 | } |