From 6662074ac2366a1068f54cefb1e46af7fca4fc81 Mon Sep 17 00:00:00 2001 From: zmk <496160012@qq.com> Date: 星期六, 18 五月 2024 17:27:22 +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/ProjectDataController.java | 47 +++++++++++ javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html | 23 ++--- javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/DeviceLogServiceImpl.java | 2 javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/vo/FileVo.java | 23 +++++ javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/files.html | 69 +++++++++++++++++ javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/DeviceLogController.java | 2 javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/project.html | 5 + javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData2.html | 37 +++----- 8 files changed, 169 insertions(+), 39 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 a939086..0e8d971 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 @@ -76,7 +76,7 @@ number++; } String formattedNumber = String.format("%06d", number); - String code = "ZK" + formattedNumber; + String code = "ZTCJ" + 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/ProjectDataController.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java index 7c274a6..2ccb64f 100644 --- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java +++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java @@ -1,7 +1,16 @@ package com.javaweb.geo.controller; +import java.io.File; +import java.util.ArrayList; import java.util.List; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.ObjectUtil; +import com.javaweb.common.config.Global; +import com.javaweb.geo.domain.Hole; +import com.javaweb.geo.domain.HoleMedia; +import com.javaweb.geo.service.IHoleMediaService; +import com.javaweb.geo.vo.FileVo; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -33,6 +42,9 @@ @Autowired private IProjectDataService projectDataService; + + @Autowired + private IHoleMediaService holeMediaService; @RequiresPermissions("geo:projectData:view") @GetMapping() @@ -71,6 +83,16 @@ } mmap.put("urlAddress",path); return prefix + "/image_view"; + } + + /** + * 椤圭洰鏂囦欢鍒楄〃椤甸潰 + * @return + */ + @GetMapping("/projectDataFileList") + public String projectDataFileList(String id ,ModelMap modelMap){ + modelMap.put("id",id); + return prefix + "/files"; } /** @@ -160,4 +182,29 @@ return projectDataService.uploadZIP(file,request); } + /** + * 鑾峰彇鏂囦欢鍒楄〃 + * @param id + * @return + */ + @PostMapping( "/listFile") + @ResponseBody + public TableDataInfo listFile(String id){ + List<FileVo> paths = new ArrayList<>(); + + HoleMedia holeMedia = new HoleMedia(); + holeMedia.setRecordId(id); + List<HoleMedia> holeMedias =holeMediaService.selectHoleMediaList(holeMedia); + + if(ObjectUtil.isNotEmpty(holeMedias)){ + for(HoleMedia holeMedia1 :holeMedias ){ + FileVo vo = new FileVo() ; + vo.setName(holeMedia1.getName()); + vo.setPath(holeMedia1.getInternetPath()); + paths.add(vo); + } + } + return getDataTable(paths); + } + } 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 d4ae689..5b1692d 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 @@ -132,7 +132,7 @@ }else { number++; } - String code = "ZK" + String.format("%06d", number); + String code = "ZTCJ" + String.format("%06d", number); item.setCode(code); item.setCreateDate(DateUtils.getNowDate()); diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/vo/FileVo.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/vo/FileVo.java new file mode 100644 index 0000000..7f7dcb7 --- /dev/null +++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/vo/FileVo.java @@ -0,0 +1,23 @@ +package com.javaweb.geo.vo; + +public class FileVo { + + private String path ; + private String name ; + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} 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 568865c..3384ce3 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 @@ -62,6 +62,11 @@ columns: [{ checkbox: true }, + { + field : 'ids', + title : '涓婚敭', + visible: false + }, { field : 'code', title : '鍦哄湴缂栧彿', diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/files.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/files.html new file mode 100644 index 0000000..a296a25 --- /dev/null +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/files.html @@ -0,0 +1,69 @@ +<!DOCTYPE html> +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> +<head> + <th:block th:include="include :: header('璧勬枡鍒楄〃')" /> + <th:block th:include="include :: bootstrap-fileinput-css" /> +</head> +<body class="gray-bg"> + <div class="container-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" /> + + <script th:inline="javascript"> + + var id =[[${id}]]; + var prefix = ctx + "geo/projectData"; + + $(function() { + var options = { + showFooter: true, + showSearch: false, + showRefresh: false, + showToggle: false, + showColumns: false, + url: prefix + "/listFile?id=" + id, + modalName: "璧勬枡鍒楄〃", + columns: [{ + checkbox: true + }, + { + field : 'name', + title : '鏂囦欢鍚嶇О' + + }, + { + field : 'path', + title : '鏂囦欢璺緞', + visible:false + }, + { + title: '鎿嶄綔', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + actions.push('<a class="btn btn-warning btn-xs ' + '" href="javascript:void(0)" onclick="file(\'' + row.path + '\')"><i class="fa fa-eye"></i>鏌ョ湅</a> '); + return actions.join(''); + } + } + ] + }; + $.table.init(options); + }); + + /** + * 鎵撳紑鏂囦欢 + * @param path + */ + function file(path) { + var url = "/bjfw/profile" + path; + window.open(url); + } + </script> +</body> + +</html> \ No newline at end of file diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html index 407098c..5896ff9 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html @@ -38,12 +38,7 @@ <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="geo:projectData:remove"> <i class="fa fa-remove"></i> 鍒犻櫎 </a> -<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="geo:projectData:export">--> -<!-- <i class="fa fa-download"></i> 瀵煎嚭--> -<!-- </a>--> -<!-- <a class="btn btn-danger" data-toggle="modal" onclick="uploadZIP();">--> -<!-- <i class="fa fa-upload"></i>涓婁紶闄勪欢--> -<!-- </a>--> + </div> <div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table> @@ -98,7 +93,8 @@ actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>缂栬緫</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>鍒犻櫎</a> '); actions.push('<a class="btn btn-info btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="uploadZIP(\'' + row.id + '\')"><i class="fa fa-upload"></i>涓婁紶</a> '); - actions.push('<a class="btn btn-info btn-xs ' + '" href="javascript:void(0)" onclick="viewImg(\'' + row.dataUrl + '\' , \'' + row.id + '\')"><i class="glyphicon glyphicon-menu-hamburger"></i>鏌ョ湅闄勪欢</a>'); + actions.push('<a class="btn btn-info btn-xs ' + '" href="javascript:void(0)" onclick="viewResource(\'' + row.id + '\' , \'' + row.id + '\')"><i class="glyphicon glyphicon-menu-hamburger"></i>鏌ョ湅闄勪欢</a>'); + return actions.join(''); } }] @@ -110,14 +106,11 @@ function uploadZIP(id){ $.modal.open('涓婁紶闄勪欢', prefix + "/importImg?projectDataId="+id); } - // 鏌ョ湅鍥剧墖璇︽儏 - function viewImg(path, id) { - if(path === null || path === '' || path === 'null'){ - $.modal.alertSuccess("鏂囦欢鏃犳硶鎵撳紑锛�"); - return; - } - var url = prefix + "/viewImage?id=" + id; - $.modal.open("鏌ョ湅鍥剧墖", url, 800, 600); + + + //鏌ョ湅璧勬枡 + function viewResource(id){ + $.modal.open("璧勬枡鍒楄〃", prefix + "/projectDataFileList?id=" + id, 800, 600); } </script> </body> diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData2.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData2.html index cd45369..aba6d71 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData2.html +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData2.html @@ -44,12 +44,7 @@ <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="geo:projectData:remove"> <i class="fa fa-remove"></i> 鍒犻櫎 </a> -<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="geo:projectData:export">--> -<!-- <i class="fa fa-download"></i> 瀵煎嚭--> -<!-- </a>--> - <a class="btn btn-danger" data-toggle="modal" onclick="uploadZIP();"> - <i class="fa fa-upload"></i>涓婁紶闄勪欢 - </a> + </div> <div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table> @@ -79,27 +74,27 @@ checkbox: true }, { - field : 'id', + field : 'id', title : '涓婚敭', visible: false }, { - field : 'name', + field : 'name', title : '璧勬枡鍚嶇О' }, { - field : 'fileType', + field : 'fileType', title : '涓氬姟绫诲瀷', formatter: function(value, row, index) { return $.table.selectDictLabel(fileTypeDatas, value); } }, { - field : 'labels', + field : 'labels', title : '鏍囩' }, { - field : 'remark', + field : 'remark', title : '澶囨敞' }, { @@ -109,7 +104,9 @@ var actions = []; actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>缂栬緫</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>鍒犻櫎</a> '); - actions.push('<a class="btn btn-info btn-xs ' + '" href="javascript:void(0)" onclick="viewImg(\'' + row.dataUrl + '\' , \'' + row.id + '\')"><i class="glyphicon glyphicon-menu-hamburger"></i>鏌ョ湅闄勪欢</a>'); + actions.push('<a class="btn btn-info btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="uploadZIP(\'' + row.id + '\')"><i class="fa fa-upload"></i>涓婁紶</a> '); + actions.push('<a class="btn btn-info btn-xs ' + '" href="javascript:void(0)" onclick="viewResource(\'' + row.id + '\' , \'' + row.id + '\')"><i class="glyphicon glyphicon-menu-hamburger"></i>鏌ョ湅闄勪欢</a>'); + return actions.join(''); } }] @@ -118,20 +115,16 @@ }); // 涓婁紶闄勪欢 - function uploadZIP(){ - $.modal.open('涓婁紶闄勪欢', prefix + "/importImg"); + function uploadZIP(id){ + $.modal.open('涓婁紶闄勪欢', prefix + "/importImg?projectDataId="+id); } - // 鏌ョ湅鍥剧墖璇︽儏 - function viewImg(path, id) { - if(path === null || path === '' || path === 'null'){ - $.modal.alertSuccess("鏂囦欢鏃犳硶鎵撳紑锛�"); - return; - } - var url = prefix + "/viewImage?id=" + id; - $.modal.open("鏌ョ湅鍥剧墖", url, 800, 600); + //鏌ョ湅璧勬枡 + function viewResource(id){ + $.modal.open("璧勬枡鍒楄〃", prefix + "/projectDataFileList?id=" + id, 800, 600); } + </script> </body> </html> \ No newline at end of file -- Gitblit v1.9.1