Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
364af45c
Commit
364af45c
authored
Aug 11, 2022
by
季圣华
Browse files
给单据明细接口增加汇总列
parent
1fa71074
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
364af45c
...
...
@@ -161,6 +161,7 @@ public class DepotItemController {
public
BaseResponseInfo
getDetailList
(
@RequestParam
(
"headerId"
)
Long
headerId
,
@RequestParam
(
"mpList"
)
String
mpList
,
@RequestParam
(
value
=
"linkType"
,
required
=
false
)
String
linkType
,
@RequestParam
(
value
=
"isReadOnly"
,
required
=
false
)
String
isReadOnly
,
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
...
...
@@ -174,6 +175,10 @@ public class DepotItemController {
//存放数据json数组
JSONArray
dataArray
=
new
JSONArray
();
if
(
null
!=
dataList
)
{
BigDecimal
totalOperNumber
=
BigDecimal
.
ZERO
;
BigDecimal
totalAllPrice
=
BigDecimal
.
ZERO
;
BigDecimal
totalTaxMoney
=
BigDecimal
.
ZERO
;
BigDecimal
totalTaxLastMoney
=
BigDecimal
.
ZERO
;
for
(
DepotItemVo4WithInfoEx
diEx
:
dataList
)
{
JSONObject
item
=
new
JSONObject
();
item
.
put
(
"id"
,
diEx
.
getId
());
...
...
@@ -223,6 +228,19 @@ public class DepotItemController {
item
.
put
(
"mType"
,
diEx
.
getMaterialType
());
item
.
put
(
"op"
,
1
);
dataArray
.
add
(
item
);
//合计数据汇总
totalOperNumber
=
totalOperNumber
.
add
(
diEx
.
getOperNumber
()==
null
?
BigDecimal
.
ZERO
:
diEx
.
getOperNumber
());
totalAllPrice
=
totalAllPrice
.
add
(
diEx
.
getAllPrice
()==
null
?
BigDecimal
.
ZERO
:
diEx
.
getAllPrice
());
totalTaxMoney
=
totalTaxMoney
.
add
(
diEx
.
getTaxMoney
()==
null
?
BigDecimal
.
ZERO
:
diEx
.
getTaxMoney
());
totalTaxLastMoney
=
totalTaxLastMoney
.
add
(
diEx
.
getTaxLastMoney
()==
null
?
BigDecimal
.
ZERO
:
diEx
.
getTaxLastMoney
());
}
if
(
StringUtil
.
isNotEmpty
(
isReadOnly
)
&&
"1"
.
equals
(
isReadOnly
))
{
JSONObject
footItem
=
new
JSONObject
();
footItem
.
put
(
"operNumber"
,
totalOperNumber
);
footItem
.
put
(
"allPrice"
,
totalAllPrice
);
footItem
.
put
(
"taxMoney"
,
totalTaxMoney
);
footItem
.
put
(
"taxLastMoney"
,
totalTaxLastMoney
);
dataArray
.
add
(
footItem
);
}
}
outer
.
put
(
"rows"
,
dataArray
);
...
...
Write
Preview
Supports
Markdown
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