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
69e40344
Commit
69e40344
authored
Sep 21, 2021
by
季圣华
Browse files
优化多选商品的库存显示
parent
50905f5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java
View file @
69e40344
...
@@ -492,12 +492,18 @@ public class MaterialController {
...
@@ -492,12 +492,18 @@ public class MaterialController {
Long
depotId
=
depotObj
.
getLong
(
"id"
);
Long
depotId
=
depotObj
.
getLong
(
"id"
);
mvo
.
setDepotId
(
depotId
);
mvo
.
setDepotId
(
depotId
);
//库存
//库存
BigDecimal
stock
=
depotItemService
.
getStockByParam
(
depotId
,
mvo
.
getId
(),
null
,
null
);
BigDecimal
stock
;
if
(
mvo
.
getUnitId
()!=
null
){
BigDecimal
skuStock
=
depotItemService
.
getSkuStockByParam
(
depotId
,
mvo
.
getMeId
(),
null
,
null
);
Unit
unit
=
unitService
.
getUnit
(
mvo
.
getUnitId
());
if
(
skuStock
.
compareTo
(
BigDecimal
.
ZERO
)!=
0
){
if
(
mvo
.
getCommodityUnit
().
equals
(
unit
.
getOtherUnit
()))
{
stock
=
skuStock
;
if
(
unit
.
getRatio
()!=
0
)
{
}
else
{
stock
=
stock
.
divide
(
BigDecimal
.
valueOf
(
unit
.
getRatio
()),
2
,
BigDecimal
.
ROUND_HALF_UP
);
stock
=
depotItemService
.
getStockByParam
(
depotId
,
mvo
.
getId
(),
null
,
null
);
if
(
mvo
.
getUnitId
()!=
null
){
Unit
unit
=
unitService
.
getUnit
(
mvo
.
getUnitId
());
if
(
mvo
.
getCommodityUnit
().
equals
(
unit
.
getOtherUnit
()))
{
if
(
unit
.
getRatio
()!=
0
)
{
stock
=
stock
.
divide
(
BigDecimal
.
valueOf
(
unit
.
getRatio
()),
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
}
}
}
}
}
}
...
...
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