Commit 26067152 authored by shangying's avatar shangying

增加一些流程和修复

parent 3582f187
...@@ -15,6 +15,7 @@ public enum CommonType { ...@@ -15,6 +15,7 @@ public enum CommonType {
PRODUCTID900(900,"900"), PRODUCTID900(900,"900"),
PRODUCTID910(910,"910"), PRODUCTID910(910,"910"),
PRODUCTID920(920,"920"), PRODUCTID920(920,"920"),
PRODUCTID940(940,"940"),
PRODUCTID540(540,"540"), PRODUCTID540(540,"540"),
PRODUCTID610(610,"610"), PRODUCTID610(610,"610"),
PRODUCTID650(650,"650"), PRODUCTID650(650,"650"),
......
package cn.quantgroup.cashloanflowboss.api.oneclickdata.service; package cn.quantgroup.cashloanflowboss.api.oneclickdata.service;
import cn.quantgroup.cashloanflowboss.api.oneclickdata.entity.OneClickData; import cn.quantgroup.cashloanflowboss.api.oneclickdata.entity.OneClickData;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.QuotaAccount;
/** /**
* Created by shang on 2019/12/3. * Created by shang on 2019/12/3.
...@@ -9,42 +10,42 @@ public interface H5BindingCardAndWithdrawDeposit { ...@@ -9,42 +10,42 @@ public interface H5BindingCardAndWithdrawDeposit {
/** /**
* 前往提现页 * 前往提现页
*/ */
void accountPro(OneClickData oneClickData); void accountPro(OneClickData oneClickData) throws Exception;
/** /**
* 查询用户额度表(获取 accountId) * 查询用户额度表(获取 accountId)
*/ */
void getXYQBAccountId(); QuotaAccount getXYQBAccountId(OneClickData oneClickData);
/** /**
* 进入支付绑卡 * 进入支付绑卡
*/ */
void bindCard(); void bindCard(OneClickData oneClickData) throws Exception;
/** /**
* 绑卡发送短信 * 绑卡发送短信
*/ */
void cardAuthSms(); void cardAuthSms(OneClickData oneClickData);
/** /**
* 绑卡确认 * 绑卡确认
*/ */
void cardAuthSmsConfirm(); void cardAuthSmsConfirm(OneClickData oneClickData,String cardNo);
/** /**
* 查询用户可用卡列表 * 查询用户可用卡列表
*/ */
void bindCardList(); void bindCardList(OneClickData oneClickData) throws Exception;
/** /**
* 查询分配资金方 * 查询分配资金方
*/ */
void accountTrial(); void accountTrial(OneClickData oneClickData) throws Exception;
/** /**
* 绑卡后提现 * 绑卡后提现
*/ */
void cashAfterBindingCard(); void cashAfterBindingCard(OneClickData oneClickData) throws Exception;
......
...@@ -244,7 +244,7 @@ public class PhoneInfoServiceImpl implements PhoneInfoService { ...@@ -244,7 +244,7 @@ public class PhoneInfoServiceImpl implements PhoneInfoService {
@Override @Override
public void spiderC() { public void spiderC() {
// 数据库中插入数据
} }
@Override @Override
......
package cn.quantgroup.cashloanflowboss.spi.xyqb.entity;
import lombok.Data;
import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
/**
* 额度账户
* Created by jingfeng on 2018/3/21.
*/
@Data
@Entity
@Table(name = "quota_account")
public class QuotaAccount {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* uuid关联风控
*/
@Column(name = "uuid")
private String uuid;
/**
* 用户id
*/
@Column(name = "user_id")
private Long userId;
/**
* 预留字段 客户ID
*/
@Column(name = "customer_id")
private String customerId;
/**
* 产品id,关联产品表
*/
@Column(name = "product_id")
private Long productId;
/**
* 产品类型; 0:现金分期;1:白条循环;2:现金循环额度
*
*/
@Column(name = "product_type")
private Integer productType;
/**
* 总额度
*/
@Column(name = "total_amount")
private BigDecimal totalAmount;
/**
* 当前可用额度
*/
@Column(name = "available_amount")
private BigDecimal availableAmount;
/**
* 已使用额度
*/
@Column(name = "used_amount")
private BigDecimal usedAmount;
/**
* 冻结额度
*/
@Column(name = "freeze_amount")
private BigDecimal freezeAmount;
/**
* 过期时间,风控提供
*/
@Column(name = "expire_at")
private Timestamp expireAt;
/**
* 备注
*/
@Column(name = "remark")
private String remark;
/**
* 数据是否启用标志位
*/
@Column(name = "is_active")
private Boolean isActive = true;
/**
* 创建时间
*/
@Column(name = "created_at")
private Timestamp createdAt;
/**
* 更新时间
*/
@Column(name = "updated_at")
private Timestamp updatedAt;
//是否过期
@Transient
private boolean expired = false;
public boolean isExpired() {
return new Date().after(expireAt);
}
public enum AccountStatus {
NONE(0, "无账户"),
ACTIVE(1, "账户可用,为过期"),
ACTIVE_EXPIRE(2, "账户可用,已过期(有未结清的,不能设置不可用)"),
EXPIRE(3, "不可用,过期");
private int code;
private String desc;
AccountStatus(int code, String desc) {
this.code = code;
this.desc = desc;
}
}
@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.QuotaAccount;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
* Created by QuantGroup on 2018/3/21.
*/
public interface IQuotaAccountRepository extends JpaRepository<QuotaAccount, Long> {
@Query(value = "select * from quota_account where uuid = ?1 and product_id=?2 and is_active=1", nativeQuery = true)
QuotaAccount findByUuidAndProductId(String uuid, Long productId);
/**
* 根据用户ID和产品ID查询最新一条账户信息
*
* @param userId
* @param productId
* @return
*/
@Query(value = "select * from quota_account where user_id = ?1 and product_id=?2 order by id desc limit 1", nativeQuery = true)
QuotaAccount findLatestAccount(Long userId, Long productId);
/**
* 根据用户ID和产品ID查询可用状态账户信息
*
* @param userId
* @param productId
* @return
*/
@Query(value = "select * from quota_account where user_id = ?1 and product_id=?2 and is_active=1", nativeQuery = true)
QuotaAccount findActiveAccount(Long userId, Long productId);
/**
* 根据用户ID查询可用状态账户信息
*
* @param userId
* @return
*/
@Query(value = "select * from quota_account where user_id = ?1 and is_active=1 order by id desc limit 1", nativeQuery = true)
QuotaAccount findActiveAccountByUserId(Long userId);
/**
* 查询用户历史订单
*
* @param userId
* @return
*/
@Query(value = "SELECT l.id,l.user_id,l.progress,l.is_active,m.funding_corp_id,m.contract_loan_amount,m.contract_term,m.transaction_status,m.loan_paid_at,m.created_at,l.created_from FROM `loan_application_history` l JOIN `loan_application_manifest_history` m ON l.id = m.`loan_application_history_id` " +
"WHERE l.`user_id` = ?1 AND l.`business_type` = 0",
nativeQuery = true)
List<Object[]> findLoanOrder(Long userId);
@Query(value = "SELECT l.id,l.user_id,l.progress,l.is_active,m.funding_corp_id,m.contract_loan_amount,m.contract_term,m.transaction_status,m.loan_paid_at,m.created_at,l.created_from FROM `loan_application_history` l JOIN `loan_application_manifest_history` m ON l.id = m.`loan_application_history_id` " +
"JOIN loan_account_ext la ON la.`loan_id` = l.`id` " +
"WHERE l.`user_id` = ?1 AND l.`business_type` = 0 AND la.`product_id`= ?2", nativeQuery = true)
List<Object[]> findLoanOrderByProduct(Long userId, Long productId);
@Query(value = "SELECT l.id,l.user_id,l.progress,l.is_active,m.funding_corp_id,m.contract_loan_amount,m.contract_term,m.transaction_status,m.loan_paid_at,m.created_at,l.created_from FROM `loan_application_history` l JOIN `loan_application_manifest_history` m ON l.id = m.`loan_application_history_id` " +
"LEFT JOIN loan_submit_info s ON s.`loan_id` = l.`id` " +
"WHERE l.`user_id` = ?1 AND l.`business_type` = 0 AND (l.created_from = ?2 OR s.`channel_id` = ?2)", nativeQuery = true)
List<Object[]> findLoanOrderByChannel(Long userId, Long channelId);
@Query(value = "SELECT a.* FROM `quota_account` a LEFT JOIN `loan_account_ext` l ON a.`id` = l.`account_id` WHERE l.`loan_id` = ?1 LIMIT 1", nativeQuery = true)
QuotaAccount findByLoanId(Long loanId);
@Modifying
@Query(value = "update quota_account set is_active = 0 ,remark = ?2 WHERE id = ?1", nativeQuery = true)
int close(Long accountId, String remark);
@Modifying
@Query(value = "update quota_account set is_active = 1 WHERE id = ?1 and is_active=0", nativeQuery = true)
int activeAccount(Long accountId);
@Query(value = "select q.* from quota_account q LEFT JOIN quota_account_log l on q.id = l.account_id where l.biz_type = 1 and l.biz_id = ?1 ",
nativeQuery = true)
QuotaAccount findByApplyId(String applyId);
}
...@@ -25,7 +25,7 @@ public class GetBiNoAndFinanceProducts { ...@@ -25,7 +25,7 @@ public class GetBiNoAndFinanceProducts {
getResult.put("biNo", "9"); getResult.put("biNo", "9");
}else if(productId == CommonType.PRODUCTID920.getCode()){ }else if(productId == CommonType.PRODUCTID920.getCode() || productId == CommonType.PRODUCTID940.getCode()){
getResult.put("biNo", "9"); getResult.put("biNo", "9");
} }
......
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