Commit b4f010ca248d717e0028cfefb8434f36b07385b6

Authored by yangfei
1 parent 6c6b545293

孕妇、儿童列表隐藏姓名和电话、居住地址

Showing 5 changed files with 138 additions and 65 deletions

platform-common/src/main/java/com/lyms/platform/common/utils/StringUtils.java View file @ b4f010c
... ... @@ -46,7 +46,7 @@
46 46 int week = (days / 7);
47 47 String str = "";
48 48 // if (week > 0) {
49   - str = week + "周";
  49 + str = week + "周";
50 50 // }
51 51 int day = (days % 7);
52 52 return "孕" + str + (day > 0 ? "+" + day + "天" : "");
53 53  
54 54  
55 55  
56 56  
... ... @@ -65,27 +65,35 @@
65 65 Integer integer=NumberUtils.toInt(babyWeight);
66 66 return ((Double)integer/1000)+"";
67 67 }*/
68   - /* */
  68 + /* */
69 69 int index = babyWeight.indexOf('.');
70   - if(index>-1){
71   - babyWeight = babyWeight.substring(0,index);
  70 + if (index > -1) {
  71 + babyWeight = babyWeight.substring(0, index);
72 72 }
73 73  
74   - if(babyWeight.length()>=4 &&index>-1 &&index<5){
75   - babyWeight=babyWeight.substring(0,4);
  74 + if (babyWeight.length() >= 4 && index > -1 && index < 5) {
  75 + babyWeight = babyWeight.substring(0, 4);
76 76 }
77 77 if (babyWeight.length() <= 3) {
78 78 babyWeight = org.apache.commons.lang.StringUtils.leftPad(babyWeight, 4, "0");
79 79 }
80 80 StringBuilder stringBuilder = new StringBuilder(babyWeight);
81 81  
82   - if (babyWeight.length() > 2) {
  82 + if (babyWeight.length() > 2) {
83 83 stringBuilder.setLength(babyWeight.length() - 1);
84 84 }
85 85 stringBuilder.insert(stringBuilder.length() - 2, ".");
86 86 return stringBuilder.toString();
87 87 }
88 88  
  89 + public static boolean contains(String str, String searchStr) {
  90 + if (str != null && searchStr != null) {
  91 + return str.indexOf(searchStr) >= 0;
  92 + } else {
  93 + return false;
  94 + }
  95 + }
  96 +
89 97 public static Object isEmpty(Object obj, Object defaultVal) {
90 98 if (null == obj) {
91 99 return defaultVal;
92 100  
... ... @@ -136,9 +144,9 @@
136 144  
137 145 return new String(res);
138 146  
139   - }else{
  147 + } else {
140 148 for (int i = 0; i < chars.length; i++) {
141   - if (2 < i && i < chars.length-2) {
  149 + if (2 < i && i < chars.length - 2) {
142 150 res[i] = '*';
143 151 } else {
144 152 res[i] = chars[i];
145 153  
146 154  
147 155  
148 156  
149 157  
150 158  
151 159  
... ... @@ -151,29 +159,81 @@
151 159 }
152 160  
153 161 /**
  162 + * 姓名加密
  163 + *
  164 + * @param name
  165 + * @return
  166 + */
  167 + public static String encryName(String name) {
  168 + if (isNotEmpty(name)) {
  169 + char[] res = new char[name.length()];
  170 + char[] chars = name.toCharArray();
  171 + if (chars != null && chars.length > 1) {
  172 + for (int i = 0; i < chars.length; i++) {
  173 + if (i > 0) {
  174 + res[i] = '*';
  175 + } else {
  176 + res[i] = chars[i];
  177 + }
  178 + }
  179 + return new String(res);
  180 + }
  181 + }
  182 + return name;
  183 + }
  184 +
  185 + /**
  186 + * 户籍地或居住地加密
  187 + *
  188 + * @param addr
  189 + * @return
  190 + */
  191 + public static String encryAddr(String addr) {
  192 + if (isNotEmpty(addr)) {
  193 + char[] res = new char[addr.length()];
  194 + char[] chars = addr.toCharArray();
  195 + if (addr.indexOf("市") != -1) {
  196 + if (chars != null && chars.length > 1) {
  197 + for (int i = 0; i <= addr.indexOf("市"); i++) {
  198 + res[i] = addr.charAt(i);
  199 + }
  200 +
  201 + for (int i = addr.indexOf("市")+1; i < chars.length; i++) {
  202 + res[i] = '*';
  203 + }
  204 + return new String(res);
  205 + }
  206 + } else {
  207 + return addr;
  208 + }
  209 + }
  210 + return addr;
  211 +}
  212 +
  213 + /**
154 214 * 证件号加密处理
  215 + *
155 216 * @param id
156 217 * @return
157 218 */
158 219 public static String encryCardNo(String id) {
159 220 if (org.apache.commons.lang.StringUtils.isEmpty(id)) {
160 221 return "";
161   - }else if (id.length() == 11) {
  222 + } else if (id.length() == 11) {
162 223 return id.substring(0, 3) + "****" + id.substring(7);
163   - }else if (id.length() == 15) {
  224 + } else if (id.length() == 15) {
164 225 return id.substring(0, 6) + "****" + id.substring(10, 13) + "*" + id.substring(14);
165   - }else if (id.length() == 18) {
  226 + } else if (id.length() == 18) {
166 227 return id.substring(0, 6) + "******" + id.substring(12, 15) + "**" + id.substring(17);
167   - }else if(id.length()<11){
  228 + } else if (id.length() < 11) {
168 229 return id;
169   - }else{
170   - return id.substring(0, 3) + "****" + id.substring(7)+"**";
  230 + } else {
  231 + return id.substring(0, 3) + "****" + id.substring(7) + "**";
171 232 }
172 233 }
173 234  
174   - public static Date getBirthDay(String idCard){
175   - if (isEmpty(idCard))
176   - {
  235 + public static Date getBirthDay(String idCard) {
  236 + if (isEmpty(idCard)) {
177 237 return null;
178 238 }
179 239 String year = idCard.substring(6, 10);
180 240  
181 241  
... ... @@ -184,29 +244,23 @@
184 244 }
185 245  
186 246  
187   - public static String emptyDeal(String str)
188   - {
189   - if (isEmpty(str))
190   - {
  247 + public static String emptyDeal(String str) {
  248 + if (isEmpty(str)) {
191 249 return "-";
192 250 }
193 251 return str;
194 252 }
195 253  
196 254  
197   - public static String emptyStr(String str)
198   - {
199   - if (str == null)
200   - {
  255 + public static String emptyStr(String str) {
  256 + if (str == null) {
201 257 return "";
202 258 }
203 259 return str;
204 260 }
205 261  
206   - public static String emptyInt(Integer str)
207   - {
208   - if (str == null)
209   - {
  262 + public static String emptyInt(Integer str) {
  263 + if (str == null) {
210 264 return "";
211 265 }
212 266 return String.valueOf(str);
213 267  
214 268  
215 269  
216 270  
217 271  
218 272  
219 273  
... ... @@ -215,46 +269,39 @@
215 269  
216 270 /**
217 271 * 替换短信中的表达式
  272 + *
218 273 * @return
219 274 */
220   - public static String replaceEL(String name,Date checkDate,String repalceStr)
221   - {
222   - if (StringUtils.isNotEmpty(repalceStr))
223   - {
  275 + public static String replaceEL(String name, Date checkDate, String repalceStr) {
  276 + if (StringUtils.isNotEmpty(repalceStr)) {
224 277 String date = DateUtil.getyyyy_MM_dd(checkDate);
225   - return repalceStr.replace("{{姓名}}",name).replace("{{预产期}}", date);
  278 + return repalceStr.replace("{{姓名}}", name).replace("{{预产期}}", date);
226 279 }
227 280 return repalceStr;
228 281 }
229 282  
230 283  
231   - public static String replaceName(String name,String repalceStr)
232   - {
233   - if (StringUtils.isNotEmpty(repalceStr))
234   - {
  284 + public static String replaceName(String name, String repalceStr) {
  285 + if (StringUtils.isNotEmpty(repalceStr)) {
235 286 return repalceStr.replace("{{姓名}}", name);
236 287 }
237 288 return repalceStr;
238 289 }
239 290  
240   - public static String replaceBaby(String name,Date birth,String repalceStr)
241   - {
242   - if (StringUtils.isNotEmpty(repalceStr))
243   - {
  291 + public static String replaceBaby(String name, Date birth, String repalceStr) {
  292 + if (StringUtils.isNotEmpty(repalceStr)) {
244 293 String date = DateUtil.getyyyy_MM_dd(birth);
245   - return repalceStr.replace("{{姓名}}",name).replace("{{出生日期}}", date);
  294 + return repalceStr.replace("{{姓名}}", name).replace("{{出生日期}}", date);
246 295 }
247 296 return repalceStr;
248 297 }
249 298  
250 299  
251   - public static String unitHandle(String value,String unit)
252   - {
253   - if (org.apache.commons.lang.StringUtils.isNotEmpty(value))
254   - {
255   - return value+ unit;
  300 + public static String unitHandle(String value, String unit) {
  301 + if (org.apache.commons.lang.StringUtils.isNotEmpty(value)) {
  302 + return value + unit;
256 303 }
257   - return "";
  304 + return "";
258 305 }
259 306  
260 307 public static <T> List<T> covertToList(String s, Class<T> clazz) {
... ... @@ -262,7 +309,7 @@
262 309 if (isNotEmpty(s)) {
263 310 String[] values = s.split(",");
264 311 for (String value : values) {
265   - if(isNotEmpty(value)){
  312 + if (isNotEmpty(value)) {
266 313 list.add((T) value);
267 314 }
268 315 }
platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java View file @ b4f010c
... ... @@ -64,7 +64,8 @@
64 64 TrackDown("TrackDown", 97222333112L),
65 65 last("last", 97531009990L),
66 66 DiagnoseConfigModel("DiagnoseConfigModel", 97531039990L),
67   - DiagnoseItemModel("DiagnoseConfigModel", 97531039590L);
  67 + DiagnoseItemModel("DiagnoseItemModel", 97531039590L),
  68 + CancerScreeningModel("CancerScreeningModel", 97531039591L);
68 69 private String cname;
69 70 private Long cid;
70 71 private SerialIdEnum(String cname, Long cid) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ b4f010c
... ... @@ -932,7 +932,6 @@
932 932 //获取所有的建档记录
933 933 List<Patients> list = patientsService.queryPatient(patientsQuery);
934 934 AntexListResult antexListResult = new AntexListResult();
935   - Map map = new HashMap();
936 935  
937 936 List sortList = new ArrayList();
938 937  
... ... @@ -951,6 +950,7 @@
951 950 antexListResult.setData(sortList);
952 951 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(antexListResult);
953 952  
  953 + // Map map = new HashMap();
954 954 // MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
955 955 // matDeliverQuery.setPid(list.get(0).getPid());
956 956 // matDeliverQuery.setYn(YnEnums.YES.getId());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ b4f010c
... ... @@ -1930,6 +1930,15 @@
1930 1930 List<String> hospitalIdList = new ArrayList<>();
1931 1931  
1932 1932 String hospitalName = "";
  1933 + String hospitalId = "";
  1934 + //得到当前登录的医院id
  1935 + if (userId != null) {
  1936 + Users dbuser = usersService.getUsers(userId);
  1937 + if (dbuser != null) {
  1938 + hospitalId = String.valueOf(dbuser.getOrgId());
  1939 + }
  1940 + }
  1941 +
1933 1942 BabyModelQuery babyQuery = new BabyModelQuery();
1934 1943 babyQuery.setQueryNo(request.getQueryNo());
1935 1944 if(String.valueOf("true").equals(request.getIsArea())){
... ... @@ -1982,14 +1991,6 @@
1982 1991 hospitalIdList.addAll(permissions);
1983 1992 }
1984 1993 }else{
1985   - String hospitalId = "";
1986   - //得到当前登录的医院id
1987   - if (userId != null) {
1988   - Users dbuser = usersService.getUsers(userId);
1989   - if (dbuser != null) {
1990   - hospitalId = String.valueOf(dbuser.getOrgId());
1991   - }
1992   - }
1993 1994 hospitalIdList.add(hospitalId);
1994 1995 hospitalName = organizationService.getOrganization(Integer.valueOf(hospitalId)).getName();
1995 1996 }
... ... @@ -2027,6 +2028,12 @@
2027 2028 ExceptionUtils.catchException(e, "baby list error.");
2028 2029 }
2029 2030 }
  2031 + }
  2032 + }
  2033 + if("216".equals(hospitalId)){
  2034 + for(BabyManageListResult result:list){
  2035 + result.setBabyName(StringUtils.encryName(result.getBabyName()));
  2036 + result.setCompleteAddress(StringUtils.encryAddr(result.getCompleteAddress()));
2030 2037 }
2031 2038 }
2032 2039 BaseListResponse objectResponse = new BaseListResponse();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ b4f010c
... ... @@ -26,7 +26,6 @@
26 26 import com.lyms.platform.query.DataPermissionsModelQuery;
27 27 import com.lyms.platform.query.PatientsQuery;
28 28 import org.apache.commons.collections.CollectionUtils;
29   -import org.apache.commons.lang.StringUtils;
30 29 import org.slf4j.Logger;
31 30 import org.slf4j.LoggerFactory;
32 31 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -97,8 +96,6 @@
97 96 private MongoTemplate mongoTemplate;
98 97  
99 98  
100   -
101   -
102 99 /**
103 100 * 修改产妇的社区
104 101 *
... ... @@ -615,7 +612,7 @@
615 612 stopWatch.stop();
616 613  
617 614 logger.info(stopWatch.toString());
618   - List data = new ArrayList<>();
  615 + List data = new ArrayList<QuanChanResult>();
619 616 if (CollectionUtils.isNotEmpty(patientses)) {
620 617 //如果是查高危孕妇
621 618 if (null != isHighRisk && Boolean.TRUE.equals(isHighRisk)) {
... ... @@ -628,6 +625,27 @@
628 625 data = convertToQuanCPatient(patientses, userId, hospital);
629 626 }
630 627 }
  628 + if ("216".equals(hospital)) {//隐藏
  629 + for (Object result : data) {
  630 + if (result instanceof RiskPatientsResult) {
  631 + RiskPatientsResult riskResult = (RiskPatientsResult) result;
  632 + riskResult.setName(StringUtils.encryName(riskResult.getName()));
  633 + riskResult.setAddr(StringUtils.encryAddr(riskResult.getAddr()));
  634 + riskResult.setRegisterAddr(StringUtils.encryAddr(riskResult.getRegisterAddr()));
  635 + } else if (result instanceof QuanPatientsResult) {
  636 + QuanPatientsResult quanResult = (QuanPatientsResult) result;
  637 + quanResult.setName(StringUtils.encryName(quanResult.getName()));
  638 + quanResult.setAddr(StringUtils.encryAddr(quanResult.getAddr()));
  639 + quanResult.setRegisterAddr(StringUtils.encryAddr(quanResult.getRegisterAddr()));
  640 + } else if (result instanceof QuanChanResult) {
  641 + QuanChanResult quanResult = (QuanChanResult) result;
  642 + quanResult.setName(StringUtils.encryName(quanResult.getName()));
  643 + quanResult.setAddr(StringUtils.encryAddr(quanResult.getAddr()));
  644 + quanResult.setRegisterAddr(StringUtils.encryAddr(quanResult.getRegisterAddr()));
  645 + }
  646 + }
  647 + }
  648 +
631 649 return new BaseListResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(patientsQuery.getPageInfo());
632 650 }
633 651