Commit a2e7d3c2 authored by suntao's avatar suntao

审批 bizType 从xyqb 查询

parent 2c6bc2f0
......@@ -5,6 +5,7 @@ import cn.quantgroup.cashloanflowboss.api.optlog.service.OptHistoryLogServiceImp
import cn.quantgroup.cashloanflowboss.core.annotation.opt.OperationAnno;
import cn.quantgroup.cashloanflowboss.core.base.Tuple;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.CallbackFailRecord;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfChannelConfiguration;
import cn.quantgroup.cashloanflowboss.spi.clf.model.KANoticeType;
import cn.quantgroup.cashloanflowboss.spi.clf.model.LoanProgress;
......@@ -30,6 +31,7 @@ import cn.quantgroup.cashloanflowboss.spi.opapi.OPCenter;
import cn.quantgroup.cashloanflowboss.spi.user.service.XyqbUserService;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.Contract;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.LoanApplicationHistory;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.QuotaProduct;
import cn.quantgroup.cashloanflowboss.spi.xyqb.repository.CancelPreLoanRepository;
import cn.quantgroup.cashloanflowboss.spi.xyqb.service.XYQBCenterService;
import cn.quantgroup.cashloanflowboss.utils.JSONTools;
......@@ -203,11 +205,6 @@ public class OrderServiceImpl implements OrderService{
return new Tuple(false, "审批失败,无订单");
}
if (Application.getPrincipal().isChannel() && !Application.getPrincipal().isSameChannel(orderMapping.getRegisteredFrom())) {
log.info("approveOpt,审批失败,不是该渠道订单无法审批 channelOrderNumber={}", approveVo.getChannelOrderNumber());
return new Tuple(false, "审批失败,不是该渠道订单无法审批");
}
XUser xUser = xyqbUserService.findXUserById(orderMapping.getQgUserId());
if (xUser == null) {
log.info("approveOpt,审批失败,未找到用户 channelOrderNumber={}", approveVo.getChannelOrderNumber());
......@@ -249,6 +246,14 @@ public class OrderServiceImpl implements OrderService{
orderApproveRepository.save(orderApprove);
}
ClfChannelConfiguration clfChannelConfiguration = clfCenterService.findChannelConfigurationByChannelId(orderMapping.getRegisteredFrom());
if (clfChannelConfiguration == null) {
return new Tuple(false, "审批失败,clfChannelConfiguration渠道配置为空");
}
QuotaProduct quotaProduct = xyqbCenterService.getXyqbProduct(clfChannelConfiguration.getXyqbProductId());
if (quotaProduct == null) {
return new Tuple(false, "审批失败,xyqb.quota_product配置为空(".concat(clfChannelConfiguration.getXyqbProductId()).concat(")"));
}
Map<String, Object> data = new HashMap<>(16);
......@@ -257,7 +262,7 @@ public class OrderServiceImpl implements OrderService{
data.put("bizChannel", orderMapping.getRegisteredFrom());
data.put("uuid", xUser.getUuid());
data.put("bizNo", orderMapping.getApplyNo());
data.put("bizType", channelConf.getBizType());
data.put("bizType", quotaProduct.getProductType());
data.put("auditResult", approveVo.getIsPass());
data.put("amount", approveVo.getAmount());
data.put("deadLine", calendar.getTime().getTime());
......
......@@ -89,4 +89,10 @@ public class ClfChannelConfiguration implements Serializable {
@Column(name = "login_page_url")
private String loginPageUrl;
/**
* xyqb产品id
*/
@Column(name = "xyqb_product_id")
private String xyqbProductId;
}
\ No newline at end of file
package cn.quantgroup.cashloanflowboss.spi.xyqb.entity;
import lombok.Data;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by QuantGroup on 2018/3/21.
* 额度产品表
*/
@Entity
@Table(name = "quota_product")
@Data
public class QuotaProduct {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 渠道ID
*/
@Column(name = "channel_id")
private Long channelId;
/**
* 产品类型 0:现金贷 1:白条 2 循环额度
*/
@Column(name = "product_type")
private Integer productType;
/**
* 产品描述
*/
@Column(name = "product_desc")
private String productDesc;
/**
* 备注
*/
@Column(name = "remark")
private String remark;
/**
* 是否启用标志位
*/
@Column(name = "is_active")
private Boolean isActive;
/**
* 创建时间
*/
@Column(name = "created_at")
private Timestamp createdAt;
/**
* 更新时间
*/
@Column(name = "updated_at")
private Timestamp updatedAt;
@PrePersist
public void prePersist() {
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
createdAt = timestamp;
updatedAt = timestamp;
}
@PreUpdate
public void preUpdate() {
updatedAt = new Timestamp(System.currentTimeMillis());
}
}
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;
/**
* @author Jie.Feng
* @date 2018/4/11
*/
@XYQBDataSource
public interface QuotaProductRepository extends JpaRepository<QuotaProduct,Long> {
}
......@@ -40,6 +40,8 @@ public interface XYQBCenterService {
Boolean validateCorpPolicy(Long corpPolicyId, Date planDate);
QuotaProduct getXyqbProduct(String productId);
ServiceResult<XyqbCurrentOrderStatusServiceResultModel> getXyqbOrderStatus(String creditOrderNumber, Long loanId);
ServiceResult<XyqbHistoryOrderStatusServiceResultModel> getXyqbOrderHistoryStatus(String creditOrderNumber, Long loanId);
......
......@@ -18,6 +18,7 @@ import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -46,7 +47,8 @@ public class XYQBCenterServiceImpl implements XYQBCenterService {
private FundingAssetAllocationsProgramsRepository fundingAssetAllocationsProgramsRepository;
@Autowired
private LoanApplicationHistoryRepository loanApplicationHistoryRepository;
@Autowired
private QuotaProductRepository quotaProductRepository;
@Autowired
private JolyneService jolyneService;
......@@ -171,6 +173,16 @@ public class XYQBCenterServiceImpl implements XYQBCenterService {
return isValidate & (fundingAssetAllocationsPrograms != null);
}
@Override
public QuotaProduct getXyqbProduct(String productId) {
if (StringUtils.isEmpty(productId)) {
return null;
}
return quotaProductRepository.findOne(Long.valueOf(productId));
}
/**
* 查询订单当前状态
* @param creditOrderNumber
......
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