给报表增加默认有权限仓库的查询条件
This commit is contained in:
@@ -559,8 +559,19 @@ public class DepotItemController {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
List<Long> depotList = new ArrayList<>();
|
||||
if(depotId != null) {
|
||||
depotList.add(depotId);
|
||||
} else {
|
||||
//未选择仓库时默认为当前用户有权限的仓库
|
||||
JSONArray depotArr = depotService.findDepotByCurrentUser();
|
||||
for(Object obj: depotArr) {
|
||||
JSONObject object = JSONObject.parseObject(obj.toString());
|
||||
depotList.add(object.getLong("id"));
|
||||
}
|
||||
}
|
||||
String[] mpArr = mpList.split(",");
|
||||
List<DepotItemStockWarningCount> list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize,materialParam,depotId);
|
||||
List<DepotItemStockWarningCount> list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize, materialParam, depotList);
|
||||
//存放数据json数组
|
||||
if (null != list) {
|
||||
for (DepotItemStockWarningCount disw : list) {
|
||||
@@ -581,7 +592,7 @@ public class DepotItemController {
|
||||
}
|
||||
}
|
||||
}
|
||||
int total = depotItemService.findStockWarningCountTotal(materialParam,depotId);
|
||||
int total = depotItemService.findStockWarningCountTotal(materialParam, depotList);
|
||||
map.put("total", total);
|
||||
map.put("rows", list);
|
||||
res.code = 200;
|
||||
|
||||
Reference in New Issue
Block a user