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
56bc53c2
Commit
56bc53c2
authored
Dec 25, 2020
by
季圣华
Browse files
修复采购入库列表库存的bug
parent
91a10eec
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
56bc53c2
...
@@ -156,7 +156,10 @@ public class DepotItemController {
...
@@ -156,7 +156,10 @@ public class DepotItemController {
if
(
ratio
!=
null
){
if
(
ratio
!=
null
){
BigDecimal
ratioDecimal
=
new
BigDecimal
(
ratio
.
toString
());
BigDecimal
ratioDecimal
=
new
BigDecimal
(
ratio
.
toString
());
if
(
ratioDecimal
.
compareTo
(
BigDecimal
.
ZERO
)!=
0
){
if
(
ratioDecimal
.
compareTo
(
BigDecimal
.
ZERO
)!=
0
){
stock
=
stock
.
divide
(
ratioDecimal
,
2
,
BigDecimal
.
ROUND_HALF_UP
);
//两位小数
String
otherUnit
=
diEx
.
getOtherUnit
();
if
(
otherUnit
.
equals
(
diEx
.
getMaterialUnit
()))
{
stock
=
stock
.
divide
(
ratioDecimal
,
2
,
BigDecimal
.
ROUND_HALF_UP
);
//两位小数
}
}
}
}
}
item
.
put
(
"Stock"
,
stock
);
item
.
put
(
"Stock"
,
stock
);
...
...
src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4WithInfoEx.java
View file @
56bc53c2
...
@@ -34,6 +34,8 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
...
@@ -34,6 +34,8 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
private
Integer
ratio
;
private
Integer
ratio
;
private
String
otherUnit
;
private
BigDecimal
presetPriceOne
;
private
BigDecimal
presetPriceOne
;
private
String
priceStrategy
;
private
String
priceStrategy
;
...
@@ -162,6 +164,14 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
...
@@ -162,6 +164,14 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
this
.
ratio
=
ratio
;
this
.
ratio
=
ratio
;
}
}
public
String
getOtherUnit
()
{
return
otherUnit
;
}
public
void
setOtherUnit
(
String
otherUnit
)
{
this
.
otherUnit
=
otherUnit
;
}
public
BigDecimal
getPresetPriceOne
()
{
public
BigDecimal
getPresetPriceOne
()
{
return
presetPriceOne
;
return
presetPriceOne
;
}
}
...
...
src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
56bc53c2
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
<result
column=
"UnitId"
jdbcType=
"BIGINT"
property=
"UnitId"
/>
<result
column=
"UnitId"
jdbcType=
"BIGINT"
property=
"UnitId"
/>
<result
column=
"unit_name"
jdbcType=
"VARCHAR"
property=
"unitName"
/>
<result
column=
"unit_name"
jdbcType=
"VARCHAR"
property=
"unitName"
/>
<result
column=
"ratio"
jdbcType=
"INTEGER"
property=
"ratio"
/>
<result
column=
"ratio"
jdbcType=
"INTEGER"
property=
"ratio"
/>
<result
column=
"other_unit"
jdbcType=
"INTEGER"
property=
"otherUnit"
/>
<result
column=
"barCode"
jdbcType=
"VARCHAR"
property=
"barCode"
/>
<result
column=
"barCode"
jdbcType=
"VARCHAR"
property=
"barCode"
/>
</resultMap>
</resultMap>
...
@@ -141,7 +142,7 @@
...
@@ -141,7 +142,7 @@
<select
id=
"getDetailList"
parameterType=
"com.jsh.erp.datasource.entities.DepotItemExample"
resultMap=
"ResultWithInfoExMap"
>
<select
id=
"getDetailList"
parameterType=
"com.jsh.erp.datasource.entities.DepotItemExample"
resultMap=
"ResultWithInfoExMap"
>
select di.*,m.name MName,m.model MModel,m.unit MaterialUnit,m.color MColor,m.standard MStandard,m.mfrs MMfrs,
select di.*,m.name MName,m.model MModel,m.unit MaterialUnit,m.color MColor,m.standard MStandard,m.mfrs MMfrs,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.name unit_name, u.ratio, me.bar_code barCode
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.name unit_name, u.ratio,
u.other_unit,
me.bar_code barCode
from jsh_depot_item di
from jsh_depot_item di
left join jsh_material m on di.material_id=m.id and ifnull(m.delete_flag,'0') !='1'
left join jsh_material m on di.material_id=m.id and ifnull(m.delete_flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
...
...
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