Commit eadab47a authored by 鹿朋's avatar 鹿朋

结清证明下载

parent b0dad9e9
...@@ -45,7 +45,9 @@ public class ActiveApplyOrder { ...@@ -45,7 +45,9 @@ public class ActiveApplyOrder {
private String updateAt; private String updateAt;
private String remark; private String remark;
/**
* 0-未申请(显示申请按钮) 1-处理中 2-可下载(显示下载按钮) 3-不支持(按钮不显示)
*/
private Integer settleFlag; private Integer settleFlag;
} }
package cn.quantgroup.customer.model.order;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* @author lupeng
* 2020/10/14
*/
@Data
@AllArgsConstructor
public class ApplySettleResult {
private Boolean result;
}
package cn.quantgroup.customer.model.order;
import lombok.Data;
/**
* @author lupeng
* 2020/10/14
*/
@Data
public class SettleStatus {
private Long loanId;
/**
* 结清证明申请进度 0-未申请 1-处理中 2-可下载 3-不支持
*/
private Integer proofProgress;
}
...@@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
/** /**
* @author Wang Xiangwei * @author Wang Xiangwei
* @version 2020/3/9 * @version 2020/3/9
...@@ -103,8 +105,8 @@ public class OrderRest { ...@@ -103,8 +105,8 @@ public class OrderRest {
* @return * @return
*/ */
@GetMapping("/download_settle/{loanId}") @GetMapping("/download_settle/{loanId}")
public JsonResult downloadSettle(@PathVariable Long loanId) { public JsonResult downloadSettle(HttpServletResponse response, @PathVariable Long loanId) {
log.info("[结清证明下载],请求参数:loanId={}", loanId); log.info("[结清证明下载],请求参数:loanId={}", loanId);
return orderService.downloadSettle(loanId); return orderService.downloadSettle(response, loanId);
} }
} }
...@@ -92,4 +92,7 @@ public class JsonResult<T> implements Serializable { ...@@ -92,4 +92,7 @@ public class JsonResult<T> implements Serializable {
return "0000".equals(code) && "0000".equals(businessCode); return "0000".equals(code) && "0000".equals(businessCode);
} }
public boolean isCodeSuccess() {
return "0000".equals(code);
}
} }
package cn.quantgroup.customer.service; package cn.quantgroup.customer.service;
import cn.quantgroup.customer.rest.vo.JsonResult;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.net.MalformedURLException; import java.net.MalformedURLException;
...@@ -10,4 +13,13 @@ import java.net.MalformedURLException; ...@@ -10,4 +13,13 @@ import java.net.MalformedURLException;
public interface IFileService { public interface IFileService {
BufferedInputStream getBufferedInputStream(Long loanId) throws MalformedURLException, Exception; BufferedInputStream getBufferedInputStream(Long loanId) throws MalformedURLException, Exception;
/**
* 下载文件
* @param response
* @param fileName
* @param file
* @return
*/
JsonResult outputFile(HttpServletResponse response, String fileName, byte[] file);
} }
...@@ -3,9 +3,11 @@ package cn.quantgroup.customer.service; ...@@ -3,9 +3,11 @@ package cn.quantgroup.customer.service;
import cn.quantgroup.customer.model.order.ApplyOrder; import cn.quantgroup.customer.model.order.ApplyOrder;
import cn.quantgroup.customer.model.order.FlowNode; import cn.quantgroup.customer.model.order.FlowNode;
import cn.quantgroup.customer.model.order.LoanOrder; import cn.quantgroup.customer.model.order.LoanOrder;
import cn.quantgroup.customer.model.order.SettleStatus;
import cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery; import cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery;
import cn.quantgroup.customer.rest.vo.JsonResult; import cn.quantgroup.customer.rest.vo.JsonResult;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -14,9 +16,9 @@ public interface IIceService { ...@@ -14,9 +16,9 @@ public interface IIceService {
JsonResult<LoanOrder> findLoanOrder(Long loanId); JsonResult<LoanOrder> findLoanOrder(Long loanId);
JsonResult<List<FlowNode>> findFlowChart(String orderNo); JsonResult<List<FlowNode>> findFlowChart(String orderNo);
JsonResult<Map<Long, Integer>> findSettleFlag(List<Long> loanIds); JsonResult<List<SettleStatus>> findSettleFlag(List<Long> loanIds);
JsonResult applySettle(Long loanId); JsonResult applySettle(Long loanId);
JsonResult downloadSettle(Long loanId); JsonResult downloadSettle(HttpServletResponse response, Long loanId);
} }
...@@ -7,6 +7,7 @@ import cn.quantgroup.customer.rest.param.ordermapping.OperateEntryParam; ...@@ -7,6 +7,7 @@ import cn.quantgroup.customer.rest.param.ordermapping.OperateEntryParam;
import cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam; import cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam;
import cn.quantgroup.customer.rest.vo.JsonResult; import cn.quantgroup.customer.rest.vo.JsonResult;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -77,5 +78,5 @@ public interface IOrderService{ ...@@ -77,5 +78,5 @@ public interface IOrderService{
* @param loanId * @param loanId
* @return * @return
*/ */
JsonResult downloadSettle(Long loanId); JsonResult downloadSettle(HttpServletResponse response, Long loanId);
} }
package cn.quantgroup.customer.service.impl; package cn.quantgroup.customer.service.impl;
import cn.quantgroup.customer.rest.vo.JsonResult;
import cn.quantgroup.customer.service.IFileService; import cn.quantgroup.customer.service.IFileService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.net.URLEncoder;
/** /**
* 文件流转发 * 文件流转发
...@@ -15,6 +23,7 @@ import java.net.URL; ...@@ -15,6 +23,7 @@ import java.net.URL;
* @version 2020-09-30 17:28 * @version 2020-09-30 17:28
*/ */
@Service @Service
@Slf4j
public class FileServiceImpl implements IFileService { public class FileServiceImpl implements IFileService {
...@@ -64,4 +73,43 @@ public class FileServiceImpl implements IFileService { ...@@ -64,4 +73,43 @@ public class FileServiceImpl implements IFileService {
} }
return null; return null;
} }
@Override
public JsonResult outputFile(HttpServletResponse response, String fileName, byte[] file){
if (ArrayUtils.isEmpty(file)) {
log.info("get file download url failed.");
return JsonResult.buildErrorStateResult("file is null");
}
// 设置相关头信息
response.setContentType("multipart/form-data");
try {
fileName = URLEncoder.encode(fileName, "UTF8");
} catch (UnsupportedEncodingException e) {
log.error("fileName encode failed. errorMessage[{}]", e.getMessage());
return JsonResult.buildErrorStateResult("fileName encode failed");
}
response.setHeader("Content-disposition", "attachment;filename=" + fileName);
response.addHeader("Pragma", "no-cache");
response.addHeader("Cache-Control", "no-cache");
response.addDateHeader("Expries", 0);
// 返回文件
OutputStream out = null;
try {
out = response.getOutputStream();
out.write(file);
out.flush();
} catch (IOException e) {
log.error("download file failed. errorMessage[{}]", e.getMessage());
return JsonResult.buildErrorStateResult("download file failed");
} finally {
if (null != out) {
try {
out.close();
} catch (IOException e) {
log.error("OutputStream close failed. errorMessage[{}]", e.getMessage());
}
}
}
return JsonResult.buildSuccessResult("ok",null);
}
} }
package cn.quantgroup.customer.service.impl; package cn.quantgroup.customer.service.impl;
import cn.quantgroup.customer.model.order.ApplyOrder; import cn.quantgroup.customer.model.order.*;
import cn.quantgroup.customer.model.order.FlowNode;
import cn.quantgroup.customer.model.order.LoanOrder;
import cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery; import cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery;
import cn.quantgroup.customer.rest.vo.JsonResult; import cn.quantgroup.customer.rest.vo.JsonResult;
import cn.quantgroup.customer.service.IFileService;
import cn.quantgroup.customer.service.IIceService; import cn.quantgroup.customer.service.IIceService;
import cn.quantgroup.customer.service.http.IHttpService; import cn.quantgroup.customer.service.http.IHttpService;
import cn.quantgroup.customer.util.JSONTools; import cn.quantgroup.customer.util.JSONTools;
...@@ -12,11 +11,16 @@ import com.fasterxml.jackson.core.type.TypeReference; ...@@ -12,11 +11,16 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import sun.security.pkcs11.wrapper.Constants;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
...@@ -30,6 +34,9 @@ public class IceServiceImpl implements IIceService { ...@@ -30,6 +34,9 @@ public class IceServiceImpl implements IIceService {
private final IHttpService httpService; private final IHttpService httpService;
@Autowired
private IFileService fileService;
@Autowired @Autowired
public IceServiceImpl(IHttpService httpService) { public IceServiceImpl(IHttpService httpService) {
...@@ -138,10 +145,10 @@ public class IceServiceImpl implements IIceService { ...@@ -138,10 +145,10 @@ public class IceServiceImpl implements IIceService {
} }
@Override @Override
public JsonResult<Map<Long, Integer>> findSettleFlag(List<Long> loanIds) { public JsonResult<List<SettleStatus>> findSettleFlag(List<Long> loanIds) {
String logPre = "IceService.findSettleFlag"; String logPre = "IceService.findSettleFlag";
log.info("{} 结清状态查询 loanIds={}", logPre, loanIds); log.info("{} 结清状态查询 loanIds={}", logPre, loanIds);
String url = iceUrl + ""; String url = iceUrl + "/middle_office/settle_proof/status";
if (CollectionUtils.isEmpty(loanIds)) { if (CollectionUtils.isEmpty(loanIds)) {
log.error("{} 订单号全为空 loanIds={}", logPre, loanIds); log.error("{} 订单号全为空 loanIds={}", logPre, loanIds);
return JsonResult.buildErrorStateResult("申请订单号为空", null); return JsonResult.buildErrorStateResult("申请订单号为空", null);
...@@ -151,7 +158,7 @@ public class IceServiceImpl implements IIceService { ...@@ -151,7 +158,7 @@ public class IceServiceImpl implements IIceService {
Map<String, String> header = Maps.newHashMap(); Map<String, String> header = Maps.newHashMap();
header.put("Content-Type", "application/x-www-form-urlencoded"); header.put("Content-Type", "application/x-www-form-urlencoded");
String result = null; String result;
try { try {
result = httpService.post(url, header, param); result = httpService.post(url, header, param);
log.info("{} 结清状态查询 loanIds={},result:{}", logPre, loanIds, result); log.info("{} 结清状态查询 loanIds={},result:{}", logPre, loanIds, result);
...@@ -164,9 +171,9 @@ public class IceServiceImpl implements IIceService { ...@@ -164,9 +171,9 @@ public class IceServiceImpl implements IIceService {
log.error("{} 调用失败 url={}, header={},param={},result={}", logPre, url, header, param, result); log.error("{} 调用失败 url={}, header={},param={},result={}", logPre, url, header, param, result);
return JsonResult.buildErrorStateResult("结清状态查询失败", null); return JsonResult.buildErrorStateResult("结清状态查询失败", null);
} }
TypeReference<JsonResult<Map<Long, Integer>>> typeToken = new TypeReference<JsonResult<Map<Long, Integer>>>() { TypeReference<JsonResult<List<SettleStatus>>> typeToken = new TypeReference<JsonResult<List<SettleStatus>>>() {
}; };
JsonResult<Map<Long, Integer>> jsonResult = JSONTools.deserialize(result, typeToken); JsonResult<List<SettleStatus>> jsonResult = JSONTools.deserialize(result, typeToken);
return jsonResult; return jsonResult;
} }
...@@ -174,9 +181,9 @@ public class IceServiceImpl implements IIceService { ...@@ -174,9 +181,9 @@ public class IceServiceImpl implements IIceService {
public JsonResult applySettle(Long loanId) { public JsonResult applySettle(Long loanId) {
String logPre = "IceService.applySettle"; String logPre = "IceService.applySettle";
log.info("{} 申请结清下载 loanIds={}", logPre, loanId); log.info("{} 申请结清下载 loanIds={}", logPre, loanId);
String url = iceUrl + ""; String url = iceUrl + "/middle_office/settleproof/apply";
if (loanId != null) { if (loanId == null) {
log.error("{} 申请订单号为空 loanId={}", logPre, loanId); log.error("{} 申请订单号loanId为空", logPre);
return JsonResult.buildErrorStateResult("申请订单号为空", null); return JsonResult.buildErrorStateResult("申请订单号为空", null);
} }
Map<String, Object> param = Maps.newHashMap(); Map<String, Object> param = Maps.newHashMap();
...@@ -184,7 +191,7 @@ public class IceServiceImpl implements IIceService { ...@@ -184,7 +191,7 @@ public class IceServiceImpl implements IIceService {
Map<String, String> header = Maps.newHashMap(); Map<String, String> header = Maps.newHashMap();
header.put("Content-Type", "application/x-www-form-urlencoded"); header.put("Content-Type", "application/x-www-form-urlencoded");
String result = null; String result;
try { try {
result = httpService.post(url, header, param); result = httpService.post(url, header, param);
log.info("{} 申请结清下载 loanId={},result:{}", logPre, loanId, result); log.info("{} 申请结清下载 loanId={},result:{}", logPre, loanId, result);
...@@ -197,14 +204,41 @@ public class IceServiceImpl implements IIceService { ...@@ -197,14 +204,41 @@ public class IceServiceImpl implements IIceService {
log.error("{} 调用失败 url={}, header={},param={},result={}", logPre, url, header, param, result); log.error("{} 调用失败 url={}, header={},param={},result={}", logPre, url, header, param, result);
return JsonResult.buildErrorStateResult("申请结清下载失败", null); return JsonResult.buildErrorStateResult("申请结清下载失败", null);
} }
TypeReference<JsonResult<Boolean>> typeToken = new TypeReference<JsonResult<Boolean>>() { TypeReference<JsonResult> typeToken = new TypeReference<JsonResult>() {
}; };
JsonResult<Boolean> jsonResult = JSONTools.deserialize(result, typeToken); return JSONTools.deserialize(result, typeToken);
return jsonResult;
} }
@Override @Override
public JsonResult downloadSettle(Long loanId) { public JsonResult downloadSettle( HttpServletResponse response, Long loanId) {
return null; String logPre = "IceService.downloadSettle";
log.info("{} 结清证明下载 loanIds={}", logPre, loanId);
String url = iceUrl + "/middle_office/settle_proof/download";
if (loanId == null) {
log.error("{} 申请订单号loanId为空 loanId", logPre);
return JsonResult.buildErrorStateResult("申请订单号为空", null);
}
Map<String, Object> param = Maps.newHashMap();
param.put("loanId", loanId);
Map<String, String> header = Maps.newHashMap();
header.put("Content-Type", "application/x-www-form-urlencoded");
String result;
try {
result = httpService.post(url, header, param);
log.info("{} 结清证明下载 loanId={},result:{}", logPre, loanId, result);
} catch (Exception e) {
log.error("{} 通讯异常 url={},param={}", logPre, url, param, e);
return JsonResult.buildErrorStateResult("通讯异常", null);
}
if (StringUtils.isBlank(result)) {
log.error("{} 调用失败 url={}, header={},param={},result={}", logPre, url, header, param, result);
return JsonResult.buildErrorStateResult("结清证明下载失败", null);
}
TypeReference<JsonResult> typeToken = new TypeReference<JsonResult>() {
};
JsonResult<byte[]> jsonResult = JSONTools.deserialize(result, typeToken);
return fileService.outputFile(response, System.currentTimeMillis() + loanId +"settle.pdf", jsonResult.getData());
} }
} }
...@@ -19,6 +19,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -19,6 +19,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
...@@ -46,6 +47,8 @@ public class OrderServiceImpl implements IOrderService { ...@@ -46,6 +47,8 @@ public class OrderServiceImpl implements IOrderService {
@Autowired @Autowired
private IIceService iceService; private IIceService iceService;
@Autowired
private IFileService fileService;
...@@ -470,12 +473,19 @@ public class OrderServiceImpl implements IOrderService { ...@@ -470,12 +473,19 @@ public class OrderServiceImpl implements IOrderService {
@Override @Override
public JsonResult applySettle(Long loanId) { public JsonResult applySettle(Long loanId) {
return iceService.applySettle(loanId); JsonResult iceResult = iceService.applySettle(loanId);
ApplySettleResult result = new ApplySettleResult(true);
if (!iceResult.isCodeSuccess()) {
result.setResult(false);
return JsonResult.buildErrorStateResult("申请失败", result);
} else {
return JsonResult.buildSuccessResult("申请成功", result);
}
} }
@Override @Override
public JsonResult downloadSettle(Long loanId) { public JsonResult downloadSettle(HttpServletResponse response,Long loanId) {
return iceService.downloadSettle(loanId); return iceService.downloadSettle(response, loanId);
} }
/** /**
......
...@@ -8,6 +8,7 @@ import cn.quantgroup.customer.model.Tuple; ...@@ -8,6 +8,7 @@ import cn.quantgroup.customer.model.Tuple;
import cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping; import cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping;
import cn.quantgroup.customer.model.order.ActiveApplyOrder; import cn.quantgroup.customer.model.order.ActiveApplyOrder;
import cn.quantgroup.customer.model.order.ApplyOrder; import cn.quantgroup.customer.model.order.ApplyOrder;
import cn.quantgroup.customer.model.order.SettleStatus;
import cn.quantgroup.customer.model.xyqbuser.UserBasicInfo; import cn.quantgroup.customer.model.xyqbuser.UserBasicInfo;
import cn.quantgroup.customer.model.xyqbuser.UserCombination; import cn.quantgroup.customer.model.xyqbuser.UserCombination;
import cn.quantgroup.customer.repo.UserRepo; import cn.quantgroup.customer.repo.UserRepo;
...@@ -482,6 +483,20 @@ public class UserServiceImpl implements IUserService { ...@@ -482,6 +483,20 @@ public class UserServiceImpl implements IUserService {
Map<String, String> data = mapJsonResult.getData(); Map<String, String> data = mapJsonResult.getData();
activeApplyOrders.forEach(e -> e.setChannelOrderNo(data.get(e.getApplyOrderNo()))); activeApplyOrders.forEach(e -> e.setChannelOrderNo(data.get(e.getApplyOrderNo())));
} }
// 添加能否申请结清证明
JsonResult<List<SettleStatus>> settleFlagResult = null;
if (CollectionUtils.isNotEmpty(activeApplyOrders)) {
settleFlagResult = iceService.findSettleFlag(activeApplyOrders.stream().filter(it-> it.getLoanId() != null).map(ActiveApplyOrder::getLoanId).collect(Collectors.toList()));
}
if (settleFlagResult != null && settleFlagResult.isCodeSuccess()) {
for (ActiveApplyOrder activeOrder : activeApplyOrders) {
for (SettleStatus settleStatus : settleFlagResult.getData()) {
if(settleStatus.getLoanId().equals(activeOrder.getLoanId())) {
activeOrder.setSettleFlag(settleStatus.getProofProgress());
}
}
}
}
} }
if (CollectionUtils.isNotEmpty(invalidApplyOrders)) { if (CollectionUtils.isNotEmpty(invalidApplyOrders)) {
...@@ -527,7 +542,22 @@ public class UserServiceImpl implements IUserService { ...@@ -527,7 +542,22 @@ public class UserServiceImpl implements IUserService {
//JsonResult<ApplyOrder> applyOrders = xyqbService.findApplyOrders(applyOrderQuery); //JsonResult<ApplyOrder> applyOrders = xyqbService.findApplyOrders(applyOrderQuery);
//todo 替换中台接口 //todo 替换中台接口
JsonResult<ApplyOrder> applyOrders = iceService.findApplyOrders(applyOrderQuery); JsonResult<ApplyOrder> applyOrders = iceService.findApplyOrders(applyOrderQuery);
// // 添加能否结清标记
// if (applyOrders.isSuccess()) {
// JsonResult<Map<Long, Integer>> settleFlagResult = null;
// List<ActiveApplyOrder> activeOrders = applyOrders.getData().getActiveOrders();
// if (CollectionUtils.isNotEmpty(activeOrders)) {
// settleFlagResult = iceService.findSettleFlag(activeOrders.stream().filter(it-> it.getLoanId() != null).map(ActiveApplyOrder::getLoanId).collect(Collectors.toList()));
// }
// if (settleFlagResult != null && settleFlagResult.isSuccess()) {
// for (ActiveApplyOrder activeOrder : activeOrders) {
// Integer flag = settleFlagResult.getData().get(activeOrder.getLoanId());
// if (activeOrder.getLoanId() != null && flag != null) {
// activeOrder.setSettleFlag(flag);
// }
// }
// }
// }
return applyOrders; return applyOrders;
} }
...@@ -541,23 +571,6 @@ public class UserServiceImpl implements IUserService { ...@@ -541,23 +571,6 @@ public class UserServiceImpl implements IUserService {
//JsonResult<ApplyOrder> applyOrders = xyqbService.findApplyOrders(applyOrderQuery); //JsonResult<ApplyOrder> applyOrders = xyqbService.findApplyOrders(applyOrderQuery);
//todo 替换中台接口 //todo 替换中台接口
JsonResult<ApplyOrder> applyOrders = iceService.findApplyOrders(applyOrderQuery); JsonResult<ApplyOrder> applyOrders = iceService.findApplyOrders(applyOrderQuery);
// 添加能否结清标记
if (applyOrders.isSuccess()) {
JsonResult<Map<Long, Integer>> settleFlagResult = null;
List<ActiveApplyOrder> activeOrders = applyOrders.getData().getActiveOrders();
if (CollectionUtils.isNotEmpty(activeOrders)) {
settleFlagResult = iceService.findSettleFlag(activeOrders.stream().filter(it-> it.getLoanId() != null).map(ActiveApplyOrder::getLoanId).collect(Collectors.toList()));
}
if (settleFlagResult != null && settleFlagResult.isSuccess()) {
for (ActiveApplyOrder activeOrder : activeOrders) {
Integer flag = settleFlagResult.getData().get(activeOrder.getLoanId());
if (activeOrder.getLoanId() != null && flag != null) {
activeOrder.setSettleFlag(flag);
}
}
}
}
return applyOrders; return applyOrders;
} }
......
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