Commit 5b38fe7f9b323511f3142527e5c86b6e3205b76d

Authored by landong2015
1 parent c92aaa5fd9

update folic

Showing 3 changed files with 53 additions and 19 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FolicAcidController.java View file @ 5b38fe7
... ... @@ -42,10 +42,11 @@
42 42 //获取单个发放记录
43 43 @RequestMapping(value = "/getFolicAcid", method = RequestMethod.GET)
44 44 @ResponseBody
45   -// @TokenRequired
  45 + @TokenRequired
46 46 public BaseObjectResponse getFolicAcid(@Valid FolicAcidQueryRequest folicAcidQueryRequest,
47 47 HttpServletRequest request) {
48   - return folicAcidFacade.getFolicAcid(folicAcidQueryRequest);
  48 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  49 + return folicAcidFacade.getFolicAcid(folicAcidQueryRequest,loginState.getId());
49 50 }
50 51  
51 52 //叶酸发放管理
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FolicAcidFacade.java View file @ 5b38fe7
... ... @@ -159,12 +159,14 @@
159 159 return id;
160 160 }
161 161  
162   - public BaseObjectResponse getFolicAcid(FolicAcidQueryRequest queryRequest){
  162 + public BaseObjectResponse getFolicAcid(FolicAcidQueryRequest queryRequest,Integer userId){
163 163 Map<String, Object> archiveMap = null;
164 164 FolicAcid folicAcid = null;
165 165 ResidentsArchiveModel archiveModel = null;
166 166 Map<String, Object> resultMap = new HashMap<>();
167 167  
  168 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  169 +
168 170 //查询妇女信息
169 171 if (StringUtils.isNotEmpty(queryRequest.getId())){
170 172 folicAcid = folicAcidService.getFolicAcid(queryRequest.getId());
171 173  
... ... @@ -173,10 +175,11 @@
173 175 }
174 176 }else {
175 177 ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery();
176   - archiveQuery.setYn(1);
177   - archiveQuery.setHospitalId(queryRequest.getHospitalId());
  178 + archiveQuery.setYn(YnEnums.YES.getId());
  179 + archiveQuery.setHospitalId(hospitalId);
178 180 if (StringUtils.isNotEmpty(queryRequest.getCardNo())){
179 181 archiveQuery.setCertificateNum(queryRequest.getCardNo());
  182 + archiveQuery.setCertificateTypeId(queryRequest.getCertificateTypeId());
180 183 List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(archiveQuery);
181 184 if (CollectionUtils.isNotEmpty(modelList)){
182 185 archiveModel = modelList.get(0);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java View file @ 5b38fe7
... ... @@ -13,6 +13,8 @@
13 13 public static String NOT = "无";
14 14 public static String NORMAL = "正常";
15 15 public static String ABNORMAL = "异常";
  16 + public static String YES = "是";
  17 + public static String NO = "否";
16 18  
17 19 //返回中间四位数为*号的手机号
18 20 public static String getXingPhone(String phone){
19 21  
20 22  
21 23  
... ... @@ -23,26 +25,54 @@
23 25 return "";
24 26 }
25 27  
26   - public static String havaOrNOString(String s){
27   - if (StringUtils.isNotEmpty(s)){
28   - if (s.equals("1")){
29   - return HAVE;
30   - }else {
31   - return NOT;
  28 + public static String havaOrNOString(String s,Integer type) {
  29 + if (StringUtils.isNotEmpty(s)) {
  30 + if (type == 1) {
  31 + if (s.equals("1")) {
  32 + return HAVE;
  33 + } else {
  34 + return NOT;
  35 + }
  36 + } else if (type == 2) {
  37 + if (s.equals("1")) {
  38 + return NORMAL;
  39 + } else {
  40 + return ABNORMAL;
  41 + }
  42 + } else if (type == 3) {
  43 + if (s.equals("1")) {
  44 + return YES;
  45 + } else {
  46 + return NO;
  47 + }
32 48 }
33 49 }
34   - return NOT;
  50 + return "";
35 51 }
36 52  
37   - public static String havaOrNOInteger(Integer i){
38   - if (i!=null){
39   - if (i==1){
40   - return HAVE;
41   - }else {
42   - return NOT;
  53 + public static String havaOrNOInteger(Integer s,Integer type) {
  54 + if (s != null) {
  55 + if (type == 1) {
  56 + if (s == 1 ) {
  57 + return HAVE;
  58 + } else {
  59 + return NOT;
  60 + }
  61 + } else if (type == 2) {
  62 + if (s == 1) {
  63 + return NORMAL;
  64 + } else {
  65 + return ABNORMAL;
  66 + }
  67 + } else if (type == 3) {
  68 + if (s == 1) {
  69 + return YES;
  70 + } else {
  71 + return NO;
  72 + }
43 73 }
44 74 }
45   - return NOT;
  75 + return "";
46 76 }
47 77  
48 78 }