Commit 954ae9a377745b5c74797aaa55d1a2fe15a6a708

Authored by liquanyu
1 parent 7773f6eb1f

儿童查询

Showing 2 changed files with 23 additions and 3 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java View file @ 954ae9a
1 1 package com.lyms.platform.operate.web.controller;
2 2  
3 3  
  4 +import com.lyms.platform.common.annotation.TokenRequired;
4 5 import com.lyms.platform.common.base.BaseController;
  6 +import com.lyms.platform.common.base.LoginContext;
5 7 import com.lyms.platform.common.constants.ErrorCodeConstants;
6 8 import com.lyms.platform.common.result.BaseListResponse;
7 9 import com.lyms.platform.common.result.BaseObjectResponse;
... ... @@ -13,6 +15,7 @@
13 15 import org.springframework.stereotype.Controller;
14 16 import org.springframework.web.bind.annotation.*;
15 17  
  18 +import javax.servlet.http.HttpServletRequest;
16 19 import javax.validation.Valid;
17 20 import java.io.UnsupportedEncodingException;
18 21  
19 22  
... ... @@ -97,12 +100,14 @@
97 100 */
98 101 @RequestMapping(value = "/queryBabyBuildRecord", method = RequestMethod.GET)
99 102 @ResponseBody
100   - public BaseObjectResponse queryBabyBuildRecord(@RequestParam(required = false)String cardNo,@RequestParam(required = false)String vcCardNo,@RequestParam(required = false)String hospitalId){
  103 + @TokenRequired
  104 + public BaseObjectResponse queryBabyBuildRecord(HttpServletRequest request,@RequestParam(required = false)String cardNo,@RequestParam(required = false)String vcCardNo,@RequestParam(required = false)String hospitalId){
101 105 BookbuildingQueryRequest param = new BookbuildingQueryRequest();
102 106 param.setCardNo(cardNo);
103 107 param.setVcCardNo(vcCardNo);
104 108 param.setHospitalId(hospitalId);
105   - return babyBookbuildingFacade.queryBabyBuildRecord(param);
  109 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  110 + return babyBookbuildingFacade.queryBabyBuildRecord(param,loginState.getId());
106 111 }
107 112  
108 113  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 954ae9a
... ... @@ -11,7 +11,9 @@
11 11 import com.lyms.platform.operate.web.result.*;
12 12 import com.lyms.platform.permission.model.Organization;
13 13 import com.lyms.platform.permission.model.OrganizationQuery;
  14 +import com.lyms.platform.permission.model.Users;
14 15 import com.lyms.platform.permission.service.OrganizationService;
  16 +import com.lyms.platform.permission.service.UsersService;
15 17 import com.lyms.platform.pojo.*;
16 18 import com.lyms.platform.query.*;
17 19 import org.apache.commons.collections.CollectionUtils;
... ... @@ -62,6 +64,8 @@
62 64 @Autowired
63 65 private BabyCheckService babyCheckService;
64 66  
  67 + @Autowired
  68 + private UsersService usersService;
65 69  
66 70 @Autowired
67 71 private SmsConfigService smsConfigService;
... ... @@ -815,7 +819,18 @@
815 819 * @param param
816 820 * @return
817 821 */
818   - public BaseObjectResponse queryBabyBuildRecord(BookbuildingQueryRequest param) {
  822 + public BaseObjectResponse queryBabyBuildRecord(BookbuildingQueryRequest param,Integer userId) {
  823 +
  824 + if (userId != null)
  825 + {
  826 + Users dbuser = usersService.getUsers(userId);
  827 + if (dbuser != null) {
  828 + Integer hospitalId = dbuser.getOrgId();
  829 + param.setHospitalId(String.valueOf(hospitalId));
  830 + }
  831 + }
  832 +
  833 +
819 834  
820 835 Map<String,Object> map = new HashMap<>();
821 836