Commit 0d62cad68da1ee35158927f26e102cbb9cdba2ee
1 parent
7fcb9fdbf0
Exists in
master
and in
8 other branches
update
Showing 4 changed files with 94 additions and 60 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FolicAcidFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FunvCommonUtil.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FolicAcidFacade.java
View file @
0d62cad
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | import com.lyms.platform.operate.web.request.FolicAcidAddRequest; |
16 | 16 | import com.lyms.platform.operate.web.request.FolicAcidQueryRequest; |
17 | 17 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
18 | +import com.lyms.platform.operate.web.utils.FunvCommonUtil; | |
18 | 19 | import com.lyms.platform.permission.model.Organization; |
19 | 20 | import com.lyms.platform.permission.model.OrganizationQuery; |
20 | 21 | import com.lyms.platform.permission.model.Users; |
21 | 22 | |
22 | 23 | |
23 | 24 | |
24 | 25 | |
25 | 26 | |
26 | 27 | |
27 | 28 | |
28 | 29 | |
29 | 30 | |
... | ... | @@ -64,53 +65,61 @@ |
64 | 65 | |
65 | 66 | //判断是否需要给妇女快捷建档 |
66 | 67 | if (StringUtils.isEmpty(addRequest.getParentId())){ |
68 | + List<ResidentsArchiveModel> modelList = new ArrayList<>(); | |
67 | 69 | |
68 | 70 | ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); |
69 | 71 | archiveQuery.setYn(YnEnums.YES.getId()); |
70 | 72 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
71 | 73 | archiveQuery.setHospitalId(hospitalId); |
72 | 74 | //判断证件号是否在同一家医院已经建档 |
73 | - if (StringUtils.isNotEmpty(addRequest.getCardNo())){ | |
75 | + if (StringUtils.isNotEmpty(addRequest.getCardNo())) { | |
74 | 76 | archiveQuery.setCertificateNum(addRequest.getCardNo()); |
75 | -// archiveQuery.setCertificateTypeId(addRequest.getCertificateTypeId()); | |
76 | - List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(archiveQuery); | |
77 | - if (CollectionUtils.isNotEmpty(modelList)){ | |
77 | + archiveQuery.setCertificateTypeId(addRequest.getCertificateTypeId()); | |
78 | + residentsArchiveService.queryResident(archiveQuery); | |
79 | + if (CollectionUtils.isNotEmpty(modelList)) { | |
78 | 80 | br.setErrorcode(ErrorCodeConstants.DATA_EXIST); |
79 | - br.setErrormsg("该证件号在医院已经建档"); | |
81 | + br.setErrormsg("该证件号在该医院已经建档"); | |
80 | 82 | return br; |
81 | - }else { | |
82 | - //进行建档 | |
83 | - ResidentsArchiveModel model = new ResidentsArchiveModel(); | |
84 | - model.setYn(YnEnums.YES.getId()); | |
85 | - model.setCreated(new Date()); | |
86 | - model.setModified(new Date()); | |
87 | - model.setPublishId(String.valueOf(userId)); | |
88 | - Users users = usersService.getUsers(userId); | |
89 | - if (users!=null && users.getYn()!=YnEnums.NO.getId()){ | |
90 | - model.setPublishName(users.getName()); | |
91 | - //建档医生 | |
92 | - model.setBuildDoctor(users.getName()); | |
93 | - } | |
94 | - model.setHospitalId(hospitalId); | |
83 | + } | |
84 | + }else if (StringUtils.isNotEmpty(addRequest.getVcCardNo())){ | |
85 | + archiveQuery.setVcCardNo(addRequest.getVcCardNo()); | |
86 | + modelList = residentsArchiveService.queryResident(archiveQuery); | |
87 | + if (CollectionUtils.isNotEmpty(modelList)) { | |
88 | + br.setErrorcode(ErrorCodeConstants.DATA_EXIST); | |
89 | + br.setErrormsg("该就诊卡在该医院已经建档"); | |
90 | + return br; | |
91 | + } | |
92 | + } | |
93 | + //进行建档 | |
94 | + ResidentsArchiveModel model = new ResidentsArchiveModel(); | |
95 | + model.setYn(YnEnums.YES.getId()); | |
96 | + model.setCreated(new Date()); | |
97 | + model.setModified(new Date()); | |
98 | + model.setPublishId(String.valueOf(userId)); | |
99 | + Users users = usersService.getUsers(userId); | |
100 | + if (users!=null && users.getYn()!=YnEnums.NO.getId()){ | |
101 | + model.setPublishName(users.getName()); | |
102 | + //建档医生 | |
103 | + model.setBuildDoctor(users.getName()); | |
104 | + } | |
105 | + model.setHospitalId(hospitalId); | |
95 | 106 | |
96 | - model.setUsername(addRequest.getUsername()); | |
97 | - model.setCertificateNum(addRequest.getCardNo()); | |
98 | - model.setCertificateTypeId(addRequest.getCertificateTypeId()); | |
99 | - model.setBirthday(addRequest.getBirthday()); | |
100 | - model.setAge(addRequest.getAge()); | |
101 | - model.setPhone(addRequest.getPhone()); | |
107 | + model.setUsername(addRequest.getUsername()); | |
108 | + model.setCertificateNum(addRequest.getCardNo()); | |
109 | + model.setCertificateTypeId(addRequest.getCertificateTypeId()); | |
110 | + model.setBirthday(addRequest.getBirthday()); | |
111 | + model.setAge(addRequest.getAge()); | |
112 | + model.setPhone(addRequest.getPhone()); | |
102 | 113 | |
103 | - model.setSex(SystemConfig.WOMAN_ID); | |
104 | - //建档日期 | |
105 | - model.setBuildDay(DateUtil.getyyyy_MM_dd(new Date())); | |
114 | + model.setSex(SystemConfig.WOMAN_ID); | |
115 | + //建档日期 | |
116 | + model.setBuildDay(DateUtil.getyyyy_MM_dd(new Date())); | |
106 | 117 | |
107 | - model.setVcCardNo(addRequest.getVcCardNo()); | |
118 | + model.setVcCardNo(addRequest.getVcCardNo()); | |
108 | 119 | |
109 | - ResidentsArchiveModel residentsArchiveModel = residentsArchiveService.addResident(model); | |
120 | + ResidentsArchiveModel residentsArchiveModel = residentsArchiveService.addResident(model); | |
110 | 121 | |
111 | - id = addOrUpdate(addRequest,userId,residentsArchiveModel.getId()); | |
112 | - } | |
113 | - } | |
122 | + id = addOrUpdate(addRequest,userId,residentsArchiveModel.getId()); | |
114 | 123 | }else { |
115 | 124 | id = addOrUpdate(addRequest,userId,addRequest.getParentId()); |
116 | 125 | } |
... | ... | @@ -189,7 +198,7 @@ |
189 | 198 | archiveMap.put("username", archiveModel.getUsername()); |
190 | 199 | archiveMap.put("birthday",archiveModel.getBirthday()); |
191 | 200 | archiveMap.put("age", StringUtils.isEmpty(archiveModel.getBirthday()) ? "" : DateUtil.getAge(DateUtil.parseYMD(archiveModel.getBirthday()))); |
192 | - archiveMap.put("phone", archiveModel.getPhone()); | |
201 | + archiveMap.put("phone", FunvCommonUtil.getXingPhone(archiveModel.getPhone())); | |
193 | 202 | archiveMap.put("id", archiveModel.getId()); |
194 | 203 | if (StringUtils.isEmpty(archiveModel.getSex()) || archiveModel.getSex().equals(SystemConfig.WOMAN_ID )){ |
195 | 204 | archiveMap.put("sex", "女"); |
... | ... | @@ -316,7 +325,7 @@ |
316 | 325 | ResidentsArchiveModel model = residentsArchiveService.getResident(data.getParentId()); |
317 | 326 | map.put("username",model.getUsername()); |
318 | 327 | map.put("certificateNum",model.getCertificateNum()); |
319 | - map.put("phone",FunvCommonUtil.getXingPhone(model.getPhone())); | |
328 | + map.put("phone", FunvCommonUtil.getXingPhone(model.getPhone())); | |
320 | 329 | map.put("drawTime", DateUtil.getyyyy_MM_dd(data.getDrawTime())); |
321 | 330 | map.put("drawCount", data.getDrawCount()); |
322 | 331 | if (data.getPregnancyType()!=null){ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FunvCommonUtil.java
View file @
0d62cad
1 | -package com.lyms.platform.operate.web.facade; | |
2 | - | |
3 | -import org.apache.commons.lang.StringUtils; | |
4 | - | |
5 | -/** | |
6 | - * 妇女模块公共方法 | |
7 | - * | |
8 | - * Created by Administrator on 2016/12/13 0013. | |
9 | - */ | |
10 | -public class FunvCommonUtil { | |
11 | - | |
12 | - //返回中间四位数为*号的手机号 | |
13 | - public static String getXingPhone(String phone){ | |
14 | - if (StringUtils.isNotEmpty(phone)){ | |
15 | - String a = phone.substring(0,3)+"****"+phone.substring(7,11); | |
16 | - return a; | |
17 | - } | |
18 | - return ""; | |
19 | - } | |
20 | - | |
21 | -} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
View file @
0d62cad
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | import com.lyms.platform.operate.web.result.ResidentsArchiveHistoryResult; |
19 | 19 | import com.lyms.platform.operate.web.result.ResidentsArchiveResult; |
20 | 20 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
21 | +import com.lyms.platform.operate.web.utils.FunvCommonUtil; | |
21 | 22 | import com.lyms.platform.operate.web.utils.MessageCenterService; |
22 | 23 | import com.lyms.platform.permission.model.Organization; |
23 | 24 | import com.lyms.platform.permission.model.Users; |
24 | 25 | |
... | ... | @@ -27,11 +28,8 @@ |
27 | 28 | import com.lyms.platform.pojo.PremaritalCheckup; |
28 | 29 | import com.lyms.platform.pojo.ResidentsArchiveModel; |
29 | 30 | import com.lyms.platform.pojo.SmsConfigModel; |
30 | -import com.lyms.platform.query.BasicConfigQuery; | |
31 | 31 | import com.lyms.platform.query.PremaritalCheckupQuery; |
32 | 32 | import com.lyms.platform.query.ResidentsArchiveQuery; |
33 | -import com.mongodb.util.JSON; | |
34 | -import net.sf.json.JSONObject; | |
35 | 33 | import org.apache.commons.collections.CollectionUtils; |
36 | 34 | import org.apache.commons.lang.StringUtils; |
37 | 35 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -487,7 +485,7 @@ |
487 | 485 | map.put("age",DateUtil.getAge(DateUtil.parseYMD(model.getBirthday()))); |
488 | 486 | map.put("residence", CommonsHelper.getResidence(model.getProvinceId(), model.getCityId(), model.getAreaId(), model.getStreetId(), model.getAddress(), basicConfigService)); |
489 | 487 | map.put("isCheckup",queryPremaritalCheckup(model.getId(), model.getHospitalId())); |
490 | - map.put("phone",FunvCommonUtil.getXingPhone(model.getPhone())); | |
488 | + map.put("phone", FunvCommonUtil.getXingPhone(model.getPhone())); | |
491 | 489 | map.put("buildDoctor",model.getBuildDoctor()); |
492 | 490 | data.add(map); |
493 | 491 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java
View file @
0d62cad
1 | +package com.lyms.platform.operate.web.utils; | |
2 | + | |
3 | +import org.apache.commons.lang.StringUtils; | |
4 | + | |
5 | +/** | |
6 | + * 妇女模块公共方法 | |
7 | + * | |
8 | + * Created by Administrator on 2016/12/13 0013. | |
9 | + */ | |
10 | +public class FunvCommonUtil { | |
11 | + | |
12 | + public static String HAVE = "有"; | |
13 | + public static String NOT = "无"; | |
14 | + public static String NORMAL = "正常"; | |
15 | + public static String ABNORMAL = "异常"; | |
16 | + | |
17 | + //返回中间四位数为*号的手机号 | |
18 | + public static String getXingPhone(String phone){ | |
19 | + if (StringUtils.isNotEmpty(phone)){ | |
20 | + String a = phone.substring(0,3)+"****"+phone.substring(7,11); | |
21 | + return a; | |
22 | + } | |
23 | + return ""; | |
24 | + } | |
25 | + | |
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; | |
32 | + } | |
33 | + } | |
34 | + return NOT; | |
35 | + } | |
36 | + | |
37 | + public static String havaOrNOInteger(Integer i){ | |
38 | + if (i!=null){ | |
39 | + if (i==1){ | |
40 | + return HAVE; | |
41 | + }else { | |
42 | + return NOT; | |
43 | + } | |
44 | + } | |
45 | + return NOT; | |
46 | + } | |
47 | + | |
48 | +} |