From b08837ad4e64348a27e21b2bb621352a523e2b7b Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 20 二月 2025 13:26:04 +0800
Subject: [PATCH] #出入库统计计数

---
 src/main/java/com/zy/asrs/mapper/ReportQueryMapper.java         |    2 +
 src/main/webapp/static/js/report/inOut.js                       |   26 +++++++++++++
 src/main/resources/mapper/ViewInOutMapper.xml                   |    4 ++
 src/main/webapp/views/report/viewInOut.html                     |   16 ++++++++
 src/main/java/com/zy/asrs/controller/ReportQueryController.java |   56 ++++++++++++++++++++++++++++
 5 files changed, 104 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/ReportQueryController.java b/src/main/java/com/zy/asrs/controller/ReportQueryController.java
index c731135..67c619b 100644
--- a/src/main/java/com/zy/asrs/controller/ReportQueryController.java
+++ b/src/main/java/com/zy/asrs/controller/ReportQueryController.java
@@ -157,6 +157,62 @@
 		return R.ok(page);
 	}
 
+	@RequestMapping("/viewInOutList/count")
+	public R getAllCount() {
+		ViewInOutBean bean = new ViewInOutBean();
+		bean.setPageSize(99999);
+		bean.setPageNumber(1);
+		List<ViewInOutBean> list = new ArrayList<>();
+		Map<String, Double> map =  new HashMap<>();
+		Double in = 0.0;
+		Double out = 0.0;
+		list = reportQueryMapper.queryViewInOutListDay(bean);
+		for (ViewInOutBean bean1 : list) {
+			in += bean1.getSto_qty().doubleValue();
+			out += bean1.getRet_qty().doubleValue();
+		}
+		map.put("in", in);
+		map.put("out", out);
+		return R.ok(map);
+	}
+
+	/**
+	 * 鑾峰彇搴撳瓨鎬绘暟
+	 * @return
+	 */
+	@RequestMapping("/viewInOutList/date/count")
+	public R getCount(@RequestBody Map<String, String> param){
+		ViewInOutBean bean = new ViewInOutBean();
+		bean.setPageSize(99999);
+		bean.setPageNumber(1);
+		if (!Cools.isEmpty(param.get("modi_time"))) {
+			String[] dates = param.get("modi_time").toString().split(RANGE_TIME_LINK);
+			bean.setBegin_date(dates[0]);
+			bean.setEnd_date(dates[1]);
+		}
+		Map<String, Double> map =  new HashMap<>();
+		Double in = 0.0;
+		Double out = 0.0;
+		List<ViewInOutBean> list = new ArrayList<>();
+		if (param.get("type") == null || param.get("type").equals(1)) {
+			list = reportQueryMapper.queryViewInOutListDay(bean);
+		}else if ( param.get("type").equals("2")) {
+			list = reportQueryMapper.queryViewInOutListMonth(bean);
+		} else if (param.get("type").equals("3")) {
+			list = reportQueryMapper.queryViewInOutListYear(bean);
+		}else {
+			list = reportQueryMapper.queryViewInOutListDay(bean);
+
+		}
+		for (ViewInOutBean bean1 : list) {
+			in += bean1.getSto_qty().doubleValue();
+			out += bean1.getRet_qty().doubleValue();
+		}
+		map.put("in", in);
+		map.put("out", out);
+		return R.ok(map);
+	}
+
 	//excel瀵煎嚭
 	@RequestMapping("/viewInOutExport.action")
 	@ManagerAuth(memo = "绔欑偣鏃ュ叆鍑哄簱娆℃暟缁熻瀵煎嚭")
diff --git a/src/main/java/com/zy/asrs/mapper/ReportQueryMapper.java b/src/main/java/com/zy/asrs/mapper/ReportQueryMapper.java
index 6665969..88f3063 100644
--- a/src/main/java/com/zy/asrs/mapper/ReportQueryMapper.java
+++ b/src/main/java/com/zy/asrs/mapper/ReportQueryMapper.java
@@ -91,4 +91,6 @@
 	Integer selectWorkCountInSum(String matnr, @Param("start") String startTime, @Param("end") String endTime);
 
 	Integer selectWorkCountOutSum(String matnr, @Param("start") String startTime, @Param("end") String endTime);
+
+	List<ViewInOutBean> selectAll();
 }
diff --git a/src/main/resources/mapper/ViewInOutMapper.xml b/src/main/resources/mapper/ViewInOutMapper.xml
index 8ee1e04..d0f4269 100644
--- a/src/main/resources/mapper/ViewInOutMapper.xml
+++ b/src/main/resources/mapper/ViewInOutMapper.xml
@@ -297,5 +297,9 @@
 			and matnr = #{matnr}
 		</if>
 	</select>
+	<select id="selectAll" resultType="com.zy.asrs.entity.ViewInOutBean">
+		select * from asr_sta_inout_view a
+
+	</select>
 
 </mapper>
\ No newline at end of file
diff --git a/src/main/webapp/static/js/report/inOut.js b/src/main/webapp/static/js/report/inOut.js
index a755f60..4d6aac3 100644
--- a/src/main/webapp/static/js/report/inOut.js
+++ b/src/main/webapp/static/js/report/inOut.js
@@ -46,6 +46,17 @@
             }
             pageCurr=curr;
             limit();
+
+            $.ajax({
+                url: baseUrl+"/report/viewInOutList/count",
+                headers: {'token': localStorage.getItem('token')},
+                contentType:'application/json;charset=UTF-8',
+                method: 'POST',
+                success: function (res) {
+                    $("#countNumIn").text(res.data.in + '娆�');
+                    $("#countNumOut").text(res.data.out + '娆�');
+                }
+            });
         }
     });
 
@@ -218,6 +229,21 @@
             limit(child);
         }
     });
+    /**
+     * 鏄剧ず搴撳瓨鎬绘暟閲�
+     */
+    $.ajax({
+        url: baseUrl+"/report/viewInOutList/date/count",
+        headers: {'token': localStorage.getItem('token')},
+        contentType:'application/json;charset=UTF-8',
+        method: 'POST',
+        data: JSON.stringify(searchData),
+        success: function (res) {
+            console.log(res);
+            $("#countNumIn").text(res.data.in + '娆�');
+            $("#countNumOut").text(res.data.out + '娆�');
+        }
+    });
 }
 
 function setFormVal(el, data, showImg) {
diff --git a/src/main/webapp/views/report/viewInOut.html b/src/main/webapp/views/report/viewInOut.html
index e0e6439..e1374b1 100644
--- a/src/main/webapp/views/report/viewInOut.html
+++ b/src/main/webapp/views/report/viewInOut.html
@@ -20,6 +20,22 @@
 <!-- 鎼滅储鏍� -->
 <div id="search-box" class="layui-form layui-card-header">
     <div class="layui-inline">
+        <fieldset class="layui-elem-field">
+            <legend>鍏ュ簱鎬昏娆℃暟</legend>
+            <div class="layui-field-box" id="countNumIn">
+                璇风◢绛�
+            </div>
+        </fieldset>
+    </div>
+    <div class="layui-inline">
+        <fieldset class="layui-elem-field">
+            <legend>鍑哄簱鎬昏娆℃暟</legend>
+            <div class="layui-field-box" id="countNumOut">
+                璇风◢绛�
+            </div>
+        </fieldset>
+    </div>
+    <div class="layui-inline">
         <div class="layui-input-inline">
             <select name="type">
                 <option value="1" selected>鏃�</option>

--
Gitblit v1.9.1