优化根据仓库和商品查询单据列表接口

This commit is contained in:
季圣华
2022-06-13 00:04:35 +08:00
parent b164fa3f74
commit 9561741f27
4 changed files with 21 additions and 6 deletions

View File

@@ -72,10 +72,11 @@ public class DepotItemController {
@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam(value = "depotIds",required = false) String depotIds,
@RequestParam(value = "sku",required = false) String sku,
@RequestParam("materialId") Long mId,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
List<DepotItemVo4DetailByTypeAndMId> list = depotItemService.findDetailByDepotIdsAndMaterialIdList(depotIds, mId, (currentPage-1)*pageSize, pageSize);
List<DepotItemVo4DetailByTypeAndMId> list = depotItemService.findDetailByDepotIdsAndMaterialIdList(depotIds, sku, mId, (currentPage-1)*pageSize, pageSize);
JSONArray dataArray = new JSONArray();
if (list != null) {
for (DepotItemVo4DetailByTypeAndMId d: list) {
@@ -102,7 +103,7 @@ public class DepotItemController {
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
objectMap.put("rows", dataArray);
objectMap.put("total", depotItemService.findDetailByDepotIdsAndMaterialIdCount(depotIds, mId));
objectMap.put("total", depotItemService.findDetailByDepotIdsAndMaterialIdCount(depotIds, sku, mId));
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}