Commit cf152f00 authored by 鹿朋's avatar 鹿朋

结清证明下载

parent eadab47a
...@@ -93,6 +93,6 @@ public class JsonResult<T> implements Serializable { ...@@ -93,6 +93,6 @@ public class JsonResult<T> implements Serializable {
} }
public boolean isCodeSuccess() { public boolean isCodeSuccess() {
return "0000".equals(code); return "0".equals(code);
} }
} }
...@@ -32,6 +32,9 @@ public class IceServiceImpl implements IIceService { ...@@ -32,6 +32,9 @@ public class IceServiceImpl implements IIceService {
@Value("${mo.ice.http}") @Value("${mo.ice.http}")
private String iceUrl; private String iceUrl;
@Value("${mo-sidecar.http}")
private String sidecarUrl;
private final IHttpService httpService; private final IHttpService httpService;
@Autowired @Autowired
...@@ -148,7 +151,7 @@ public class IceServiceImpl implements IIceService { ...@@ -148,7 +151,7 @@ public class IceServiceImpl implements IIceService {
public JsonResult<List<SettleStatus>> 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 + "/middle_office/settle_proof/status"; String url = sidecarUrl + "/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);
...@@ -160,7 +163,7 @@ public class IceServiceImpl implements IIceService { ...@@ -160,7 +163,7 @@ public class IceServiceImpl implements IIceService {
header.put("Content-Type", "application/x-www-form-urlencoded"); header.put("Content-Type", "application/x-www-form-urlencoded");
String result; String result;
try { try {
result = httpService.post(url, header, param); result = httpService.get(url, header, param);
log.info("{} 结清状态查询 loanIds={},result:{}", logPre, loanIds, result); log.info("{} 结清状态查询 loanIds={},result:{}", logPre, loanIds, result);
} catch (Exception e) { } catch (Exception e) {
log.error("{} 通讯异常 url={},param={}", logPre, url, param, e); log.error("{} 通讯异常 url={},param={}", logPre, url, param, e);
...@@ -181,13 +184,13 @@ public class IceServiceImpl implements IIceService { ...@@ -181,13 +184,13 @@ 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 + "/middle_office/settleproof/apply"; String url = sidecarUrl + "/middle_office/settle_proof/apply";
if (loanId == null) { if (loanId == null) {
log.error("{} 申请订单号loanId为空", logPre); log.error("{} 申请订单号loanId为空", logPre);
return JsonResult.buildErrorStateResult("申请订单号为空", null); return JsonResult.buildErrorStateResult("申请订单号为空", null);
} }
Map<String, Object> param = Maps.newHashMap(); Map<String, Object> param = Maps.newHashMap();
param.put("loanId", loanId); param.put("loanId", String.valueOf(loanId));
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");
...@@ -213,19 +216,19 @@ public class IceServiceImpl implements IIceService { ...@@ -213,19 +216,19 @@ public class IceServiceImpl implements IIceService {
public JsonResult downloadSettle( HttpServletResponse response, Long loanId) { public JsonResult downloadSettle( HttpServletResponse response, Long loanId) {
String logPre = "IceService.downloadSettle"; String logPre = "IceService.downloadSettle";
log.info("{} 结清证明下载 loanIds={}", logPre, loanId); log.info("{} 结清证明下载 loanIds={}", logPre, loanId);
String url = iceUrl + "/middle_office/settle_proof/download"; String url = sidecarUrl + "/middle_office/settle_proof/download";
if (loanId == null) { if (loanId == null) {
log.error("{} 申请订单号loanId为空 loanId", logPre); log.error("{} 申请订单号loanId为空 loanId", logPre);
return JsonResult.buildErrorStateResult("申请订单号为空", null); return JsonResult.buildErrorStateResult("申请订单号为空", null);
} }
Map<String, Object> param = Maps.newHashMap(); Map<String, Object> param = Maps.newHashMap();
param.put("loanId", loanId); param.put("loanId", String.valueOf(loanId));
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; String result;
try { try {
result = httpService.post(url, header, param); result = httpService.get(url, header, param);
log.info("{} 结清证明下载 loanId={},result:{}", logPre, loanId, result); log.info("{} 结清证明下载 loanId={},result:{}", logPre, loanId, result);
} catch (Exception e) { } catch (Exception e) {
log.error("{} 通讯异常 url={},param={}", logPre, url, param, e); log.error("{} 通讯异常 url={},param={}", logPre, url, param, e);
......
...@@ -47,8 +47,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -47,8 +47,7 @@ public class OrderServiceImpl implements IOrderService {
@Autowired @Autowired
private IIceService iceService; private IIceService iceService;
@Autowired
private IFileService fileService;
......
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