Commit 2c3593d3 by zhaoyang

查询资产列表

parent 91c71532
......@@ -2,17 +2,22 @@ package com.abssqr.plat.biz.api.astPool;
import com.abssqr.plat.biz.support.ServiceSupport;
import com.abssqr.plat.common.dal.mysql.auto.paging.AstPoolPage;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoan;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoanStat;
import com.abssqr.plat.common.facade.base.BaseStringParam;
import com.abssqr.plat.common.facade.enums.AstTypeEnum;
import com.abssqr.plat.common.facade.param.astPool.AstPoolOprParam;
import com.abssqr.plat.common.facade.param.astPool.AstPoolPageQryParam;
import com.abssqr.plat.common.facade.result.BasePage;
import com.abssqr.plat.common.facade.result.ast.AstPoolLoanListVO;
import com.abssqr.plat.common.facade.result.astPool.AstPoolVO;
import com.abssqr.plat.common.facade.service.AstPoolService;
import com.abssqr.plat.common.facade.validation.Valid;
import com.abssqr.plat.common.model.convertor.AstPoolConvert;
import com.abssqr.plat.common.model.convertor.LoanConvert;
import com.abssqr.plat.common.model.domain.ast.AstPoolEntity;
import com.abssqr.plat.common.model.enums.IdTypeEnum;
import com.abssqr.plat.common.model.repo.ast.LoanRepository;
import com.abssqr.plat.common.model.repo.astPool.AstPoolRepository;
import com.abssqr.plat.common.model.seq.SequenceUtil;
import com.abssqr.plat.core.service.ast.AstPackManager;
......@@ -21,6 +26,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class AstPoolServiceImpl extends ServiceSupport implements AstPoolService{
......@@ -30,6 +37,9 @@ public class AstPoolServiceImpl extends ServiceSupport implements AstPoolService
@Autowired
AstPackManager astPackManager;
@Autowired
LoanRepository loanRepository;
/**
* 新增资产池
* @param astPoolOprParam
......@@ -67,6 +77,7 @@ public class AstPoolServiceImpl extends ServiceSupport implements AstPoolService
result.setDatas(AstPoolConvert.convert2VOs(page.getDatas()));
result.setCurrPageNo(page.getCurrPageNo());
result.setTotal(page.getTotal());
result.setLimit(page.getLimit());
return result;
});
......@@ -82,8 +93,27 @@ public class AstPoolServiceImpl extends ServiceSupport implements AstPoolService
return super.doQry(new BaseStringParam(astPoolNo),()->{
AstPoolEntity astPoolEntity = astPoolRepository.getByAstPoolNo(astPoolNo);
VarChecker.checkNotNull(astPoolEntity,"资产池不存在");
return AstPoolConvert.convert2VO(astPoolEntity);
AstPoolLoanStat astPoolLoanStat = loanRepository.statAstPoolLoan(astPoolNo);
AstPoolVO astPoolVO = AstPoolConvert.convert2VO(astPoolEntity);
astPoolVO.setAstAmt(astPoolLoanStat.getAllPrinBal());
astPoolVO.setAstCnt(astPoolLoanStat.getAllCnt());
astPoolVO.setPackedAstAmt(astPoolLoanStat.getPackPrinBal());
astPoolVO.setPackedAstCnt(astPoolLoanStat.getPackCnt());
return astPoolVO;
});
}
@Override
public List<AstPoolLoanListVO> astList(String astPoolNo) {
return null;
}
/*
@Override
public AstPoolLoanListVO astList(String astPoolNo) {
List<AstPoolLoan> loanListByAstPoolNo = loanRepository.getLoanListByAstPoolNo(astPoolNo);
List<AstPoolLoanListVO> loanListVOS = LoanConvert.convert2AstPoolLoanListVOs(loanListByAstPoolNo);
return loanListVOS;
}
*/
}
......@@ -292,6 +292,30 @@
<column name="CNT" jdbctype="BIGINT" javatype="Long" remark="总条数"/>
</resultmap>
<resultmap name="AstPoolLoanStat" type="AstPoolLoanStat">
<column name="ALL_PRIN_BAL" jdbctype="BIGINT" javatype="com.general.system.common.model.Money" remark="所有剩余本金"/>
<column name="ALL_CNT" jdbctype="BIGINT" javatype="Long" remark="共剩余资产笔数"/>
<column name="PACK_PRIN_BAL" jdbctype="BIGINT" javatype="com.general.system.common.model.Money" remark="已打包剩余本金"/>
<column name="PACK_CNT" jdbctype="BIGINT" javatype="Long" remark="已打包剩余资产笔数"/>
</resultmap>
<resultmap name="AstPoolLoan" type="AstPoolLoan">
<column name="AST_NO" jdbctype="VARCHAR" javatype="String" remark="资产编号"/>
<column name="PRIN_BAL" jdbctype="BIGINT" javatype="com.general.system.common.model.Money" remark="贷款剩余本金"/>
<column name="START_DATE" jdbctype="DATE" javatype="java.util.Date" remark="贷款日期"/>
<column name="FREE_TERM" jdbctype="BIGINT" javatype="Long" remark="贷款剩余期限"/>
<column name="RATE" jdbctype="BIGINT" javatype="java.math.BigDecimal" remark="贷款利率"/>
<column name="RISK_CL" jdbctype="VARCHAR" javatype="String" remark="五级分类"/>
<column name="REPAY_PERIOD" jdbctype="BIGINT" javatype="Long" remark="还款周期"/>
<column name="REPAY_PERIOD_TYPE" jdbctype="VARCHAR" javatype="String" remark="还款周期类型"/>
<column name="REPAY_METHOD" jdbctype="VARCHAR" javatype="String" remark="还款方式"/>
<column name="PLAN_NAME" jdbctype="VARCHAR" javatype="String" remark="资产归属"/>
</resultmap>
AstPoolLoan
<operation name="statPlanBal" resultmap="LoanPropCntStat" multiplicity="one" remark="统计机构当前资产规模">
SELECT
LENDER_ORG_CODE as PROP_VAL,
......@@ -354,4 +378,44 @@
OWN_STATUS != 'out'
ORDER BY END_DATE ASC
</operation>
<operation name="statPrinAndCnt" resultmap="AstPoolLoanStat" multiplicity="one" remark="根据资产池编号统计已打包为总共的本金余额和资产笔数">
select
SUM(case WHEN R2.STATUS='pack' then L1.PRIN_BAL else 0 end) AS ALL_PRIN_BAL,
SUM(case when R2.STATUS = 'pack' then 1 else 0 end) AS ALL_CNT,
SUM(case WHEN R2.STATUS != 'pack' then L1.PRIN_BAL else 0 end ) AS PACK_PRIN_BAL,
SUM(case when R2.STATUS != 'pack' then 1 else 0 end) AS PACK_CNT
from
ABS_LOAN L1
LEFT JOIN ABS_LOAN_PACK_REL R1 ON L1.AST_NO=R1.AST_NO AND R1.STATUS='in'
LEFT JOIN ABS_AST_PACK R2 ON R1.PACK_NO=R2.PACK_NO
WHERE
R2.AST_POOL_NO=#{astPoolNo,jdbcType=VARCHAR}
</operation>
<operation name="getLoanListByAstPoolNo" resultmap="AstPoolLoan" multiplicity="paging" paging="AstPoolLoanPage" remark="根据资产池编号查询对应的资产">
SELECT
L1.AST_NO, --资产编号
L1.PRIN_BAL, --贷款剩余本金
L1.START_DATE, --贷款日期
L1.TERM_CNT-L1.CUR_TERM AS FREE_TERM, --贷款剩余期限
R1.RATE, --贷款利率
L1.RISK_CL, --五级分类
R1.REPAY_PERIOD, --还款周期
R1.REPAY_PERIOD_TYPE, --还款周期类型
R1.REPAY_METHOD, --还款方式
R4.PLAN_NAME --资产归属
FROM
ABS_LOAN L1
LEFT JOIN ABS_LOAN_CONTRACT R1 ON L1.AST_NO=R1.AST_NO
LEFT JOIN ABS_LOAN_PACK_REL R2 ON L1.AST_NO=R2.AST_NO
LEFT JOIN ABS_AST_PACK R3 ON R2.PACK_NO=R3.PACK_NO
LEFT JOIN ABS_PLAN R4 ON R3.PLAN_NO=R4.PLAN_NO
WHERE
R2.STATUS='in'
AND R3.AST_POOL_NO=#{astPoolNo,jdbcType=VARCHAR}
</operation>
</table>
......@@ -8,6 +8,8 @@ import com.abssqr.plat.common.dal.mysql.auto.paging.LoanListPage;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.LoanPropCntStat;
import com.abssqr.plat.common.dal.mysql.auto.paging.CapitalAstMatchPage;
import com.abssqr.plat.common.dal.mysql.auto.paging.CapitalAstUnMatchPage;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoanStat;
import com.abssqr.plat.common.dal.mysql.auto.paging.AstPoolLoanPagePage;
import com.abssqr.plat.common.dal.mysql.auto.mapper.LoanDOMapper;
/**
......@@ -142,4 +144,29 @@ public class LoanDAO{
capitalAstUnMatch.setTotal(total);
return capitalAstUnMatch;
}
/**
* desc:根据资产池编号统计已打包为总共的本金余额和资产笔数.<br/>
* @param astPoolNo astPoolNo
* @return AstPoolLoanStat
*/
public AstPoolLoanStat statPrinAndCnt(String astPoolNo){
return loanDOMapper.statPrinAndCnt(astPoolNo);
}
/**
* desc:根据资产池编号查询对应的资产.<br/>
* @param astPoolLoanPage astPoolLoanPage
* @return AstPoolLoanPagePage
*/
public AstPoolLoanPagePage getLoanListByAstPoolNo(AstPoolLoanPagePage astPoolLoanPage){
int total = loanDOMapper.getLoanListByAstPoolNoCount(astPoolLoanPage);
if(total>0){
astPoolLoanPage.setDatas(loanDOMapper.getLoanListByAstPoolNoResult(astPoolLoanPage));
}else{
astPoolLoanPage.setDatas(new ArrayList());
}
astPoolLoanPage.setTotal(total);
return astPoolLoanPage;
}
}
......@@ -25,7 +25,7 @@ public class LoanDO{
*/
private String extInf;
/**
* ownOrg 所属机构(计划).
* ownOrg 所属资产池编号.
*/
private String ownOrg;
/**
......@@ -278,14 +278,14 @@ public class LoanDO{
}
/**
* Set ownOrg 所属机构(计划).
* Set ownOrg 所属资产池编号.
*/
public void setOwnOrg(String ownOrg){
this.ownOrg = ownOrg;
}
/**
* Get ownOrg 所属机构(计划).
* Get ownOrg 所属资产池编号.
*
* @return the string
*/
......
......@@ -7,6 +7,9 @@ import com.abssqr.plat.common.dal.mysql.auto.resultmap.LoanPropCntStat;
import com.abssqr.plat.common.dal.mysql.auto.paging.CapitalAstMatchPage;
import java.lang.String;
import com.abssqr.plat.common.dal.mysql.auto.paging.CapitalAstUnMatchPage;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoanStat;
import com.abssqr.plat.common.dal.mysql.auto.paging.AstPoolLoanPagePage;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoan;
import org.apache.ibatis.annotations.Param;
/**
......@@ -102,4 +105,22 @@ public interface LoanDOMapper{
* @return List<String>
*/
List<String> queryForCapitalAstUnMatchResult(CapitalAstUnMatchPage capitalAstUnMatch);
/**
* desc:根据资产池编号统计已打包为总共的本金余额和资产笔数.<br/>
* @param astPoolNo astPoolNo
* @return AstPoolLoanStat
*/
AstPoolLoanStat statPrinAndCnt(String astPoolNo);
/**
* desc:根据资产池编号查询对应的资产.<br/>
* @param astPoolLoanPage astPoolLoanPage
* @return int
*/
int getLoanListByAstPoolNoCount(AstPoolLoanPagePage astPoolLoanPage);
/**
* desc:根据资产池编号查询对应的资产.<br/>
* @param astPoolLoanPage astPoolLoanPage
* @return List<AstPoolLoan>
*/
List<AstPoolLoan> getLoanListByAstPoolNoResult(AstPoolLoanPagePage astPoolLoanPage);
}
......@@ -61,6 +61,24 @@
<result column="PROP_VAL" property="propVal" javaType="String"/>
<result column="AMT" property="amt" javaType="com.general.system.common.model.Money"/>
</resultMap>
<resultMap id="AstPoolLoanStat" type="com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoanStat" >
<result column="ALL_CNT" property="allCnt" javaType="Long"/>
<result column="PACK_CNT" property="packCnt" javaType="Long"/>
<result column="ALL_PRIN_BAL" property="allPrinBal" javaType="com.general.system.common.model.Money"/>
<result column="PACK_PRIN_BAL" property="packPrinBal" javaType="com.general.system.common.model.Money"/>
</resultMap>
<resultMap id="AstPoolLoan" type="com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoan" >
<result column="FREE_TERM" property="freeTerm" javaType="Long"/>
<result column="REPAY_PERIOD" property="repayPeriod" javaType="Long"/>
<result column="AST_NO" property="astNo" javaType="String"/>
<result column="RISK_CL" property="riskCl" javaType="String"/>
<result column="PLAN_NAME" property="planName" javaType="String"/>
<result column="REPAY_METHOD" property="repayMethod" javaType="String"/>
<result column="REPAY_PERIOD_TYPE" property="repayPeriodType" javaType="String"/>
<result column="START_DATE" property="startDate" javaType="java.util.Date"/>
<result column="RATE" property="rate" javaType="java.math.BigDecimal"/>
<result column="PRIN_BAL" property="prinBal" javaType="com.general.system.common.model.Money"/>
</resultMap>
<sql id="Base_SF_Column_List">
sf.USER_ID,sf.FEE_BAL,sf.INTR_BAL,sf.PRIN_BAL,sf.PAID_FEE_AMT,sf.OVD_PRIN_BAL,sf.OVD_INTR_BAL,sf.OVD_FEE_BAL,sf.OWN_STATUS
......@@ -475,4 +493,67 @@
) table_alias
where table_alias.rowno &gt; #{startRow}
</select>
<!--根据资产池编号统计已打包为总共的本金余额和资产笔数 mydalgen自动生成,请勿修改-->
<select id="statPrinAndCnt" resultMap="AstPoolLoanStat" >
select
SUM(case WHEN R2.STATUS='pack' then L1.PRIN_BAL else 0 end) AS ALL_PRIN_BAL,
SUM(case when R2.STATUS = 'pack' then 1 else 0 end) AS ALL_CNT,
SUM(case WHEN R2.STATUS != 'pack' then L1.PRIN_BAL else 0 end ) AS PACK_PRIN_BAL,
SUM(case when R2.STATUS != 'pack' then 1 else 0 end) AS PACK_CNT
from
ABS_LOAN L1
LEFT JOIN ABS_LOAN_PACK_REL R1 ON L1.AST_NO=R1.AST_NO AND R1.STATUS='in'
LEFT JOIN ABS_AST_PACK R2 ON R1.PACK_NO=R2.PACK_NO
WHERE
R2.AST_POOL_NO=#{astPoolNo,jdbcType=VARCHAR}
</select>
<!--根据资产池编号查询对应的资产 pageCount mydalgen自动生成,请勿修改-->
<select id="getLoanListByAstPoolNoCount" resultType="int" >
SELECT
COUNT(*) AS total
FROM
ABS_LOAN L1
LEFT JOIN ABS_LOAN_CONTRACT R1 ON L1.AST_NO=R1.AST_NO
LEFT JOIN ABS_LOAN_PACK_REL R2 ON L1.AST_NO=R2.AST_NO
LEFT JOIN ABS_AST_PACK R3 ON R2.PACK_NO=R3.PACK_NO
LEFT JOIN ABS_PLAN R4 ON R3.PLAN_NO=R4.PLAN_NO
WHERE
R2.STATUS='in'
AND R3.AST_POOL_NO=#{astPoolNo,jdbcType=VARCHAR}
</select>
<!--根据资产池编号查询对应的资产 pageResult mydalgen自动生成,请勿修改-->
<select id="getLoanListByAstPoolNoResult" resultMap="AstPoolLoan" >
select
*
from(
select
tt.*,ROWNUM AS rowno
from(
SELECT
L1.AST_NO, --资产编号
L1.PRIN_BAL, --贷款剩余本金
L1.START_DATE, --贷款日期
L1.TERM_CNT-L1.CUR_TERM AS FREE_TERM, --贷款剩余期限
R1.RATE, --贷款利率
L1.RISK_CL, --五级分类
R1.REPAY_PERIOD, --还款周期
R1.REPAY_PERIOD_TYPE, --还款周期类型
R1.REPAY_METHOD, --还款方式
R4.PLAN_NAME --资产归属
FROM
ABS_LOAN L1
LEFT JOIN ABS_LOAN_CONTRACT R1 ON L1.AST_NO=R1.AST_NO
LEFT JOIN ABS_LOAN_PACK_REL R2 ON L1.AST_NO=R2.AST_NO
LEFT JOIN ABS_AST_PACK R3 ON R2.PACK_NO=R3.PACK_NO
LEFT JOIN ABS_PLAN R4 ON R3.PLAN_NO=R4.PLAN_NO
WHERE
R2.STATUS='in'
AND R3.AST_POOL_NO=#{astPoolNo,jdbcType=VARCHAR}
) tt where ROWNUM &lt;= #{endRow}
) table_alias
where table_alias.rowno &gt; #{startRow}
</select>
</mapper>
package com.abssqr.plat.common.facade.result.ast;
import com.general.system.common.model.BaseEntity;
import com.general.system.common.model.Money;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class AstPoolLoanListVO extends BaseEntity implements Serializable {
//资产编号
private String astNo;
//贷款剩余本金
private Money prinBal;
//贷款日期
private Date startDate;
//贷款剩余期限
private Long freeTerm;
//贷款利率
private BigDecimal rate;
//贷款五级分类
private String riskCl;
//还款周期
private Long repayPeriod;
//还款周期类型
private String repoayPeriodType;
//还款方式
private String repayMethod;
//资产归属
private String planName;
public String getAstNo() {
return astNo;
}
public void setAstNo(String astNo) {
this.astNo = astNo;
}
public Money getPrinBal() {
return prinBal;
}
public void setPrinBal(Money prinBal) {
this.prinBal = prinBal;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Long getFreeTerm() {
return freeTerm;
}
public void setFreeTerm(Long freeTerm) {
this.freeTerm = freeTerm;
}
public BigDecimal getRate() {
return rate;
}
public void setRate(BigDecimal rate) {
this.rate = rate;
}
public String getRiskCl() {
return riskCl;
}
public void setRiskCl(String riskCl) {
this.riskCl = riskCl;
}
public Long getRepayPeriod() {
return repayPeriod;
}
public void setRepayPeriod(Long repayPeriod) {
this.repayPeriod = repayPeriod;
}
public String getRepoayPeriodType() {
return repoayPeriodType;
}
public void setRepoayPeriodType(String repoayPeriodType) {
this.repoayPeriodType = repoayPeriodType;
}
public String getRepayMethod() {
return repayMethod;
}
public void setRepayMethod(String repayMethod) {
this.repayMethod = repayMethod;
}
public String getPlanName() {
return planName;
}
public void setPlanName(String planName) {
this.planName = planName;
}
}
......@@ -5,7 +5,7 @@ import com.general.system.common.model.Money;
import java.io.Serializable;
public class AstPoolVO extends BaseEntity implements Serializable{
public class AstPoolVO extends BaseEntity implements Serializable {
//资产池名称
private String astPoolName;
//准入资产名称
......@@ -17,12 +17,12 @@ public class AstPoolVO extends BaseEntity implements Serializable{
private Money astAmt;
//合计资产剩余笔数
private Money astCnt;
private Long astCnt;
//已打包资产剩余本金
private Money packedAstAmt;
//已打包资产剩余笔数
private Money packedAstCnt;
private Long packedAstCnt;
public String getAstPoolName() {
return astPoolName;
......@@ -56,11 +56,11 @@ public class AstPoolVO extends BaseEntity implements Serializable{
this.astAmt = astAmt;
}
public Money getAstCnt() {
public Long getAstCnt() {
return astCnt;
}
public void setAstCnt(Money astCnt) {
public void setAstCnt(Long astCnt) {
this.astCnt = astCnt;
}
......@@ -72,11 +72,11 @@ public class AstPoolVO extends BaseEntity implements Serializable{
this.packedAstAmt = packedAstAmt;
}
public Money getPackedAstCnt() {
public Long getPackedAstCnt() {
return packedAstCnt;
}
public void setPackedAstCnt(Money packedAstCnt) {
public void setPackedAstCnt(Long packedAstCnt) {
this.packedAstCnt = packedAstCnt;
}
}
......@@ -3,8 +3,11 @@ package com.abssqr.plat.common.facade.service;
import com.abssqr.plat.common.facade.param.astPool.AstPoolOprParam;
import com.abssqr.plat.common.facade.param.astPool.AstPoolPageQryParam;
import com.abssqr.plat.common.facade.result.BasePage;
import com.abssqr.plat.common.facade.result.ast.AstPoolLoanListVO;
import com.abssqr.plat.common.facade.result.astPool.AstPoolVO;
import java.util.List;
public interface AstPoolService {
int add(AstPoolOprParam astPoolOprParam);
......@@ -12,4 +15,6 @@ public interface AstPoolService {
BasePage<AstPoolVO> page(AstPoolPageQryParam astPoolPageQryParam);
AstPoolVO get(String astPoolNo);
List<AstPoolLoanListVO> astList(String astPoolNo);
}
......@@ -7,14 +7,18 @@ package com.abssqr.plat.common.model.convertor;
import com.abssqr.plat.common.dal.mysql.auto.dataobject.LoanBakDO;
import com.abssqr.plat.common.dal.mysql.auto.dataobject.LoanDO;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoan;
import com.abssqr.plat.common.facade.enums.*;
import com.abssqr.plat.common.facade.result.ast.AstPoolLoanListVO;
import com.abssqr.plat.common.model.domain.ast.Loan;
import com.abssqr.plat.common.model.domain.ast.LoanBak;
import com.abssqr.plat.common.model.domain.ast.LoanRisk;
import com.abssqr.plat.common.model.utils.TextUtil;
import com.general.system.tool.util.ToolUtil;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
/**
......@@ -216,4 +220,28 @@ public class LoanConvert {
instance.setExtInf(TextUtil.convertMap2Txt(var.getExtInf()));
return instance;
}
public static List<AstPoolLoanListVO> convert2AstPoolLoanListVOs(List<AstPoolLoan> astPoolLoanList){
List<AstPoolLoanListVO> loanListVOS=new ArrayList<>();
astPoolLoanList.forEach(v->{
loanListVOS.add(convert2AstPoolLoanListVO(v));
});
return loanListVOS;
}
public static AstPoolLoanListVO convert2AstPoolLoanListVO(AstPoolLoan astPoolLoan){
AstPoolLoanListVO astPoolLoanListVO=new AstPoolLoanListVO();
astPoolLoanListVO.setAstNo(astPoolLoan.getAstNo());
astPoolLoanListVO.setFreeTerm(astPoolLoan.getFreeTerm());
astPoolLoanListVO.setPlanName(astPoolLoan.getPlanName());
astPoolLoanListVO.setPrinBal(astPoolLoan.getPrinBal());
astPoolLoanListVO.setRate(astPoolLoan.getRate());
astPoolLoanListVO.setRepayMethod(astPoolLoan.getRepayMethod());
astPoolLoanListVO.setRepayPeriod(astPoolLoan.getRepayPeriod());
astPoolLoanListVO.setRepoayPeriodType(astPoolLoan.getRepayPeriodType());
astPoolLoanListVO.setRiskCl(astPoolLoan.getRiskCl());
astPoolLoanListVO.setStartDate(astPoolLoan.getStartDate());
return astPoolLoanListVO;
}
}
......@@ -9,6 +9,8 @@ import com.abssqr.plat.common.dal.mysql.auto.paging.CapitalAstMatchPage;
import com.abssqr.plat.common.dal.mysql.auto.paging.CapitalAstUnMatchPage;
import com.abssqr.plat.common.dal.mysql.auto.paging.LoanBakListPage;
import com.abssqr.plat.common.dal.mysql.auto.paging.LoanListPage;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoan;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoanStat;
import com.abssqr.plat.common.facade.param.loan.LoanPageQryParam;
import com.abssqr.plat.common.model.domain.ast.Loan;
import com.abssqr.plat.common.model.domain.ast.LoanBak;
......@@ -108,4 +110,11 @@ public interface LoanRepository {
* @return
*/
CapitalAstUnMatchPage queryForCapitalAstUnMatch(CapitalAstUnMatchPage capitalAstUnBind);
AstPoolLoanStat statAstPoolLoan(String astPoolNo);
List<AstPoolLoan> getLoanListByAstPoolNo(String astPoolNo);
}
......@@ -14,12 +14,17 @@ import com.abssqr.plat.common.dal.mysql.auto.paging.CapitalAstMatchPage;
import com.abssqr.plat.common.dal.mysql.auto.paging.CapitalAstUnMatchPage;
import com.abssqr.plat.common.dal.mysql.auto.paging.LoanBakListPage;
import com.abssqr.plat.common.dal.mysql.auto.paging.LoanListPage;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoan;
import com.abssqr.plat.common.dal.mysql.auto.resultmap.AstPoolLoanStat;
import com.abssqr.plat.common.facade.param.loan.LoanPageQryParam;
import com.abssqr.plat.common.model.convertor.LoanConvert;
import com.abssqr.plat.common.model.domain.ast.AstPoolEntity;
import com.abssqr.plat.common.model.domain.ast.Loan;
import com.abssqr.plat.common.model.domain.ast.LoanBak;
import com.abssqr.plat.common.model.repo.ast.LoanRepository;
import com.abssqr.plat.common.model.repo.astPool.AstPoolRepository;
import com.abssqr.plat.common.util.profiler.PerformTrace;
import com.general.system.common.model.Money;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -46,6 +51,9 @@ public class LoanRepositoryImpl implements LoanRepository {
@Autowired
private LoanBakDAO loanBakDAO;
@Autowired
private AstPoolRepository astPoolRepository;
@Override
public Loan lockByAstNo(String astNo) {
if (StringUtils.isBlank(astNo)) {
......@@ -151,4 +159,30 @@ public class LoanRepositoryImpl implements LoanRepository {
return loanDAO.queryForCapitalAstUnMatch(capitalAstUnBind);
}
@Override
public AstPoolLoanStat statAstPoolLoan(String astPoolNo) {
AstPoolLoanStat astPoolLoanStat = loanDAO.statPrinAndCnt(astPoolNo);
if(astPoolLoanStat==null){
astPoolLoanStat=new AstPoolLoanStat();
//AstPoolEntity byAstPoolNo = astPoolRepository.getByAstPoolNo(astPoolNo);
astPoolLoanStat.setAllCnt(0L);
astPoolLoanStat.setAllPrinBal(new Money(0));
astPoolLoanStat.setPackCnt(0L);
astPoolLoanStat.setPackPrinBal(new Money(0));
}
return astPoolLoanStat;
}
@Override
public List<AstPoolLoan> getLoanListByAstPoolNo(String astPoolNo) {
return null;
}
/*
@Override
public List<AstPoolLoan> getLoanListByAstPoolNo(String astPoolNo){
List<AstPoolLoan> loanListByAstPoolNo = loanDAO.getLoanListByAstPoolNo(astPoolNo);
return loanListByAstPoolNo;
}
*/
}
......@@ -36,6 +36,8 @@ public class AstPoolRepositoryImpl implements AstPoolRepository {
String astPoolName = astPoolPageQryParam.getAstPoolName();
AstPoolPage astPoolPage=new AstPoolPage();
astPoolPage.setAstPoolName(astPoolName);
astPoolPage.setLimit(astPoolPageQryParam.getPageSize());
astPoolPage.setCurrPageNo(astPoolPageQryParam.getPageNum());
AstPoolPage page = astPoolDAO.getPage(astPoolPage);
return page;
}
......
package com.abssqr.plat.web.controller.ast;
import com.abssqr.plat.common.facade.param.astPool.AstPoolOprParam;
import com.abssqr.plat.common.facade.service.AstPoolService;
import com.general.enhanced.controller.annotation.RestJsonController;
import com.general.system.common.model.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestJsonController
@RequestMapping("ast")
public class AstController {
@Autowired
private AstPoolService astPoolService;
@PostMapping("query.json")
public BaseResult add(@RequestBody AstPoolOprParam astPoolOprParam){
return BaseResult.success(astPoolService.add(astPoolOprParam));
}
}
......@@ -18,19 +18,46 @@ public class AstPoolController {
@Autowired
private AstPoolService astPoolService;
/**
* 新增资产池
* @param astPoolOprParam
* @return
*/
@PostMapping("add.json")
public BaseResult add(@RequestBody AstPoolOprParam astPoolOprParam){
return BaseResult.success(astPoolService.add(astPoolOprParam));
}
/**
* 查询资产池列表
* @param astPoolPageQryParam
* @return
*/
@PostMapping("page.json")
public BasePage<AstPoolVO> page(@RequestBody AstPoolPageQryParam astPoolPageQryParam){
return astPoolService.page(astPoolPageQryParam);
}
/**
* 查询资产池详情
* @param astPoolNo
* @return
*/
@GetMapping("get.json")
public AstPoolVO get(@RequestParam("astNo") String astNo){
return astPoolService.get(astNo);
public AstPoolVO get(@RequestParam("astPoolNo") String astPoolNo){
return astPoolService.get(astPoolNo);
}
/**
* 查询资产列表
* @param astPoolNo
* @return
*/
@GetMapping("astList.json")
public AstPoolVO astList(@RequestParam("astPoolNo") String astPoolNo){
return astPoolService.get(astPoolNo);
}
}
COMMENT ON COLUMN ABS_LOAN.OWN_ORG IS '所属资产池编号';
COMMENT ON COLUMN ABS_LOAN.OWN_ORG IS '所属资产池编号';
\ No newline at end of file
CREATE TABLE ABS_LOAN_PACK_REL
CREATE TABLE ABS_LOAN_PACK_REL
CREATE TABLE ABS_LOAN_PACK_REL
(
AST_NO VARCHAR2(64) NOT NULL
, PACK_NO VARCHAR2(64) NOT NULL
, STATUS VARCHAR2(16) NOT NULL
, REPAY_FINAL_DATE DATE
, BACK_NO VARCHAR2(64)
, BACK_COST NUMBER(20)
, BACK_PRIN NUMBER(20)
, BACK_RATE NUMBER(19,6)
, GMT_CREATE DATE
, GMT_MODIFIED DATE
, CONSTRAINT ABS_LOAN_PACK_REL_PK PRIMARY KEY
(
AST_NO
, PACK_NO
, STATUS
)
ENABLE
ID NUMBER(10),
PACK_NO VARCHAR2(64),
AST_NO VARCHAR2(64),
STATUS VARCHAR2(64),
REPAY_FINAL_DATE DATE,
BACK_NO VARCHAR2(64),
PRIN_BAL NUMBER(10),
BACK_AMT NUMBER(10),
PRIN_RATE NUMBER(10,2),
GMT_CREATE DATE,
GMT_MODIFIED DATE
);
COMMENT ON COLUMN ABS_LOAN_PACK_REL.AST_NO IS '资产编号';
CREATE INDEX ABS_LOAN_PACK_REL_AST_NO_index ON ABS_LOAN_PACK_REL (AST_NO);
CREATE INDEX ABS_LOAN_PACK_REL_PACK_NO_index ON ABS_LOAN_PACK_REL (PACK_NO);
COMMENT ON COLUMN ABS_LOAN_PACK_REL.PACK_NO IS '资产包编号';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.STATUS IS '状态 归属 in 赎回 back';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.AST_NO IS '资产编号';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.STATUS IS '状态,归属 in,赎回 back';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.REPAY_FINAL_DATE IS '还款最后归属日';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.BACK_NO IS '赎回编号';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.BACK_COST IS '赎回价格';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.BACK_PRIN IS '赎回本金';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.BACK_RATE IS '赎回定价';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.PRIN_BAL IS '本金余额';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.BACK_AMT IS '赎回价格';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.PRIN_RATE IS '本金定价利率';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.GMT_CREATE IS '创建时间';
COMMENT ON COLUMN ABS_LOAN_PACK_REL.GMT_MODIFIED IS '更新时间';
CREATE INDEX IDX_LOAN_PACK_REL_PACK ON ABS_LOAN_PACK_REL (PACK_NO);
COMMENT ON COLUMN ABS_LOAN_PACK_REL.GMT_MODIFIED IS '修改时间';
COMMENT ON TABLE ABS_LOAN_PACK_REL IS '资产-包关系表';
\ No newline at end of file
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