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
b2a7e834
Commit
b2a7e834
authored
May 05, 2022
by
神话
Browse files
优化进销存统计的查询接口
parent
d90771c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
b2a7e834
...
@@ -299,11 +299,6 @@ public class DepotItemController {
...
@@ -299,11 +299,6 @@ public class DepotItemController {
//存放数据json数组
//存放数据json数组
JSONArray
dataArray
=
new
JSONArray
();
JSONArray
dataArray
=
new
JSONArray
();
if
(
null
!=
dataList
)
{
if
(
null
!=
dataList
)
{
List
<
Long
>
idList
=
new
ArrayList
<>();
for
(
DepotItemVo4WithInfoEx
m
:
dataList
)
{
idList
.
add
(
m
.
getMId
());
}
List
<
MaterialExtend
>
meList
=
materialExtendService
.
getListByMIds
(
idList
);
for
(
DepotItemVo4WithInfoEx
diEx
:
dataList
)
{
for
(
DepotItemVo4WithInfoEx
diEx
:
dataList
)
{
JSONObject
item
=
new
JSONObject
();
JSONObject
item
=
new
JSONObject
();
Long
mId
=
diEx
.
getMId
();
Long
mId
=
diEx
.
getMId
();
...
@@ -325,14 +320,8 @@ public class DepotItemController {
...
@@ -325,14 +320,8 @@ public class DepotItemController {
item
.
put
(
"inSum"
,
inSum
);
item
.
put
(
"inSum"
,
inSum
);
item
.
put
(
"outSum"
,
outSum
);
item
.
put
(
"outSum"
,
outSum
);
item
.
put
(
"thisSum"
,
thisSum
);
item
.
put
(
"thisSum"
,
thisSum
);
for
(
MaterialExtend
me:
meList
)
{
item
.
put
(
"unitPrice"
,
diEx
.
getPurchaseDecimal
());
if
(
me
.
getMaterialId
().
longValue
()
==
diEx
.
getMId
().
longValue
())
{
item
.
put
(
"thisAllPrice"
,
thisSum
.
multiply
(
diEx
.
getPurchaseDecimal
()));
if
(
me
.
getPurchaseDecimal
()!=
null
)
{
item
.
put
(
"unitPrice"
,
me
.
getPurchaseDecimal
());
item
.
put
(
"thisAllPrice"
,
thisSum
.
multiply
(
me
.
getPurchaseDecimal
()));
}
}
}
dataArray
.
add
(
item
);
dataArray
.
add
(
item
);
}
}
}
}
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
b2a7e834
...
@@ -191,7 +191,7 @@
...
@@ -191,7 +191,7 @@
select m.id MId, me.bar_code, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard,
select m.id MId, me.bar_code, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
concat_ws('', m.unit, u.basic_unit) MaterialUnit, m.color MColor, u.name unit_name,
concat_ws('', m.unit, u.basic_unit) MaterialUnit, m.color MColor, u.name unit_name,
(select purchase_decimal from jsh_material_extend me
(select
ifnull(
purchase_decimal
,0)
from jsh_material_extend me
where me.material_id=m.id and me.default_flag=1 and ifnull(me.delete_Flag,'0') !='1' limit 0,1)
where me.material_id=m.id and me.default_flag=1 and ifnull(me.delete_Flag,'0') !='1' limit 0,1)
purchase_decimal
purchase_decimal
from jsh_material m
from jsh_material m
...
...
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