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
dfe3145b
Commit
dfe3145b
authored
Aug 04, 2022
by
王亚雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报告单独收费
parent
8ed8a405
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
219 deletions
+110
-219
ProductForPcApi.java
src/main/java/com/tanpu/fund/api/ProductForPcApi.java
+11
-0
ProductForPcController.java
...ava/com/tanpu/fund/controller/ProductForPcController.java
+15
-0
ReportDownloadSummary.java
...om/tanpu/fund/entity/generator/ReportDownloadSummary.java
+51
-216
ReportDownloadSummaryMapper.java
...pu/fund/mapper/generator/ReportDownloadSummaryMapper.java
+2
-0
DownloadPdfService.java
src/main/java/com/tanpu/fund/service/DownloadPdfService.java
+29
-2
ReportDownloadSummaryMapper.xml
...sources/mybatis/generator/ReportDownloadSummaryMapper.xml
+2
-1
No files found.
src/main/java/com/tanpu/fund/api/ProductForPcApi.java
View file @
dfe3145b
package
com
.
tanpu
.
fund
.
api
;
import
com.tanpu.common.model.fund.req.IncReportDownloadTimesReq
;
import
com.tanpu.common.model.product.resp.Net
;
import
com.tanpu.common.resp.CommonResp
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
...
...
@@ -27,4 +30,12 @@ public interface ProductForPcApi {
@ApiOperation
(
"增加标准会员的下载次数"
)
@GetMapping
(
"/pdf/standard/add"
)
CommonResp
<
Void
>
addStandardVipCount
(
String
userId
);
/**
* 增加报告下载次数
* @param req 请求参数
* @return 总次数
*/
@PostMapping
(
"/inner/incReportDownloadTimes"
)
CommonResp
<
Integer
>
incReportDownloadTimes
(
@RequestBody
IncReportDownloadTimesReq
req
);
}
src/main/java/com/tanpu/fund/controller/ProductForPcController.java
View file @
dfe3145b
package
com
.
tanpu
.
fund
.
controller
;
import
com.tanpu.common.auth.mapping.TanpuInterfaceLoginAuth
;
import
com.tanpu.common.model.fund.req.IncReportDownloadTimesReq
;
import
com.tanpu.common.model.product.resp.Net
;
import
com.tanpu.common.resp.CommonResp
;
import
com.tanpu.fund.api.ProductForPcApi
;
...
...
@@ -41,4 +43,17 @@ public class ProductForPcController implements ProductForPcApi {
downloadPdfService
.
addStandardVipCount
(
userId
);
return
CommonResp
.
success
();
}
/**
* 增加报告下载次数
*
* @param req 请求参数
* @return 总次数
*/
@Override
@TanpuInterfaceLoginAuth
public
CommonResp
<
Integer
>
incReportDownloadTimes
(
IncReportDownloadTimesReq
req
)
{
int
totalTimes
=
downloadPdfService
.
incReportDownloadTimes
(
req
);
return
CommonResp
.
success
(
totalTimes
);
}
}
src/main/java/com/tanpu/fund/entity/generator/ReportDownloadSummary.java
View file @
dfe3145b
This diff is collapsed.
Click to expand it.
src/main/java/com/tanpu/fund/mapper/generator/ReportDownloadSummaryMapper.java
View file @
dfe3145b
...
...
@@ -2,6 +2,8 @@ package com.tanpu.fund.mapper.generator;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.tanpu.fund.entity.generator.ReportDownloadSummary
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
ReportDownloadSummaryMapper
extends
BaseMapper
<
ReportDownloadSummary
>
{
}
\ No newline at end of file
src/main/java/com/tanpu/fund/service/DownloadPdfService.java
View file @
dfe3145b
package
com
.
tanpu
.
fund
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.tanpu.common.model.fund.req.IncReportDownloadTimesReq
;
import
com.tanpu.fund.entity.generator.ReportDownloadSummary
;
import
com.tanpu.fund.mapper.generator.ReportDownloadSummaryMapper
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -47,8 +49,33 @@ public class DownloadPdfService {
entity
.
setStdVipLimit
(
entity
.
getStdVipLimit
()
+
onceAddTimes
);
reportDownloadSummaryMapper
.
updateById
(
entity
);
}
}
/**
* 增加报告下载次数
*
* @param req 请求参数
* @return 总次数
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
int
incReportDownloadTimes
(
IncReportDownloadTimesReq
req
)
{
ReportDownloadSummary
record
=
reportDownloadSummaryMapper
.
selectOne
(
Wrappers
.<
ReportDownloadSummary
>
lambdaQuery
().
eq
(
ReportDownloadSummary:
:
getUserId
,
req
.
getUserId
()));
if
(
record
==
null
)
{
reportDownloadSummaryMapper
.
insert
(
ReportDownloadSummary
.
builder
()
.
userId
(
req
.
getUserId
())
.
reportTimesBuy
(
req
.
getIncTimes
())
.
build
()
);
}
else
{
reportDownloadSummaryMapper
.
updateById
(
ReportDownloadSummary
.
builder
()
.
id
(
record
.
getId
())
.
reportTimesBuy
(
record
.
getReportTimesBuy
()
+
req
.
getIncTimes
())
.
build
()
);
}
return
record
==
null
?
req
.
getIncTimes
()
:
record
.
getReportTimesBuy
()
+
req
.
getIncTimes
();
}
}
src/main/resources/mybatis/generator/ReportDownloadSummaryMapper.xml
View file @
dfe3145b
...
...
@@ -15,6 +15,7 @@
<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=
"report_times_buy"
jdbcType=
"INTEGER"
property=
"reportTimesBuy"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
...
...
@@ -22,6 +23,6 @@
<!--@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
std_vip_limit,
report_times_buy,
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