Commit c34c76221e125c07a2a72dc17f69987274e49b63
1 parent
37a805e98c
Exists in
master
and in
6 other branches
产检人数明细查看修复
Showing 3 changed files with 41 additions and 0 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/NewbornVisitControoler.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/INewbornVisitService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/NewbornVisitControoler.java
View file @
c34c762
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | import com.lyms.platform.pojo.NewbornVisit; |
8 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
9 | 9 | import org.springframework.stereotype.Controller; |
10 | +import org.springframework.web.bind.annotation.PathVariable; | |
10 | 11 | import org.springframework.web.bind.annotation.RequestMapping; |
11 | 12 | import org.springframework.web.bind.annotation.RequestMethod; |
12 | 13 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -58,6 +59,30 @@ |
58 | 59 | @TokenRequired |
59 | 60 | public BaseObjectResponse query(HttpServletRequest request, String babyId) { |
60 | 61 | return visitService.query(getUserId(request), babyId); |
62 | + } | |
63 | + | |
64 | + /** | |
65 | + * 新生儿访视详情 | |
66 | + * @param id | |
67 | + * @return | |
68 | + */ | |
69 | + @RequestMapping(value = "/{id}", method = RequestMethod.GET) | |
70 | + @ResponseBody | |
71 | + @TokenRequired | |
72 | + public BaseObjectResponse get(@PathVariable String id) { | |
73 | + return visitService.get(id); | |
74 | + } | |
75 | + | |
76 | + /** | |
77 | + * 新生儿访视删除 | |
78 | + * @param id | |
79 | + * @return | |
80 | + */ | |
81 | + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) | |
82 | + @ResponseBody | |
83 | + @TokenRequired | |
84 | + public BaseObjectResponse delete(@PathVariable String id) { | |
85 | + return visitService.delete(id); | |
61 | 86 | } |
62 | 87 | |
63 | 88 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/INewbornVisitService.java
View file @
c34c762
... | ... | @@ -17,5 +17,9 @@ |
17 | 17 | void export(Date startDate, Date endDate, String doctor, Integer userId, HttpServletResponse response, String key); |
18 | 18 | |
19 | 19 | BaseObjectResponse query(Integer userId, String babyId); |
20 | + | |
21 | + BaseObjectResponse get(String id); | |
22 | + | |
23 | + BaseObjectResponse delete(String id); | |
20 | 24 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
View file @
c34c762
... | ... | @@ -19,6 +19,7 @@ |
19 | 19 | import com.lyms.platform.permission.model.Users; |
20 | 20 | import com.lyms.platform.pojo.*; |
21 | 21 | import com.lyms.platform.query.DataPermissionsModelQuery; |
22 | +import com.mongodb.WriteResult; | |
22 | 23 | import org.apache.commons.lang.StringUtils; |
23 | 24 | import org.springframework.beans.factory.annotation.Autowired; |
24 | 25 | import org.springframework.data.domain.Sort; |
... | ... | @@ -236,6 +237,17 @@ |
236 | 237 | rest.add(temp); |
237 | 238 | } |
238 | 239 | return RespBuilder.buildSuccess(rest); |
240 | + } | |
241 | + | |
242 | + @Override | |
243 | + public BaseObjectResponse get(String id) { | |
244 | + return RespBuilder.buildSuccess(mongoTemplate.findById(id, NewbornVisit.class)); | |
245 | + } | |
246 | + | |
247 | + @Override | |
248 | + public BaseObjectResponse delete(String id) { | |
249 | + mongoTemplate.remove(Query.query(Criteria.where("id").is(id)), NewbornVisit.class); | |
250 | + return RespBuilder.buildSuccess(); | |
239 | 251 | } |
240 | 252 | |
241 | 253 | } |