给报表增加默认有权限仓库的查询条件

This commit is contained in:
季圣华
2021-12-07 23:58:21 +08:00
parent f96f85952b
commit 9fac19502b
8 changed files with 171 additions and 60 deletions

View File

@@ -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;