From 306749fa2e6ea7609468889cb56473770d0a26cc Mon Sep 17 00:00:00 2001
From: zmk <496160012@qq.com>
Date: 星期六, 18 五月 2024 14:44:51 +0800
Subject: [PATCH] Merge branch 'master' of ssh://117.78.1.188:29418/dkyChenJiang
---
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/DeviceLogMapper.java | 8 +
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/edit.html | 2
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/HoleServiceImpl.java | 7
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/DeviceLogServiceImpl.java | 28 ++++
javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/DeviceLogMapper.xml | 8 +
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectController.java | 1
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/utils/ExceptionTimeUtils.java | 10 +
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/info.html | 155 +++++++++++++++++++++++-------
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/DeviceLog.java | 15 +-
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/hole/edit.html | 4
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/DeviceLogController.java | 10 ++
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/add.html | 5
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IDeviceLogService.java | 6 +
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/project.html | 1
14 files changed, 195 insertions(+), 65 deletions(-)
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/DeviceLogController.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/DeviceLogController.java
index 94af662..a939086 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/DeviceLogController.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/DeviceLogController.java
@@ -6,6 +6,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
+import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import com.javaweb.common.annotation.Log;
import com.javaweb.common.enums.BusinessType;
@@ -68,7 +69,16 @@
*/
@GetMapping("/add")
public String add(String projectId, ModelMap mmap) {
+ Integer number = deviceLogService.selectMaxDeviceLogId(projectId);
+ if (ObjectUtils.isEmpty(number)){
+ number = 1;
+ }else {
+ number++;
+ }
+ String formattedNumber = String.format("%06d", number);
+ String code = "ZK" + formattedNumber;
mmap.put("projectId", projectId);
+ mmap.put("code", code);
return prefix + "/add";
}
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectController.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectController.java
index cb5c728..498692c 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectController.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectController.java
@@ -118,6 +118,7 @@
project.setHoleNum(count);
mmap.put("project", project);
+ mmap.put("projectId", id);
return prefix + "/info";
}
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/DeviceLog.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/DeviceLog.java
index 0c65631..9e7b6de 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/DeviceLog.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/DeviceLog.java
@@ -17,7 +17,7 @@
private static final long serialVersionUID = 1L;
/** 涓婚敭 */
- private String id;
+ private Integer id;
/** 鍑哄叆搴撳崟瀛愬彿 */
@Excel(name = "鍑哄叆搴撳崟瀛愬彿")
@@ -67,16 +67,15 @@
/** 鏃堕棿 */
private Date createDate;
- public void setId(String id)
- {
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
this.id = id;
}
- public String getId()
- {
- return id;
- }
- public void setCode(String code)
+ public void setCode(String code)
{
this.code = code;
}
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/DeviceLogMapper.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/DeviceLogMapper.java
index b8d3475..dc9a9b2 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/DeviceLogMapper.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/DeviceLogMapper.java
@@ -1,6 +1,8 @@
package com.javaweb.geo.mapper;
import com.javaweb.geo.domain.DeviceLog;
+import org.apache.ibatis.annotations.Param;
+
import java.util.List;
/**
@@ -58,4 +60,10 @@
* @return 缁撴灉
*/
public int deleteDeviceLogByIds(String[] ids);
+
+ /**
+ * 鏌ヨ鏁版嵁搴撲腑id鏈�澶у��
+ * @return
+ */
+ Integer selectMaxDeviceLogId(@Param("projectId") String projectId);
}
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IDeviceLogService.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IDeviceLogService.java
index 1f32791..2490d1f 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IDeviceLogService.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IDeviceLogService.java
@@ -65,4 +65,10 @@
* 瀵煎叆璁惧鍑哄叆搴撹褰�
*/
String importDeviceLog(String projectId, MultipartFile file, boolean updateSupport);
+
+ /**
+ * 鏌ヨ鏁版嵁搴撲腑id鏈�澶у��
+ * @return
+ */
+ Integer selectMaxDeviceLogId(String projectId);
}
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/DeviceLogServiceImpl.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/DeviceLogServiceImpl.java
index df6206c..d4ae689 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/DeviceLogServiceImpl.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/DeviceLogServiceImpl.java
@@ -70,9 +70,6 @@
*/
@Override
public int insertDeviceLog(DeviceLog deviceLog) {
- if(ObjectUtils.isEmpty(deviceLog.getId())){
- deviceLog.setId(IdGenerate.nextId());
- }
deviceLog.setCreateDate(DateUtils.getNowDate());
return deviceLogMapper.insertDeviceLog(deviceLog);
}
@@ -118,6 +115,8 @@
public String importDeviceLog(String projectId,MultipartFile file, boolean updateSupport) {
// 鍏宠仈椤圭洰淇℃伅
Project project = projectService.selectProjectById(projectId);
+ // 鍏宠仈code
+ Integer number = deviceLogMapper.selectMaxDeviceLogId(projectId);
try {
String dest = saveExcel(file);
@@ -127,6 +126,15 @@
item.setProjectId(projectId);
item.setProjectName(project.getFullName());
+ // 杞崲number淇℃伅
+ if (ObjectUtils.isEmpty(number)){
+ number = 1;
+ }else {
+ number++;
+ }
+ String code = "ZK" + String.format("%06d", number);
+ item.setCode(code);
+
item.setCreateDate(DateUtils.getNowDate());
insertDeviceLog(item);
}
@@ -134,6 +142,19 @@
return e.toString();
}
return "瀵煎叆瀹屾瘯" ;
+ }
+
+
+ /**
+ * 鏌ヨ鏁版嵁搴撲腑id鏈�澶у��
+ * @return
+ *
+ * TRUNCATE TABLE js_device_log;
+ * ALTER TABLE js_device_log AUTO_INCREMENT = 1;
+ */
+ @Override
+ public Integer selectMaxDeviceLogId(String projectId) {
+ return deviceLogMapper.selectMaxDeviceLogId(projectId);
}
private String saveExcel(MultipartFile file) {
@@ -154,7 +175,6 @@
private List<DeviceLog> readData(String filepath) {
ExcelReader reader = ExcelUtil.getReader(filepath, 0);
- reader.addHeaderAlias("鍑哄叆搴撳崟瀛愬彿", "code");
reader.addHeaderAlias("璁惧鍚嶇О", "deviceName");
reader.addHeaderAlias("绫诲瀷", "type");
reader.addHeaderAlias("鍏ュ簱鏃堕棿", "inboundDate");
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/HoleServiceImpl.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/HoleServiceImpl.java
index b7422a6..da794c3 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/HoleServiceImpl.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/HoleServiceImpl.java
@@ -201,11 +201,12 @@
private List<Hole> readData(String filepath) {
ExcelReader reader = ExcelUtil.getReader(filepath, 0);
reader.addHeaderAlias("閽诲瓟缂栧彿", "code");
- reader.addHeaderAlias("瀛斿彛楂樼▼", "elevation");
- reader.addHeaderAlias("璁捐瀛旀繁", "depth");
+ reader.addHeaderAlias("瀛斿彛楂樼▼(m)", "elevation");
+ reader.addHeaderAlias("璁捐瀛旀繁(m)", "depth");
reader.addHeaderAlias("閽诲瓟缁忓害", "longitude");
reader.addHeaderAlias("閽诲瓟绾害", "latitude");
- reader.addHeaderAlias("杩涘害", "pic1");
+ reader.addHeaderAlias("鎬昏繘灏�(m)", "footage");
+ reader.addHeaderAlias("宸插畬鎴愯繘灏�(m)", "footageCpl");
List<Hole> list = reader.readAll(Hole.class);
return list;
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/utils/ExceptionTimeUtils.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/utils/ExceptionTimeUtils.java
index e931f92..d5b0a56 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/utils/ExceptionTimeUtils.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/utils/ExceptionTimeUtils.java
@@ -66,9 +66,13 @@
//2022-03-05 14:05:11 6.5
- Date date1 = DateUtils.parseDate("2022-03-05 13:43:03");
- Date date2 = DateUtils.parseDate("2022-03-05 14:05:11");
- Double spead = spead(date1,5.4d,date2,6.5d);
+// Date date1 = DateUtils.parseDate("2022-03-05 13:43:03");
+// Date date2 = DateUtils.parseDate("2022-03-05 14:05:11");
+// Double spead = spead(date1,5.4d,date2,6.5d);
+
+ String s1 = "000019";
+ int a = Integer.parseInt(s1) + 1;
+ System.out.println(a);
}
}
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/DeviceLogMapper.xml b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/DeviceLogMapper.xml
index 424d266..15e6ad0 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/DeviceLogMapper.xml
+++ b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/DeviceLogMapper.xml
@@ -46,11 +46,14 @@
<include refid="selectDeviceLogVo"/>
where id = #{id}
</select>
-
+
+ <select id="selectMaxDeviceLogId" resultType="java.lang.Integer">
+ SELECT MAX(id) FROM js_device_log where project_id = #{projectId}
+ </select>
+
<insert id="insertDeviceLog" parameterType="DeviceLog">
insert into js_device_log
<trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null and id != ''">id,</if>
<if test="code != null and code != ''">code,</if>
<if test="projectId != null and projectId != ''">project_id,</if>
<if test="projectName != null and projectName != ''">project_name,</if>
@@ -67,7 +70,6 @@
<if test="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null and id != ''">#{id},</if>
<if test="code != null and code != ''">#{code},</if>
<if test="projectId != null and projectId != ''">#{projectId},</if>
<if test="projectName != null and projectName != ''">#{projectName},</if>
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/add.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/add.html
index 1f749e9..49f4689 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/add.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/add.html
@@ -9,7 +9,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">鍑哄叆搴撳崟瀛愬彿锛�</label>
<div class="col-sm-8">
- <input name="code" class="form-control" type="text">
+ <input name="code" th:value="${code}" class="form-control" type="text" disabled="disabled">
</div>
</div>
<div class="form-group">
@@ -68,6 +68,7 @@
<script th:inline="javascript">
var prefix = ctx + "geo/deviceLog"
var projectId = [[${projectId}]];
+ var code = [[${code}]];
$("#form-deviceLog-add").validate({
focusCleanup: true
@@ -76,7 +77,7 @@
function submitHandler() {
if ($.validate.form()) {
let formData = $('#form-deviceLog-add').serialize();
- let data = formData + "&projectId=" + projectId;
+ let data = formData + "&projectId=" + projectId + "&code=" + code;
$.operate.save(prefix + "/add", data);
}
}
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/edit.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/edit.html
index 4353bef..7acdb17 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/edit.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/edit.html
@@ -10,7 +10,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">鍑哄叆搴撳崟瀛愬彿锛�</label>
<div class="col-sm-8">
- <input name="code" th:field="*{code}" class="form-control" type="text">
+ <input name="code" th:field="*{code}" class="form-control" type="text" disabled="disabled">
</div>
</div>
<div class="form-group">
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/hole/edit.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/hole/edit.html
index d6b2646..4706995 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/hole/edit.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/hole/edit.html
@@ -15,13 +15,13 @@
</div>
</div>
<div class="form-group">
- <label class="col-sm-3 control-label">瀛斿彛楂樼▼锛�</label>
+ <label class="col-sm-3 control-label">瀛斿彛楂樼▼(m)锛�</label>
<div class="col-sm-8">
<input name="elevation" th:field="*{elevation}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
- <label class="col-sm-3 control-label">璁捐瀛旀繁锛�</label>
+ <label class="col-sm-3 control-label">璁捐瀛旀繁(m)锛�</label>
<div class="col-sm-8">
<input name="depth" th:field="*{depth}" class="form-control" type="text" >
</div>
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/info.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/info.html
index cf01935..1f4867a 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/info.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/info.html
@@ -54,51 +54,128 @@
</head>
<body class="white-bg">
<div id="container">
- <p class="project-name">
- <span class="name-label">鍦哄湴鍚嶇О锛�</span>
- <span class="name-val" th:text="${project.fullName}"></span>
- </p>
- <table class="basic-info">
- <tr>
- <td>寤鸿鍗曚綅锛�</td>
- <td colspan="3" th:text="${project.companyName}"></td>
- <td>鍔冲姟鍗曚綅锛�</td>
- <td colspan="3" th:text="${project.laborUnit}"></td>
- </tr>
- <tr>
- <td>寤鸿鍦扮偣锛�</td>
- <td colspan="7" th:text="${project.address}"></td>
- </tr>
- <tr>
- <td>鍦哄湴鍚嶇О锛�</td>
- <td colspan="5" th:text="${project.fullName}"></td>
- <td>鍦哄湴缂栧彿锛�</td>
- <td th:text="${project.code}"></td>
- </tr>
- <tr>
- <td>閽诲瓟涓暟锛�</td>
- <td th:text="${project.holeNum}"></td>
- <td>寮�濮嬫椂闂达細</td>
- <td th:text="${#dates.format(project.createTime,'yyyy-MM-dd')}"></td>
- <td>缁堟鏃堕棿锛�</td>
- <td th:text="${#dates.format(project.endTime,'yyyy-MM-dd')}"></td>
- <td>璐熻矗浜猴細</td>
- <td th:text="${project.leaderName}"></td>
- </tr>
- </table>
-<!-- <div class="map-model">-->
-<!-- <button onclick="map()" type="button">鍦板浘妯″紡</button>-->
-<!-- </div>-->
+
+ <div class="row">
+ <p class="project-name">
+ <span class="name-label">鍦哄湴鍚嶇О锛�</span>
+ <span class="name-val" th:text="${project.fullName}"></span>
+ </p>
+ <table class="basic-info">
+ <tr>
+ <td>寤鸿鍗曚綅锛�</td>
+ <td colspan="3" th:text="${project.companyName}"></td>
+ <td>鍔冲姟鍗曚綅锛�</td>
+ <td colspan="3" th:text="${project.laborUnit}"></td>
+ </tr>
+ <tr>
+ <td>寤鸿鍦扮偣锛�</td>
+ <td colspan="7" th:text="${project.address}"></td>
+ </tr>
+ <tr>
+ <td>鍦哄湴鍚嶇О锛�</td>
+ <td colspan="5" th:text="${project.fullName}"></td>
+ <td>鍦哄湴缂栧彿锛�</td>
+ <td th:text="${project.code}"></td>
+ </tr>
+ <tr>
+ <td>閽诲瓟涓暟锛�</td>
+ <td th:text="${project.holeNum}"></td>
+ <td>寮�濮嬫椂闂达細</td>
+ <td th:text="${#dates.format(project.createTime,'yyyy-MM-dd')}"></td>
+ <td>缁堟鏃堕棿锛�</td>
+ <td th:text="${#dates.format(project.endTime,'yyyy-MM-dd')}"></td>
+ <td>璐熻矗浜猴細</td>
+ <td th:text="${project.leaderName}"></td>
+ </tr>
+ </table>
+ <!-- <div class="map-model">-->
+ <!-- <button onclick="map()" type="button">鍦板浘妯″紡</button>-->
+ <!-- </div>-->
+ </div>
+
+ <div class="row">
+ <div class="col-sm-12 select-table table-striped">
+ <table id="bootstrap-table"></table>
+ </div>
+ </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
-
+
<script th:inline="javascript">
var project =[[${project}]];
+ var projectId=[[${projectId}]];
+ var statusDatas = [[${@dict.getType('hole_status')}]];
+ var prefix = ctx + "geo/hole";
- function map(){
- parent.$.modal.openTab("椤圭洰鍦板浘",ctx+"/geo/projectwork/map?id=" + project.ids);
- }
+ $(function() {
+ var options = {
+ url: prefix + "/list?projectId=" + projectId,
+ modalName: "閽诲瓟",
+ columns: [{
+ checkbox: true
+ },
+ {
+ field : 'ids',
+ title : '涓婚敭',
+ visible: false
+ },
+ {
+ field : 'code',
+ title : '閽诲瓟缂栧彿'
+ },
+ {
+ field : 'elevation',
+ title : '瀛斿彛楂樼▼锛坢锛�'
+ },
+ {
+ field : 'depth',
+ title : '璁捐瀛旀繁锛坢锛�'
+ },
+ {
+ field : 'longitude',
+ title : '閽诲瓟缁忓害',
+ visible: false
+ },
+ {
+ field : 'latitude',
+ title : '閽诲瓟绾害',
+ visible: false
+ },
+ {
+ field : 'status',
+ title : '閽诲瓟鐘舵��',
+ formatter: function(value, row, index) {
+ return $.table.selectDictLabel(statusDatas, value);
+ }
+ },
+ {
+ field : 'footage',
+ title : '鎬昏繘灏猴紙m锛�',
+ },
+ {
+ field : 'footageCpl',
+ title : '宸插畬鎴愯繘灏猴紙m锛�',
+ },
+ {
+ field : 'rate',
+ title : '瀹屾垚杩涘害(%)',
+ formatter: function(value, row, index) {
+ if (row.rate !=null){
+ return (row.rate*100).toFixed(2) + "%";
+ }else{
+ return "0%";
+ }
+ }
+ }
+ ]
+ };
+ $.table.init(options);
+ });
+ //
+ // function map(){
+ // parent.$.modal.openTab("椤圭洰鍦板浘",ctx+"/geo/projectwork/map?id=" + project.ids);
+ // }
</script>
</body>
</html>
\ No newline at end of file
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/project.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/project.html
index 81b12f8..568865c 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/project.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/project.html
@@ -58,6 +58,7 @@
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "鍦哄湴",
+ pageSize:50,
columns: [{
checkbox: true
},
--
Gitblit v1.9.1