From f7d7213aa29d754228105e1c2ca2ded62d4b2beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Fri, 3 Dec 2021 23:39:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=9B=E9=94=80=E5=AD=98?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/controller/DepotItemController.java | 28 +++---------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java index 96ec7de2..7f79965c 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java @@ -280,7 +280,7 @@ public class DepotItemController { @ApiOperation(value = "查找所有的明细") public BaseResponseInfo findByAll(@RequestParam("currentPage") Integer currentPage, @RequestParam("pageSize") Integer pageSize, - @RequestParam(value = "depotIds", required = false) String depotIds, + @RequestParam("depotIds") String depotIds, @RequestParam("monthTime") String monthTime, @RequestParam("materialParam") String materialParam, @RequestParam("mpList") String mpList, @@ -290,17 +290,7 @@ public class DepotItemController { try { String timeA = Tools.firstDayOfMonth(monthTime) + BusinessConstants.DAY_FIRST_TIME; String timeB = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; - List depotList = new ArrayList<>(); - if(StringUtil.isNotEmpty(depotIds)) { - depotList = StringUtil.strToLongList(depotIds); - } else { - //未选择仓库时默认为当前用户有权限的仓库 - JSONArray depotArr = depotService.findDepotByCurrentUser(); - for(Object obj: depotArr) { - JSONObject object = JSONObject.parseObject(obj.toString()); - depotList.add(object.getLong("id")); - } - } + List depotList = StringUtil.strToLongList(depotIds); List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), timeB,(currentPage-1)*pageSize, pageSize); String[] mpArr = mpList.split(","); @@ -376,7 +366,7 @@ public class DepotItemController { */ @GetMapping(value = "/totalCountMoney") @ApiOperation(value = "统计总计金额") - public BaseResponseInfo totalCountMoney(@RequestParam(value = "depotIds", required = false) String depotIds, + public BaseResponseInfo totalCountMoney(@RequestParam("depotIds") String depotIds, @RequestParam("monthTime") String monthTime, @RequestParam("materialParam") String materialParam, HttpServletRequest request) throws Exception{ @@ -384,17 +374,7 @@ public class DepotItemController { Map map = new HashMap(); try { String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; - List depotList = new ArrayList<>(); - if(StringUtil.isNotEmpty(depotIds)) { - depotList = StringUtil.strToLongList(depotIds); - } else { - //未选择仓库时默认为当前用户有权限的仓库 - JSONArray depotArr = depotService.findDepotByCurrentUser(); - for(Object obj: depotArr) { - JSONObject object = JSONObject.parseObject(obj.toString()); - depotList.add(object.getLong("id")); - } - } + List depotList = StringUtil.strToLongList(depotIds); List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), endTime, null, null); BigDecimal thisAllPrice = BigDecimal.ZERO;