Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tamp_fund
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周鹏
tamp_fund
Commits
908cdcf3
Commit
908cdcf3
authored
Feb 04, 2021
by
张亚辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
私募产品
parent
377a6cc5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1528 additions
and
10 deletions
+1528
-10
ProductApi.java
src/main/java/com/tanpu/fund/api/ProductApi.java
+7
-6
ProductController.java
...ain/java/com/tanpu/fund/controller/ProductController.java
+5
-0
FundDistribution.java
...ava/com/tanpu/fund/entity/generator/FundDistribution.java
+49
-0
FundDistributionExample.java
.../tanpu/fund/entity/generator/FundDistributionExample.java
+869
-0
FundDistributionMapper.java
...m/tanpu/fund/mapper/generator/FundDistributionMapper.java
+70
-0
ProductService.java
src/main/java/com/tanpu/fund/service/ProductService.java
+2
-2
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+27
-2
FundDistributionMapper.xml
...in/resources/mybatis/generator/FundDistributionMapper.xml
+499
-0
No files found.
src/main/java/com/tanpu/fund/api/ProductApi.java
View file @
908cdcf3
...
...
@@ -3,11 +3,9 @@ package com.tanpu.fund.api;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.product.req.ProductListReq
;
import
com.tanpu.common.model.product.resp.
*
;
import
com.tanpu.common.model.
user.resp.SysConstantResp
;
import
com.tanpu.common.model.product.resp.
DynamicRetreatVO
;
import
com.tanpu.common.model.
product.resp.ProductInfoVO
;
import
com.tanpu.common.resp.CommonResp
;
import
com.tanpu.fund.api.model.req.FundQaAskReq
;
import
com.tanpu.fund.api.model.req.FundQaListReq
;
import
com.tanpu.fund.api.model.req.NetReq
;
import
com.tanpu.fund.api.model.req.ProductInfoReq
;
import
com.tanpu.fund.api.model.resp.*
;
...
...
@@ -19,8 +17,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.List
;
@Api
(
tags
=
"产品服务"
)
...
...
@@ -58,6 +54,11 @@ public interface ProductApi {
@PostMapping
(
"/get/net/list"
)
CommonResp
<
Page
<
NetVO
>>
getNetListInfo
(
@ApiParam
(
"净值列表筛选对象"
)
@RequestBody
NetReq
req
);
@ApiOperation
(
"分红配送"
)
@GetMapping
(
"/bonus/ratio"
)
CommonResp
<
List
<
BonusRatioVO
>>
getBonusRatioInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
);
@ApiOperation
(
"历史业绩"
)
@GetMapping
(
"/track/record"
)
CommonResp
<
List
<
TrackRecordVO
>>
getTrackRecordInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
);
...
...
src/main/java/com/tanpu/fund/controller/ProductController.java
View file @
908cdcf3
...
...
@@ -53,6 +53,11 @@ public class ProductController implements ProductApi {
return
CommonResp
.
success
(
this
.
productService
.
getNetList
(
req
));
}
@Override
public
CommonResp
<
List
<
BonusRatioVO
>>
getBonusRatioInfo
(
String
id
)
{
return
CommonResp
.
success
(
this
.
productService
.
getBonusRatio
(
id
));
}
@Override
public
CommonResp
<
List
<
TrackRecordVO
>>
getTrackRecordInfo
(
String
id
)
{
return
CommonResp
.
success
(
this
.
productService
.
getTrackRecord
(
id
));
...
...
src/main/java/com/tanpu/fund/entity/generator/FundDistribution.java
0 → 100644
View file @
908cdcf3
package
com
.
tanpu
.
fund
.
entity
.
generator
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 基金分红
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
FundDistribution
{
private
String
id
;
/**
* 基金Id
*/
private
String
fundId
;
/**
* 分配日期
*/
private
Date
distributeDate
;
/**
* 基金分配类型标志:-1-其他,1-分红,2-拆分 3-业绩报酬 -1-其他
*/
private
Integer
distributeType
;
/**
* 分红/拆分比例
*/
private
BigDecimal
distribution
;
private
String
createBy
;
private
Date
createTime
;
private
String
updateBy
;
private
Date
updateTime
;
private
Integer
deleteTag
;
}
\ No newline at end of file
src/main/java/com/tanpu/fund/entity/generator/FundDistributionExample.java
0 → 100644
View file @
908cdcf3
This diff is collapsed.
Click to expand it.
src/main/java/com/tanpu/fund/mapper/generator/FundDistributionMapper.java
0 → 100644
View file @
908cdcf3
package
com
.
tanpu
.
fund
.
mapper
.
generator
;
import
com.tanpu.fund.entity.generator.FundDistribution
;
import
com.tanpu.fund.entity.generator.FundDistributionExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
FundDistributionMapper
{
long
countByExample
(
FundDistributionExample
example
);
int
deleteByExample
(
FundDistributionExample
example
);
/**
* delete by primary key
* @param id primaryKey
* @return deleteCount
*/
int
deleteByPrimaryKey
(
String
id
);
/**
* insert record to table
* @param record the record
* @return insert count
*/
int
insert
(
FundDistribution
record
);
int
insertOrUpdate
(
FundDistribution
record
);
int
insertOrUpdateSelective
(
FundDistribution
record
);
/**
* insert record to table selective
* @param record the record
* @return insert count
*/
int
insertSelective
(
FundDistribution
record
);
List
<
FundDistribution
>
selectByExample
(
FundDistributionExample
example
);
/**
* select by primary key
* @param id primary key
* @return object by primary key
*/
FundDistribution
selectByPrimaryKey
(
String
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
FundDistribution
record
,
@Param
(
"example"
)
FundDistributionExample
example
);
int
updateByExample
(
@Param
(
"record"
)
FundDistribution
record
,
@Param
(
"example"
)
FundDistributionExample
example
);
/**
* update record selective
* @param record the updated record
* @return update count
*/
int
updateByPrimaryKeySelective
(
FundDistribution
record
);
/**
* update record
* @param record the updated record
* @return update count
*/
int
updateByPrimaryKey
(
FundDistribution
record
);
int
updateBatch
(
List
<
FundDistribution
>
list
);
int
batchInsert
(
@Param
(
"list"
)
List
<
FundDistribution
>
list
);
}
\ No newline at end of file
src/main/java/com/tanpu/fund/service/ProductService.java
View file @
908cdcf3
...
...
@@ -3,9 +3,7 @@ package com.tanpu.fund.service;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.product.req.ProductListReq
;
import
com.tanpu.common.model.product.resp.AttachmentInfoVO
;
import
com.tanpu.common.model.product.resp.DynamicRetreatVO
;
import
com.tanpu.common.model.product.resp.FundDateResp
;
import
com.tanpu.common.model.product.resp.ProductInfoVO
;
import
com.tanpu.fund.api.model.req.NetReq
;
import
com.tanpu.fund.api.model.req.ProductInfoReq
;
...
...
@@ -30,6 +28,8 @@ public interface ProductService {
Page
<
NetVO
>
getNetList
(
NetReq
req
);
List
<
BonusRatioVO
>
getBonusRatio
(
String
id
);
List
<
TrackRecordVO
>
getTrackRecord
(
String
id
);
Page
<
TrackNetVO
>
getTrackNetList
(
String
id
,
Pageable
page
);
...
...
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
908cdcf3
...
...
@@ -8,7 +8,9 @@ import com.tanpu.common.enums.Constant;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.product.req.ProductListReq
;
import
com.tanpu.common.model.product.resp.*
;
import
com.tanpu.common.model.product.resp.DynamicRetreatVO
;
import
com.tanpu.common.model.product.resp.Net
;
import
com.tanpu.common.model.product.resp.ProductInfoVO
;
import
com.tanpu.common.utils.BigDecimalUtil
;
import
com.tanpu.fund.api.model.FundInfoVO
;
import
com.tanpu.fund.api.model.req.NetReq
;
...
...
@@ -27,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -78,6 +81,9 @@ public class ProductServiceImpl implements ProductService, Constant {
@Resource
private
FundRateMappingMapper
fundRateMappingMapper
;
@Resource
private
FundDistributionMapper
fundDistributionMapper
;
@Override
public
Page
<
ProductInfoVO
>
getProductList
(
ProductInfoReq
req
)
{
...
...
@@ -430,6 +436,25 @@ public class ProductServiceImpl implements ProductService, Constant {
fundCounts
.
stream
().
map
(
f
->
getNetVO
(
infoMap
,
f
)).
collect
(
Collectors
.
toList
()));
}
@Override
public
List
<
BonusRatioVO
>
getBonusRatio
(
String
id
)
{
FundDistributionExample
example
=
new
FundDistributionExample
();
example
.
createCriteria
().
andFundIdEqualTo
(
id
).
andDeleteTagEqualTo
(
ZERO_NUM
);
example
.
setOrderByClause
(
"distribute_date desc"
);
List
<
FundDistribution
>
list
=
this
.
fundDistributionMapper
.
selectByExample
(
example
);
return
list
.
stream
().
filter
(
l
->
l
.
getDistributeDate
()
!=
null
&&
(
l
.
getDistributeType
()
==
1
||
l
.
getDistributeType
()
==
2
))
.
map
(
l
->
{
BonusRatioVO
vo
=
new
BonusRatioVO
();
vo
.
setType
(
l
.
getDistributeType
());
vo
.
setTime
(
l
.
getDistributeDate
().
getTime
());
if
(
l
.
getDistribution
()
!=
null
)
{
vo
.
setDistribution
(
l
.
getDistribution
().
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
toString
());
}
return
vo
;
}).
collect
(
Collectors
.
toList
());
}
private
NetVO
getNetVO
(
Map
<
String
,
FundInfo
>
infoMap
,
FundCount
f
)
{
NetVO
netVO
=
new
NetVO
();
netVO
.
setProductId
(
f
.
getFundId
());
...
...
@@ -1010,7 +1035,7 @@ public class ProductServiceImpl implements ProductService, Constant {
// 查询研报信息是否有研报
Map
<
String
,
Object
>
fundInfoReport
=
getFundReport
(
Lists
.
newArrayList
(
fundInfoMap
.
keySet
()));
return
fundCounts
.
stream
().
map
(
p
->
getProductInfoVO
(
fundInfoMap
,
rateMappingMap
,
p
,
fundInfoReport
.
keySet
()))
return
fundCounts
.
stream
().
map
(
p
->
getProductInfoVO
(
fundInfoMap
,
rateMappingMap
,
p
,
fundInfoReport
.
keySet
()))
.
collect
(
Collectors
.
toList
());
}
...
...
src/main/resources/mybatis/generator/FundDistributionMapper.xml
0 → 100644
View file @
908cdcf3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment