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
689bfe51
Commit
689bfe51
authored
Jun 13, 2020
by
maliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
类属性修改
parent
2d2c0221
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
33 deletions
+108
-33
BaseSettlement.java
...n/java/com/boot/security/server/model/BaseSettlement.java
+18
-0
CopyrightBookServiceImpl.java
...ecurity/server/service/impl/CopyrightBookServiceImpl.java
+90
-33
No files found.
src/main/java/com/boot/security/server/model/BaseSettlement.java
View file @
689bfe51
...
...
@@ -34,6 +34,24 @@ public class BaseSettlement extends BaseEntity<Long>{
public
Integer
type
;
public
String
typeName
;
public
String
context
;
public
Double
bookRadio
;
public
Double
bookAdRadio
;
public
Double
getBookAdRadio
()
{
return
bookAdRadio
;
}
public
void
setBookAdRadio
(
Double
bookAdRadio
)
{
this
.
bookAdRadio
=
bookAdRadio
;
}
public
Double
getBookRadio
()
{
return
bookRadio
;
}
public
void
setBookRadio
(
Double
bookRadio
)
{
this
.
bookRadio
=
bookRadio
;
}
public
Integer
getType
()
{
return
type
;
...
...
src/main/java/com/boot/security/server/service/impl/CopyrightBookServiceImpl.java
View file @
689bfe51
...
...
@@ -118,6 +118,7 @@ public class CopyrightBookServiceImpl implements CopyrightBookService {
@Override
public
String
selectBookSettlement
(
Integer
copyrightId
,
String
startTime
,
String
endTime
,
Long
bookId
,
String
bookName
,
Integer
page
,
Integer
limit
)
{
Integer
status
=
null
;
Integer
roleId
=
copyrightDao
.
selectRoleId
(
UserUtil
.
getLoginUser
().
getId
());
List
<
BaseSettlement
>
baseSettlementList
=
new
ArrayList
<>();
if
(
copyrightId
==
null
||
copyrightId
==
0
){
...
...
@@ -132,39 +133,32 @@ public class CopyrightBookServiceImpl implements CopyrightBookService {
if
(
roleId
!=
3
){
list
=
copyrightDao
.
selectReleaseCopyright
();
status
=
1
;
}
DecimalFormat
df
=
new
DecimalFormat
(
"#.0000"
);
List
<
BaseSettlement
>
baseSettlementCopyright
=
copyrightDao
.
selectTableListMonth
(
baseSettlementList
,
0
,
1000
,
status
);
List
<
BaseSettlement
>
baseSettlements
=
copyrightDao
.
selectBookDetail
(
baseSettlementList
,
bookId
,
bookName
,
startTime
,
endTime
,
page
-
1
,
limit
);
DecimalFormat
df
=
new
DecimalFormat
(
"#.00"
);
Iterator
<
BaseSettlement
>
iterator
=
baseSettlements
.
iterator
();
while
(
iterator
.
hasNext
())
{
BaseSettlement
baseSettlement
=
iterator
.
next
();
Boolean
flag
=
false
;
for
(
BaseSettlement
settlement
:
list
)
{
Integer
id
=
settlement
.
getCopyrightId
();
Integer
id1
=
baseSettlement
.
getCopyrightId
();
if
(
(
settlement
.
getReportDate
().
equals
(
baseSettlement
.
getReportDate
())
)
&&
id
.
equals
(
id1
)
){
flag
=
true
;
break
;
}
}
if
(
roleId
!=
3
){
if
(
list
==
null
||
list
.
size
()==
0
){
baseSettlements
.
clear
();
break
;
for
(
BaseSettlement
baseSettlement
:
baseSettlementCopyright
)
{
for
(
BaseSettlement
settlement
:
baseSettlements
)
{
if
(
(
settlement
.
getReportDate
().
equals
(
baseSettlement
.
getReportDate
()))
&&
(
settlement
.
getCopyrightId
().
equals
(
baseSettlement
.
getCopyrightId
()))
){
Double
totalAmountC
=
baseSettlement
.
getTotalAmount
();
Double
totalAdvertAmountC
=
baseSettlement
.
getTotalAdvertAmount
();
Double
totalAmount
=
settlement
.
getTotalAmount
();
Double
totalAdvertAmount
=
settlement
.
getTotalAdvertAmount
();
settlement
.
setBookRadio
(
Double
.
valueOf
(
df
.
format
(
totalAmount
/
totalAmountC
)
));
settlement
.
setBookAdRadio
(
Double
.
valueOf
(
df
.
format
(
totalAdvertAmount
/
totalAdvertAmountC
)
));
}
}
if
(
flag
==
false
&&
list
.
size
()>
0
){
iterator
.
remove
();
continue
;
}
if
(
baseSettlement
.
getTotalAmount
()==
null
){
baseSettlement
.
setTotalAmount
(
0
d
);
}
if
(
baseSettlement
.
getTotalAdvertAmount
()==
null
){
baseSettlement
.
setTotalAdvertAmount
(
0
d
);
}
Double
totalAmount
=
baseSettlement
.
getTotalAmount
();
}
for
(
BaseSettlement
baseSettlement
:
baseSettlementCopyright
)
{
Integer
type
=
baseSettlement
.
getType
();
Double
totalAmount
=
baseSettlement
.
getTotalAmount
();
String
context
=
baseSettlement
.
getContext
();
Double
count
=
0.0
;
Double
count1
=
0.0
;
...
...
@@ -180,13 +174,13 @@ public class CopyrightBookServiceImpl implements CopyrightBookService {
}
Collections
.
sort
(
list1
);
int
size
=
list1
.
size
();
int
flag
=
0
;
int
flag1
=
0
;
int
flag2
=
0
;
Double
a1
=
0
D
;
Double
a2
=
0
D
;
for
(
int
i
=
1
;
i
<
size
;
i
++){
if
(
totalAmount
>=
list1
.
get
(
i
-
1
)&&
totalAmount
<=
list1
.
get
(
i
)){
flag
1
=
i
;
flag
=
i
;
a1
=
totalAmount
-
list1
.
get
(
i
-
1
);
count
=
a1
*
jsonObject
.
getDouble
(
String
.
valueOf
(
list1
.
get
(
i
)
)
);
break
;
...
...
@@ -195,18 +189,18 @@ public class CopyrightBookServiceImpl implements CopyrightBookService {
for
(
int
i
=
1
;
i
<
size
;
i
++){
if
(
totalAdvertAmount
>=
list1
.
get
(
i
-
1
)&&
totalAdvertAmount
<=
list1
.
get
(
i
)){
flag
2
=
i
;
flag
1
=
i
;
a2
=
totalAdvertAmount
-
list1
.
get
(
i
-
1
);
count1
=
a2
*
jsonObject
.
getDouble
(
String
.
valueOf
(
list1
.
get
(
i
)
)
);
break
;
}
}
for
(
int
i
=
1
;
i
<
flag
1
;
i
++){
for
(
int
i
=
1
;
i
<
flag
;
i
++){
count
+=
list1
.
get
(
i
)*
jsonObject
.
getDouble
(
String
.
valueOf
(
list1
.
get
(
i
)
));
}
for
(
int
i
=
1
;
i
<
flag
2
;
i
++){
for
(
int
i
=
1
;
i
<
flag
1
;
i
++){
count1
+=
list1
.
get
(
i
)*
jsonObject
.
getDouble
(
String
.
valueOf
(
list1
.
get
(
i
)
));
}
...
...
@@ -237,6 +231,69 @@ public class CopyrightBookServiceImpl implements CopyrightBookService {
}
baseSettlement
.
setCountSettlement
(
Double
.
valueOf
(
df
.
format
(
baseSettlement
.
getSettlementAmount
()+
baseSettlement
.
getSettlementAdAmount
())));
}
df
=
new
DecimalFormat
(
"#.00"
);
Iterator
<
BaseSettlement
>
iterator
=
baseSettlements
.
iterator
();
while
(
iterator
.
hasNext
())
{
BaseSettlement
baseSettlement
=
iterator
.
next
();
Boolean
flag
=
false
;
for
(
BaseSettlement
settlement
:
list
)
{
Integer
id
=
settlement
.
getCopyrightId
();
Integer
id1
=
baseSettlement
.
getCopyrightId
();
if
(
(
settlement
.
getReportDate
().
equals
(
baseSettlement
.
getReportDate
())
)
&&
id
.
equals
(
id1
)
){
flag
=
true
;
break
;
}
}
if
(
roleId
!=
3
){
if
(
list
==
null
||
list
.
size
()==
0
){
baseSettlements
.
clear
();
break
;
}
}
if
(
flag
==
false
&&
list
.
size
()>
0
){
iterator
.
remove
();
continue
;
}
if
(
baseSettlement
.
getTotalAmount
()==
null
){
baseSettlement
.
setTotalAmount
(
0
d
);
}
if
(
baseSettlement
.
getTotalAdvertAmount
()==
null
){
baseSettlement
.
setTotalAdvertAmount
(
0
d
);
}
Double
count
=
0.0
;
Double
count1
=
0.0
;
for
(
BaseSettlement
settlement
:
baseSettlementCopyright
)
{
if
(
(
settlement
.
getReportDate
().
equals
(
baseSettlement
.
getReportDate
())
)
&&
(
settlement
.
getCopyrightId
().
equals
(
baseSettlement
.
getCopyrightId
()))
){
count
=
settlement
.
getTotalAmount
()*
baseSettlement
.
getBookRadio
();
count1
=
settlement
.
getTotalAdvertAmount
()*
baseSettlement
.
getBookAdRadio
();
break
;
}
}
count
=
Double
.
valueOf
(
df
.
format
(
count
));
baseSettlement
.
setTotalAmount
(
count
);
baseSettlement
.
setSettlementAmount
(
Double
.
valueOf
(
df
.
format
(
count
*
0.5
)));
count
=
Double
.
valueOf
(
df
.
format
(
count1
));
Integer
id
=
baseSettlement
.
getCopyrightId
();
if
(
id
==
3219
||
id
==
3230
||
id
==
3254
||
id
==
3253
){
count
=
Double
.
valueOf
(
df
.
format
(
baseSettlement
.
getTotalAmount
()+
count
));
baseSettlement
.
setTotalAmount
(
count
);
baseSettlement
.
setSettlementAmount
(
Double
.
valueOf
(
df
.
format
(
count
*
0.5
)));
baseSettlement
.
setTotalAdvertAmount
(
0
d
);
baseSettlement
.
setSettlementAdAmount
(
0
d
);
}
else
{
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
.
selectBookDetailCount
(
baseSettlementList
,
bookId
,
bookName
,
startTime
,
endTime
);
return
PageTableHandler
.
getJSONObject
(
baseSettlements
,
count
);
}
...
...
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