Commit c47d42b58f406bc852aef535809bb8bc746234e9
1 parent
1afb35c048
Exists in
master
and in
6 other branches
bug
xiufu
Showing 2 changed files with 25 additions and 4 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/StringUtils.java
View file @
c47d42b
... | ... | @@ -131,6 +131,27 @@ |
131 | 131 | return phone; |
132 | 132 | } |
133 | 133 | |
134 | + /** | |
135 | + * 证件号加密处理 | |
136 | + * @param id | |
137 | + * @return | |
138 | + */ | |
139 | + public static String encryCardNo(String id) { | |
140 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)) { | |
141 | + return ""; | |
142 | + } | |
143 | + if (id.length() == 11) { | |
144 | + return id.substring(0, 3) + "****" + id.substring(7); | |
145 | + } | |
146 | + if (id.length() == 15) { | |
147 | + return id.substring(0, 6) + "****" + id.substring(10, 13) + "*" + id.substring(14); | |
148 | + } | |
149 | + if (id.length() == 18) { | |
150 | + return id.substring(0, 6) + "******" + id.substring(12, 15) + "**" + id.substring(17); | |
151 | + } | |
152 | + return ""; | |
153 | + } | |
154 | + | |
134 | 155 | public static Date getBirthDay(String idCard){ |
135 | 156 | if (isEmpty(idCard)) |
136 | 157 | { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PostReviewServiceImpl.java
View file @
c47d42b
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 | tempMap.put("vcCardNo", p.getVcCardNo()); |
81 | 81 | tempMap.put("pcerteTypeId", p.getPcerteTypeId()); |
82 | 82 | tempMap.put("checkTime", model.getCheckTime() == null ? null : DateUtil.getyyyy_MM_dd(model.getCheckTime())); /** 复查日期 */ |
83 | - tempMap.put("hcertificateNum", p == null ? null : p.getCardNo()); /** 证件号 */ | |
83 | + tempMap.put("hcertificateNum", p == null ? null : StringUtils.encryCardNo(p.getCardNo())); /** 证件号 */ | |
84 | 84 | tempMap.put("name", p == null ? null : p.getUsername()); /** 姓名 */ |
85 | 85 | tempMap.put("age", p == null ? null : DateUtil.getAge(p.getBirth())); /** 年龄 */ |
86 | 86 | tempMap.put("day", p == null ? null : model.getDay()); /** 产后天数 */ |
... | ... | @@ -94,7 +94,7 @@ |
94 | 94 | } else { |
95 | 95 | tempMap.put("doctorName", null); |
96 | 96 | } |
97 | - tempMap.put("phone", p == null ? null : p.getPhone()); | |
97 | + tempMap.put("phone", p == null ? null : StringUtils.encryPhone(p.getPhone())); | |
98 | 98 | rest.add(tempMap); |
99 | 99 | } |
100 | 100 | pageResult.setGrid(rest); |
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 | cnames.put("id", "#"); |
111 | 111 | cnames.put("checkTime", "复查日期"); |
112 | 112 | cnames.put("hcertificateNum", "证件号"); |
113 | - cnames.put("username", "姓名"); | |
113 | + cnames.put("name", "姓名"); | |
114 | 114 | cnames.put("age", "年龄"); |
115 | 115 | cnames.put("day", "产后天数"); |
116 | 116 | cnames.put("reviewCount", "复查次数"); |
... | ... | @@ -126,7 +126,7 @@ |
126 | 126 | result.put("id", ++i); |
127 | 127 | result.put("checkTime", data.get("checkTime")); |
128 | 128 | result.put("hcertificateNum", data.get("hcertificateNum")); |
129 | - result.put("username", data.get("username")); | |
129 | + result.put("name", data.get("name")); | |
130 | 130 | result.put("age", data.get("age")); |
131 | 131 | result.put("day", data.get("day")); |
132 | 132 | result.put("reviewCount", data.get("reviewCount")); |