Commit b3d6b32c authored by 王向伟's avatar 王向伟

综合查询修改

parent eeffdbe1
...@@ -369,43 +369,63 @@ public class UserServiceImpl implements IUserService { ...@@ -369,43 +369,63 @@ public class UserServiceImpl implements IUserService {
log.error("{},参数验证失败,{}", logPre, tuple.getValue()); log.error("{},参数验证失败,{}", logPre, tuple.getValue());
return JsonResult.buildErrorStateResult(tuple.getValue(), null); return JsonResult.buildErrorStateResult(tuple.getValue(), null);
} }
//查询用户 JsonResult<List<ApplyOrder>> applyOrders;
JsonResult userInfo; JsonResult userInfo;
if ("2".equals(tuple.getValue())) { if ("1".equals(tuple.getValue())) {
//用户参数查询 //订单参数查询
OrderQueryParam orderQueryParam = new OrderQueryParam(); OrderQueryParam orderQueryParam = new OrderQueryParam();
orderQueryParam.setApplyOrderNo(userCombinationParam.getOrderNo()); orderQueryParam.setApplyOrderNo(userCombinationParam.getOrderNo());
orderQueryParam.setLoanId(userCombinationParam.getLoanId()); orderQueryParam.setLoanId(userCombinationParam.getLoanId());
orderQueryParam.setChannelId(userCombinationParam.getChannelId()); orderQueryParam.setChannelId(userCombinationParam.getChannelId());
orderQueryParam.setChannelOrderNo(userCombinationParam.getChannelOrderNo()); orderQueryParam.setChannelOrderNo(userCombinationParam.getChannelOrderNo());
userInfo = this.findUserInfoByOrderParam(orderQueryParam); userInfo = this.findUserInfoByOrderParam(orderQueryParam);
}else { applyOrders = findApplyOrders(orderQueryParam);
//订单参数查询 } else {
//用户参数查询
UserQueryParam userQueryParam = new UserQueryParam(); UserQueryParam userQueryParam = new UserQueryParam();
userQueryParam.setIdNo(userCombinationParam.getIdNo()); userQueryParam.setIdNo(userCombinationParam.getIdNo());
userQueryParam.setPhoneNo(userCombinationParam.getPhoneNo()); userQueryParam.setPhoneNo(userCombinationParam.getPhoneNo());
userQueryParam.setUserId(userCombinationParam.getUserId()); userQueryParam.setUserId(userCombinationParam.getUserId());
userQueryParam.setUuid(userCombinationParam.getUuid()); userQueryParam.setUuid(userCombinationParam.getUuid());
userInfo = this.findUserInfo(userQueryParam); userInfo = this.findUserInfo(userQueryParam);
applyOrders = findApplyOrders(userQueryParam);
} }
if (!userInfo.isSuccess()) { if (!userInfo.isSuccess()) {
return userInfo; return userInfo;
} }
if (!applyOrders.isSuccess()) {
return applyOrders;
}
UserBasicInfo userBasicInfo = (UserBasicInfo) userInfo.getData(); UserBasicInfo userBasicInfo = (UserBasicInfo) userInfo.getData();
List<ApplyOrder> applyOrderList = applyOrders.getData();
//通过申请订单号获得渠道订单号
List<String> applyOrderNoList = applyOrderList.stream().map(e -> e.getApplyOrderNo()).distinct().collect(Collectors.toList());
JsonResult<Map<String, String>> mapJsonResult = kaService.findMap(applyOrderNoList);
if (!mapJsonResult.isSuccess()) {
return mapJsonResult;
}
Map<String, String> data = mapJsonResult.getData();
applyOrderList.forEach(e -> e.setChannelOrderNo(data.get(e.getApplyOrderNo())));
UserCombination userCombination = new UserCombination();
userCombination.setUserInfo(userBasicInfo);
userCombination.setApplyOrderList(applyOrderList);
return JsonResult.buildSuccessResult("", userCombination);
}
//查询订单 //订单信息综合查询
private JsonResult findApplyOrders(OrderQueryParam orderQueryParam) {
String logPre = "UserService.findApplyOrders";
ApplyOrderQuery applyOrderQuery = new ApplyOrderQuery(); ApplyOrderQuery applyOrderQuery = new ApplyOrderQuery();
if("2".equals(tuple.getValue())){ Long loanId = orderQueryParam.getLoanId();
applyOrderQuery.setUserId(userBasicInfo.getUserId()); String applyNo = orderQueryParam.getApplyOrderNo();
}else {
Long loanId = userCombinationParam.getLoanId();
String applyNo = userCombinationParam.getOrderNo();
//申请订单查询(如果查询参数是渠道订单号)将渠道订单号转为借款订单号和申请订单号 //申请订单查询(如果查询参数是渠道订单号)将渠道订单号转为借款订单号和申请订单号
if (StringUtils.isNotBlank(userCombinationParam.getChannelOrderNo())) { if (StringUtils.isNotBlank(orderQueryParam.getChannelOrderNo())) {
OrderQueryParam orderQueryParam = new OrderQueryParam();
orderQueryParam.setChannelId(userCombinationParam.getChannelId());
orderQueryParam.setChannelOrderNo(userCombinationParam.getChannelOrderNo());
JsonResult<LoanOrderMapping> orderMappingJsonResult = kaService.findOrderMapping(orderQueryParam); JsonResult<LoanOrderMapping> orderMappingJsonResult = kaService.findOrderMapping(orderQueryParam);
LoanOrderMapping data; LoanOrderMapping data;
if (!orderMappingJsonResult.isSuccess() || Objects.isNull(data = orderMappingJsonResult.getData())) { if (!orderMappingJsonResult.isSuccess() || Objects.isNull(data = orderMappingJsonResult.getData())) {
...@@ -417,32 +437,22 @@ public class UserServiceImpl implements IUserService { ...@@ -417,32 +437,22 @@ public class UserServiceImpl implements IUserService {
} }
applyOrderQuery.setLoanId(loanId); applyOrderQuery.setLoanId(loanId);
applyOrderQuery.setOrderNo(applyNo); applyOrderQuery.setOrderNo(applyNo);
}
//申请订单查询 //申请订单查询
JsonResult<List<ApplyOrder>> applyOrders = xyqbService.findApplyOrders(applyOrderQuery); JsonResult<List<ApplyOrder>> applyOrders = xyqbService.findApplyOrders(applyOrderQuery);
if (!applyOrders.isSuccess()) {
return applyOrders; return applyOrders;
} }
List<ApplyOrder> applyOrderList = applyOrders.getData(); //用户信息综合查询
//通过申请订单号获得渠道订单号 private JsonResult findApplyOrders(UserQueryParam userQueryParam) {
List<String> applyOrderNoList = applyOrderList.stream().map(e -> e.getApplyOrderNo()).distinct().collect(Collectors.toList());
JsonResult<Map<String, String>> mapJsonResult = kaService.findMap(applyOrderNoList);
if (!mapJsonResult.isSuccess()) {
return mapJsonResult;
}
Map<String, String> data = mapJsonResult.getData();
applyOrderList.forEach(e -> e.setChannelOrderNo(data.get(e.getApplyOrderNo())));
UserCombination userCombination = new UserCombination(); ApplyOrderQuery applyOrderQuery = new ApplyOrderQuery();
userCombination.setUserInfo(userBasicInfo); applyOrderQuery.setUserId(userQueryParam.getUserId());
userCombination.setApplyOrderList(applyOrderList); //申请订单查询
JsonResult<List<ApplyOrder>> applyOrders = xyqbService.findApplyOrders(applyOrderQuery);
return JsonResult.buildSuccessResult("", userCombination); return applyOrders;
} }
@Override @Override
public JsonResult findUserInfoByOrderParam(OrderQueryParam orderQueryParam) { public JsonResult findUserInfoByOrderParam(OrderQueryParam orderQueryParam) {
......
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