Commit 5e40efd0 by 陶光胜

自助指标解密

parent 2155d97f
...@@ -48,6 +48,10 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService { ...@@ -48,6 +48,10 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
/** csv / xls 下载目录 */ /** csv / xls 下载目录 */
public static final String SAVE_FOLDER = "/usr/local/data-hook-file"; public static final String SAVE_FOLDER = "/usr/local/data-hook-file";
public static final List<String> PHONE = Arrays.asList("mobile", "phone", "phone_number", "receive_phone_number");
public static final List<String> CARD = Arrays.asList("card_num", "receive_card_num");
@Autowired @Autowired
FlatQueryTableDao flatQueryTableDao; FlatQueryTableDao flatQueryTableDao;
...@@ -243,15 +247,15 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService { ...@@ -243,15 +247,15 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
if ("phone_number".equals(fieldName) || "card_num".equals(fieldName)) { if ("phone_number".equals(fieldName) || "card_num".equals(fieldName)) {
if(queryDataType == QueryDataType.FULL){ if(queryDataType == QueryDataType.FULL){
String preResult = rs.getString(fieldColumnIndex); String preResult = rs.getString(fieldColumnIndex);
if(dataPermission == 1 && "phone_number".equals(fieldName)){ if(dataPermission == 1 && FreeQueryServiceImpl.FILTERS_PHONE_ONLY.contains(fieldName)){
fieldResult = DecryptUtils.decrypt(preResult); fieldResult = DecryptUtils.decrypt(preResult);
}else if(dataPermission == 2 && ("phone_number".equals(fieldName) || "card_num".equals(fieldName))){ }else if(dataPermission == 2 && FreeQueryServiceImpl.FILTERS_PHONE_AND_CARD.contains(fieldName)){
fieldResult = DecryptUtils.decrypt(preResult); fieldResult = DecryptUtils.decrypt(preResult);
}else fieldResult = rs.getObject(fieldColumnIndex); }else fieldResult = rs.getObject(fieldColumnIndex);
} else { } else {
if(dataPermission == 1 && "phone_number".equals(fieldName)){ if(dataPermission == 1 && FreeQueryServiceImpl.FILTERS_PHONE_ONLY.contains(fieldName)){
fieldResult = "******"; fieldResult = "******";
}else if(dataPermission == 2 && ("phone_number".equals(fieldName) || "card_num".equals(fieldName))){ }else if(dataPermission == 2 && FreeQueryServiceImpl.FILTERS_PHONE_AND_CARD.contains(fieldName)){
fieldResult = "******"; fieldResult = "******";
} else fieldResult = rs.getObject(fieldColumnIndex); } else fieldResult = rs.getObject(fieldColumnIndex);
} }
......
...@@ -46,10 +46,10 @@ public class FreeQueryServiceImpl implements IFreeQueryService { ...@@ -46,10 +46,10 @@ public class FreeQueryServiceImpl implements IFreeQueryService {
public static final String SAVE_FOLDER = "/usr/local/data-hook-file"; public static final String SAVE_FOLDER = "/usr/local/data-hook-file";
/** 脱敏字段 */ /** 脱敏字段 */
public static final List<String> FILTERS_PHONE_ONLY = Arrays.asList("mobile", "phone", "enterprise_name", "phone_number"); public static final List<String> FILTERS_PHONE_ONLY = Arrays.asList("mobile", "phone", "enterprise_name", "phone_number", "receive_phone_number");
/** 脱敏字段 */ /** 脱敏字段 */
public static final List<String> FILTERS_PHONE_AND_CARD = Arrays.asList("card_num", "mobile", "phone", "enterprise_name", "phone_number"); public static final List<String> FILTERS_PHONE_AND_CARD = Arrays.asList("card_num", "mobile", "phone", "enterprise_name", "phone_number", "receive_card_num");
/** 获取指定脱敏类型的过滤字段集合 /** 获取指定脱敏类型的过滤字段集合
* @param desensiType * @param desensiType
......
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