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
2df1e020
Commit
2df1e020
authored
Apr 27, 2022
by
神话
Browse files
解决多单位商品,大单位时分批出库的时候的bug
parent
b75076a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
2df1e020
...
...
@@ -191,13 +191,13 @@ public class DepotItemController {
item
.
put
(
"color"
,
diEx
.
getMColor
());
item
.
put
(
"materialOther"
,
getOtherInfo
(
mpArr
,
diEx
));
BigDecimal
stock
;
Unit
unitInfo
=
materialService
.
findUnit
(
diEx
.
getMaterialId
());
//查询计量单位信息
String
materialUnit
=
diEx
.
getMaterialUnit
();
if
(
StringUtil
.
isNotEmpty
(
diEx
.
getSku
())){
stock
=
depotItemService
.
getSkuStockByParam
(
diEx
.
getDepotId
(),
diEx
.
getMaterialExtendId
(),
null
,
null
);
}
else
{
stock
=
depotItemService
.
getStockByParam
(
diEx
.
getDepotId
(),
diEx
.
getMaterialId
(),
null
,
null
);
Unit
unitInfo
=
materialService
.
findUnit
(
diEx
.
getMaterialId
());
//查询计量单位信息
if
(
StringUtil
.
isNotEmpty
(
unitInfo
.
getName
()))
{
String
materialUnit
=
diEx
.
getMaterialUnit
();
stock
=
unitService
.
parseStockByUnit
(
stock
,
unitInfo
,
materialUnit
);
}
}
...
...
@@ -212,7 +212,7 @@ public class DepotItemController {
item
.
put
(
"operNumber"
,
diEx
.
getOperNumber
());
item
.
put
(
"basicNumber"
,
diEx
.
getBasicNumber
());
item
.
put
(
"preNumber"
,
diEx
.
getOperNumber
());
//原数量
item
.
put
(
"finishNumber"
,
depotItemService
.
getFinishNumber
(
diEx
.
getMaterialId
(),
diEx
.
getHeaderId
()));
//已入库|已出库
item
.
put
(
"finishNumber"
,
depotItemService
.
getFinishNumber
(
diEx
.
getMaterialId
(),
diEx
.
getHeaderId
()
,
unitInfo
,
materialUnit
));
//已入库|已出库
item
.
put
(
"unitPrice"
,
diEx
.
getUnitPrice
());
item
.
put
(
"taxUnitPrice"
,
diEx
.
getTaxUnitPrice
());
item
.
put
(
"allPrice"
,
diEx
.
getAllPrice
());
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
2df1e020
...
...
@@ -701,7 +701,7 @@ public class DepotItemService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
BigDecimal
getFinishNumber
(
Long
mId
,
Long
headerId
)
{
public
BigDecimal
getFinishNumber
(
Long
mId
,
Long
headerId
,
Unit
unitInfo
,
String
materialUnit
)
{
String
goToType
=
""
;
DepotHead
depotHead
=
depotHeadMapper
.
selectByPrimaryKey
(
headerId
);
String
linkNumber
=
depotHead
.
getNumber
();
//订单号
...
...
@@ -712,6 +712,16 @@ public class DepotItemService {
goToType
=
BusinessConstants
.
SUB_TYPE_SALES
;
}
BigDecimal
count
=
depotItemMapperEx
.
getFinishNumber
(
mId
,
linkNumber
,
goToType
);
//根据多单位情况进行数量的转换
if
(
materialUnit
.
equals
(
unitInfo
.
getOtherUnit
())
&&
unitInfo
.
getRatio
()
!=
0
)
{
count
=
count
.
divide
(
BigDecimal
.
valueOf
(
unitInfo
.
getRatio
()),
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
if
(
materialUnit
.
equals
(
unitInfo
.
getOtherUnitTwo
())
&&
unitInfo
.
getRatioTwo
()
!=
0
)
{
count
=
count
.
divide
(
BigDecimal
.
valueOf
(
unitInfo
.
getRatioTwo
()),
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
if
(
materialUnit
.
equals
(
unitInfo
.
getOtherUnitThree
())
&&
unitInfo
.
getRatioThree
()
!=
0
)
{
count
=
count
.
divide
(
BigDecimal
.
valueOf
(
unitInfo
.
getRatioThree
()),
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
return
count
;
}
...
...
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