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
2ccc6f69
Commit
2ccc6f69
authored
Dec 17, 2021
by
季圣华
Browse files
优化商品选择界面的多单位展示形式
parent
76f3ac76
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java
View file @
2ccc6f69
...
...
@@ -208,11 +208,26 @@ public class MaterialController {
for
(
MaterialVo4Unit
material
:
dataList
)
{
JSONObject
item
=
new
JSONObject
();
item
.
put
(
"id"
,
material
.
getMeId
());
//商品扩展表的id
String
ratioStr
;
//比例
if
(
material
.
getUnitId
()
==
null
||
material
.
getUnitId
().
equals
(
""
))
{
String
ratioStr
=
""
;
//比例
Unit
unit
=
new
Unit
();
if
(
material
.
getUnitId
()
==
null
)
{
ratioStr
=
""
;
}
else
{
ratioStr
=
"[多单位]"
;
unit
=
unitService
.
getUnit
(
material
.
getUnitId
());
//拼接副单位的比例
String
commodityUnit
=
material
.
getCommodityUnit
();
if
(
commodityUnit
.
equals
(
unit
.
getBasicUnit
()))
{
ratioStr
=
"[基本]"
;
}
if
(
commodityUnit
.
equals
(
unit
.
getOtherUnit
()))
{
ratioStr
=
"["
+
unit
.
getRatio
()
+
unit
.
getBasicUnit
()
+
"]"
;
}
if
(
commodityUnit
.
equals
(
unit
.
getOtherUnitTwo
()))
{
ratioStr
=
"["
+
unit
.
getRatioTwo
()
+
unit
.
getBasicUnit
()
+
"]"
;
}
if
(
commodityUnit
.
equals
(
unit
.
getOtherUnitThree
()))
{
ratioStr
=
"["
+
unit
.
getRatioThree
()
+
unit
.
getBasicUnit
()
+
"]"
;
}
}
item
.
put
(
"mBarCode"
,
material
.
getmBarCode
());
item
.
put
(
"name"
,
material
.
getName
());
...
...
@@ -230,7 +245,6 @@ public class MaterialController {
}
else
{
stock
=
depotItemService
.
getStockByParam
(
depotId
,
material
.
getId
(),
null
,
null
);
if
(
material
.
getUnitId
()!=
null
){
Unit
unit
=
unitService
.
getUnit
(
material
.
getUnitId
());
String
commodityUnit
=
material
.
getCommodityUnit
();
stock
=
unitService
.
parseStockByUnit
(
stock
,
unit
,
commodityUnit
);
}
...
...
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