From e8460462dc4289a2ef57a78529580417c5eaf272 Mon Sep 17 00:00:00 2001
From: suerwei <18810552194@163.com>
Date: 星期四, 23 五月 2024 11:43:15 +0800
Subject: [PATCH] 管材出入库统计
---
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/TubLogController.java | 11 +++++
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/add.html | 12 -----
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/TubLog.java | 20 ++++++++++
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/ITubLogService.java | 6 +++
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/TubLogServiceImpl.java | 10 +++++
javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml | 12 ++++++
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/TubLogMapper.java | 5 ++
7 files changed, 65 insertions(+), 11 deletions(-)
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/TubLogController.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/TubLogController.java
index 34882bc..2ae93e6 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/TubLogController.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/TubLogController.java
@@ -136,4 +136,15 @@
String message = tubLogService.importTubLog(projectId,file,updateSupport);
return AjaxResult.success(message);
}
+
+
+ /**
+ * 缁熻
+ */
+ @GetMapping("/countTubLogDate")
+ @ResponseBody
+ public AjaxResult countTubLogDate() {
+ return tubLogService.countTubLogDate();
+ }
+
}
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/TubLog.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/TubLog.java
index 142e10d..70582ed 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/TubLog.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/TubLog.java
@@ -62,6 +62,10 @@
@Excel(name = "鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd")
private Date createDate;
+ /** 鍑哄叆搴撴暟閲忕粺璁� */
+ private Double outboundNumber;
+ private Double inboundNumber;
+
public void setId(Integer id)
{
this.id = id;
@@ -171,6 +175,22 @@
return createDate;
}
+ public Double getOutboundNumber() {
+ return outboundNumber;
+ }
+
+ public void setOutboundNumber(Double outboundNumber) {
+ this.outboundNumber = outboundNumber;
+ }
+
+ public Double getInboundNumber() {
+ return inboundNumber;
+ }
+
+ public void setInboundNumber(Double inboundNumber) {
+ this.inboundNumber = inboundNumber;
+ }
+
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/TubLogMapper.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/TubLogMapper.java
index 05a884c..2aa702e 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/TubLogMapper.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/TubLogMapper.java
@@ -66,4 +66,9 @@
* @return
*/
Integer selectMaxTubLogId(@Param("projectId") String projectId);
+
+ /**
+ * 缁熻
+ */
+ List<TubLog> countTubLogDate();
}
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/ITubLogService.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/ITubLogService.java
index 3dae239..3a51560 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/ITubLogService.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/ITubLogService.java
@@ -1,5 +1,6 @@
package com.javaweb.geo.service;
+import com.javaweb.common.core.domain.AjaxResult;
import com.javaweb.geo.domain.TubLog;
import org.springframework.web.multipart.MultipartFile;
@@ -71,4 +72,9 @@
* 瀵煎叆绠℃潗鍑哄叆搴撹褰�
*/
String importTubLog(String projectId, MultipartFile file, boolean updateSupport);
+
+ /**
+ * 缁熻
+ */
+ AjaxResult countTubLogDate();
}
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/TubLogServiceImpl.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/TubLogServiceImpl.java
index 448f9b1..9d153f2 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/TubLogServiceImpl.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/TubLogServiceImpl.java
@@ -6,6 +6,7 @@
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import com.javaweb.common.config.Global;
+import com.javaweb.common.core.domain.AjaxResult;
import com.javaweb.common.utils.DateUtils;
import com.javaweb.geo.domain.TubLog;
import org.springframework.beans.factory.annotation.Autowired;
@@ -107,6 +108,15 @@
}
/**
+ * 缁熻
+ */
+ @Override
+ public AjaxResult countTubLogDate() {
+ List<TubLog> list = tubLogMapper.countTubLogDate();
+ return AjaxResult.success("鏌ヨ鎴愬姛锛�",list);
+ }
+
+ /**
* 瀵煎叆绠℃潗鍑哄叆搴撹褰�
*/
@Override
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml
index 90e8385..b364545 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml
+++ b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml
@@ -18,6 +18,8 @@
<result property="unit" column="unit" />
<result property="createDate" column="create_date" />
<result property="remark" column="remark" />
+ <result property="outboundNumber" column="outbound_number" />
+ <result property="inboundNumber" column="inbound_number" />
</resultMap>
<sql id="selectTubLogVo">
@@ -50,6 +52,16 @@
SELECT MAX(id) FROM js_tub_log where project_id = #{projectId}
</select>
+ <select id="countTubLogDate" resultMap="TubLogResult">
+ SELECT
+ a.tub_name,
+ b.inbound_number,
+ a.outbound_number
+ FROM
+ ( SELECT tub_name, SUM( number ) AS outbound_number FROM js_tub_log WHERE outbound_date IS NOT NULL GROUP BY tub_name ) a
+ LEFT JOIN ( SELECT tub_name, SUM( number ) AS inbound_number FROM js_tub_log WHERE inbound_date IS NOT NULL GROUP BY tub_name ) b ON a.tub_name = b.tub_name
+ </select>
+
<insert id="insertTubLog" parameterType="TubLog" useGeneratedKeys="true" keyProperty="id">
insert into js_tub_log
<trim prefix="(" suffix=")" suffixOverrides=",">
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/add.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/add.html
index a63ca3c..066ac16 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/add.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/add.html
@@ -19,16 +19,7 @@
<input name="tubName" class="form-control" type="text" placeholder="璇峰~鍐欐潗鏂欏悕绉�" required>
</div>
</div>
-<!-- <div class="form-group"> -->
-<!-- <label class="col-sm-3 control-label">绫诲瀷锛�</label>-->
-<!-- <div class="col-sm-8">-->
-<!-- <select name="type" class="form-control m-b">-->
-<!-- <option value="">鎵�鏈�</option>-->
-<!-- </select>-->
-<!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 浠g爜鐢熸垚璇烽�夋嫨瀛楀吀灞炴��</span>-->
-<!-- </div>-->
-<!-- </div>-->
- <div class="form-group">
+ <div class="form-group">
<label class="col-sm-3 control-label">鍑哄簱鏃堕棿锛�</label>
<div class="col-sm-8">
<div class="input-group date">
@@ -84,7 +75,6 @@
var prefix = ctx + "geo/TubLog"
var projectId = [[${projectId}]];
var code = [[${code}]];
-
$("#form-TubLog-add").validate({
focusCleanup: true
--
Gitblit v1.9.1