From 57d8b1c987873bc928fd4cc612177a9a1186f862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sun, 30 Aug 2020 22:19:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp_web/home.html | 38 ++++--------------- .../erp/controller/DepotHeadController.java | 5 ++- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/erp_web/home.html b/erp_web/home.html index 2c33021a..682f0ea0 100644 --- a/erp_web/home.html +++ b/erp_web/home.html @@ -38,22 +38,21 @@ -
- +
- 本月累计进货 - + 今日累计进货 +
- +
- 本月利润(含财务部分) - + 本月累计进货 +
@@ -133,6 +132,7 @@ if (res && res.code === 200) { if (res.data) { $("#todaySale").text((res.data.todaySale).toFixed(2)); + $("#todayBuy").text((res.data.todayBuy).toFixed(2)); $("#thisMonthSale").text((res.data.thisMonthSale).toFixed(2)); $("#thisMonthBuy").text((res.data.thisMonthBuy).toFixed(2)); } @@ -144,34 +144,12 @@ }); } else { $("#todaySale").text("--"); + $("#todayBuy").text("--"); $("#thisMonthSale").text("--"); $("#thisMonthBuy").text("--"); } }); - $(function () { - var loginName = sessionStorage.getItem("loginName"); - if(loginName!="admin") { - $.ajax({ - type: "get", - url: "/account/getStatistics", - dataType: "json", - success: function (res) { - if (res && res.code === 200) { - if(res.data) { - $("#thisMonthAmount").text((res.data.allMonthAmount-0).toFixed(2)); - } - } - }, - error:function(res){ - - } - }); - } else { - $("#thisMonthAmount").text("--"); - } - }); - function getChartObj(titleName, categories, seriesData) { var chartObj = { chart: { diff --git a/src/main/java/com/jsh/erp/controller/DepotHeadController.java b/src/main/java/com/jsh/erp/controller/DepotHeadController.java index b6474aaa..d0de07cf 100644 --- a/src/main/java/com/jsh/erp/controller/DepotHeadController.java +++ b/src/main/java/com/jsh/erp/controller/DepotHeadController.java @@ -426,7 +426,7 @@ public class DepotHeadController { } /** - * 统计今日销售额、本月销售额、本月进货额 + * 统计今日销售额、今日进货额、本月销售额、本月进货额 * @param request * @return */ @@ -441,6 +441,8 @@ public class DepotHeadController { 1, today, getNow3()); //今日销售出库 BigDecimal todayRetailSale = depotHeadService.getBuyAndSaleRetailStatistics("出库", "零售", 0, today, getNow3()); //今日零售出库 + BigDecimal todayBuy = depotHeadService.getBuyAndSaleStatistics("入库", "采购", + 1, today, getNow3()); //今日采购入库 BigDecimal monthSale = depotHeadService.getBuyAndSaleStatistics("出库", "销售", 1,firstDay, getNow3()); //本月销售出库 BigDecimal monthRetailSale = depotHeadService.getBuyAndSaleRetailStatistics("出库", "零售", @@ -448,6 +450,7 @@ public class DepotHeadController { BigDecimal monthBuy = depotHeadService.getBuyAndSaleStatistics("入库", "采购", 1, firstDay, getNow3()); //本月采购入库 map.put("todaySale", todaySale.add(todayRetailSale)); + map.put("todayBuy", todayBuy); map.put("thisMonthSale", monthSale.add(monthRetailSale)); map.put("thisMonthBuy", monthBuy); res.code = 200;