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
afccbed4
Commit
afccbed4
authored
Nov 26, 2021
by
张亚辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分红处理
parent
22028f6a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
262 additions
and
1442 deletions
+262
-1442
pom.xml
pom.xml
+72
-5
FundApplication.java
src/main/java/com/tanpu/fund/FundApplication.java
+2
-0
ProductOrderApi.java
src/main/java/com/tanpu/fund/api/ProductOrderApi.java
+7
-0
MybatisPlusConfig.java
src/main/java/com/tanpu/fund/config/MybatisPlusConfig.java
+21
-0
ProductOrderController.java
...ava/com/tanpu/fund/controller/ProductOrderController.java
+12
-0
TxFundDistribution.java
...a/com/tanpu/fund/entity/generator/TxFundDistribution.java
+70
-19
TxFundDistributionExample.java
...anpu/fund/entity/generator/TxFundDistributionExample.java
+0
-869
TxFundDistributionMapper.java
...tanpu/fund/mapper/generator/TxFundDistributionMapper.java
+3
-64
ProductOrderService.java
...main/java/com/tanpu/fund/service/ProductOrderService.java
+3
-0
ProductOrderServiceImpl.java
.../com/tanpu/fund/service/impl/ProductOrderServiceImpl.java
+47
-0
TxFundDistributionMapper.xml
.../resources/mybatis/generator/TxFundDistributionMapper.xml
+25
-485
No files found.
pom.xml
View file @
afccbed4
...
...
@@ -36,12 +36,34 @@
<artifactId>
commons-pool2
</artifactId>
<groupId>
org.apache.commons
</groupId>
</exclusion>
<exclusion>
<groupId>
org.mybatis
</groupId>
<artifactId>
mybatis
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.mybatis
</groupId>
<artifactId>
mybatis-spring
</artifactId>
</exclusion>
<exclusion>
<artifactId>
fastjson
</artifactId>
<groupId>
com.alibaba
</groupId>
</exclusion>
<exclusion>
<artifactId>
commons-logging
</artifactId>
<groupId>
commons-logging
</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- 支持链路追踪的日志 -->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-sleuth
</artifactId>
<exclusions>
<exclusion>
<artifactId>
bcprov-jdk15on
</artifactId>
<groupId>
org.bouncycastle
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
...
...
@@ -64,10 +86,45 @@
<artifactId>
spring-boot-starter-undertow
</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.mybatis.spring.boot</groupId>-->
<!-- <artifactId>mybatis-spring-boot-starter</artifactId>-->
<!-- <version>2.1.2</version>-->
<!-- </dependency>-->
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
2.1.2
</version>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.4.3.1
</version>
<exclusions>
<exclusion>
<artifactId>
jsqlparser
</artifactId>
<groupId>
com.github.jsqlparser
</groupId>
</exclusion>
<exclusion>
<artifactId>
mybatis-spring
</artifactId>
<groupId>
org.mybatis
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.9.2
</version>
<exclusions>
<exclusion>
<artifactId>
swagger-annotations
</artifactId>
<groupId>
io.swagger
</groupId>
</exclusion>
<exclusion>
<artifactId>
swagger-models
</artifactId>
<groupId>
io.swagger
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
swagger-bootstrap-ui
</artifactId>
<version>
1.9.3
</version>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
...
...
@@ -91,6 +148,10 @@
<artifactId>
bcprov-jdk15on
</artifactId>
<groupId>
org.bouncycastle
</groupId>
</exclusion>
<exclusion>
<artifactId>
commons-io
</artifactId>
<groupId>
commons-io
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
...
...
@@ -121,8 +182,8 @@
<version>
1.2.13
</version>
<exclusions>
<exclusion>
<
artifactId>
mybatis-spring-boot-starter
</artifact
Id>
<
groupId>
org.mybatis.spring.boot
</group
Id>
<
groupId>
org.mybatis
</group
Id>
<
artifactId>
mybatis
</artifact
Id>
</exclusion>
</exclusions>
</dependency>
...
...
@@ -215,6 +276,12 @@
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
<version>
4.1.2
</version>
<exclusions>
<exclusion>
<artifactId>
commons-collections4
</artifactId>
<groupId>
org.apache.commons
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
...
...
src/main/java/com/tanpu/fund/FundApplication.java
View file @
afccbed4
package
com
.
tanpu
.
fund
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
...
...
@@ -17,6 +18,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
"com.tanpu.common"
,
"com.tanpu.fund"
})
@MapperScan
(
"com.tanpu.fund.mapper.generator"
)
public
class
FundApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/com/tanpu/fund/api/ProductOrderApi.java
View file @
afccbed4
package
com
.
tanpu
.
fund
.
api
;
import
com.tanpu.common.model.fund.resq.FundBounsResp
;
import
com.tanpu.common.model.product.resp.*
;
import
com.tanpu.common.resp.CommonResp
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
...
@@ -26,4 +28,9 @@ public interface ProductOrderApi {
@GetMapping
(
"/get/fund/lastnet"
)
CommonResp
<
List
<
NetBigDecimal
>>
getFundLastNet
(
@RequestParam
(
"list"
)
List
<
String
>
list
);
@ApiOperation
(
"查询基金分红信息"
)
@GetMapping
(
"/get/fund/bounsinfo"
)
CommonResp
<
List
<
FundBounsResp
>>
getFundBounsinfo
(
@ApiParam
(
"基金代码"
)
@RequestParam
(
"list"
)
List
<
String
>
list
,
@ApiParam
(
"指定日期"
)
@RequestParam
(
"date"
)
String
date
);
}
src/main/java/com/tanpu/fund/config/MybatisPlusConfig.java
0 → 100644
View file @
afccbed4
package
com
.
tanpu
.
fund
.
config
;
import
com.baomidou.mybatisplus.annotation.DbType
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@MapperScan
(
"com.tanpu.fund.mapper.**.*Mapper"
)
public
class
MybatisPlusConfig
{
// 最新版
@Bean
public
MybatisPlusInterceptor
mybatisPlusInterceptor
()
{
MybatisPlusInterceptor
interceptor
=
new
MybatisPlusInterceptor
();
interceptor
.
addInnerInterceptor
(
new
PaginationInnerInterceptor
(
DbType
.
MYSQL
));
return
interceptor
;
}
}
src/main/java/com/tanpu/fund/controller/ProductOrderController.java
View file @
afccbed4
package
com
.
tanpu
.
fund
.
controller
;
import
com.tanpu.common.model.fund.resq.FundBounsResp
;
import
com.tanpu.common.model.product.resp.*
;
import
com.tanpu.common.resp.CommonResp
;
import
com.tanpu.fund.api.ProductOrderApi
;
import
com.tanpu.fund.service.ProductOrderService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
...
...
@@ -38,4 +40,14 @@ public class ProductOrderController implements ProductOrderApi {
return
CommonResp
.
success
(
this
.
productOrderService
.
getFundLastNet
(
list
));
}
@Override
public
CommonResp
<
List
<
FundBounsResp
>>
getFundBounsinfo
(
List
<
String
>
list
,
String
date
)
{
if
(
CollectionUtils
.
isEmpty
(
list
)
||
StringUtils
.
isBlank
(
date
))
{
return
CommonResp
.
error
(
CommonResp
.
PARAMETER_INVALID_STATUS_CODE
,
CommonResp
.
PARAMETER_INVALID_MESSAGE
);
}
return
CommonResp
.
success
(
this
.
productOrderService
.
getFundBounsinfo
(
list
,
date
));
}
}
src/main/java/com/tanpu/fund/entity/generator/TxFundDistribution.java
View file @
afccbed4
package
com
.
tanpu
.
fund
.
entity
.
generator
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
lombok.AllArgsConstructor
;
...
...
@@ -7,43 +11,90 @@ import lombok.Builder;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 基金分红
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
value
=
"tamp_fund.tx_fund_distribution"
)
public
class
TxFundDistribution
{
private
String
id
;
/**
* ID
*/
@TableField
(
value
=
"id"
)
private
Long
id
;
/**
* 基金Id
*/
private
String
fundId
;
* 最原始版本基金id
*/
@TableField
(
value
=
"fund_id"
)
private
Long
fundId
;
@TableField
(
value
=
"fund_code"
)
private
String
fundCode
;
/**
* 分配日期
*/
private
Date
distributeDate
;
* 中文名称缩写
*/
@TableField
(
value
=
"fund_short_name"
)
private
String
fundShortName
;
/**
* 基金分配类型标志:-1-其他,1-分红,2-拆分 3-业绩报酬 -1-其他
*/
private
Integer
distributeType
;
* 信息发布日期
*/
@TableField
(
value
=
"ann_date"
)
private
Date
annDate
;
/**
* 分红/拆分比例
*/
private
BigDecimal
distribution
;
* 权益登记日
*/
@TableField
(
value
=
"register_date"
)
private
Date
registerDate
;
private
String
createBy
;
/**
* 发放日
*/
@TableField
(
value
=
"distribute_date"
)
private
Date
distributeDate
;
private
Date
createTime
;
/**
* 除权日
*/
@TableField
(
value
=
"ex_date"
)
private
Date
exDate
;
private
String
updateBy
;
/**
* 红利再投资日
*/
@TableField
(
value
=
"confirm_date"
)
private
Date
confirmDate
;
@TableField
(
value
=
"distribution"
)
private
BigDecimal
distribution
;
/**
* 修改日期
*/
@TableField
(
value
=
"update_time"
)
private
Date
updateTime
;
@TableField
(
value
=
"delete_tag"
)
private
Integer
deleteTag
;
@TableField
(
value
=
"distribute_type"
)
private
byte
[]
distributeType
;
@TableField
(
value
=
"create_by"
)
private
byte
[]
createBy
;
@TableField
(
value
=
"create_time"
)
private
byte
[]
createTime
;
@TableField
(
value
=
"update_by"
)
private
byte
[]
updateBy
;
@TableField
(
value
=
"org_id"
)
private
byte
[]
orgId
;
@TableField
(
value
=
"org"
)
private
byte
[]
org
;
}
\ No newline at end of file
src/main/java/com/tanpu/fund/entity/generator/TxFundDistributionExample.java
deleted
100644 → 0
View file @
22028f6a
This diff is collapsed.
Click to expand it.
src/main/java/com/tanpu/fund/mapper/generator/TxFundDistributionMapper.java
View file @
afccbed4
package
com
.
tanpu
.
fund
.
mapper
.
generator
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.tanpu.fund.entity.generator.TxFundDistribution
;
import
com.tanpu.fund.entity.generator.TxFundDistributionExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
TxFundDistributionMapper
{
long
countByExample
(
TxFundDistributionExample
example
);
int
deleteByExample
(
TxFundDistributionExample
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
(
TxFundDistribution
record
);
int
insertOrUpdate
(
TxFundDistribution
record
);
int
insertOrUpdateSelective
(
TxFundDistribution
record
);
/**
* insert record to table selective
* @param record the record
* @return insert count
*/
int
insertSelective
(
TxFundDistribution
record
);
List
<
TxFundDistribution
>
selectByExample
(
TxFundDistributionExample
example
);
/**
* select by primary key
* @param id primary key
* @return object by primary key
*/
TxFundDistribution
selectByPrimaryKey
(
String
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
TxFundDistribution
record
,
@Param
(
"example"
)
TxFundDistributionExample
example
);
int
updateByExample
(
@Param
(
"record"
)
TxFundDistribution
record
,
@Param
(
"example"
)
TxFundDistributionExample
example
);
/**
* update record selective
* @param record the updated record
* @return update count
*/
int
updateByPrimaryKeySelective
(
TxFundDistribution
record
);
/**
* update record
* @param record the updated record
* @return update count
*/
int
updateByPrimaryKey
(
TxFundDistribution
record
);
int
updateBatch
(
List
<
TxFundDistribution
>
list
);
int
batchInsert
(
@Param
(
"list"
)
List
<
TxFundDistribution
>
list
);
}
\ No newline at end of file
public
interface
TxFundDistributionMapper
extends
BaseMapper
<
TxFundDistribution
>
{
}
src/main/java/com/tanpu/fund/service/ProductOrderService.java
View file @
afccbed4
package
com
.
tanpu
.
fund
.
service
;
import
com.tanpu.common.model.fund.resq.FundBounsResp
;
import
com.tanpu.common.model.product.resp.AttachmentInfoVO
;
import
com.tanpu.common.model.product.resp.FilePreviewResp
;
import
com.tanpu.common.model.product.resp.FundInfoResp
;
...
...
@@ -19,4 +20,6 @@ public interface ProductOrderService {
List
<
NetBigDecimal
>
getFundLastNet
(
List
<
String
>
list
);
List
<
FilePreviewResp
>
getFilePreview
(
List
<
String
>
list
);
List
<
FundBounsResp
>
getFundBounsinfo
(
List
<
String
>
list
,
String
date
);
}
src/main/java/com/tanpu/fund/service/impl/ProductOrderServiceImpl.java
View file @
afccbed4
package
com
.
tanpu
.
fund
.
service
.
impl
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.google.common.collect.Lists
;
import
com.tanpu.common.enums.BizEnums
;
import
com.tanpu.common.enums.Constant
;
import
com.tanpu.common.enums.fund.FundFileTypeEnum
;
import
com.tanpu.common.model.fund.resq.FundBounsResp
;
import
com.tanpu.common.model.product.resp.*
;
import
com.tanpu.common.utils.BigDecimalUtil
;
import
com.tanpu.fund.entity.generator.*
;
...
...
@@ -44,6 +47,12 @@ public class ProductOrderServiceImpl implements ProductOrderService, Constant {
@Resource
private
FundInfoCustomMapper
fundInfoCustomMapper
;
@Resource
private
TxFundDistributionMapper
txFundDistributionMapper
;
@Resource
private
TxFundNavMapper
txFundNavMapper
;
@Override
public
List
<
FundInfoResp
>
getFundInfos
(
List
<
String
>
list
)
{
FundInfoExample
example
=
new
FundInfoExample
();
...
...
@@ -119,4 +128,42 @@ public class ProductOrderServiceImpl implements ProductOrderService, Constant {
return
this
.
fundInfoCustomMapper
.
getFilePreviewUrl
(
list
.
stream
().
collect
(
Collectors
.
joining
(
"','"
,
"'"
,
"'"
)))
.
stream
().
peek
(
f
->
f
.
setPreviewUrl
(
suffix
+
f
.
getPreviewUrl
().
substring
(
f
.
getPreviewUrl
().
lastIndexOf
(
"/"
)
+
1
,
f
.
getPreviewUrl
().
lastIndexOf
(
"."
)))).
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
FundBounsResp
>
getFundBounsinfo
(
List
<
String
>
list
,
String
date
)
{
LambdaQueryWrapper
<
TxFundDistribution
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
final
List
<
TxFundDistribution
>
distributionList
=
this
.
txFundDistributionMapper
.
selectList
(
queryWrapper
.
ge
(
TxFundDistribution:
:
getRegisterDate
,
date
)
.
in
(
TxFundDistribution:
:
getFundCode
,
list
).
eq
(
TxFundDistribution:
:
getDeleteTag
,
BizEnums
.
DeleteTag
.
tag_init
));
if
(
CollectionUtils
.
isNotEmpty
(
distributionList
))
{
// 查询分红权益日内基金净值
TxFundNavExample
fundNavExample
=
new
TxFundNavExample
();
fundNavExample
.
createCriteria
()
.
andFundIdIn
(
distributionList
.
stream
().
map
(
c
->
String
.
valueOf
(
c
.
getFundId
())).
collect
(
Collectors
.
toList
()))
.
andPriceDateIn
(
distributionList
.
stream
().
map
(
TxFundDistribution:
:
getRegisterDate
).
collect
(
Collectors
.
toList
()))
.
andDeleteTagEqualTo
(
BizEnums
.
DeleteTag
.
tag_init
);
final
Map
<
String
,
List
<
TxFundNav
>>
txFundNavMap
=
this
.
txFundNavMapper
.
selectByExample
(
fundNavExample
)
.
stream
().
collect
(
Collectors
.
groupingBy
(
TxFundNav:
:
getFundId
));
return
distributionList
.
stream
().
map
(
c
->
{
final
FundBounsResp
build
=
FundBounsResp
.
builder
()
.
fundId
(
c
.
getFundId
())
.
fundCode
(
c
.
getFundCode
())
.
registerDate
(
c
.
getRegisterDate
())
.
distributeDate
(
c
.
getDistributeDate
())
.
distribution
(
c
.
getDistribution
())
.
build
();
final
TxFundNav
txFundNav
=
txFundNavMap
.
get
(
String
.
valueOf
(
c
.
getFundId
())).
stream
()
.
filter
(
nav
->
StringUtils
.
equals
(
String
.
valueOf
(
c
.
getFundId
()),
nav
.
getFundId
())
&&
c
.
getRegisterDate
().
getTime
()
==
nav
.
getPriceDate
().
getTime
()).
findFirst
().
get
();
build
.
setFundNet
(
txFundNav
.
getNav
());
return
build
;
}).
collect
(
Collectors
.
toList
());
}
return
new
ArrayList
<>(
0
);
}
}
src/main/resources/mybatis/generator/TxFundDistributionMapper.xml
View file @
afccbed4
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