Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王衍超
cloud-fb
Commits
c6631909
Commit
c6631909
authored
May 10, 2021
by
shiwenbo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of gitlab.beecode.cn:kunlun/xyst_dinas/xyst_dinas_backend into develop
parents
8973dc7b
3a85389b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
6 deletions
+34
-6
StatementAccountServiceImpl.java
...finance/internal/service/StatementAccountServiceImpl.java
+33
-6
StatementAccountController.java
...om/xyst/dinas/finance/web/StatementAccountController.java
+1
-0
No files found.
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/internal/service/StatementAccountServiceImpl.java
View file @
c6631909
...
...
@@ -4,6 +4,9 @@ import java.math.BigDecimal;
import
java.net.URLEncoder
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -77,14 +80,14 @@ public class StatementAccountServiceImpl implements StatementAccountService{
for
(
int
i
=
0
;
i
<
financeRefundList
.
size
();
i
++)
{
KObject
kObject
=
financeRefundList
.
get
(
i
);
StatementAccount
statementAccount
=
new
StatementAccount
();
if
(
kObject
.
get
String
(
"fundType"
).
equals
(
FundTypeEnum
.
ADVANCE
.
name
()
))
{
//预付款
if
(
kObject
.
get
Int
(
"fundType"
)
==
FundTypeEnum
.
ADVANCE
.
getValue
(
))
{
//预付款
statementAccount
.
setDealType
(
"预付款退费"
);
advanceFinanceRefundAmount
=
advanceFinanceRefundAmount
.
add
(
kObject
.
getBigDecimal
(
"actualRefundAmount"
));
//实际退费金额
}
else
if
(
kObject
.
get
String
(
"fundType"
).
equals
(
FundTypeEnum
.
DEPOSIT
.
name
()
)){
advanceFinanceRefundAmount
=
advanceFinanceRefundAmount
.
add
(
kObject
.
isNull
(
"actualRefundAmount"
)
?
new
BigDecimal
(
"0"
)
:
kObject
.
getBigDecimal
(
"actualRefundAmount"
));
//实际退费金额
}
else
if
(
kObject
.
get
Int
(
"fundType"
)
==
FundTypeEnum
.
DEPOSIT
.
getValue
(
)){
statementAccount
.
setDealType
(
"保证金退费"
);
depositFinanceRefundAmount
=
depositFinanceRefundAmount
.
add
(
kObject
.
getBigDecimal
(
"actualRefundAmount"
));
depositFinanceRefundAmount
=
depositFinanceRefundAmount
.
add
(
kObject
.
isNull
(
"actualRefundAmount"
)
?
new
BigDecimal
(
"0"
)
:
kObject
.
getBigDecimal
(
"actualRefundAmount"
));
}
statementAccount
.
setDealAmount
(
kObject
.
getBigDecimal
(
"actualRefundAmount"
));
statementAccount
.
setDealAmount
(
kObject
.
isNull
(
"actualRefundAmount"
)
?
new
BigDecimal
(
"0"
)
:
kObject
.
getBigDecimal
(
"actualRefundAmount"
));
statementAccount
.
setDealDate
(
kObject
.
getString
(
"createTime"
));
statementAccounts
.
add
(
statementAccount
);
}
...
...
@@ -128,11 +131,35 @@ public class StatementAccountServiceImpl implements StatementAccountService{
salesAmount
=
salesAmount
.
add
(
kObject
.
getBigDecimal
(
"amount"
));
}
}
listSort
(
statementAccounts
);
map
.
put
(
"salesAmount"
,
salesAmount
);
map
.
put
(
"statementAccounts"
,
statementAccounts
);
return
map
;
}
private
static
void
listSort
(
List
<
StatementAccount
>
list
)
{
Collections
.
sort
(
list
,
new
Comparator
<
StatementAccount
>()
{
@Override
public
int
compare
(
StatementAccount
o1
,
StatementAccount
o2
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
try
{
Date
dt1
=
format
.
parse
(
o1
.
getDealDate
());
Date
dt2
=
format
.
parse
(
o2
.
getDealDate
());
if
(
dt1
.
getTime
()
<
dt2
.
getTime
())
{
return
1
;
}
else
if
(
dt1
.
getTime
()
>
dt2
.
getTime
())
{
return
-
1
;
}
else
{
return
0
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
0
;
}
});
};
@Value
(
"classpath:template/statementAccount.xlsx"
)
private
Resource
statementAccountResource
;
...
...
@@ -246,7 +273,7 @@ public class StatementAccountServiceImpl implements StatementAccountService{
statementAccounts
.
add
(
statementAccount
);
}
}
listSort
(
statementAccounts
);
return
statementAccounts
;
}
...
...
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/web/StatementAccountController.java
View file @
c6631909
...
...
@@ -42,6 +42,7 @@ public class StatementAccountController {
Map
<
String
,
Object
>
statementAccountByContract
=
statementAccountService
.
queryStatementAccountByContractId
(
new
JSONObject
(
body
));
return
ResponseObj
.
success
(
"查询成功"
,
statementAccountByContract
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseObj
.
error
();
}
...
...
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