Commit 96956a91 authored by xiaozhe.chen's avatar xiaozhe.chen

修改多订单类型的判断

parent 17e24725
......@@ -232,18 +232,19 @@ public class OrderServiceImpl implements OrderService {
if (clfChannelConfiguration == null) {
return new Tuple(false, "审批失败,clfChannelConfiguration渠道配置为空");
}
QuotaProduct quotaProduct = null;
Map<String, Object> data = null;
if (channels.contains(orderMapping.getRegisteredFrom())) {
data = getApproveObjectMap(approveVo, orderMapping, xUser, fundFormat, 9);
QuotaProduct quotaProduct ;
Map<String, Object> data ;
Long channelId = orderMapping.getRegisteredFrom();
if (StringUtils.isEmpty(clfChannelConfiguration.getXyqbProductId())) {
//没有配置productId多订单类型
quotaProduct = xyqbCenterService.getXyqbProduct(channelId);
} else {
quotaProduct = xyqbCenterService.getXyqbProduct(clfChannelConfiguration.getXyqbProductId());
if (quotaProduct == null) {
return new Tuple(false, "审批失败,xyqb.quota_product配置为空(".concat(clfChannelConfiguration.getXyqbProductId()).concat(")"));
}
data = getApproveObjectMap(approveVo, orderMapping, xUser, fundFormat, quotaProduct.getProductType());
}
if (quotaProduct == null) {
return new Tuple(false, "审批失败,xyqb.quota_product配置为空(".concat(clfChannelConfiguration.getXyqbProductId()).concat(")"));
}
data = getApproveObjectMap(approveVo, orderMapping, xUser, fundFormat, quotaProduct.getProductType());
// 发起审批
......
......@@ -17,7 +17,7 @@ public enum ApplicationStatus implements Status<ApplicationStatus> {
INTERNAL_SERVICE_ERROR(500001, "内部服务错误"),
ARGUMENT_VALID_EXCEPTION(500002, "无效的请求参数"),
ARGUMENT_VALID_EXCEPTION(500002, "无效的参数"),
AUTHENTICATION_FAILURE(500003, "非法访问"),
......
......@@ -4,6 +4,7 @@ package cn.quantgroup.cashloanflowboss.spi.xyqb.repository;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.QuotaProduct;
import cn.quantgroup.cashloanflowboss.spi.xyqb.source.XYQBDataSource;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
/**
* @author Jie.Feng
......@@ -11,4 +12,8 @@ import org.springframework.data.jpa.repository.JpaRepository;
*/
@XYQBDataSource
public interface QuotaProductRepository extends JpaRepository<QuotaProduct,Long> {
@Query(value = "select * from quota_product where channel_id=?1 limit 1", nativeQuery = true)
QuotaProduct findByChannelIdFirstOne(Long channelId);
}
......@@ -63,4 +63,6 @@ public interface XYQBCenterService {
ApplyScenarioInfoEntity findFirstByApplyNo(String applyNo);
QuotaProduct getXyqbProduct(Long channelId);
}
......@@ -4,8 +4,10 @@ import cn.quantgroup.cashloanflowboss.api.order.model.RepaymentPlansResultModel;
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.asserts.Assert;
import cn.quantgroup.cashloanflowboss.core.base.ServiceResult;
import cn.quantgroup.cashloanflowboss.core.base.Tuple;
import cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus;
import cn.quantgroup.cashloanflowboss.spi.jolyne.JolyneService;
import cn.quantgroup.cashloanflowboss.spi.jolyne.JolyneUtil;
import cn.quantgroup.cashloanflowboss.spi.jolyne.model.JolyneDB;
......@@ -288,4 +290,10 @@ public class XYQBCenterServiceImpl implements XYQBCenterService {
return applyScenarioInfoRepository.findFirstByOrderNo(applyNo);
}
@Override
public QuotaProduct getXyqbProduct(Long channelId) {
Assert.isNull(channelId, ApplicationStatus.ARGUMENT_VALID_EXCEPTION);
return quotaProductRepository.findByChannelIdFirstOne(channelId);
}
}
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