Merge branch 'master' of ssh://117.78.1.188:29418/dkyChenJiang
# Conflicts:
#	javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html
 
	
	
	
	
	
	
	
	
	
	
	
	
	
 |  |  | 
 |  |  |             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"; | 
 
 |  |  | 
 |  |  | 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; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private IProjectDataService projectDataService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private IHoleMediaService holeMediaService; | 
 |  |  |  | 
 |  |  |     @RequiresPermissions("geo:projectData:view") | 
 |  |  |     @GetMapping() | 
 |  |  | 
 |  |  |         } | 
 |  |  |         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"; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |         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); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |                 }else { | 
 |  |  |                     number++; | 
 |  |  |                 } | 
 |  |  |                 String code = "ZK" + String.format("%06d", number); | 
 |  |  |                 String code = "ZTCJ" + String.format("%06d", number); | 
 |  |  |                 item.setCode(code); | 
 |  |  |  | 
 |  |  |                 item.setCreateDate(DateUtils.getNowDate()); | 
 
| New file | 
 |  |  | 
 |  |  | 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; | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |                 columns: [{ | 
 |  |  |                     checkbox: true | 
 |  |  |                 }, | 
 |  |  |                     { | 
 |  |  |                         field : 'ids', | 
 |  |  |                         title : '主键', | 
 |  |  |                         visible: false | 
 |  |  |                     }, | 
 |  |  |                 { | 
 |  |  |                         field : 'code', | 
 |  |  |                         title : '场地编号', | 
 
| New file | 
 |  |  | 
 |  |  | <!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> | 
 
 |  |  | 
 |  |  |                 <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> | 
 |  |  | 
 |  |  |                         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(''); | 
 |  |  |                     } | 
 |  |  |                 }] | 
 |  |  | 
 |  |  |         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> | 
 
 |  |  | 
 |  |  |                 <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> | 
 |  |  | 
 |  |  |                     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 : '备注' | 
 |  |  |                 }, | 
 |  |  |                 { | 
 |  |  | 
 |  |  |                         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(''); | 
 |  |  |                     } | 
 |  |  |                 }] | 
 |  |  | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         // 上传附件 | 
 |  |  |         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> |