From 364af45c7ca42e04e1ea3d0a6bf5417fcb97076f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Thu, 11 Aug 2022 00:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E5=8D=95=E6=8D=AE=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E6=B1=87=E6=80=BB=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/controller/DepotItemController.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 5727f6bd..81998a62 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 @@ -161,6 +161,7 @@ public class DepotItemController { public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId, @RequestParam("mpList") String mpList, @RequestParam(value = "linkType", required = false) String linkType, + @RequestParam(value = "isReadOnly", required = false) String isReadOnly, HttpServletRequest request)throws Exception { BaseResponseInfo res = new BaseResponseInfo(); try { @@ -174,6 +175,10 @@ public class DepotItemController { //存放数据json数组 JSONArray dataArray = new JSONArray(); if (null != dataList) { + BigDecimal totalOperNumber = BigDecimal.ZERO; + BigDecimal totalAllPrice = BigDecimal.ZERO; + BigDecimal totalTaxMoney = BigDecimal.ZERO; + BigDecimal totalTaxLastMoney = BigDecimal.ZERO; for (DepotItemVo4WithInfoEx diEx : dataList) { JSONObject item = new JSONObject(); item.put("id", diEx.getId()); @@ -223,6 +228,19 @@ public class DepotItemController { item.put("mType", diEx.getMaterialType()); item.put("op", 1); dataArray.add(item); + //合计数据汇总 + totalOperNumber = totalOperNumber.add(diEx.getOperNumber()==null?BigDecimal.ZERO:diEx.getOperNumber()); + totalAllPrice = totalAllPrice.add(diEx.getAllPrice()==null?BigDecimal.ZERO:diEx.getAllPrice()); + totalTaxMoney = totalTaxMoney.add(diEx.getTaxMoney()==null?BigDecimal.ZERO:diEx.getTaxMoney()); + totalTaxLastMoney = totalTaxLastMoney.add(diEx.getTaxLastMoney()==null?BigDecimal.ZERO:diEx.getTaxLastMoney()); + } + if(StringUtil.isNotEmpty(isReadOnly) && "1".equals(isReadOnly)) { + JSONObject footItem = new JSONObject(); + footItem.put("operNumber", totalOperNumber); + footItem.put("allPrice", totalAllPrice); + footItem.put("taxMoney", totalTaxMoney); + footItem.put("taxLastMoney", totalTaxLastMoney); + dataArray.add(footItem); } } outer.put("rows", dataArray);