Commit 14f0e90a authored by 王向伟's avatar 王向伟

查询订单状态接口接考拉

parent e12c0821
...@@ -152,7 +152,7 @@ public class MoOrderServiceImpl implements OrderService{ ...@@ -152,7 +152,7 @@ public class MoOrderServiceImpl implements OrderService{
orderVo.setCreatedAt(it.getCreatedAt()); orderVo.setCreatedAt(it.getCreatedAt());
if (StringUtils.isNotEmpty(it.getApplyNo())) { if (StringUtils.isNotEmpty(it.getApplyNo())) {
ServiceResult<XyqbCurrentOrderStatusServiceResultModel> xyqbCenterServiceXyqbOrderStatus = xyqbCenterService.getXyqbOrderStatus(it.getApplyNo(), it.getLoanId()); ServiceResult<XyqbCurrentOrderStatusServiceResultModel> xyqbCenterServiceXyqbOrderStatus = koalaCenterService.getOrderStatus(it.getApplyNo(), it.getLoanId());
log.info("[xyqbCenterService.getXyqbOrderStatus]xyqbOrderStatus={}", JSONTools.serialize(xyqbCenterServiceXyqbOrderStatus)); log.info("[xyqbCenterService.getXyqbOrderStatus]xyqbOrderStatus={}", JSONTools.serialize(xyqbCenterServiceXyqbOrderStatus));
if (xyqbCenterServiceXyqbOrderStatus.isSuccess()) { if (xyqbCenterServiceXyqbOrderStatus.isSuccess()) {
QueryXyqbOrderStatus currentStatus = xyqbCenterServiceXyqbOrderStatus.getData().getCurrentStatus(); QueryXyqbOrderStatus currentStatus = xyqbCenterServiceXyqbOrderStatus.getData().getCurrentStatus();
...@@ -399,7 +399,7 @@ public class MoOrderServiceImpl implements OrderService{ ...@@ -399,7 +399,7 @@ public class MoOrderServiceImpl implements OrderService{
return historyOrderStatusVoModel; return historyOrderStatusVoModel;
} }
ServiceResult<XyqbHistoryOrderStatusServiceResultModel> xyqbOrderHistoryStatusResult = xyqbCenterService.getXyqbOrderHistoryStatus(orderMapping.getApplyNo(), orderMapping.getLoanId()); ServiceResult<XyqbHistoryOrderStatusServiceResultModel> xyqbOrderHistoryStatusResult = koalaCenterService.getXyqbOrderHistoryStatus(orderMapping.getApplyNo(), orderMapping.getLoanId());
if (xyqbOrderHistoryStatusResult.isSuccess()) { if (xyqbOrderHistoryStatusResult.isSuccess()) {
log.info("[getOrderHistoryStatus]查询成功channelOrderNumber={}, xyqbOrderHistoryStatusResult={}", channelOrderNumber, JSONTools.serialize(xyqbOrderHistoryStatusResult)); log.info("[getOrderHistoryStatus]查询成功channelOrderNumber={}, xyqbOrderHistoryStatusResult={}", channelOrderNumber, JSONTools.serialize(xyqbOrderHistoryStatusResult));
XyqbHistoryOrderStatusServiceResultModel data = xyqbOrderHistoryStatusResult.getData(); XyqbHistoryOrderStatusServiceResultModel data = xyqbOrderHistoryStatusResult.getData();
......
package cn.quantgroup.cashloanflowboss.spi.koala.client; package cn.quantgroup.cashloanflowboss.spi.koala.client;
import cn.quantgroup.cashloanflowboss.api.order.model.XyqbCurrentOrderStatusServiceResultModel;
import cn.quantgroup.cashloanflowboss.api.order.model.XyqbHistoryOrderStatusServiceResultModel;
import cn.quantgroup.cashloanflowboss.conf.FeignConfig; import cn.quantgroup.cashloanflowboss.conf.FeignConfig;
import cn.quantgroup.cashloanflowboss.core.base.ServiceResult;
import cn.quantgroup.cashloanflowboss.spi.clotho.exception.ClothoCenterException; import cn.quantgroup.cashloanflowboss.spi.clotho.exception.ClothoCenterException;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -72,6 +75,18 @@ public interface KoalaCenter { ...@@ -72,6 +75,18 @@ public interface KoalaCenter {
@PostMapping(value = "/external/huijinsuo/withdraw/test/72", consumes = "application/x-www-form-urlencoded") @PostMapping(value = "/external/huijinsuo/withdraw/test/72", consumes = "application/x-www-form-urlencoded")
String cancelAfterLoan(@RequestParam Map data); String cancelAfterLoan(@RequestParam Map data);
/**
* 查询订单状态
* @param paramMap
* @return
*/
@PostMapping(value = "/v1/order/query/status", consumes = "application/x-www-form-urlencoded")
ServiceResult<XyqbCurrentOrderStatusServiceResultModel> getOrderStatus(@RequestParam Map paramMap);
@PostMapping(value = "/v1/order/query/status/history", consumes = "application/x-www-form-urlencoded")
ServiceResult<XyqbHistoryOrderStatusServiceResultModel> getOrderHistoryStatus(@RequestParam Map paramMap);
@Component @Component
class Fallback implements KoalaCenter { class Fallback implements KoalaCenter {
...@@ -106,5 +121,15 @@ public interface KoalaCenter { ...@@ -106,5 +121,15 @@ public interface KoalaCenter {
@Override public String cancelAfterLoan(Map data) { @Override public String cancelAfterLoan(Map data) {
return null; return null;
} }
@Override
public ServiceResult<XyqbCurrentOrderStatusServiceResultModel> getOrderStatus(Map paramMap) {
return null;
}
@Override
public ServiceResult<XyqbHistoryOrderStatusServiceResultModel> getOrderHistoryStatus(Map paramMap) {
return null;
}
} }
} }
package cn.quantgroup.cashloanflowboss.spi.koala.service; package cn.quantgroup.cashloanflowboss.spi.koala.service;
import cn.quantgroup.cashloanflowboss.api.order.model.XyqbCurrentOrderStatusServiceResultModel;
import cn.quantgroup.cashloanflowboss.api.order.model.XyqbHistoryOrderStatusServiceResultModel;
import cn.quantgroup.cashloanflowboss.core.Application; import cn.quantgroup.cashloanflowboss.core.Application;
import cn.quantgroup.cashloanflowboss.core.base.ServiceResult;
import cn.quantgroup.cashloanflowboss.core.constants.Constants; import cn.quantgroup.cashloanflowboss.core.constants.Constants;
import cn.quantgroup.cashloanflowboss.spi.clotho.model.LendingServiceModel; import cn.quantgroup.cashloanflowboss.spi.clotho.model.LendingServiceModel;
import cn.quantgroup.cashloanflowboss.spi.koala.client.KoalaCenter; import cn.quantgroup.cashloanflowboss.spi.koala.client.KoalaCenter;
import cn.quantgroup.cashloanflowboss.spi.model.JsonResult; import cn.quantgroup.cashloanflowboss.spi.model.JsonResult;
import cn.quantgroup.cashloanflowboss.spi.xyqb.util.SignUtil;
import cn.quantgroup.cashloanflowboss.utils.JSONTools; import cn.quantgroup.cashloanflowboss.utils.JSONTools;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -132,6 +137,31 @@ public class KoalaCenterService { ...@@ -132,6 +137,31 @@ public class KoalaCenterService {
} }
public ServiceResult<XyqbCurrentOrderStatusServiceResultModel> getOrderStatus(String creditOrderNumber, Long loanId){
Map paramMap = Maps.newHashMap();
paramMap.put("orderNo", creditOrderNumber);
if (loanId != null && loanId > 1) {
paramMap.put("loanId", loanId);
}
final ServiceResult<XyqbCurrentOrderStatusServiceResultModel> orderStatus = koalaCenter.getOrderStatus(paramMap);
log.info("[getOrderStatus]koala订单状态查询,creditOrderNumber={},result={}", creditOrderNumber, JSONTools.serialize(orderStatus));
return orderStatus;
}
public ServiceResult<XyqbHistoryOrderStatusServiceResultModel> getXyqbOrderHistoryStatus(String creditOrderNumber, Long loanId){
Map paramMap = Maps.newHashMap();
paramMap.put("orderNo", creditOrderNumber);
if (loanId != null) {
paramMap.put("loanId", loanId);
}
// paramMap = SignUtil.sign(SignUtil.KA_API_KEY, paramMap);
return koalaCenter.getOrderHistoryStatus(paramMap);
}
public static void main(String[] args) { public static void main(String[] args) {
String result = " {\n" + String result = " {\n" +
" \"code\":\"0\",\n" + " \"code\":\"0\",\n" +
......
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