Commit 983b2fb0 by guojuxing

导出修改:添加加密功能

parent 49825975
......@@ -243,7 +243,7 @@ public class DownloadUtils {
String convertValue = loader.convertProperty(bean, name, property);
//加密处理
if (needEncryptField != null && needEncryptField.contains(name)) {
convertValue = "****";
convertValue = encrypt(convertValue);
}
// 组装成row
result.add(convertValue);
......@@ -256,4 +256,20 @@ public class DownloadUtils {
}
}
private static String encrypt(String data) {
if (StringUtils.isBlank(data)) {
return data;
}
//手机号或者会员卡号 第5-8位用*代替
int length = data.length();
if (length > 8) {
return data.substring(0, 4) + "****" + data.substring(8);
} else if (length > 4) {
return data.substring(0, 4) + "****";
} else {
return "****";
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment