Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lwby_copyright_book_data
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
maliang
lwby_copyright_book_data
Commits
621fa2c6
Commit
621fa2c6
authored
May 07, 2020
by
maliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传bug修复
parent
34acaf0f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
135 additions
and
47 deletions
+135
-47
CopyrightBookController.java
...t/security/server/controller/CopyrightBookController.java
+0
-1
BaseSettlement.java
...n/java/com/boot/security/server/model/BaseSettlement.java
+29
-20
CopyrightBookServiceImpl.java
...ecurity/server/service/impl/CopyrightBookServiceImpl.java
+84
-0
CopyrightMapper.xml
src/main/resources/mybatis-mappers/CopyrightMapper.xml
+16
-25
copyrightMonthSettlement.html
...tic/pages/copyrightBookData/copyrightMonthSettlement.html
+6
-1
No files found.
src/main/java/com/boot/security/server/controller/CopyrightBookController.java
View file @
621fa2c6
...
...
@@ -33,7 +33,6 @@ public class CopyrightBookController {
@PostMapping
(
"/updateSettlementStatus"
)
@ApiOperation
(
value
=
"版权方数据"
)
public
void
updateSettlementStatus
(
@RequestBody
PageTableRequest
request
){
System
.
out
.
println
(
request
.
getBaseSettlement
().
getStatusName
());
BaseSettlement
baseSettlement
=
request
.
getBaseSettlement
();
copyrightDao
.
updateSettlementStatus
(
baseSettlement
.
getCopyrightId
(),
baseSettlement
.
getReportDate
(),
baseSettlement
.
getStatus
(),
baseSettlement
.
getStatusName
());
}
...
...
src/main/java/com/boot/security/server/model/BaseSettlement.java
View file @
621fa2c6
...
...
@@ -13,25 +13,27 @@ public class BaseSettlement extends BaseEntity<Long>{
public
String
kouliang_ratio
;
public
String
batch_id
;
public
String
batch_name
;
public
String
book
_i
d
;
public
String
book
_n
ame
;
public
String
book
I
d
;
public
String
book
N
ame
;
public
String
authors
;
public
Double
totalAmount
;
public
String
settlementAmount
;
public
Double
settlementAmount
;
public
String
kouliang_amount
;
public
String
all_consume
;
public
Double
totalAdvertAmount
;
public
String
jiesuan_ad_a
mount
;
public
Double
settlementAdA
mount
;
public
String
kouliang_ad_amount
;
public
Double
countSettlement
;
public
Integer
status
;
public
String
statusName
;
public
String
getSettlementAmount
()
{
return
settlementAmount
;
public
Double
getCountSettlement
()
{
return
countSettlement
;
}
public
void
set
SettlementAmount
(
String
settlementAmou
nt
)
{
this
.
settlementAmount
=
settlementAmou
nt
;
public
void
set
CountSettlement
(
Double
countSettleme
nt
)
{
this
.
countSettlement
=
countSettleme
nt
;
}
public
Integer
getStatus
()
{
...
...
@@ -106,20 +108,20 @@ public class BaseSettlement extends BaseEntity<Long>{
this
.
batch_name
=
batch_name
;
}
public
String
getBook
_i
d
()
{
return
book
_i
d
;
public
String
getBook
I
d
()
{
return
book
I
d
;
}
public
void
setBook
_id
(
String
book_i
d
)
{
this
.
book
_id
=
book_i
d
;
public
void
setBook
Id
(
String
bookI
d
)
{
this
.
book
Id
=
bookI
d
;
}
public
String
getBook
_n
ame
()
{
return
book
_n
ame
;
public
String
getBook
N
ame
()
{
return
book
N
ame
;
}
public
void
setBook
_name
(
String
book_n
ame
)
{
this
.
book
_name
=
book_n
ame
;
public
void
setBook
Name
(
String
bookN
ame
)
{
this
.
book
Name
=
bookN
ame
;
}
public
String
getAuthors
()
{
...
...
@@ -147,13 +149,20 @@ public class BaseSettlement extends BaseEntity<Long>{
this
.
all_consume
=
all_consume
;
}
public
Double
getSettlementAmount
()
{
return
settlementAmount
;
}
public
void
setSettlementAmount
(
Double
settlementAmount
)
{
this
.
settlementAmount
=
settlementAmount
;
}
public
String
getJiesuan_ad_a
mount
()
{
return
jiesuan_ad_a
mount
;
public
Double
getSettlementAdA
mount
()
{
return
settlementAdA
mount
;
}
public
void
set
Jiesuan_ad_amount
(
String
jiesuan_ad_a
mount
)
{
this
.
jiesuan_ad_amount
=
jiesuan_ad_a
mount
;
public
void
set
SettlementAdAmount
(
Double
settlementAdA
mount
)
{
this
.
settlementAdAmount
=
settlementAdA
mount
;
}
public
String
getKouliang_ad_amount
()
{
...
...
src/main/java/com/boot/security/server/service/impl/CopyrightBookServiceImpl.java
View file @
621fa2c6
...
...
@@ -8,6 +8,7 @@ import com.boot.security.server.service.CopyrightBookService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.text.DecimalFormat
;
import
java.util.List
;
@Service
...
...
@@ -16,7 +17,90 @@ public class CopyrightBookServiceImpl implements CopyrightBookService {
CopyrightDao
copyrightDao
;
@Override
public
String
selectSettlement
(
Integer
copyrightId
,
Integer
page
,
Integer
limit
)
{
if
(
copyrightId
==
null
||
copyrightId
==
0
){
copyrightId
=
null
;
}
List
<
BaseSettlement
>
baseSettlements
=
copyrightDao
.
selectTableListMonth
(
copyrightId
,
page
-
1
,
limit
);
DecimalFormat
df
=
new
DecimalFormat
(
"#.00"
);
for
(
BaseSettlement
baseSettlement
:
baseSettlements
)
{
Double
totalAmount
=
baseSettlement
.
getTotalAmount
();
Double
count
=
0.0
;
if
(
totalAmount
<=
2000.0
){
count
=
totalAmount
;
}
else
if
(
totalAmount
>=
2001.0
&&
totalAmount
<=
5000.0
){
Double
a1
=
totalAmount
-
2000.0
;
count
=
2000.0
+
a1
*
0.5
;
}
else
if
(
totalAmount
>=
5001.0
&&
totalAmount
<=
10000.0
){
Double
a1
=
totalAmount
-
5000.0
;
count
=
2000.0
+
3000
*
0.5
+
a1
*
0.2
;
}
else
if
(
totalAmount
>=
10001.0
&&
totalAmount
<=
30000.0
){
Double
a1
=
totalAmount
-
10000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
a1
*
0.2
;
}
else
if
(
totalAmount
>=
30001.0
&&
totalAmount
<=
50000.0
){
Double
a1
=
totalAmount
-
30000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
+
a1
*
0.15
;
}
else
if
(
totalAmount
>=
50001.0
&&
totalAmount
<=
100000.0
){
Double
a1
=
totalAmount
-
50000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
a1
*
0.15
;
}
else
if
(
totalAmount
>=
100001.0
&&
totalAmount
<=
300000.0
){
Double
a1
=
totalAmount
-
100000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
50000
*
0.15
+
a1
*
0.1
;
}
else
if
(
totalAmount
>=
300001.0
&&
totalAmount
<=
500000.0
){
Double
a1
=
totalAmount
-
300000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
50000
*
0.15
+
200000
*
0.1
+
a1
*
0.05
;
}
else
if
(
totalAmount
>=
500001.0
&&
totalAmount
<=
1000000.0
){
Double
a1
=
totalAmount
-
500000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
50000
*
0.15
+
200000
*
0.1
*
2
+
a1
*
0.02
;
}
else
if
(
totalAmount
>=
1000001.0
&&
totalAmount
<=
3000000.0
){
Double
a1
=
totalAmount
-
1000000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
50000
*
0.15
+
200000
*
0.1
*
2
+
500000
*
0.02
+
a1
*
0.02
;
}
else
if
(
totalAmount
>=
3000001.0
&&
totalAmount
<=
5000000.0
){
Double
a1
=
totalAmount
-
3000000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
50000
*
0.15
+
200000
*
0.1
*
2
+
500000
*
0.02
+
2000000
*
0.02
+
a1
*
0.02
;
}
count
=
Double
.
valueOf
(
df
.
format
(
count
));
baseSettlement
.
setTotalAmount
(
count
);
baseSettlement
.
setSettlementAmount
(
Double
.
valueOf
(
df
.
format
(
count
*
0.5
)));
count
=
0.0
;
Double
totalAdvertAmount
=
baseSettlement
.
getTotalAdvertAmount
();
if
(
totalAdvertAmount
<=
2000.0
){
count
=
totalAdvertAmount
;
}
else
if
(
totalAdvertAmount
>=
2001.0
&&
totalAdvertAmount
<=
5000.0
){
Double
a1
=
totalAdvertAmount
-
2000.0
;
count
=
2000.0
+
a1
*
0.5
;
}
else
if
(
totalAdvertAmount
>=
5001.0
&&
totalAdvertAmount
<=
10000.0
){
Double
a1
=
totalAdvertAmount
-
5000.0
;
count
=
2000.0
+
3000
*
0.5
+
a1
*
0.2
;
}
else
if
(
totalAdvertAmount
>=
10001.0
&&
totalAdvertAmount
<=
30000.0
){
Double
a1
=
totalAdvertAmount
-
10000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
a1
*
0.2
;
}
else
if
(
totalAdvertAmount
>=
30001.0
&&
totalAdvertAmount
<=
50000.0
){
Double
a1
=
totalAdvertAmount
-
30000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
+
a1
*
0.15
;
}
else
if
(
totalAdvertAmount
>=
50001.0
&&
totalAdvertAmount
<=
100000.0
){
Double
a1
=
totalAdvertAmount
-
50000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
a1
*
0.15
;
}
else
if
(
totalAdvertAmount
>=
100001.0
&&
totalAdvertAmount
<=
300000.0
){
Double
a1
=
totalAdvertAmount
-
100000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
50000
*
0.15
+
a1
*
0.1
;
}
else
if
(
totalAdvertAmount
>=
300001.0
&&
totalAdvertAmount
<=
500000.0
){
Double
a1
=
totalAdvertAmount
-
300000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
50000
*
0.15
+
200000
*
0.1
+
a1
*
0.05
;
}
else
if
(
totalAdvertAmount
>=
500001.0
&&
totalAdvertAmount
<=
1000000.0
){
Double
a1
=
totalAdvertAmount
-
500000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
50000
*
0.15
+
200000
*
0.1
*
2
+
a1
*
0.02
;
}
else
if
(
totalAdvertAmount
>=
1000001.0
&&
totalAdvertAmount
<=
3000000.0
){
Double
a1
=
totalAdvertAmount
-
1000000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
50000
*
0.15
+
200000
*
0.1
*
2
+
500000
*
0.02
+
a1
*
0.02
;
}
else
if
(
totalAdvertAmount
>=
3000001.0
&&
totalAdvertAmount
<=
5000000.0
){
Double
a1
=
totalAdvertAmount
-
3000000.0
;
count
=
2000.0
+
3000
*
0.5
+
5000
*
0.2
+
20000
*
0.2
*
2
+
50000
*
0.15
+
200000
*
0.1
*
2
+
500000
*
0.02
+
2000000
*
0.02
+
a1
*
0.02
;
}
count
=
Double
.
valueOf
(
df
.
format
(
count
));
baseSettlement
.
setTotalAdvertAmount
(
count
);
baseSettlement
.
setSettlementAdAmount
(
Double
.
valueOf
(
df
.
format
(
count
*
0.5
)));
baseSettlement
.
setCountSettlement
(
Double
.
valueOf
(
df
.
format
(
baseSettlement
.
getSettlementAmount
()+
baseSettlement
.
getSettlementAdAmount
())));
}
Integer
count
=
copyrightDao
.
selectTableListMonthCount
(
copyrightId
);
return
PageTableHandler
.
getJSONObject
(
baseSettlements
,
count
);
}
...
...
src/main/resources/mybatis-mappers/CopyrightMapper.xml
View file @
621fa2c6
...
...
@@ -10,9 +10,9 @@
FROM bi_report.report_book_settlement_month a
LEFT JOIN bi_report.report_book_advert_month b
ON a.report_date=b.report_date AND a.batch_id=b.batch_id AND a.batch_name=b.batch_name
WHERE a.report_date>='2020-04'
<if
test=
"copyrightId != null"
>
WHERE
a.copyright_id =#{copyrightId}
and a.copyright_id =#{copyrightId}
</if>
ORDER BY a.total_amount DESC
limit #{page},#{limit};
...
...
@@ -25,9 +25,9 @@
FROM bi_report.report_book_settlement_month a
LEFT JOIN bi_report.report_book_advert_month b
ON a.report_date=b.report_date AND a.batch_id=b.batch_id AND a.batch_name=b.batch_name
WHERE a.report_date>='2020-04'
<if
test=
"copyrightId != null"
>
WHERE
a.copyright_id =#{copyrightId}
and a.copyright_id =#{copyrightId}
</if>
ORDER BY a.total_amount DESC ;
</select>
...
...
@@ -38,20 +38,17 @@
</select>
<select
id=
"selectBookDetail"
resultType=
"com.boot.security.server.model.BaseSettlement"
parameterType=
"java.util.List"
>
select * from
select reportDate,copyright_id copyrightId,copyright_name copyrightName,book_id bookId,book_name bookName,authors,sum(total_amount) totalAmount,sum(total_ad_amount) totalAdvertAmount
from
(SELECT
a.report_date,a.copyright_id,a.copyright_name,a.copyright_start_date,a.copyright_end_date,a.fencheng_ratio,a.kouliang_ratio,
a.batch_id,a.batch_name,a.book_id,a.book_name,a.authors,a.total_amount,a.jiesuan_amount,a.kouliang_amount
, ifnull(b.total_ad_amount,0) total_ad_amount
, ifnull(b.jiesuan_ad_amount,0) jiesuan_ad_amount
, ifnull(b.kouliang_ad_amount,0) kouliang_ad_amount
,if (b.jiesuan_ad_amount is null,a.jiesuan_amount,a.jiesuan_amount+b.jiesuan_ad_amount) as all_consume
DATE_FORMAT(a.report_date,'%Y-%m') reportDate,a.copyright_id,a.copyright_name,a.book_id,a.book_name,a.authors,a.total_amount
,ifnull(b.total_ad_amount,0) total_ad_amount
FROM report_book_settlement a
left join report_book_advert b
on a.report_date=b.report_date and a.book_id=b.book_id and a.batch_id=b.batch_id and a.batch_name=b.batch_name
WHERE
<![CDATA[
a.report_date >
= #{startTime} and a.report_date
<
= #{endTime}
DATE_FORMAT(a.report_date,'%Y-%m') >
= #{startTime} and DATE_FORMAT(a.report_date,'%Y-%m')
<
= #{endTime}
]]>
<if
test=
"bookId != null and bookId!='' "
>
and a.book_id = #{bookId}
...
...
@@ -59,23 +56,20 @@
<if
test=
" bookName != null and bookName !='' "
>
and a.book_name like #{bookName}
</if>
<if
test=
"copyrightIdList != null and copyrightIdList.size>0"
>
and a.copyright_id in
<foreach
collection=
"copyrightIdList"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
<if
test=
"copyrightId != null"
>
and a.copyright_id =#{copyrightId}
</if>
UNION
SELECT
b.report_date,b.copyright_id,b.copyright_name,b.batch_id,b.batch_name,b.book_id,b.book_name,b.authors,IFNULL(a.total_amount,0)
,IFNULL(b.total_ad_amount,0) total_ad_amount
DATE_FORMAT(a.report_date,'%Y-%m') reportDate,b.copyright_id,b.copyright_name,b.book_id,b.book_name,b.authors,IFNULL(a.total_amount,0) total_amount
,IFNULL(b.total_ad_amount,0) total_ad_amount
FROM report_book_settlement a
RIGHT JOIN report_book_advert b
ON a.report_date=b.report_date AND a.book_id=b.book_id AND a.batch_id=b.batch_id AND a.batch_name=b.batch_name
WHERE b.jiesuan_ad_amount>0
<![CDATA[
and
b.report_date >
= #{startTime} and b.report_date
<
= #{endTime}
DATE_FORMAT(b.report_date,'%Y-%m') >
= #{startTime} and DATE_FORMAT(b.report_date,'%Y-%m')
<
= #{endTime}
]]>
<if
test=
"bookId != null and bookId!='' "
>
and b.book_id = #{bookId}
...
...
@@ -83,13 +77,10 @@
<if
test=
" bookName != null and bookName !='' "
>
and b.book_name like #{bookName}
</if>
<if
test=
"copyrightIdList != null and copyrightIdList.size>0"
>
and b.copyright_id in
<foreach
collection=
"copyrightIdList"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
<if
test=
"copyrightId != null"
>
and a.copyright_id =#{copyrightId}
</if>
) t
ORDER BY t.total_amount desc
group BY t.reportDate,t.copyright_id,t.copyright_name,t.book_id,t.book_name,t.authors
</select>
</mapper>
\ No newline at end of file
src/main/resources/static/pages/copyrightBookData/copyrightMonthSettlement.html
View file @
621fa2c6
...
...
@@ -14,7 +14,7 @@
<div
class=
"layui-row"
>
<div
style=
"width: 160px"
class=
"layui-col-md3"
>
<select
id=
"copyrightId"
lay-filter=
"copyright"
>
<option>
全部
</option>
<option
value=
"0"
>
全部
</option>
</select>
</div>
<div
class=
"layui-col-md3"
>
...
...
@@ -55,12 +55,17 @@
,
contentType
:
'application/json'
,
url
:
'/copyrightBookController/settlementMonth'
,
page
:
true
,
toolbar
:
'true'
,
defaultToolbar
:
[
'exports'
]
,
cols
:
[[
{
field
:
'reportDate'
,
title
:
'日期'
,
sort
:
true
,
fixed
:
'left'
}
,{
field
:
'copyrightId'
,
title
:
'版权费id'
,
hide
:
true
}
,{
field
:
'copyrightName'
,
title
:
'版权方名称'
}
,{
field
:
'totalAmount'
,
title
:
'销售金额'
}
,{
field
:
'settlementAmount'
,
title
:
'销售结算'
}
,{
field
:
'totalAdvertAmount'
,
title
:
'广告金额'
}
,{
field
:
'settlementAdAmount'
,
title
:
'广告结算'
}
,{
field
:
'countSettlement'
,
title
:
'总结算'
}
,{
field
:
'statusName'
,
title
:
'结算状态'
}
,{
title
:
'操作'
,
toolbar
:
'#operation'
,
fixed
:
'right'
}
]]
//设置表头
...
...
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