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
fe9f3516
Commit
fe9f3516
authored
Apr 24, 2022
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v3.2.0_download_pdf' into 'master'
V3.2.0 download pdf See merge request
!13
parents
bf232fba
7d36a03d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
442 additions
and
2 deletions
+442
-2
ProductForPcApi.java
src/main/java/com/tanpu/fund/api/ProductForPcApi.java
+7
-0
ProductForPcController.java
...ava/com/tanpu/fund/controller/ProductForPcController.java
+16
-0
ReportDownloadSummary.java
...om/tanpu/fund/entity/generator/ReportDownloadSummary.java
+316
-0
ReportDownloadSummaryMapper.java
...pu/fund/mapper/generator/ReportDownloadSummaryMapper.java
+7
-0
DownloadPdfService.java
src/main/java/com/tanpu/fund/service/DownloadPdfService.java
+54
-0
application-test.properties
src/main/resources/application-test.properties
+15
-2
ReportDownloadSummaryMapper.xml
...sources/mybatis/generator/ReportDownloadSummaryMapper.xml
+27
-0
No files found.
src/main/java/com/tanpu/fund/api/ProductForPcApi.java
View file @
fe9f3516
...
...
@@ -20,4 +20,11 @@ public interface ProductForPcApi {
@GetMapping
(
"/get/privatefund/newnet"
)
CommonResp
<
List
<
Net
>>
getPrivatefundNewnet
(
@RequestParam
(
"list"
)
List
<
String
>
list
);
@ApiOperation
(
"清空标准会员的下载次数"
)
@GetMapping
(
"/pdf/standard/empty"
)
CommonResp
<
Void
>
emptyStandardVipCount
(
String
userId
);
@ApiOperation
(
"增加标准会员的下载次数"
)
@GetMapping
(
"/pdf/standard/add"
)
CommonResp
<
Void
>
addStandardVipCount
(
String
userId
);
}
src/main/java/com/tanpu/fund/controller/ProductForPcController.java
View file @
fe9f3516
...
...
@@ -3,6 +3,7 @@ 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.service.DownloadPdfService
;
import
com.tanpu.fund.service.ProductForPcService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -16,6 +17,9 @@ public class ProductForPcController implements ProductForPcApi {
@Resource
private
ProductForPcService
productForPcService
;
@Resource
private
DownloadPdfService
downloadPdfService
;
@Override
public
CommonResp
<
List
<
Net
>>
getFundNewnet
(
List
<
String
>
list
)
{
return
CommonResp
.
success
(
productForPcService
.
getFundNewnet
(
list
));
...
...
@@ -25,4 +29,16 @@ public class ProductForPcController implements ProductForPcApi {
public
CommonResp
<
List
<
Net
>>
getPrivatefundNewnet
(
List
<
String
>
list
)
{
return
CommonResp
.
success
(
productForPcService
.
getPrivatefundNewnet
(
list
));
}
@Override
public
CommonResp
<
Void
>
emptyStandardVipCount
(
String
userId
)
{
downloadPdfService
.
emptyStandardVipCount
(
userId
);
return
CommonResp
.
success
();
}
@Override
public
CommonResp
<
Void
>
addStandardVipCount
(
String
userId
)
{
downloadPdfService
.
addStandardVipCount
(
userId
);
return
CommonResp
.
success
();
}
}
src/main/java/com/tanpu/fund/entity/generator/ReportDownloadSummary.java
0 → 100644
View file @
fe9f3516
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
lombok.Builder
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 报告下载统计
*/
@TableName
(
value
=
"report_download_summary"
)
@Builder
@Data
public
class
ReportDownloadSummary
{
/**
* id
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
INPUT
)
private
Long
id
;
/**
* 用户Id
*/
@TableField
(
value
=
"user_id"
)
private
String
userId
;
/**
* 深度报告免费下载次数
*/
@TableField
(
value
=
"deep_report"
)
private
Integer
deepReport
;
/**
* 深度报告-标准版-下载次数
*/
@TableField
(
value
=
"deep_report_std"
)
private
Integer
deepReportStd
;
/**
* 累计收益报告-免费下载次数
*/
@TableField
(
value
=
"cumulative_profit_report"
)
private
Integer
cumulativeProfitReport
;
/**
* 累计收益报告-标准版-下载次数
*/
@TableField
(
value
=
"cumulative_profit_report_std"
)
private
Integer
cumulativeProfitReportStd
;
/**
* 周报/月报
*/
@TableField
(
value
=
"weekly_monthly_report"
)
private
Integer
weeklyMonthlyReport
;
/**
* 持仓分析-免费版-下载次数
*/
@TableField
(
value
=
"hold_fund_report"
)
private
Integer
holdFundReport
;
/**
* 持仓分析-标准版-下载次数
*/
@TableField
(
value
=
"hold_fund_report_std"
)
private
Integer
holdFundReportStd
;
/**
* 免费版-下载次数上限
*/
@TableField
(
value
=
"free_total_limit"
)
private
Integer
freeTotalLimit
;
/**
* 标准版-下载次数上限
*/
@TableField
(
value
=
"std_vip_limit"
)
private
Integer
stdVipLimit
;
@TableField
(
value
=
"create_time"
)
private
Date
createTime
;
@TableField
(
value
=
"update_time"
)
private
Date
updateTime
;
/**
* 获取id
*
* @return id - id
*/
public
Long
getId
()
{
return
id
;
}
/**
* 设置id
*
* @param id id
*/
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
/**
* 获取用户Id
*
* @return user_id - 用户Id
*/
public
String
getUserId
()
{
return
userId
;
}
/**
* 设置用户Id
*
* @param userId 用户Id
*/
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
/**
* 获取深度报告免费下载次数
*
* @return deep_report - 深度报告免费下载次数
*/
public
Integer
getDeepReport
()
{
return
deepReport
;
}
/**
* 设置深度报告免费下载次数
*
* @param deepReport 深度报告免费下载次数
*/
public
void
setDeepReport
(
Integer
deepReport
)
{
this
.
deepReport
=
deepReport
;
}
/**
* 获取深度报告-标准版-下载次数
*
* @return deep_report_std - 深度报告-标准版-下载次数
*/
public
Integer
getDeepReportStd
()
{
return
deepReportStd
;
}
/**
* 设置深度报告-标准版-下载次数
*
* @param deepReportStd 深度报告-标准版-下载次数
*/
public
void
setDeepReportStd
(
Integer
deepReportStd
)
{
this
.
deepReportStd
=
deepReportStd
;
}
/**
* 获取累计收益报告-免费下载次数
*
* @return cumulative_profit_report - 累计收益报告-免费下载次数
*/
public
Integer
getCumulativeProfitReport
()
{
return
cumulativeProfitReport
;
}
/**
* 设置累计收益报告-免费下载次数
*
* @param cumulativeProfitReport 累计收益报告-免费下载次数
*/
public
void
setCumulativeProfitReport
(
Integer
cumulativeProfitReport
)
{
this
.
cumulativeProfitReport
=
cumulativeProfitReport
;
}
/**
* 获取累计收益报告-标准版-下载次数
*
* @return cumulative_profit_report_std - 累计收益报告-标准版-下载次数
*/
public
Integer
getCumulativeProfitReportStd
()
{
return
cumulativeProfitReportStd
;
}
/**
* 设置累计收益报告-标准版-下载次数
*
* @param cumulativeProfitReportStd 累计收益报告-标准版-下载次数
*/
public
void
setCumulativeProfitReportStd
(
Integer
cumulativeProfitReportStd
)
{
this
.
cumulativeProfitReportStd
=
cumulativeProfitReportStd
;
}
/**
* 获取周报/月报
*
* @return weekly_monthly_report - 周报/月报
*/
public
Integer
getWeeklyMonthlyReport
()
{
return
weeklyMonthlyReport
;
}
/**
* 设置周报/月报
*
* @param weeklyMonthlyReport 周报/月报
*/
public
void
setWeeklyMonthlyReport
(
Integer
weeklyMonthlyReport
)
{
this
.
weeklyMonthlyReport
=
weeklyMonthlyReport
;
}
/**
* 获取持仓分析-免费版-下载次数
*
* @return hold_fund_report - 持仓分析-免费版-下载次数
*/
public
Integer
getHoldFundReport
()
{
return
holdFundReport
;
}
/**
* 设置持仓分析-免费版-下载次数
*
* @param holdFundReport 持仓分析-免费版-下载次数
*/
public
void
setHoldFundReport
(
Integer
holdFundReport
)
{
this
.
holdFundReport
=
holdFundReport
;
}
/**
* 获取持仓分析-标准版-下载次数
*
* @return hold_fund_report_std - 持仓分析-标准版-下载次数
*/
public
Integer
getHoldFundReportStd
()
{
return
holdFundReportStd
;
}
/**
* 设置持仓分析-标准版-下载次数
*
* @param holdFundReportStd 持仓分析-标准版-下载次数
*/
public
void
setHoldFundReportStd
(
Integer
holdFundReportStd
)
{
this
.
holdFundReportStd
=
holdFundReportStd
;
}
/**
* 获取免费版-下载次数上限
*
* @return free_total_limit - 免费版-下载次数上限
*/
public
Integer
getFreeTotalLimit
()
{
return
freeTotalLimit
;
}
/**
* 设置免费版-下载次数上限
*
* @param freeTotalLimit 免费版-下载次数上限
*/
public
void
setFreeTotalLimit
(
Integer
freeTotalLimit
)
{
this
.
freeTotalLimit
=
freeTotalLimit
;
}
/**
* 获取标准版-下载次数上限
*
* @return std_vip_limit - 标准版-下载次数上限
*/
public
Integer
getStdVipLimit
()
{
return
stdVipLimit
;
}
/**
* 设置标准版-下载次数上限
*
* @param stdVipLimit 标准版-下载次数上限
*/
public
void
setStdVipLimit
(
Integer
stdVipLimit
)
{
this
.
stdVipLimit
=
stdVipLimit
;
}
/**
* @return create_time
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* @param createTime
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* @return update_time
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* @param updateTime
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
src/main/java/com/tanpu/fund/mapper/generator/ReportDownloadSummaryMapper.java
0 → 100644
View file @
fe9f3516
package
com
.
tanpu
.
fund
.
mapper
.
generator
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.tanpu.fund.entity.generator.ReportDownloadSummary
;
public
interface
ReportDownloadSummaryMapper
extends
BaseMapper
<
ReportDownloadSummary
>
{
}
\ No newline at end of file
src/main/java/com/tanpu/fund/service/DownloadPdfService.java
0 → 100644
View file @
fe9f3516
package
com
.
tanpu
.
fund
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.fund.entity.generator.ReportDownloadSummary
;
import
com.tanpu.fund.mapper.generator.ReportDownloadSummaryMapper
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
public
class
DownloadPdfService
{
@Resource
private
ReportDownloadSummaryMapper
reportDownloadSummaryMapper
;
private
static
final
Integer
onceAddTimes
=
200
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
emptyStandardVipCount
(
String
userId
)
{
LambdaQueryWrapper
<
ReportDownloadSummary
>
qw
=
new
LambdaQueryWrapper
<>();
List
<
ReportDownloadSummary
>
reportDownloadSummaries
=
reportDownloadSummaryMapper
.
selectList
(
qw
.
eq
(
ReportDownloadSummary:
:
getUserId
,
userId
));
if
(
CollectionUtils
.
isEmpty
(
reportDownloadSummaries
)){
ReportDownloadSummary
entity
=
ReportDownloadSummary
.
builder
().
userId
(
userId
).
stdVipLimit
(
0
).
build
();
reportDownloadSummaryMapper
.
insert
(
entity
);
}
else
{
ReportDownloadSummary
entity
=
reportDownloadSummaries
.
get
(
0
);
entity
.
setStdVipLimit
(
0
);
entity
.
setDeepReportStd
(
0
);
entity
.
setHoldFundReportStd
(
0
);
entity
.
setCumulativeProfitReportStd
(
0
);
reportDownloadSummaryMapper
.
updateById
(
entity
);
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
addStandardVipCount
(
String
userId
)
{
LambdaQueryWrapper
<
ReportDownloadSummary
>
qw
=
new
LambdaQueryWrapper
<>();
List
<
ReportDownloadSummary
>
reportDownloadSummaries
=
reportDownloadSummaryMapper
.
selectList
(
qw
.
eq
(
ReportDownloadSummary:
:
getUserId
,
userId
));
if
(
CollectionUtils
.
isEmpty
(
reportDownloadSummaries
)){
ReportDownloadSummary
entity
=
ReportDownloadSummary
.
builder
().
userId
(
userId
).
stdVipLimit
(
onceAddTimes
).
build
();
reportDownloadSummaryMapper
.
insert
(
entity
);
}
else
{
ReportDownloadSummary
entity
=
reportDownloadSummaries
.
get
(
0
);
entity
.
setStdVipLimit
(
entity
.
getStdVipLimit
()
+
onceAddTimes
);
reportDownloadSummaryMapper
.
updateById
(
entity
);
}
}
}
src/main/resources/application-test.properties
View file @
fe9f3516
...
...
@@ -10,11 +10,24 @@ management.endpoints.web.base-path = /myhealth
management.endpoint.health.enabled
=
true
management.endpoint.health.show-details
=
always
spring.datasource.url
=
jdbc:mysql://tamper.mysql.polardb.rds.aliyuncs.com:3306/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.username
=
tamp
#spring.datasource.url=jdbc:mysql://tamper.mysql.polardb.rds.aliyuncs.com:3306/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
#spring.datasource.username=tamp
#spring.datasource.password= @imeng123
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://rm-uf6r22t3d798q4kmk.mysql.rds.aliyuncs.com:3306/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.username
=
tamp_admin
spring.datasource.password
=
@imeng123
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
# 阿里云智能媒体管理
tanpu.aliyun.imm.access-key-id
=
LTAIAKEzVydP0Q9P
tanpu.aliyun.imm.access-key-secret
=
59V9ke9txaIFzWxHFKTb1eoOOpmKpJ
tanpu.aliyun.imm.region-id
=
cn-shanghai
tanpu.aliyun.imm.endpoint
=
imm.${tanpu.aliyun.imm.region-id}.aliyuncs.com
tanpu.aliyun.imm.project
=
doc-preview-test
tanpu.aliyun.imm.limit-preview-page
=
3
company.oss.prefix
=
https://tamp-pro.oss-cn-shanghai.aliyuncs.com/
#mybatis
...
...
src/main/resources/mybatis/generator/ReportDownloadSummaryMapper.xml
0 → 100644
View file @
fe9f3516
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.tanpu.fund.mapper.generator.ReportDownloadSummaryMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.tanpu.fund.entity.generator.ReportDownloadSummary"
>
<!--@mbg.generated-->
<!--@Table report_download_summary-->
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"user_id"
jdbcType=
"VARCHAR"
property=
"userId"
/>
<result
column=
"deep_report"
jdbcType=
"INTEGER"
property=
"deepReport"
/>
<result
column=
"deep_report_std"
jdbcType=
"INTEGER"
property=
"deepReportStd"
/>
<result
column=
"cumulative_profit_report"
jdbcType=
"INTEGER"
property=
"cumulativeProfitReport"
/>
<result
column=
"cumulative_profit_report_std"
jdbcType=
"INTEGER"
property=
"cumulativeProfitReportStd"
/>
<result
column=
"weekly_monthly_report"
jdbcType=
"INTEGER"
property=
"weeklyMonthlyReport"
/>
<result
column=
"hold_fund_report"
jdbcType=
"INTEGER"
property=
"holdFundReport"
/>
<result
column=
"hold_fund_report_std"
jdbcType=
"INTEGER"
property=
"holdFundReportStd"
/>
<result
column=
"free_total_limit"
jdbcType=
"INTEGER"
property=
"freeTotalLimit"
/>
<result
column=
"std_vip_limit"
jdbcType=
"INTEGER"
property=
"stdVipLimit"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--@mbg.generated-->
id, user_id, deep_report, deep_report_std, cumulative_profit_report, cumulative_profit_report_std,
weekly_monthly_report, hold_fund_report, hold_fund_report_std, free_total_limit,
std_vip_limit, create_time, update_time
</sql>
</mapper>
\ No newline at end of file
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