修改脱敏查询导出bug

parent 41f1c86e
...@@ -286,7 +286,7 @@ public class UserQueryLogController { ...@@ -286,7 +286,7 @@ public class UserQueryLogController {
//保存记录 //保存记录
UserQueryLog log=new UserQueryLog(); UserQueryLog log=new UserQueryLog();
log.setQueryItems(columns.replace("userId","用户ID").replace("phoneNo","手机号").replace("idNo","身份证号").replace("bankCard","银行卡号").replace("address","地址")); log.setQueryItems(columns.replace("userId","用户ID").replace("phoneNo","手机号").replace("idNo","身份证号").replace("bankCard","银行卡号").replace("address","地址"));
log.setResultAmount(Long.valueOf(userDetailPage.getTotalPages())); log.setResultAmount(Long.valueOf(userDetailPage.getTotalElements()));
//转换存储 //转换存储
log.setQueryCondition(key.replace("userId","用户ID").replace("phoneNo","手机号").replace("idNo","身份证号")); log.setQueryCondition(key.replace("userId","用户ID").replace("phoneNo","手机号").replace("idNo","身份证号"));
log.setQueryDetail(keyValues.replace("\n",";")); log.setQueryDetail(keyValues.replace("\n",";"));
...@@ -304,7 +304,7 @@ public class UserQueryLogController { ...@@ -304,7 +304,7 @@ public class UserQueryLogController {
} }
private HashMap<String,String> getBankCardsByPhoneNos(List<String> phoneNos){ private HashMap<String,String> getBankCardsByPhoneNos(List<String> phoneNos){
//String ph="15686171025";
String phoneNoStr= new Gson().toJson(phoneNos); String phoneNoStr= new Gson().toJson(phoneNos);
String data=""; String data="";
String sign=""; String sign="";
...@@ -333,8 +333,7 @@ public class UserQueryLogController { ...@@ -333,8 +333,7 @@ public class UserQueryLogController {
//校验签名 //校验签名
if(MD5Util.build(dataStr).equals(signStr)){ if(MD5Util.build(dataStr).equals(signStr)){
String jsonDataStr=RSA.decrypt(dataStr,privateKey); String jsonDataStr=RSA.decrypt(dataStr,privateKey);
//String chang=jsonDataStr.substring(1,jsonDataStr.length()-1); JsonArray listObj = new JsonParser().parse(jsonDataStr).getAsJsonArray();
JsonArray listObj = new JsonParser().parse(jsonDataStr).getAsJsonArray();//.getAsJsonObject();
for(JsonElement jsonElement : listObj) { for(JsonElement jsonElement : listObj) {
JsonObject jo = jsonElement.getAsJsonObject(); JsonObject jo = jsonElement.getAsJsonObject();
JsonArray cardList = jo.get("cardList").getAsJsonArray(); JsonArray cardList = jo.get("cardList").getAsJsonArray();
...@@ -344,7 +343,10 @@ public class UserQueryLogController { ...@@ -344,7 +343,10 @@ public class UserQueryLogController {
for(JsonElement element : cardList){ for(JsonElement element : cardList){
cards=cards+element.getAsString()+";"; cards=cards+element.getAsString()+";";
} }
phonesMap.put(phone,cards.substring(0,cards.length()-1)); if(cards.length()>0){
phonesMap.put(phone,cards.substring(0,cards.length()-1));
}
} }
}else{ }else{
phonesMap.put("errorMsg","签名校验失败!"); phonesMap.put("errorMsg","签名校验失败!");
...@@ -354,10 +356,7 @@ public class UserQueryLogController { ...@@ -354,10 +356,7 @@ public class UserQueryLogController {
phonesMap.put("errorMsg",obj.get("msg").getAsString()); phonesMap.put("errorMsg",obj.get("msg").getAsString());
LOGGER.info("从支付中心接口返回data为null"); LOGGER.info("从支付中心接口返回data为null");
} }
// if(obj.get("msg")!=null&&!obj.get("msg").getAsString().equals("")){
// phonesMap.put("errorMsg",obj.get("msg").getAsString());
// LOGGER.info("从支付中心接口返回");
// }
}catch(Exception e){ }catch(Exception e){
phonesMap.put("errorMsg","查询银行卡信息接口返回解析异常"); phonesMap.put("errorMsg","查询银行卡信息接口返回解析异常");
LOGGER.info("查询银行卡信息接口返回解析异常"); LOGGER.info("查询银行卡信息接口返回解析异常");
...@@ -368,7 +367,6 @@ public class UserQueryLogController { ...@@ -368,7 +367,6 @@ public class UserQueryLogController {
@RequestMapping("/exportUserInfo") @RequestMapping("/exportUserInfo")
public JsonResult exportExcel(final HttpServletResponse response,String key,String keyValues, String columns,String token){ public JsonResult exportExcel(final HttpServletResponse response,String key,String keyValues, String columns,String token){
//String token=request.getHeader("x-auth-token");
if(token==null||token.equals("")){ if(token==null||token.equals("")){
return JsonResult.buildErrorStateResult("缺少授权信息",null); return JsonResult.buildErrorStateResult("缺少授权信息",null);
} }
...@@ -376,7 +374,6 @@ public class UserQueryLogController { ...@@ -376,7 +374,6 @@ public class UserQueryLogController {
if(userName.equals("")){ if(userName.equals("")){
return JsonResult.buildErrorStateResult("未授权查询",null); return JsonResult.buildErrorStateResult("未授权查询",null);
} }
//输入enter换行\n //输入enter换行\n
if(org.apache.commons.lang3.StringUtils.isEmpty(keyValues)){ if(org.apache.commons.lang3.StringUtils.isEmpty(keyValues)){
return JsonResult.buildErrorStateResult("请输入查询条件",null); return JsonResult.buildErrorStateResult("请输入查询条件",null);
...@@ -556,11 +553,6 @@ public class UserQueryLogController { ...@@ -556,11 +553,6 @@ public class UserQueryLogController {
cell4.setCellValue(user.getAddress()==null?" ":user.getAddress()); cell4.setCellValue(user.getAddress()==null?" ":user.getAddress());
} }
// row.createCell(0).setCellValue();
// row.createCell(1).setCellValue(user.getPhoneNo());
// row.createCell(2).setCellValue(user.getIdNo());
// row.createCell(3).setCellValue(user.getBankCards());
// row.createCell(4).setCellValue(user.getAddress());
} }
} }
// 第六步,将文件存到指定位置 // 第六步,将文件存到指定位置
......
...@@ -3,7 +3,7 @@ configserver.disable=1 ...@@ -3,7 +3,7 @@ configserver.disable=1
configserver.system=xyqb-user configserver.system=xyqb-user
#xyqb.data.mysql.jdbc-url=jdbc:mysql://192.168.4.22:3306/xyqb_user?useUnicode=true&characterEncoding=UTF8 #xyqb.data.mysql.jdbc-url=jdbc:mysql://192.168.4.22:3306/xyqb_user?useUnicode=true&characterEncoding=UTF8
xyqb.data.mysql.jdbc-url=jdbc:mysql://192.168.4.23:3306/xyqb_user?useUnicode=true&characterEncoding=UTF8 xyqb.data.mysql.jdbc-url=jdbc:mysql://192.168.4.26:3306/xyqb_user?useUnicode=true&characterEncoding=UTF8
xyqb.data.mysql.password=qatest xyqb.data.mysql.password=qatest
...@@ -92,7 +92,7 @@ xyqb.user.domain=passport.xyqb.com ...@@ -92,7 +92,7 @@ xyqb.user.domain=passport.xyqb.com
xyqb.user.query.url=http://192.168.11.40:8081 xyqb.user.query.url=http://192.168.11.40:8081
xyqb.domain = http://192.168.4.153:7003 xyqb.domain = http://192.168.4.153:7003
xyqb.paycenter.url=http://payapi.xyqb.com/ xyqb.paycenter.url=http://192.168.4.26:7006
xyqb.paycenter.id=3 xyqb.paycenter.id=3
#内部运营系统 #内部运营系统
xyqb.yunying.url=http://opapi.xyqb.com xyqb.yunying.url=http://192.168.4.26:7047
\ No newline at end of file \ No newline at end of file
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