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
37803487
Commit
37803487
authored
Mar 05, 2021
by
张亚辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
myselect
parent
83afe43d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
2 deletions
+98
-2
ProductForPcApi.java
src/main/java/com/tanpu/fund/api/ProductForPcApi.java
+15
-0
ProductForPcController.java
...ava/com/tanpu/fund/controller/ProductForPcController.java
+17
-0
FundInfoCustomMapper.java
...pu/fund/mapper/generator/custom/FundInfoCustomMapper.java
+9
-1
ProductForPcService.java
...main/java/com/tanpu/fund/service/ProductForPcService.java
+7
-0
ProductForPcServiceImpl.java
.../com/tanpu/fund/service/impl/ProductForPcServiceImpl.java
+39
-0
FundInfoCustomMapper.xml
...main/resources/mybatis/customize/FundInfoCustomMapper.xml
+11
-1
No files found.
src/main/java/com/tanpu/fund/api/ProductForPcApi.java
View file @
37803487
package
com
.
tanpu
.
fund
.
api
;
package
com
.
tanpu
.
fund
.
api
;
import
com.tanpu.common.model.product.resp.Net
;
import
com.tanpu.common.resp.CommonResp
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
@Api
(
tags
=
"私募基金 PC端"
)
@Api
(
tags
=
"私募基金 PC端"
)
public
interface
ProductForPcApi
{
public
interface
ProductForPcApi
{
@ApiOperation
(
"获取私募基金最新净值"
)
@GetMapping
(
"/get/fund/newnet"
)
CommonResp
<
List
<
Net
>>
getFundNewnet
(
@RequestParam
(
"list"
)
List
<
String
>
list
);
@ApiOperation
(
"获取私有基金最新净值"
)
@GetMapping
(
"/get/privatefund/newnet"
)
CommonResp
<
List
<
Net
>>
getPrivatefundNewnet
(
@RequestParam
(
"list"
)
List
<
String
>
list
);
}
}
src/main/java/com/tanpu/fund/controller/ProductForPcController.java
View file @
37803487
package
com
.
tanpu
.
fund
.
controller
;
package
com
.
tanpu
.
fund
.
controller
;
import
com.tanpu.common.model.product.resp.Net
;
import
com.tanpu.common.resp.CommonResp
;
import
com.tanpu.fund.api.ProductForPcApi
;
import
com.tanpu.fund.api.ProductForPcApi
;
import
com.tanpu.fund.service.ProductForPcService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.List
;
@RestController
@RestController
@Slf4j
@Slf4j
public
class
ProductForPcController
implements
ProductForPcApi
{
public
class
ProductForPcController
implements
ProductForPcApi
{
@Resource
private
ProductForPcService
productForPcService
;
@Override
public
CommonResp
<
List
<
Net
>>
getFundNewnet
(
List
<
String
>
list
)
{
return
CommonResp
.
success
(
productForPcService
.
getFundNewnet
(
list
));
}
@Override
public
CommonResp
<
List
<
Net
>>
getPrivatefundNewnet
(
List
<
String
>
list
)
{
return
CommonResp
.
success
(
productForPcService
.
getPrivatefundNewnet
(
list
));
}
}
}
src/main/java/com/tanpu/fund/mapper/generator/custom/FundInfoCustomMapper.java
View file @
37803487
...
@@ -30,13 +30,21 @@ public interface FundInfoCustomMapper {
...
@@ -30,13 +30,21 @@ public interface FundInfoCustomMapper {
List
<
FundNav
>
getFundInfoLastNet
(
@Param
(
"list"
)
List
<
String
>
fundIdList
);
List
<
FundNav
>
getFundInfoLastNet
(
@Param
(
"list"
)
List
<
String
>
fundIdList
);
/**
/**
* 获取基金最新净值
* 获取
*私募*
基金最新净值
*
*
* @param fundIdList
* @param fundIdList
* @return
* @return
*/
*/
List
<
FundNav
>
getFundInfoNewNet
(
@Param
(
"list"
)
List
<
String
>
fundIdList
);
List
<
FundNav
>
getFundInfoNewNet
(
@Param
(
"list"
)
List
<
String
>
fundIdList
);
/**
* 获取*私有*基金最新净值
*
* @param fundIdList
* @return
*/
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})"
)
List
<
FilePreviewResp
>
getFilePreviewUrl
(
@Param
(
"list"
)
String
list
);
List
<
FilePreviewResp
>
getFilePreviewUrl
(
@Param
(
"list"
)
String
list
);
}
}
src/main/java/com/tanpu/fund/service/ProductForPcService.java
View file @
37803487
package
com
.
tanpu
.
fund
.
service
;
package
com
.
tanpu
.
fund
.
service
;
import
com.tanpu.common.model.product.resp.Net
;
import
java.util.List
;
/**
/**
* @author: zyh
* @author: zyh
*/
*/
public
interface
ProductForPcService
{
public
interface
ProductForPcService
{
List
<
Net
>
getFundNewnet
(
List
<
String
>
list
);
List
<
Net
>
getPrivatefundNewnet
(
List
<
String
>
list
);
}
}
src/main/java/com/tanpu/fund/service/impl/ProductForPcServiceImpl.java
View file @
37803487
package
com
.
tanpu
.
fund
.
service
.
impl
;
package
com
.
tanpu
.
fund
.
service
.
impl
;
import
com.tanpu.common.model.product.resp.Net
;
import
com.tanpu.common.model.product.resp.NetBigDecimal
;
import
com.tanpu.common.utils.BigDecimalUtil
;
import
com.tanpu.fund.entity.generator.FundNav
;
import
com.tanpu.fund.mapper.generator.custom.FundInfoCustomMapper
;
import
com.tanpu.fund.service.ProductForPcService
;
import
com.tanpu.fund.service.ProductForPcService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* @author: zyh
* @author: zyh
*/
*/
@Service
@Service
public
class
ProductForPcServiceImpl
implements
ProductForPcService
{
public
class
ProductForPcServiceImpl
implements
ProductForPcService
{
@Resource
private
FundInfoCustomMapper
fundInfoCustomMapper
;
@Override
public
List
<
Net
>
getFundNewnet
(
List
<
String
>
list
)
{
List
<
FundNav
>
fundInfoNewNet
=
fundInfoCustomMapper
.
getFundInfoNewNet
(
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
.
getCumulativeNavWithdrawal
(),
4
))
.
build
()).
collect
(
Collectors
.
toList
());
}
return
new
ArrayList
<>(
0
);
}
@Override
public
List
<
Net
>
getPrivatefundNewnet
(
List
<
String
>
list
)
{
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
.
getCumulativeNavWithdrawal
(),
4
))
.
build
()).
collect
(
Collectors
.
toList
());
}
return
new
ArrayList
<>(
0
);
}
}
}
src/main/resources/mybatis/customize/FundInfoCustomMapper.xml
View file @
37803487
...
@@ -32,7 +32,17 @@
...
@@ -32,7 +32,17 @@
<select
id=
"getFundInfoNewNet"
parameterType=
"java.lang.String"
resultType=
"com.tanpu.fund.entity.generator.FundNav"
>
<select
id=
"getFundInfoNewNet"
parameterType=
"java.lang.String"
resultType=
"com.tanpu.fund.entity.generator.FundNav"
>
select res.* from
select res.* from
(SELECT * FROM tamp_product.fund_nav WHERE fund_id in
(SELECT * FROM fund_nav WHERE fund_id in
<foreach
close=
")"
collection=
"list"
item=
"fundId"
open=
"("
separator=
","
>
#{fundId}
</foreach>
order BY price_date desc) res
GROUP BY res.fund_id
</select>
<select
id=
"getPrivateFundInfoNewNet"
parameterType=
"java.lang.String"
resultType=
"com.tanpu.fund.entity.generator.FundNav"
>
select res.* from
(SELECT * FROM ifa_imported_fund_nav WHERE fund_id in
<foreach
close=
")"
collection=
"list"
item=
"fundId"
open=
"("
separator=
","
>
<foreach
close=
")"
collection=
"list"
item=
"fundId"
open=
"("
separator=
","
>
#{fundId}
#{fundId}
</foreach>
</foreach>
...
...
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