Commit 56b5ecf8 authored by 杨钧's avatar 杨钧

增加xyqb接口调用

parent aeecc7e9
...@@ -4,7 +4,7 @@ import cn.quantgroup.customer.config.http.mvc.converter.DateConverter; ...@@ -4,7 +4,7 @@ import cn.quantgroup.customer.config.http.mvc.converter.DateConverter;
import cn.quantgroup.customer.config.http.mvc.converter.IEnumConverterFactory; import cn.quantgroup.customer.config.http.mvc.converter.IEnumConverterFactory;
import cn.quantgroup.customer.config.http.mvc.converter.LocalDateConverter; import cn.quantgroup.customer.config.http.mvc.converter.LocalDateConverter;
import cn.quantgroup.customer.config.http.mvc.converter.LocalDateTimeConverter; import cn.quantgroup.customer.config.http.mvc.converter.LocalDateTimeConverter;
import cn.quantgroup.customer.config.http.mvc.filter.UserTokenIntecepter; import cn.quantgroup.customer.config.http.mvc.filter.UserTokenInterceptor;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -22,7 +22,7 @@ import java.util.List; ...@@ -22,7 +22,7 @@ import java.util.List;
public class WebMvcConfigure extends WebMvcConfigurerAdapter { public class WebMvcConfigure extends WebMvcConfigurerAdapter {
@Autowired @Autowired
private UserTokenIntecepter tokenIntecepter; private UserTokenInterceptor tokenIntecepter;
@Override @Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
......
...@@ -24,7 +24,7 @@ import java.util.Objects; ...@@ -24,7 +24,7 @@ import java.util.Objects;
*/ */
@Slf4j @Slf4j
@Component @Component
public class UserTokenIntecepter implements HandlerInterceptor{ public class UserTokenInterceptor implements HandlerInterceptor{
@Autowired @Autowired
private IOpSystemService IOpSystemService; private IOpSystemService IOpSystemService;
......
package cn.quantgroup.customer.enums;
import java.util.Arrays;
import java.util.Optional;
/**
* 试算字段转换
*/
public enum OrderFieldEnum {
PRINCIPAL("principal","应还本金"),
INTEREST("interest","应还利息"),
SERVICE_FEE("serviceFee","应还担保费"),
PREMIUM("premium","应还保费"),
OVERDUE_INTEREST("overDueInterest","应还罚息"),
LIQUIDATE_DAMAGES("liquidatedDamages","结清违约金"),
OTHERFEE("otherFee","应还其他费用"),
TOTAL_AMOUNT("totalAmount","应还总额"),
OTHER("other","其他收费项目");
private String field;
private String title;
OrderFieldEnum(String field, String title) {
this.field = field;
this.title = title;
}
public String getField() {
return field;
}
public String getTitle() {
return title;
}
public static String getValue(String field){
Optional<OrderFieldEnum> optional = Arrays.asList(OrderFieldEnum.values()).stream().filter(orderFieldEnum -> field.equalsIgnoreCase(orderFieldEnum.getField())).findFirst();
if(optional.isPresent()){
return optional.get().getTitle();
}
return OrderFieldEnum.OTHER.getTitle();
}
}
...@@ -15,15 +15,15 @@ public class EarlySettleUpOrder { ...@@ -15,15 +15,15 @@ public class EarlySettleUpOrder {
private Long loanId; private Long loanId;
private String phoneNo; private String phoneNo;
private BigDecimal loanAmount; private BigDecimal loanAmount;
private String fundOrderNo; private String fundOrder;
private Long fundId; private Long fundCorpId;
private String fundName; private String fundName;
private String channelOrderNo; private String channelOrderNo;
private Long channelId; private Long channelId;
private String channelName; private String channelName;
private Integer allTerm; private Integer termSum;
private Integer noPaidTerm; private Integer noRepayTerm;
private Boolean showEntryFlag; private Boolean showAllRepay;
private Boolean hideEntryFlag; private Boolean showTrial;
private Boolean showOplog;
} }
...@@ -15,9 +15,11 @@ public class EarlySettleUpTrial { ...@@ -15,9 +15,11 @@ public class EarlySettleUpTrial {
private BigDecimal principal; private BigDecimal principal;
private BigDecimal interest; private BigDecimal interest;
private BigDecimal overdueInterest; private BigDecimal overDueInterest;
private BigDecimal otherFee; private BigDecimal premium;
private BigDecimal liquid; private BigDecimal liquidatedDamages;
private BigDecimal serviceFee; private BigDecimal serviceFee;
private BigDecimal otherFee;
private BigDecimal totalAmount;
} }
...@@ -18,8 +18,4 @@ public class OperateEntryParam { ...@@ -18,8 +18,4 @@ public class OperateEntryParam {
*/ */
private Integer opState; private Integer opState;
private String userNo;
private String userName;
} }
...@@ -3,6 +3,7 @@ package cn.quantgroup.customer.service; ...@@ -3,6 +3,7 @@ package cn.quantgroup.customer.service;
import cn.quantgroup.customer.model.kaordermapping.ApplyRequestHistory; import cn.quantgroup.customer.model.kaordermapping.ApplyRequestHistory;
import cn.quantgroup.customer.model.kaordermapping.ChannelConfigurationResult; import cn.quantgroup.customer.model.kaordermapping.ChannelConfigurationResult;
import cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping; import cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping;
import cn.quantgroup.customer.model.order.ApplyOrder;
import cn.quantgroup.customer.model.order.CallbackRecordList; import cn.quantgroup.customer.model.order.CallbackRecordList;
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;
......
package cn.quantgroup.customer.service; package cn.quantgroup.customer.service;
import cn.quantgroup.customer.model.order.FlowNode; import cn.quantgroup.customer.entity.OpLog;
import cn.quantgroup.customer.model.order.LoanOrderDetail; import cn.quantgroup.customer.model.order.*;
import cn.quantgroup.customer.model.order.OrderInfo;
import cn.quantgroup.customer.model.order.OrderInfoVo;
import cn.quantgroup.customer.rest.param.ordermapping.EarlySettleUpOrderQueryParam; import cn.quantgroup.customer.rest.param.ordermapping.EarlySettleUpOrderQueryParam;
import cn.quantgroup.customer.rest.param.ordermapping.OperateEntryParam; 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 java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author Wang Xiangwei * @author Wang Xiangwei
...@@ -39,26 +38,26 @@ public interface IOrderService{ ...@@ -39,26 +38,26 @@ public interface IOrderService{
* @param orderQuery * @param orderQuery
* @return * @return
*/ */
JsonResult queryEarlySettleUpOrders(EarlySettleUpOrderQueryParam orderQuery); JsonResult<List<EarlySettleUpOrder>> queryEarlySettleUpOrders(EarlySettleUpOrderQueryParam orderQuery);
/** /**
* 显示or隐藏操作 * 显示or隐藏操作
* @param operateEntryParam * @param operateEntryParam
* @return * @return
*/ */
JsonResult operateEntry(OperateEntryParam operateEntryParam); JsonResult<Boolean> operateEntry(OperateEntryParam operateEntryParam);
/** /**
* 提前一次性结清金额试算 * 提前一次性结清金额试算
* @param loanId * @param loanId
* @return * @return
*/ */
JsonResult earlySettleUpTrial(Long loanId); JsonResult<List<Map<String,Object>>> earlySettleUpTrial(Long loanId);
/** /**
* 查询操作日志 * 查询操作日志
* @param loanId * @param loanId
* @return * @return
*/ */
JsonResult queryOperateLog(Long loanId); JsonResult<List<OpLog>> queryOperateLog(Long loanId);
} }
...@@ -4,6 +4,8 @@ import cn.quantgroup.customer.model.order.*; ...@@ -4,6 +4,8 @@ import cn.quantgroup.customer.model.order.*;
import cn.quantgroup.customer.rest.param.card.ModifyReservePhone; import cn.quantgroup.customer.rest.param.card.ModifyReservePhone;
import cn.quantgroup.customer.rest.param.card.UnBindCardModel; import cn.quantgroup.customer.rest.param.card.UnBindCardModel;
import cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery; import cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery;
import cn.quantgroup.customer.rest.param.ordermapping.EarlySettleUpOrderQueryParam;
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.param.repay.RepayOrderInfoQuery; import cn.quantgroup.customer.rest.param.repay.RepayOrderInfoQuery;
import cn.quantgroup.customer.rest.param.repay.RepayOrderQuery; import cn.quantgroup.customer.rest.param.repay.RepayOrderQuery;
...@@ -63,4 +65,20 @@ public interface IXyqbService { ...@@ -63,4 +65,20 @@ public interface IXyqbService {
* @return * @return
*/ */
JsonResult<OrderStatus> orderStatusQuery(OrderQueryParam orderQuery); JsonResult<OrderStatus> orderStatusQuery(OrderQueryParam orderQuery);
/**
* 查询xyqb一次性结清订单相关信息
* @param orderQuery
* @return
*/
JsonResult<List<EarlySettleUpOrder>> findLoanOrder4EarlySettleUp(EarlySettleUpOrderQueryParam orderQuery);
/**
* 处理新增或删除白名单操作
* @param operateEntryParam
* @return
*/
JsonResult<Boolean> operateEntry(OperateEntryParam operateEntryParam);
JsonResult<EarlySettleUpTrial> earlySettleUpTrial(Long loanId);
} }
...@@ -5,6 +5,7 @@ import cn.quantgroup.customer.exception.BusinessException; ...@@ -5,6 +5,7 @@ import cn.quantgroup.customer.exception.BusinessException;
import cn.quantgroup.customer.model.kaordermapping.ApplyRequestHistory; import cn.quantgroup.customer.model.kaordermapping.ApplyRequestHistory;
import cn.quantgroup.customer.model.kaordermapping.ChannelConfigurationResult; import cn.quantgroup.customer.model.kaordermapping.ChannelConfigurationResult;
import cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping; import cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping;
import cn.quantgroup.customer.model.order.ApplyOrder;
import cn.quantgroup.customer.model.order.CallbackRecordList; import cn.quantgroup.customer.model.order.CallbackRecordList;
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;
...@@ -238,5 +239,4 @@ public class KaServiceImpl implements IKaService { ...@@ -238,5 +239,4 @@ public class KaServiceImpl implements IKaService {
throw new BusinessException(ErrorCodeEnum.NET_ERROR); throw new BusinessException(ErrorCodeEnum.NET_ERROR);
} }
} }
} }
...@@ -5,6 +5,8 @@ import cn.quantgroup.customer.model.order.*; ...@@ -5,6 +5,8 @@ import cn.quantgroup.customer.model.order.*;
import cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery; import cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery;
import cn.quantgroup.customer.rest.param.card.ModifyReservePhone; import cn.quantgroup.customer.rest.param.card.ModifyReservePhone;
import cn.quantgroup.customer.rest.param.card.UnBindCardModel; import cn.quantgroup.customer.rest.param.card.UnBindCardModel;
import cn.quantgroup.customer.rest.param.ordermapping.EarlySettleUpOrderQueryParam;
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.param.repay.RepayOrderInfoQuery; import cn.quantgroup.customer.rest.param.repay.RepayOrderInfoQuery;
import cn.quantgroup.customer.rest.param.repay.RepayOrderQuery; import cn.quantgroup.customer.rest.param.repay.RepayOrderQuery;
...@@ -354,4 +356,109 @@ public class XyqbServiceImpl implements IXyqbService { ...@@ -354,4 +356,109 @@ public class XyqbServiceImpl implements IXyqbService {
} }
} }
} }
@Override
public JsonResult<List<EarlySettleUpOrder>> findLoanOrder4EarlySettleUp(EarlySettleUpOrderQueryParam orderQuery) {
String logPre = "[XyqbServiceImpl.findLoanOrder4EarlySettleUp] 查询一次性结清订单相关信息";
String url = xyqbSysUrl + "/ex/operate/config/earlysettle/query";
Map<String, Object> queryParam = new HashMap<>(8);
if(Objects.isNull(orderQuery.getUserId()) &&
Objects.isNull(orderQuery.getLoanId()) &&
StringUtils.isBlank(orderQuery.getFundOrderNo())){
log.error("{} 请求参数都为空,不允许查询 orderQuery={}",logPre,orderQuery);
return JsonResult.buildErrorStateResult("查询参数都为空,不允许查询", null);
}
queryParam.put("loan_id", orderQuery.getLoanId());
queryParam.put("user_id",orderQuery.getUserId());
queryParam.put("fund_order_no",orderQuery.getFundOrderNo());
log.info("{} 请求参数 orderQuery={},queryParam={}", logPre, orderQuery, queryParam);
Map<String, String> header = new HashMap<>(2);
header.put("Accept", "application/json");
header.put("Content-Type", "application/x-www-form-urlencoded");
String result = httpService.post(url, header, queryParam);
log.info("{} 返回结果 result:{}", logPre, result);
if (StringUtils.isBlank(result)) {
log.error("{} 处理失败 queryParam={} result={}", logPre, queryParam, result);
return JsonResult.buildErrorStateResult("[查询失败,返回为空]", ErrorCodeEnum.RETURN_ERROR);
} else {
TypeReference<JsonResult<List<EarlySettleUpOrder>>> typeToken = new TypeReference<JsonResult<List<EarlySettleUpOrder>>>() {
};
JsonResult<List<EarlySettleUpOrder>> jsonResult = JSONTools.deserialize(result, typeToken);
if (Objects.isNull(jsonResult) || !jsonResult.isSuccess()) {
return JsonResult.buildErrorStateResult("[查询失败]", ErrorCodeEnum.RETURN_ERROR);
} else {
return jsonResult;
}
}
}
@Override
public JsonResult<Boolean> operateEntry(OperateEntryParam operateEntryParam){
String logPre = "[XyqbServiceImpl.operateEntry] 处理新增或删除白名单操作";
String url = xyqbSysUrl + "/ex/operate/config/earlysettle/opt_white_list";
Map<String, Object> queryParam = new HashMap<>(8);
if(Objects.isNull(operateEntryParam.getLoanId()) &&
Objects.isNull(operateEntryParam.getOpState())){
log.error("{} 请求参数都为空,不允许操作 orderQuery={}",logPre,operateEntryParam);
return JsonResult.buildErrorStateResult("查询参数都为空,不允许操作", null);
}
queryParam.put("loan_id", operateEntryParam.getLoanId());
if(operateEntryParam.getOpState()==1){
queryParam.put("opt","ADD");
}else{
queryParam.put("opt","DEL");
}
log.info("{} 请求参数 orderQuery={},queryParam={}", logPre, operateEntryParam, queryParam);
Map<String, String> header = new HashMap<>(2);
header.put("Accept", "application/json");
header.put("Content-Type", "application/x-www-form-urlencoded");
String result = httpService.post(url, header, queryParam);
log.info("{} 返回结果 result:{}", logPre, result);
if (StringUtils.isBlank(result)) {
log.error("{} 处理失败 queryParam={} result={}", logPre, queryParam, result);
return JsonResult.buildErrorStateResult("[处理失败]", Boolean.FALSE);
} else {
TypeReference<JsonResult> typeToken = new TypeReference<JsonResult>() {
};
JsonResult<JsonResult> jsonResult = JSONTools.deserialize(result, typeToken);
if (Objects.isNull(jsonResult) || !jsonResult.isSuccess()) {
return JsonResult.buildErrorStateResult("[处理失败]", Boolean.FALSE);
} else {
return JsonResult.buildSuccessResult("[操作成功]",Boolean.TRUE);
}
}
}
@Override
public JsonResult<EarlySettleUpTrial> earlySettleUpTrial(Long loanId) {
String logPre = "[XyqbServiceImpl.earlySettleUpTrial] 提前一次性结清金额试算";
String url = xyqbSysUrl + "/ex/operate/config/earlysettle/trial_order";
Map<String, Object> queryParam = new HashMap<>(8);
if(Objects.isNull(loanId)){
log.error("{} 请求参数为空,不允许操作 loanId={}",logPre,loanId);
return JsonResult.buildErrorStateResult("借据单号为空,不允许操作", null);
}
queryParam.put("loan_id", loanId);
log.info("{} 请求参数 loanId={},queryParam={}", logPre, loanId, queryParam);
Map<String, String> header = new HashMap<>(2);
header.put("Accept", "application/json");
header.put("Content-Type", "application/x-www-form-urlencoded");
String result = httpService.post(url, header, queryParam);
log.info("{} 返回结果 result:{}", logPre, result);
if (StringUtils.isBlank(result)) {
log.error("{} 处理失败 queryParam={} result={}", logPre, queryParam, result);
return JsonResult.buildErrorStateResult("[处理失败]", null);
} else {
TypeReference<JsonResult<EarlySettleUpTrial>> typeToken = new TypeReference<JsonResult<EarlySettleUpTrial>>() {
};
JsonResult<JsonResult<EarlySettleUpTrial>> jsonResult = JSONTools.deserialize(result, typeToken);
if (Objects.isNull(jsonResult) || !jsonResult.isSuccess()) {
return JsonResult.buildErrorStateResult("[处理失败]", null);
} else {
return JsonResult.buildSuccessResult("[操作成功]",jsonResult.getData());
}
}
}
} }
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