From 80125173e0051ffdd9914d33586b739e80362e78 Mon Sep 17 00:00:00 2001
From: zmk <496160012@qq.com>
Date: 星期四, 23 五月 2024 17:48:09 +0800
Subject: [PATCH] Merge branch 'master' of ssh://117.78.1.188:29418/dkyChenJiang
---
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 | 34 ++++++++++------
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/templates/geo/project/navigate.html | 4 +-
javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml | 13 ++++++
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/edit.html | 11 ++++-
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/TubLogMapper.java | 5 ++
9 files changed, 96 insertions(+), 18 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..7410116 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,17 @@
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,
+ a.unit
+ FROM
+ ( SELECT tub_name, SUM( number ) AS outbound_number, unit 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, unit 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..8ce903c 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,21 +19,12 @@
<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">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
- <input name="outboundDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
+ <input id="outboundDateId" name="outboundDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
</div>
</div>
</div>
@@ -42,7 +33,7 @@
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
- <input name="inboundDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
+ <input id="inboundDateId" name="inboundDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
</div>
</div>
</div>
@@ -85,12 +76,22 @@
var projectId = [[${projectId}]];
var code = [[${code}]];
-
$("#form-TubLog-add").validate({
focusCleanup: true
});
function submitHandler() {
+ let inboundDateValue = $("#inboundDateId").val();
+ let outboundDateValue = $("#outboundDateId").val();
+ if ($.common.isEmpty(inboundDateValue) && $.common.isEmpty(outboundDateValue)) {
+ $.modal.alertWarning("鍑哄叆搴撴椂闂达紝璇烽�夋嫨涓�鏉¤褰�");
+ return;
+ }
+ if (!$.common.isEmpty(inboundDateValue) && !$.common.isEmpty(outboundDateValue)) {
+ $.modal.alertWarning("鍑哄叆搴撴椂闂达紝璇烽�夋嫨涓�鏉¤褰�");
+ return;
+ }
+
if ($.validate.form()) {
let formData = $('#form-TubLog-add').serialize();
let data = formData + "&projectId=" + projectId + "&code=" + code;
@@ -109,6 +110,13 @@
minView: "month",
autoclose: true
});
+
+
+
+
+
+
+
</script>
</body>
</html>
\ No newline at end of file
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/edit.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/edit.html
index d25d869..d94ea29 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/edit.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/edit.html
@@ -34,7 +34,7 @@
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
- <input name="outboundDate" th:value="${#dates.format(tubLog.outboundDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
+ <input id="outboundDateId" name="outboundDate" th:value="${#dates.format(tubLog.outboundDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
</div>
</div>
</div>
@@ -43,7 +43,7 @@
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
- <input name="inboundDate" th:value="${#dates.format(tubLog.inboundDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
+ <input id="inboundDateId" name="inboundDate" th:value="${#dates.format(tubLog.inboundDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
</div>
</div>
</div>
@@ -90,7 +90,12 @@
});
function submitHandler() {
-
+ let inboundDateValue = $("#inboundDateId").val();
+ let outboundDateValue = $("#outboundDateId").val();
+ if ($.common.isEmpty(inboundDateValue) && $.common.isEmpty(outboundDateValue)) {
+ $.modal.alertWarning("鍑哄叆搴撴椂闂达紝璇烽�夋嫨涓�鏉¤褰�");
+ return;
+ }
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-TubLog-edit').serialize());
}
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/navigate.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/navigate.html
index 5c4fb2d..9a3893d 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/navigate.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/navigate.html
@@ -31,7 +31,7 @@
</div>
<div class="box-header ">
<div class="box-title">
- <i class="glyphicon glyphicon-map-marker"></i> <a class="afont" th:href="@{/geo/holeLog(id=${project.ids})}" target="mainFrame" onclick="selected(this)">閽诲瓟杩涘害鏃ュ織</a>
+ <i class="glyphicon glyphicon-list-alt"></i> <a class="afont" th:href="@{/geo/holeLog(id=${project.ids})}" target="mainFrame" onclick="selected(this)">閽诲瓟杩涘害鏃ュ織</a>
</div>
</div>
<div class="box-header ">
@@ -46,7 +46,7 @@
</div>
<div class="box-header ">
<div class="box-title">
- <i class="glyphicon glyphicon-retweet"></i> <a class="afont" th:href="@{/geo/TubLog(id=${project.ids})}" target="mainFrame" onclick="selected(this)">鏉愭枡绠$悊</a>
+ <i class="glyphicon glyphicon-random"></i> <a class="afont" th:href="@{/geo/TubLog(id=${project.ids})}" target="mainFrame" onclick="selected(this)">鏉愭枡绠$悊</a>
</div>
</div>
<div class="box-header ">
--
Gitblit v1.9.1