Commit d34603ef authored by suntao's avatar suntao

二次风控接口

parent 851b33b5
...@@ -86,22 +86,24 @@ public class OrderController { ...@@ -86,22 +86,24 @@ public class OrderController {
@PostMapping("/lending") @PostMapping("/lending")
public Result<Boolean> lending(@RequestBody @Valid LendingFormModel lendingFormModel) { public Result<Boolean> lending(@RequestBody @Valid LendingFormModel lendingFormModel) {
if (debugModel) { if (debugModel) {
return Result.buildSuccess(this.orderService.lending(lendingFormModel), this.orderService.lending(lendingFormModel) ? "放款操作成功" : "放款操作失败"); boolean lendingResult = this.orderService.lending(lendingFormModel);
return Result.buildSuccess(lendingResult, lendingResult ? "放款操作成功" : "放款操作失败");
} else { } else {
return Result.buildSuccess(false,"无此操作"); return Result.buildSuccess(false,"无此操作");
} }
} }
/** /**
* 放款 * 二次风控审批
* *
* @return * @return
*/ */
@Security(authorityId = "Order.secondAudit") @Security(authorityId = "Order.secondAudit")
@PostMapping("/secondAudit") @GetMapping("/secondAudit")
public Result<Boolean> secondAudit(@RequestBody @Valid LendingFormModel lendingFormModel) { public Result<Boolean> secondAudit(String channelOrderNumber) {
if (debugModel) { if (debugModel) {
return Result.buildSuccess(this.orderService.secondAudit(lendingFormModel)); boolean secondAudit = this.orderService.secondAudit(channelOrderNumber);
return Result.buildSuccess(secondAudit, secondAudit ? "操作成功" : "操作失败");
} else { } else {
return Result.buildSuccess(false,"无此操作"); return Result.buildSuccess(false,"无此操作");
} }
......
...@@ -37,6 +37,7 @@ public class OrderVo { ...@@ -37,6 +37,7 @@ public class OrderVo {
public enum OptButtonAction { public enum OptButtonAction {
audit("审批"), audit("审批"),
cancel("贷前关单"), cancel("贷前关单"),
second_audit("二次风控审批"),
pay_succ("放款成功"), pay_succ("放款成功"),
pay_fail("放款失败"), pay_fail("放款失败"),
withdraw_second("存管提现"), withdraw_second("存管提现"),
......
package cn.quantgroup.cashloanflowboss.spi.xyqb.entity;
import cn.quantgroup.cashloanflowboss.spi.clf.model.LoanProgress;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;
/**
* Created by FrankChow on 15/7/8.
* 贷款记录表
*/
@Entity
@Table(name = "loan_application_history")
@Getter
@Setter
@ToString
public class LoanApplicationHistory implements Serializable {
private static final long serialVersionUID = -1L;
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "user_id")
private Long userId;
@Column(name = "channel_id")
private Long channelId;
// false表示借款申请是无效的或者已完成
@Column(name = "is_active")
private Boolean isActive = true;
// 贷款进度 默认是02
@Column(name = "progress")
private LoanProgress progress = LoanProgress.USER_AUTHENTICATION_INCOMPLETE;
@Column(name = "bank_card_id")
private Long bankCardId;
// 从哪个渠道注册过来
@Column(name = "created_from")
private Long createdFrom;
@Column(name = "baitiao_merchant_id")
private Long baitiaoMerchantId = -1L;
// 上一次修改时间
@Column(name = "updated_at")
private Timestamp updatedAt;
// 上一次修改时间
@Column(name = "created_at")
private Timestamp createdAt;
@PrePersist
public void prePersist() {
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
createdAt = timestamp;
updatedAt = timestamp;
}
@PreUpdate
public void preUpdate() {
updatedAt = new Timestamp(System.currentTimeMillis());
}
public long parseChannelId() {
return !Objects.equals(createdFrom, -1L) ? this.createdFrom : this.channelId;
}
}
package cn.quantgroup.cashloanflowboss.spi.xyqb.repository;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.LoanApplicationHistory;
import cn.quantgroup.cashloanflowboss.spi.xyqb.source.XYQBDataSource;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
/**
* Created by WeiWei on 2019/8/12.
*/
@XYQBDataSource
@Repository
public interface LoanApplicationHistoryRepository extends CrudRepository<LoanApplicationHistory, Integer> {
LoanApplicationHistory findById(Long id);
}
\ No newline at end of file
...@@ -4,10 +4,7 @@ import cn.quantgroup.cashloanflowboss.api.order.model.XyqbCurrentOrderStatusServ ...@@ -4,10 +4,7 @@ import cn.quantgroup.cashloanflowboss.api.order.model.XyqbCurrentOrderStatusServ
import cn.quantgroup.cashloanflowboss.api.order.model.XyqbHistoryOrderStatusServiceResultModel; import cn.quantgroup.cashloanflowboss.api.order.model.XyqbHistoryOrderStatusServiceResultModel;
import cn.quantgroup.cashloanflowboss.core.base.ServiceResult; import cn.quantgroup.cashloanflowboss.core.base.ServiceResult;
import cn.quantgroup.cashloanflowboss.spi.xyqb.client.XYQBCenter; import cn.quantgroup.cashloanflowboss.spi.xyqb.client.XYQBCenter;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.Contract; import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.*;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.FundLending;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.FundingAssetAllocationsPrograms;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.FundingCorpPolicy;
import cn.quantgroup.cashloanflowboss.spi.xyqb.repository.*; import cn.quantgroup.cashloanflowboss.spi.xyqb.repository.*;
import cn.quantgroup.cashloanflowboss.spi.xyqb.util.SignUtil; import cn.quantgroup.cashloanflowboss.spi.xyqb.util.SignUtil;
import cn.quantgroup.cashloanflowboss.utils.DateUtil; import cn.quantgroup.cashloanflowboss.utils.DateUtil;
...@@ -38,6 +35,8 @@ public class XYQBCenterService { ...@@ -38,6 +35,8 @@ public class XYQBCenterService {
private FundingCorpPolicyRepository fundingCorpPolicyRepository; private FundingCorpPolicyRepository fundingCorpPolicyRepository;
@Autowired @Autowired
private FundingAssetAllocationsProgramsRepository fundingAssetAllocationsProgramsRepository; private FundingAssetAllocationsProgramsRepository fundingAssetAllocationsProgramsRepository;
@Autowired
private LoanApplicationHistoryRepository loanApplicationHistoryRepository;
@Value("${debug.model}") @Value("${debug.model}")
...@@ -133,6 +132,10 @@ public class XYQBCenterService { ...@@ -133,6 +132,10 @@ public class XYQBCenterService {
return fundingAssetAllocationsProgramsRepository.findByFundCorpIdAndPlanDate(corpPolicyId, planDate); return fundingAssetAllocationsProgramsRepository.findByFundCorpIdAndPlanDate(corpPolicyId, planDate);
} }
public LoanApplicationHistory findLoanApplicationHistoryById(Long loanId) {
return loanApplicationHistoryRepository.findById(loanId);
}
/** /**
* 验证资产计划 是否有效 * 验证资产计划 是否有效
* @param corpPolicyId * @param corpPolicyId
......
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