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
0e82eac9
Commit
0e82eac9
authored
Dec 08, 2021
by
季圣华
Browse files
解决库存计算的bug
parent
37d526b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
0e82eac9
...
...
@@ -650,6 +650,8 @@ public class DepotItemService {
BigDecimal
assemOutTotal
=
stockObj
.
getAssemOutTotal
();
BigDecimal
disAssemOutTotal
=
stockObj
.
getDisAssemOutTotal
();
outSum
=
outTotal
.
subtract
(
transfOutTotal
).
subtract
(
assemOutTotal
).
subtract
(
disAssemOutTotal
);
//取绝对值
outSum
=
outSum
.
abs
();
}
if
(
stockCheckSum
.
compareTo
(
BigDecimal
.
ZERO
)>
0
)
{
inSum
=
inSum
.
add
(
stockCheckSum
);
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
0e82eac9
...
...
@@ -328,11 +328,17 @@
</if>
</sql>
<sql
id=
"anotherDepotParam"
>
<if
test=
"depotList.size()>0"
>
and di.another_depot_id in
<foreach
collection=
"depotList"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
</if>
</sql>
<select
id=
"getStockByParamWithDepotList"
resultMap=
"stockMap"
>
select
sum(case when dh.type='入库'
<include
refid=
"depotParam"
/>
then di.basic_number else 0 end) as inTotal,
sum(case when dh.type='出库' and dh.sub_type!='调拨'
<include
refid=
"depotParam"
/>
then di.basic_number else 0 end) as outTotal,
sum(case when dh.sub_type='调拨'
<include
refid=
"
d
epotParam"
/>
then di.basic_number else 0 end) as transfInTotal,
sum(case when dh.sub_type='调拨'
<include
refid=
"
anotherD
epotParam"
/>
then di.basic_number else 0 end) as transfInTotal,
sum(case when dh.sub_type='调拨'
<include
refid=
"depotParam"
/>
then di.basic_number else 0 end) as transfOutTotal,
sum(case when dh.sub_type='组装单' and di.material_type='组合件'
<include
refid=
"depotParam"
/>
then di.basic_number else 0 end) as assemInTotal,
sum(case when dh.sub_type='组装单' and di.material_type='普通子件'
<include
refid=
"depotParam"
/>
then di.basic_number else 0 end) as assemOutTotal,
...
...
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