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
bb1c70f7
Commit
bb1c70f7
authored
Feb 17, 2020
by
季圣华
Browse files
优化库存状态报表
parent
2e7638fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/reports/in_out_stock_report.html
View file @
bb1c70f7
...
...
@@ -204,16 +204,16 @@
pageSize
:
10
,
pageList
:
[
10
,
50
,
100
],
columns
:
[[
{
title
:
'
名称
'
,
field
:
'
MaterialName
'
,
width
:
60
},
{
title
:
'
名称
'
,
field
:
'
MaterialName
'
,
width
:
1
60
},
{
title
:
'
型号
'
,
field
:
'
MaterialModel
'
,
width
:
80
},
{
title
:
'
扩展信息
'
,
field
:
'
MaterialOther
'
,
width
:
1
5
0
},
{
title
:
'
扩展信息
'
,
field
:
'
MaterialOther
'
,
width
:
1
2
0
},
{
title
:
'
单位
'
,
field
:
'
unitName
'
,
width
:
80
},
{
title
:
'
单价
'
,
field
:
'
UnitPrice
'
,
width
:
60
},
{
title
:
'
上月结存数量
'
,
field
:
'
prevSum
'
,
width
:
8
0
},
{
title
:
'
入库数量
'
,
field
:
'
InSum
'
,
width
:
6
0
},
{
title
:
'
出库数量
'
,
field
:
'
OutSum
'
,
width
:
6
0
},
{
title
:
'
本月结存数量
'
,
field
:
'
thisSum
'
,
width
:
8
0
},
{
title
:
'
结存金额
'
,
field
:
'
thisAllPrice
'
,
width
:
6
0
}
{
title
:
'
上月结存数量
'
,
field
:
'
prevSum
'
,
width
:
12
0
},
{
title
:
'
入库数量
'
,
field
:
'
InSum
'
,
width
:
8
0
},
{
title
:
'
出库数量
'
,
field
:
'
OutSum
'
,
width
:
8
0
},
{
title
:
'
本月结存数量
'
,
field
:
'
thisSum
'
,
width
:
12
0
},
{
title
:
'
结存金额
'
,
field
:
'
thisAllPrice
'
,
width
:
8
0
}
]],
onLoadError
:
function
()
{
$
.
messager
.
alert
(
'
页面加载提示
'
,
'
页面加载异常,请稍后再试!
'
,
'
error
'
);
...
...
src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
bb1c70f7
...
...
@@ -7,6 +7,7 @@ import com.jsh.erp.constants.ExceptionConstants;
import
com.jsh.erp.datasource.entities.*
;
import
com.jsh.erp.datasource.vo.DepotItemStockWarningCount
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
com.jsh.erp.service.MaterialExtend.MaterialExtendService
;
import
com.jsh.erp.service.depotItem.DepotItemService
;
import
com.jsh.erp.service.material.MaterialService
;
import
com.jsh.erp.utils.*
;
...
...
@@ -40,6 +41,9 @@ public class DepotItemController {
@Resource
private
MaterialService
materialService
;
@Resource
private
MaterialExtendService
materialExtendService
;
/**
* 只根据商品id查询单据列表
* @param mId
...
...
@@ -269,6 +273,11 @@ public class DepotItemController {
//存放数据json数组
JSONArray
dataArray
=
new
JSONArray
();
if
(
null
!=
dataList
)
{
List
<
Long
>
idList
=
new
ArrayList
<
Long
>();
for
(
DepotItemVo4WithInfoEx
m
:
dataList
)
{
idList
.
add
(
m
.
getMId
());
}
List
<
MaterialExtend
>
meList
=
materialExtendService
.
getListByMIds
(
idList
);
for
(
DepotItemVo4WithInfoEx
diEx
:
dataList
)
{
JSONObject
item
=
new
JSONObject
();
Long
mId
=
diEx
.
getMId
();
...
...
@@ -281,13 +290,18 @@ public class DepotItemController {
item
.
put
(
"MaterialOther"
,
materialOther
);
item
.
put
(
"MaterialColor"
,
diEx
.
getMColor
());
item
.
put
(
"unitName"
,
getUName
(
diEx
.
getMaterialUnit
(),
diEx
.
getUName
()));
item
.
put
(
"UnitPrice"
,
getUnitPrice
(
diEx
.
getPresetPriceOne
(),
diEx
.
getPriceStrategy
()));
item
.
put
(
"prevSum"
,
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
timeA
,
tenantId
));
item
.
put
(
"InSum"
,
depotItemService
.
getInNumByParam
(
depotId
,
mId
,
timeA
,
timeB
,
tenantId
));
item
.
put
(
"OutSum"
,
depotItemService
.
getOutNumByParam
(
depotId
,
mId
,
timeA
,
timeB
,
tenantId
));
BigDecimal
thisSum
=
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
null
,
tenantId
);
item
.
put
(
"thisSum"
,
thisSum
);
item
.
put
(
"thisAllPrice"
,
thisSum
.
multiply
(
getUnitPrice
(
diEx
.
getPresetPriceOne
(),
diEx
.
getPriceStrategy
())));
for
(
MaterialExtend
me:
meList
)
{
if
(
me
.
getMaterialId
().
longValue
()
==
diEx
.
getMId
().
longValue
())
{
item
.
put
(
"UnitPrice"
,
me
.
getPurchaseDecimal
());
item
.
put
(
"thisAllPrice"
,
thisSum
.
multiply
(
me
.
getPurchaseDecimal
()));
}
}
dataArray
.
add
(
item
);
}
}
...
...
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