Commit 39ca8590 by 夏晨翔

Merge remote-tracking branch 'origin/dev_branch_BB_1_202004' into dev_branch_BB_1_202004

# Conflicts:
#	app/common/dal/dalgen/AbssqrCoreTables/ABS_AST_POOL.xml
#	app/common/dal/src/main/resources/com/abssqr/plat/common/dal/mysql/auto/mapper/AstPoolDOMapper.xml
parents 571b820b 95f89814
......@@ -2,16 +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.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.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.domain.ast.AstPoolEntity;
import com.abssqr.plat.common.model.enums.IdTypeEnum;
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;
import com.general.system.common.util.VarChecker;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -20,31 +26,49 @@ public class AstPoolServiceImpl extends ServiceSupport implements AstPoolService
@Autowired
AstPoolRepository astPoolRepository;
@Autowired
AstPackManager astPackManager;
@Override
public int add(AstPoolOprParam astPoolOprParam) {
AstPoolEntity astPoolEntity=new AstPoolEntity();
astPoolEntity.setAstTypeEnum(AstTypeEnum.getByCode(astPoolOprParam.getAstTypeCode()));
astPoolEntity.setAstPoolNo(astPoolOprParam.getAstPoolNo());
astPoolEntity.setAstPoolName(astPoolOprParam.getAstPoolName());
VarChecker.checkArgument(astPoolRepository.checkAstPool(astPoolEntity),"资产池名称/资产池编号重复");
return astPoolRepository.create(astPoolEntity);
public int add(@Valid AstPoolOprParam astPoolOprParam) {
return super.doOpr(astPoolOprParam,()->{
AstPoolEntity astPoolEntity=new AstPoolEntity();
astPoolEntity.setAstTypeEnum(AstTypeEnum.getByCode(astPoolOprParam.getAstTypeCode()));
//如果前端传入产品编号为空则将资产类型编号作为产品编号
if(StringUtils.isEmpty(astPoolEntity.getProdNo())){
astPoolEntity.setProdNo(astPoolOprParam.getAstTypeCode());
}
astPoolEntity.setAstPoolNo(SequenceUtil.genId(IdTypeEnum.AST_POOL_CODE));
astPoolEntity.setAstPoolName(astPoolOprParam.getAstPoolName());
VarChecker.checkArgument(astPoolRepository.checkAstPool(astPoolEntity),"资产池名称/资产池编号重复");
//创建默认资产包
astPackManager.craeteDefaultPack(astPoolOprParam.getProdNo());
return astPoolRepository.create(astPoolEntity);
});
}
@Override
public BasePage<AstPoolVO> page(AstPoolPageQryParam astPoolPageQryParam) {
BasePage<AstPoolVO> result=new BasePage();
AstPoolPage page = astPoolRepository.getPage(astPoolPageQryParam);
result.setDatas(AstPoolConvert.convert2VOs(page.getDatas()));
result.setCurrPageNo(page.getCurrPageNo());
result.setTotal(page.getTotal());
return result;
public BasePage<AstPoolVO> page(@Valid AstPoolPageQryParam astPoolPageQryParam) {
return super.doQry(astPoolPageQryParam,()->{
BasePage<AstPoolVO> result=new BasePage();
AstPoolPage page = astPoolRepository.getPage(astPoolPageQryParam);
result.setDatas(AstPoolConvert.convert2VOs(page.getDatas()));
result.setCurrPageNo(page.getCurrPageNo());
result.setTotal(page.getTotal());
return result;
});
}
@Override
public AstPoolVO get(String astPoolNo) {
AstPoolEntity astPoolEntity = astPoolRepository.getByAstPoolNo(astPoolNo);
VarChecker.checkNotNull(astPoolEntity,"资产池不存在");
return AstPoolConvert.convert2VO(astPoolEntity);
return super.doQry(new BaseStringParam(astPoolNo),()->{
AstPoolEntity astPoolEntity = astPoolRepository.getByAstPoolNo(astPoolNo);
VarChecker.checkNotNull(astPoolEntity,"资产池不存在");
return AstPoolConvert.convert2VO(astPoolEntity);
});
}
}
......@@ -3,13 +3,15 @@
<!-- 特殊字符说明 &lt;&gt; <> -->
<!-- baseSql option中 select * 会自动替换为 include -->
<sql id="Base_Column_List">
ID,AST_POOL_NO,GMT_CREATE,AST_POOL_NAME,AST_TYPE_CODE
ID,AST_POOL_NO,GMT_CREATE,AST_POOL_NAME,AST_TYPE_CODE
,PROD_NO
,GMT_MODIFIED
</sql>
<!-- baseSql option中 select sf.* 会自动替换为 include -->
<sql id="Base_SF_Column_List">
sf.ID,sf.AST_POOL_NO,sf.GMT_CREATE,sf.AST_POOL_NAME,sf.AST_TYPE_CODE
sf.ID,sf.AST_POOL_NO,sf.GMT_CREATE,sf.AST_POOL_NAME,sf.AST_TYPE_CODE
,PROD_NO
,sf.GMT_MODIFIED
</sql>
......@@ -21,13 +23,15 @@
,GMT_CREATE
,AST_POOL_NAME
,AST_TYPE_CODE
,PROD_NO
,GMT_MODIFIED
)VALUES(
SEQ_ABS_AST_POOL.nextval
, #{astPoolNo,jdbcType=VARCHAR}
, sysdate
, #{astPoolName,jdbcType=VARCHAR}
, #{astType,jdbcType=VARCHAR}
, #{astTypeCode,jdbcType=VARCHAR}
, #{prodNo,jdbcType=VARCHAR}
, sysdate
)
]]>
......@@ -43,6 +47,7 @@
,GMT_CREATE
,AST_POOL_NAME
,AST_TYPE_CODE
,PROD_NO
,GMT_MODIFIED
)VALUES
(
......@@ -50,7 +55,8 @@
, #{item.astPoolNo,jdbcType=VARCHAR}
, sysdate
, #{item.astPoolName,jdbcType=VARCHAR}
, #{item.astType,jdbcType=VARCHAR}
, #{item.astTypeCode,jdbcType=VARCHAR}
, #{item.prodNo,jdbcType=VARCHAR}
, sysdate
)
</foreach>
......@@ -63,7 +69,7 @@
SET
AST_POOL_NO = #{astPoolNo,jdbcType=VARCHAR}
,AST_POOL_NAME = #{astPoolName,jdbcType=VARCHAR}
,AST_TYPE_CODE = #{astType,jdbcType=VARCHAR}
,AST_TYPE_CODE = #{astTypeCode,jdbcType=VARCHAR}
,GMT_MODIFIED = sysdate
WHERE
ID = #{id,jdbcType=DECIMAL}
......
......@@ -12,6 +12,10 @@ public class AstPoolDO{
*/
private Long id;
/**
* prodNo 外部产品码.
*/
private String prodNo;
/**
* astPoolNo 资产池编号.
*/
private String astPoolNo;
......@@ -49,6 +53,22 @@ public class AstPoolDO{
}
/**
* Set prodNo 外部产品码.
*/
public void setProdNo(String prodNo){
this.prodNo = prodNo;
}
/**
* Get prodNo 外部产品码.
*
* @return the string
*/
public String getProdNo(){
return prodNo;
}
/**
* Set astPoolNo 资产池编号.
*/
public void setAstPoolNo(String astPoolNo){
......
......@@ -4,20 +4,23 @@
<!-- 自动生成,请修改 ABS_AST_POOL.xml -->
<resultMap id="BaseResultMap" type="com.abssqr.plat.common.dal.mysql.auto.dataobject.AstPoolDO">
<id column="ID" property="id" jdbcType="DECIMAL" javaType="Long"/>
<result column="PROD_NO" property="prodNo" jdbcType="VARCHAR" javaType="String"/>
<result column="AST_POOL_NO" property="astPoolNo" jdbcType="VARCHAR" javaType="String"/>
<result column="AST_POOL_NAME" property="astPoolName" jdbcType="VARCHAR" javaType="String"/>
<result column="AST_TYPE_CODE" property="astType" jdbcType="VARCHAR" javaType="String"/>
<result column="AST_TYPE_CODE" property="astTypeCode" jdbcType="VARCHAR" javaType="String"/>
<result column="GMT_CREATE" property="gmtCreate" jdbcType="DATE" javaType="java.util.Date"/>
<result column="GMT_MODIFIED" property="gmtModified" jdbcType="DATE" javaType="java.util.Date"/>
</resultMap>
<sql id="Base_SF_Column_List">
sf.ID,sf.AST_POOL_NO,sf.GMT_CREATE,sf.AST_POOL_NAME,sf.AST_TYPE_CODE
sf.ID,sf.AST_POOL_NO,sf.GMT_CREATE,sf.AST_POOL_NAME,sf.AST_TYPE_CODE
,PROD_NO
,sf.GMT_MODIFIED
</sql>
<sql id="Base_Column_List">
ID,AST_POOL_NO,GMT_CREATE,AST_POOL_NAME,AST_TYPE_CODE
ID,AST_POOL_NO,GMT_CREATE,AST_POOL_NAME,AST_TYPE_CODE
,PROD_NO
,GMT_MODIFIED
</sql>
......@@ -31,13 +34,15 @@
,GMT_CREATE
,AST_POOL_NAME
,AST_TYPE_CODE
,PROD_NO
,GMT_MODIFIED
)VALUES(
SEQ_ABS_AST_POOL.nextval
, #{astPoolNo,jdbcType=VARCHAR}
, sysdate
, #{astPoolName,jdbcType=VARCHAR}
, #{astType,jdbcType=VARCHAR}
, #{astTypeCode,jdbcType=VARCHAR}
, #{prodNo,jdbcType=VARCHAR}
, sysdate
)
]]>
......@@ -53,6 +58,7 @@
,GMT_CREATE
,AST_POOL_NAME
,AST_TYPE_CODE
,PROD_NO
,GMT_MODIFIED
)VALUES
(
......@@ -60,7 +66,8 @@
, #{item.astPoolNo,jdbcType=VARCHAR}
, sysdate
, #{item.astPoolName,jdbcType=VARCHAR}
, #{item.astType,jdbcType=VARCHAR}
, #{item.astTypeCode,jdbcType=VARCHAR}
, #{item.prodNo,jdbcType=VARCHAR}
, sysdate
)
</foreach>
......
package com.abssqr.plat.common.facade.base;
import com.abssqr.plat.common.facade.enums.EventCodeEnum;
public class BaseStringParam extends BaseParam{
private String data;
@Override
public EventCodeEnum getEventCode() {
return EventCodeEnum.ADMIN_DTL_QRY;
}
public BaseStringParam(String data) {
this.data = data;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
}
package com.abssqr.plat.common.facade.param.astPool;
import com.abssqr.plat.common.facade.base.BaseOprParam;
import com.abssqr.plat.common.facade.enums.AstTypeEnum;
import com.abssqr.plat.common.facade.enums.EventCodeEnum;
import com.abssqr.plat.common.facade.validation.VldEnums;
import com.abssqr.plat.common.facade.validation.VldString;
public class AstPoolOprParam {
@VldString(nullable = false,minLength = 0,maxLength = 30)
public class AstPoolOprParam extends BaseOprParam{
@VldString(maxLength = 30)
private String astPoolName;
@VldString(nullable = false,minLength = 0,maxLength = 30)
@VldEnums(enumClass= AstTypeEnum.class,message = "不支持的资产类型")
private String astTypeCode;
@VldString(nullable = false,minLength = 0,maxLength = 30)
private String astPoolNo;
@VldString(nullable = true,maxLength = 30)
private String prodNo;
public String getAstPoolName() {
return astPoolName;
......@@ -28,11 +32,16 @@ public class AstPoolOprParam {
this.astTypeCode = astTypeCode;
}
public String getAstPoolNo() {
return astPoolNo;
public String getProdNo() {
return prodNo;
}
public void setAstPoolNo(String astPoolNo) {
this.astPoolNo = astPoolNo;
public void setProdNo(String prodNo) {
this.prodNo = prodNo;
}
@Override
public EventCodeEnum getEventCode() {
return EventCodeEnum.ADMIN_EDIT;
}
}
package com.abssqr.plat.common.facade.result.astPool;
public class AstPoolVO {
import com.general.system.common.model.BaseEntity;
import com.general.system.common.model.Money;
import java.io.Serializable;
public class AstPoolVO extends BaseEntity implements Serializable{
//资产池名称
private String astPoolName;
//准入资产名称
private String astTypeName;
private String astPoolNo;
//准入资产代码
private String prodNo;
//合计资产剩余本金
private Money astAmt;
//合计资产剩余笔数
private Money astCnt;
//已打包资产剩余本金
private Money packedAstAmt;
//已打包资产剩余笔数
private Money packedAstCnt;
public String getAstPoolName() {
return astPoolName;
}
......@@ -20,12 +40,43 @@ public class AstPoolVO {
this.astTypeName = astTypeName;
}
public String getProdNo() {
return prodNo;
}
public void setProdNo(String prodNo) {
this.prodNo = prodNo;
}
public Money getAstAmt() {
return astAmt;
}
public void setAstAmt(Money astAmt) {
this.astAmt = astAmt;
}
public Money getAstCnt() {
return astCnt;
}
public void setAstCnt(Money astCnt) {
this.astCnt = astCnt;
}
public Money getPackedAstAmt() {
return packedAstAmt;
}
public void setPackedAstAmt(Money packedAstAmt) {
this.packedAstAmt = packedAstAmt;
}
public String getAstPoolNo() {
return astPoolNo;
public Money getPackedAstCnt() {
return packedAstCnt;
}
public void setAstPoolNo(String astPoolNo) {
this.astPoolNo = astPoolNo;
public void setPackedAstCnt(Money packedAstCnt) {
this.packedAstCnt = packedAstCnt;
}
}
......@@ -28,7 +28,7 @@ public class AstPoolConvert {
result.setAstPoolName(param.getAstPoolName());
result.setAstPoolNo(param.getAstPoolNo());
result.setAstTypeEnum(AstTypeEnum.getByCode(param.getAstTypeCode()));
result.setProdNo(param.getProdNo());
return result;
}
......@@ -40,6 +40,7 @@ public class AstPoolConvert {
result.setAstTypeCode(astPoolEntity.getAstTypeEnum().getCode());
result.setAstPoolNo(astPoolEntity.getAstPoolNo());
result.setAstPoolName(astPoolEntity.getAstPoolName());
result.setProdNo(astPoolEntity.getProdNo());
return result;
}
......@@ -49,8 +50,8 @@ public class AstPoolConvert {
}
AstPoolVO result =new AstPoolVO();
result.setAstTypeName(AstTypeEnum.getByCode(param.getAstTypeCode()).getDesc());
result.setAstPoolNo(param.getAstPoolNo());
result.setAstPoolName(param.getAstPoolName());
result.setProdNo(param.getProdNo());
return result;
}
......@@ -60,7 +61,7 @@ public class AstPoolConvert {
}
AstPoolVO result =new AstPoolVO();
result.setAstTypeName(param.getAstTypeEnum().getDesc());
result.setAstPoolNo(param.getAstPoolNo());
result.setProdNo(param.getProdNo());
result.setAstPoolName(param.getAstPoolName());
return result;
}
......
......@@ -25,12 +25,14 @@ public class AstPoolEntity extends BaseEntity {
/**
* 资产管理机构
*/
private AstTypeEnum astTypeEnum;
private AstTypeEnum astTypeEnum;
/**
* 资产所属机构 放款池计划
*/
private String astPoolNo;
private String prodNo;
public String getAstPoolName() {
return astPoolName;
}
......@@ -54,4 +56,12 @@ public class AstPoolEntity extends BaseEntity {
public void setAstPoolNo(String astPoolNo) {
this.astPoolNo = astPoolNo;
}
public String getProdNo() {
return prodNo;
}
public void setProdNo(String prodNo) {
this.prodNo = prodNo;
}
}
\ No newline at end of file
......@@ -55,9 +55,14 @@ public enum IdTypeEnum implements IEnum {
CAP_AST_MATCH("CAM","资金资产匹配"),
CAP_AST_UNMATCH("CAU","资金资产解绑");
CAP_AST_UNMATCH("CAU","资金资产解绑"),
AST_POOL_CODE("ASTPOOL","资产池编号"),
AST_PACK_CODE("ASTPACK","资产包编号"),
;
//
// PERMISSION("PERM", "权限编号前缀"),
// PACK("PACK", "资产包编号前缀"),
......
......@@ -10,6 +10,7 @@ import com.abssqr.plat.common.facade.model.rule.AstScreenRule;
import com.abssqr.plat.common.facade.param.ast.AstPackOprParam;
import com.abssqr.plat.common.model.domain.ast.AstPack;
import com.abssqr.plat.common.model.domain.task.CommonTask;
import com.abssqr.plat.common.model.enums.IdTypeEnum;
import com.abssqr.plat.common.model.repo.ast.AstPackRepo;
import com.abssqr.plat.common.model.repo.rule.AstScreenRuleRepo;
import com.abssqr.plat.common.model.repo.task.CommonTaskRepository;
......@@ -97,7 +98,7 @@ public class AstPackManager {
return result;
}
private CommonTask buildBasicCommonTask(String packNo, String astPoolNo) {
public CommonTask buildBasicCommonTask(String packNo, String astPoolNo) {
CommonTask commonTask = new CommonTask();
commonTask.setBizNo(packNo);
commonTask.setContext(astPoolNo);
......@@ -107,4 +108,14 @@ public class AstPackManager {
commonTask.setExecTimes(0L);
return commonTask;
}
public void craeteDefaultPack(String astPoolNo){
AstPack astPack=new AstPack();
astPack.setAstPoolNo(astPoolNo);
//astPack.setAstTypeCode();
astPack.setPackNo(SequenceUtil.genId(IdTypeEnum.AST_PACK_CODE));
astPack.setType(AstPackTypeEnum.DEFAULT);
astPack.setStatus(AstPackStatusEnum.INIT);
astPackRepository.insert(astPack);
}
}
......@@ -10,9 +10,7 @@ import com.abssqr.plat.common.facade.validation.Valid;
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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
@RestJsonController
@RequestMapping("astPool")
......@@ -21,15 +19,15 @@ public class AstPoolController {
private AstPoolService astPoolService;
@PostMapping("add.json")
public BaseResult add(@Valid AstPoolOprParam astPoolOprParam){
public BaseResult add(@RequestBody AstPoolOprParam astPoolOprParam){
return BaseResult.success(astPoolService.add(astPoolOprParam));
}
@PostMapping("page.json")
public BasePage<AstPoolVO> page(AstPoolPageQryParam astPoolPageQryParam){
public BasePage<AstPoolVO> page(@RequestBody AstPoolPageQryParam astPoolPageQryParam){
return astPoolService.page(astPoolPageQryParam);
}
@GetMapping("get.json")
public AstPoolVO get(String astNo){
public AstPoolVO get(@RequestParam("astNo") String astNo){
return astPoolService.get(astNo);
}
......
drop table ABS_AST_POOL;
drop table ABS_AST_POOL;
CREATE TABLE ABS_AST_POOL
( ID NUMBER(10,0) NOT NULL,
AST_POOL_NAME VARCHAR2(128) NOT NULL,
AST_TYPE_CODE VARCHAR2(128) NOT NULL,
AST_POOL_NO VARCHAR2(128) NOT NULL,
GMT_CREATE DATE,
GMT_MODIFIED DATE,
PROD_NO VARCHAR2(128) NOT NULL,
PRIMARY KEY (ID)
) ;
COMMENT ON COLUMN "BB_DEV"."ABS_AST_POOL"."ID" IS '主键';
COMMENT ON COLUMN "BB_DEV"."ABS_AST_POOL"."AST_POOL_NAME" IS '资产池名称';
COMMENT ON COLUMN "BB_DEV"."ABS_AST_POOL"."AST_TYPE_CODE" IS '准入资产代码';
COMMENT ON COLUMN "BB_DEV"."ABS_AST_POOL"."AST_POOL_NO" IS '资产池编号';
COMMENT ON COLUMN "BB_DEV"."ABS_AST_POOL"."GMT_CREATE" IS '创建时间';
COMMENT ON COLUMN "BB_DEV"."ABS_AST_POOL"."GMT_MODIFIED" IS '更新时间';
COMMENT ON COLUMN "BB_DEV"."ABS_AST_POOL"."PROD_NO" IS '外部产品码';
CREATE UNIQUE INDEX UK_ABS_AST_POOL_NO ON ABS_AST_POOL (AST_POOL_NO);
CREATE INDEX IDX_ABS_AST_POOL_NO ON ABS_AST_POOL (AST_POOL_NO);
drop sequence SEQ_ABS_AST_POOL;
CREATE SEQUENCE SEQ_ABS_AST_POOL MINVALUE 1 MAXVALUE 9999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 ORDER NOCYCLE ;
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