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
3f2322e0
Commit
3f2322e0
authored
Oct 25, 2021
by
胡定国
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 47.100.44.39:zhoupeng/tamp_fund into dev
parents
bb49b089
00602ecf
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
116 additions
and
20 deletions
+116
-20
ProductApi.java
src/main/java/com/tanpu/fund/api/ProductApi.java
+4
-0
WebConfig.java
src/main/java/com/tanpu/fund/config/WebConfig.java
+14
-0
ApolloRefresherConfiguration.java
...anpu/fund/config/apollo/ApolloRefresherConfiguration.java
+2
-1
ProductController.java
...ain/java/com/tanpu/fund/controller/ProductController.java
+5
-0
ProductForCommunityController.java
.../tanpu/fund/controller/ProductForCommunityController.java
+2
-1
FundInfoCustomMapper.java
...pu/fund/mapper/generator/custom/FundInfoCustomMapper.java
+4
-4
ProductService.java
src/main/java/com/tanpu/fund/service/ProductService.java
+2
-0
ProductForPcServiceImpl.java
.../com/tanpu/fund/service/impl/ProductForPcServiceImpl.java
+7
-1
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+70
-10
application-test.properties
src/main/resources/application-test.properties
+5
-0
FundInfoCustomMapper.xml
...main/resources/mybatis/customize/FundInfoCustomMapper.xml
+1
-3
No files found.
src/main/java/com/tanpu/fund/api/ProductApi.java
View file @
3f2322e0
...
...
@@ -94,6 +94,10 @@ public interface ProductApi {
@GetMapping
(
"/fund/record"
)
CommonResp
<
FundRecordVO
>
getFundRecordInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
);
@ApiOperation
(
"基金档案 - 交易须知"
)
@GetMapping
(
"/fund/notice"
)
CommonResp
<
FundNoticeVO
>
getFundNoticeInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
);
@ApiOperation
(
"基金公司"
)
@GetMapping
(
"/fund/company"
)
CommonResp
<
FundCompanyVO
>
getFundCompanyInfo
(
@ApiParam
(
"基金公司id"
)
@RequestParam
(
"id"
)
String
id
);
...
...
src/main/java/com/tanpu/fund/config/WebConfig.java
View file @
3f2322e0
package
com
.
tanpu
.
fund
.
config
;
import
com.tanpu.common.auth.intercept.FaLoginIntercept
;
import
com.tanpu.common.log.LoggingFilter
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
...
...
@@ -27,4 +30,15 @@ public class WebConfig implements WebMvcConfigurer {
log
.
info
(
"添加拦截器FaLoginIntercept"
);
registry
.
addInterceptor
(
faLoginIntercept
).
addPathPatterns
(
"/**"
);
}
@Bean
public
FilterRegistrationBean
<
LoggingFilter
>
logFilterRegistration
()
{
log
.
info
(
"logFilter Registration"
);
FilterRegistrationBean
<
LoggingFilter
>
registration
=
new
FilterRegistrationBean
<>();
registration
.
setFilter
(
new
LoggingFilter
());
registration
.
addUrlPatterns
(
"/*"
);
return
registration
;
}
}
src/main/java/com/tanpu/fund/config/apollo/ApolloRefresherConfiguration.java
View file @
3f2322e0
...
...
@@ -13,12 +13,13 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import
org.springframework.cloud.context.environment.EnvironmentChangeEvent
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
java.util.Set
;
/*动态刷新日志参数配置*/
//
@Component
@Component
@Slf4j
@ConditionalOnProperty
(
PropertySourcesConstants
.
APOLLO_BOOTSTRAP_ENABLED
)
@AutoConfigureAfter
(
ApolloAutoConfiguration
.
class
)
...
...
src/main/java/com/tanpu/fund/controller/ProductController.java
View file @
3f2322e0
...
...
@@ -108,6 +108,11 @@ public class ProductController implements ProductApi {
return
CommonResp
.
success
(
this
.
productService
.
getFundRecord
(
id
));
}
@Override
public
CommonResp
<
FundNoticeVO
>
getFundNoticeInfo
(
String
id
)
{
return
CommonResp
.
success
(
this
.
productService
.
getFundNoticeInfo
(
id
));
}
@Override
public
CommonResp
<
FundCompanyVO
>
getFundCompanyInfo
(
String
id
)
{
return
CommonResp
.
success
(
this
.
productService
.
getFundCompany
(
id
));
...
...
src/main/java/com/tanpu/fund/controller/ProductForCommunityController.java
View file @
3f2322e0
package
com
.
tanpu
.
fund
.
controller
;
import
com.tanpu.common.enums.BizEnums
;
import
com.tanpu.common.model.product.resp.FundCompanySimpleVO
;
import
com.tanpu.common.resp.CommonResp
;
import
com.tanpu.fund.api.ProductForCommunityApi
;
...
...
@@ -40,7 +41,7 @@ public class ProductForCommunityController implements ProductForCommunityApi {
@Override
public
CommonResp
<
FundCompanySimpleVO
>
getCompanyFundCount
(
String
id
)
{
FundInfoExample
fundInfoExample
=
new
FundInfoExample
();
fundInfoExample
.
createCriteria
().
andTrustIdEqualTo
(
id
);
fundInfoExample
.
createCriteria
().
andTrustIdEqualTo
(
id
)
.
andDeleteTagEqualTo
(
BizEnums
.
DeleteTag
.
tag_init
)
;
long
l
=
fundInfoMapper
.
countByExample
(
fundInfoExample
);
FundCompanySimpleVO
build
=
FundCompanySimpleVO
.
builder
().
fundCount
(
l
).
build
();
return
CommonResp
.
success
(
build
);
...
...
src/main/java/com/tanpu/fund/mapper/generator/custom/FundInfoCustomMapper.java
View file @
3f2322e0
...
...
@@ -46,15 +46,15 @@ public interface FundInfoCustomMapper {
*/
List
<
FundNav
>
getPrivateFundInfoNewNet
(
@Param
(
"list"
)
List
<
String
>
fundIdList
);
@Select
(
"select t.id as fileId,t.logical_path as previewUrl from fund_file_record t where t.id in(${list})"
)
@Select
(
"select t.id as fileId,t.logical_path as previewUrl from fund_file_record t where t.id in(${list})
and t.delete_tag=0
"
)
List
<
FilePreviewResp
>
getFilePreviewUrl
(
@Param
(
"list"
)
String
list
);
@Select
(
"select t.id as id, t.fund_short_name as `value` from fund_info t where t.id in(${list})"
)
@Select
(
"select t.id as id, t.fund_short_name as `value` from fund_info t where t.id in(${list})
and t.delete_tag=0
"
)
List
<
Type
>
getSimpleFundList
(
@Param
(
"list"
)
String
list
);
@Select
(
"select t.id as id, t.fund_name as `value` from ifa_imported_fund_info t where t.id in(${list})"
)
@Select
(
"select t.id as id, t.fund_name as `value` from ifa_imported_fund_info t where t.id in(${list})
and t.delete_tag=0
"
)
List
<
Type
>
getSimplePrivateFundList
(
@Param
(
"list"
)
String
list
);
@Select
(
"select t.id as id,t.fund_short_name as value from fund_info t where t.fund_short_name like #{productName}"
)
@Select
(
"select t.id as id,t.fund_short_name as value from fund_info t where t.fund_short_name like #{productName}
and t.delete_tag=0
"
)
List
<
Type
>
getFundInfoLikeName
(
@Param
(
"productName"
)
String
productName
);
}
src/main/java/com/tanpu/fund/service/ProductService.java
View file @
3f2322e0
...
...
@@ -51,6 +51,8 @@ public interface ProductService {
FundRecordVO
getFundRecord
(
String
id
);
FundNoticeVO
getFundNoticeInfo
(
String
id
);
FundCompanyVO
getFundCompany
(
String
id
);
List
<
ProductInfoVO
>
getProductInfolist
(
ProductListReq
req
);
...
...
src/main/java/com/tanpu/fund/service/impl/ProductForPcServiceImpl.java
View file @
3f2322e0
...
...
@@ -24,6 +24,9 @@ public class ProductForPcServiceImpl implements ProductForPcService {
@Override
public
List
<
Net
>
getFundNewnet
(
List
<
String
>
list
)
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
new
ArrayList
<>();
}
List
<
FundNav
>
fundInfoNewNet
=
fundInfoCustomMapper
.
getFundInfoNewNet
(
list
);
if
(
CollectionUtils
.
isNotEmpty
(
fundInfoNewNet
))
{
return
fundInfoNewNet
.
stream
().
map
(
item
->
Net
.
builder
()
...
...
@@ -38,13 +41,16 @@ public class ProductForPcServiceImpl implements ProductForPcService {
@Override
public
List
<
Net
>
getPrivatefundNewnet
(
List
<
String
>
list
)
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
new
ArrayList
<>();
}
List
<
FundNav
>
fundInfoNewNet
=
fundInfoCustomMapper
.
getPrivateFundInfoNewNet
(
list
);
if
(
CollectionUtils
.
isNotEmpty
(
fundInfoNewNet
))
{
return
fundInfoNewNet
.
stream
().
map
(
item
->
Net
.
builder
()
.
fundId
(
item
.
getFundId
())
.
netDate
(
item
.
getPriceDate
().
getTime
())
.
netValue
(
BigDecimalUtil
.
toString
(
item
.
getNav
(),
4
))
.
cumulativeNav
(
BigDecimalUtil
.
toString
(
item
.
getCumulativeNav
Withdrawal
(),
4
))
.
cumulativeNav
(
BigDecimalUtil
.
toString
(
item
.
getCumulativeNav
(),
4
))
.
build
()).
collect
(
Collectors
.
toList
());
}
return
new
ArrayList
<>(
0
);
...
...
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
3f2322e0
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateField;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.poi.excel.ExcelReader
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
com.github.pagehelper.page.PageMethod
;
...
...
@@ -46,9 +47,9 @@ import org.springframework.stereotype.Service;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.stream.Collectors
;
...
...
@@ -157,6 +158,8 @@ public class ProductServiceImpl implements ProductService, Constant {
}
FundInfo
fundInfo
=
infos
.
get
(
0
);
BeanUtils
.
copyProperties
(
fundInfo
,
vo
);
vo
.
setStrategy
(
String
.
valueOf
(
fundInfo
.
getStrategy
()));
vo
.
setSubstrategy
(
String
.
valueOf
(
fundInfo
.
getSubstrategy
()));
vo
.
setOpenDay
(
fundInfo
.
getOpenDay
());
vo
.
setProductName
(
fundInfo
.
getFundShortName
());
vo
.
setDesc
(
fundInfo
.
getDescInfo
());
...
...
@@ -194,6 +197,33 @@ public class ProductServiceImpl implements ProductService, Constant {
vo
.
setCumulativeProfit
(
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
()));
vo
.
setRetYtd
(
multiply100
(
fundCount
.
getRetYtd
()));
vo
.
setRetIncep
(
multiply100
(
fundCount
.
getRetIncep
()));
vo
.
setSharperatioIncep
(
BigDecimalUtil
.
toString
(
fundCount
.
getSharperatioIncep
()));
vo
.
setMaxdrawdownIncep
(
multiply100
(
fundCount
.
getMaxdrawdownIncep
()));
vo
.
setRetIncepA
(
multiply100
(
fundCount
.
getRetIncepA
()));
if
(
ObjectUtil
.
isNotNull
(
fundInfo
.
getInceptionDate
()))
{
long
betweenMonth
=
DateUtil
.
betweenMonth
(
fundInfo
.
getInceptionDate
(),
new
Date
(),
false
);
BigDecimal
bigDecimal
=
new
BigDecimal
(
betweenMonth
);
BigDecimal
bigDecimal2
=
new
BigDecimal
(
12
);
BigDecimal
divide
=
bigDecimal
.
divide
(
bigDecimal2
,
1
,
RoundingMode
.
HALF_UP
);
vo
.
setInceptionDateYear
(
divide
.
toString
());
if
(
betweenMonth
<
1
)
{
vo
.
setMouth
(
"1个月"
);
vo
.
setRetOfMouth
(
""
);
}
else
if
(
betweenMonth
<
3
)
{
vo
.
setMouth
(
"1个月"
);
vo
.
setRetOfMouth
(
multiply100
(
fundCount
.
getRet1m
()));
}
else
if
(
betweenMonth
<
6
)
{
vo
.
setMouth
(
"3个月"
);
vo
.
setRetOfMouth
(
multiply100
(
fundCount
.
getRet3m
()));
}
else
if
(
betweenMonth
<
12
)
{
vo
.
setMouth
(
"6个月"
);
vo
.
setRetOfMouth
(
multiply100
(
fundCount
.
getRet6m
()));
}
else
{
vo
.
setMouth
(
"1年"
);
vo
.
setRetOfMouth
(
multiply100
(
fundCount
.
getRet1y
()));
}
}
}
// 基金公司信息
...
...
@@ -220,13 +250,17 @@ public class ProductServiceImpl implements ProductService, Constant {
//子策略名称
if
(
vo
.
getSubstrategy
()
!=
null
)
{
CommonResp
<
List
<
SysConstantResp
>>
listCommonResp
=
this
.
fatools
.
queryLabels
(
SysConstEnums
.
TAMPSUBSTRATEGY
.
getConstantGroup
());
if
(
listCommonResp
.
isSuccess
())
{
listCommonResp
.
getAttributes
().
stream
()
.
filter
(
item
->
StringUtils
.
equals
(
String
.
valueOf
(
vo
.
getSubstrategy
()),
item
.
getConstantCode
()))
.
findFirst
()
.
ifPresent
(
sysConstantResp
->
vo
.
setStrategyName
(
sysConstantResp
.
getConstantName
()));
}
vo
.
setSubstrategyName
(
ProductEnums
.
FundSubStrategyEnum
.
getBySubStrategy
(
Integer
.
valueOf
(
vo
.
getSubstrategy
())));
// CommonResp<List<SysConstantResp>> listCommonResp = this.fatools.queryLabels(SysConstEnums.TAMPSUBSTRATEGY.getConstantGroup());
// if (listCommonResp.isSuccess()) {
// listCommonResp.getAttributes().stream()
// .filter(item -> StringUtils.equals(String.valueOf(vo.getSubstrategy()), item.getConstantCode()))
// .findFirst()
// .ifPresent(sysConstantResp -> vo.setStrategyName(sysConstantResp.getConstantName()));
// }
}
if
(
vo
.
getStrategy
()
!=
null
)
{
vo
.
setStrategyName
(
ProductEnums
.
FundStrategyEnum
.
getByStrategy
(
Integer
.
valueOf
(
vo
.
getStrategy
())));
}
vo
.
setProductType
(
Constant
.
ONE_NUM
);
...
...
@@ -568,7 +602,7 @@ public class ProductServiceImpl implements ProductService, Constant {
BonusRatioVO
vo
=
new
BonusRatioVO
();
vo
.
setType
(
l
.
getDistributeType
());
vo
.
setTime
(
l
.
getDistributeDate
().
getTime
());
vo
.
setDistribution
(
BigDecimalUtil
.
toString
(
l
.
getDistribution
(),
2
));
vo
.
setDistribution
(
BigDecimalUtil
.
toString
(
l
.
getDistribution
(),
4
));
return
vo
;
}).
collect
(
Collectors
.
toList
());
}
...
...
@@ -1028,6 +1062,32 @@ public class ProductServiceImpl implements ProductService, Constant {
return
vo
;
}
@Override
public
FundNoticeVO
getFundNoticeInfo
(
String
id
)
{
FundNoticeVO
fundNoticeVO
=
new
FundNoticeVO
();
FundInfo
fundInfo
=
this
.
fundInfoMapper
.
selectByPrimaryKey
(
id
);
fundNoticeVO
.
setOpenDay
(
fundInfo
.
getOpenDay
());
fundNoticeVO
.
setCloseDay
(
fundInfo
.
getOpenDay
());
FundRateMapping
fundRateMapping
=
this
.
fundRateMappingMapper
.
selectByPrimaryKey
(
id
);
if
(
fundRateMapping
!=
null
)
{
fundNoticeVO
.
setMinInvestmentShare
(
fundRateMapping
.
getMinInvestmentShare
());
fundNoticeVO
.
setSubsequentInvestmentShare
(
fundRateMapping
.
getSubsequentInvestmentShare
());
fundNoticeVO
.
setPurchaseRates
(
BigDecimalUtil
.
multiply100
(
fundRateMapping
.
getSubscriptionFee
()));
fundNoticeVO
.
setManagementRate
(
BigDecimalUtil
.
multiply100
(
fundRateMapping
.
getManagementfeeTrust
()));
fundNoticeVO
.
setRedemptionFee
(
fundRateMapping
.
getRedemptionFeeNote
());
fundNoticeVO
.
setPrecautiousLine
(
BigDecimalUtil
.
toString
(
fundRateMapping
.
getGuardLine
()));
fundNoticeVO
.
setStopLossLine
(
BigDecimalUtil
.
toString
(
fundRateMapping
.
getStopLossLine
()));
fundNoticeVO
.
setExPerformanceRewardMethod
(
fundRateMapping
.
getPerformanceFeeDeductionMethod
());
fundNoticeVO
.
setExPerformanceRewardRatio
(
BigDecimalUtil
.
toString
(
fundRateMapping
.
getPerformanceFee
()));
}
fundNoticeVO
.
setLockupPeriodQuota
(
fundInfo
.
getLockupPeriod
());
return
fundNoticeVO
;
}
@Override
public
List
<
ProductInfoVO
>
getProductInfolist
(
ProductListReq
req
)
{
...
...
@@ -1454,7 +1514,7 @@ public class ProductServiceImpl implements ProductService, Constant {
List
<
IfaImportedFundNav
>
navList
=
ifaImportedFundNavMapper
.
selectByExample
(
navExample
);
if
(
CollectionUtils
.
isNotEmpty
(
navList
))
{
detailResp
.
setNet
(
Net
.
builder
().
netDate
(
navList
.
get
(
0
).
getPriceDate
().
getTime
())
.
netValue
(
BigDecimalUtil
.
toString
(
navList
.
get
(
0
).
get
Cumulative
Nav
(),
4
)).
build
());
.
netValue
(
BigDecimalUtil
.
toString
(
navList
.
get
(
0
).
getNav
(),
4
)).
build
());
}
}
...
...
src/main/resources/application-test.properties
View file @
3f2322e0
...
...
@@ -95,6 +95,11 @@ tanpu.oss.ali.endpoint = https://oss-${tanpu.oss.ali.region-id}.aliyuncs.com
tanpu.oss.ali.bucket-domain
=
https://${tanpu.oss.ali.bucket-name}.oss-${tanpu.oss.ali.region-id}.aliyuncs.com
tanpu.oss.ali.oss-path
=
/upload
tanpu.oss.ali.access-key-id
=
LTAIAKEzVydP0Q9P
tanpu.oss.ali.secret-access-key
=
59V9ke9txaIFzWxHFKTb1eoOOpmKpJ
tanpu.oss.ali.project-name
=
faTools-sit
tanpu.oss.ali.doc-convert-output-path
=
/docConvertOutput
tanpu.userno.startstep
=
10000000
shorterUrl.domain
=
http://shorturl:8086/shorter/get
...
...
src/main/resources/mybatis/customize/FundInfoCustomMapper.xml
View file @
3f2322e0
...
...
@@ -55,9 +55,7 @@
res.price_date as priceDate,
res.nav as nav,
res.cumulative_nav as cumulativeNav,
res.cumulative_nav_withdrawal as cumulativeNavWithdrawal,
res.ishigh_or_low as ishighOrLow,
res.tohigh_nav_ratio as tohighNavRatio
res.cumulative_nav as cumulativeNavWithdrawal
from
(SELECT fund_id, max(price_date) as price_date FROM ifa_imported_fund_nav WHERE fund_id in
<foreach
close=
")"
collection=
"list"
item=
"fundId"
open=
"("
separator=
","
>
...
...
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