diff --git a/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java b/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java index a21d66ae2e737529c078698fe95edc732a79dce2..5ddabd6e8dd0eb5c0f941b62e8c45f5b054da426 100644 --- a/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java +++ b/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java @@ -14,12 +14,9 @@ import com.cetc32.dh.common.response.ResponseResult; import com.cetc32.dh.entity.DataFile; import com.cetc32.dh.entity.DataSubmit; import com.cetc32.dh.entity.FileToMenu; -import com.cetc32.dh.service.DataFileService; -import com.cetc32.dh.service.DataMenuService; -import com.cetc32.dh.service.DataSubmitService; -import com.cetc32.dh.service.FileToMenuService; +import com.cetc32.dh.entity.VfileMenu; +import com.cetc32.dh.service.*; import com.cetc32.dh.utils.FileUtil; -import com.cetc32.dh.service.AdminUserService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -30,12 +27,14 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import java.io.File; +import javax.servlet.http.HttpServletResponse; +import java.io.*; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; - +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; @RestController @@ -115,179 +114,197 @@ public class FileSubmitController { // return new PageDataResult(count,list); } + /** * 拒绝导入请求 - * @param map * @return 返回执行结果 * **/ - @ApiOperation(value = "拒绝请求") - @PostMapping("/reject") - @ApiImplicitParam(name = "ids", value = "申请审批的记录id", dataType = "List", defaultValue = "") - public ResponseResult rejectSubmit(@RequestBody Map map) { + @ApiOperation(value = "审核通过") + @PostMapping("/accept") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "申请审批的记录id", dataType = "List", defaultValue = ""), +// @ApiImplicitParam(name = "menuid", value = "编目id", dataType = "Integer", defaultValue = "") + }) + public ResponseResult acceptSubmit(@RequestBody Map map) { + System.out.println(map); List ids = new ArrayList<>(); - ids = (List) map.get("ids"); - DataSubmit dataSubmit = null; + DataFile dataFile = new DataFile(); int sum = 0; + ids = (List) map.get("ids"); for (int i = 0; i < ids.size(); i++) { Integer id = ids.get(i); - dataSubmit = dataSubmitService.queryById(id); - if (dataSubmitService.rejectSubmit(dataSubmit) > 0) { -// String delFile = dataSubmit.getPath() + File.separator + dataSubmit.getTitle(); - String delFile = dataSubmit.getPath() ; - System.out.println(delFile); - FileUtil.deleteDir(delFile); - sum = sum + 1; + dataFile = dataFileService.queryById(id.longValue()); + dataFile.setStatus("审核通过"); + dataFile.setApproveTime(new Date()); + if (dataFileService.updatebyId(dataFile) > 0) { + sum++; } } - if (sum == ids.size()) - return ResponseResult.success("已审批拒绝"); - return ResponseResult.error("审批失败"); + if (sum == ids.size()) + return ResponseResult.success("已审批通过"); + return ResponseResult.error("审批失败"); + } /** * 拒绝导入请求 + * @param map * @return 返回执行结果 * **/ - @ApiOperation(value = "审核通过") - @PostMapping("/accept") + @ApiOperation(value = "拒绝请求") + @PostMapping("/reject") @ApiImplicitParam(name = "ids", value = "申请审批的记录id", dataType = "List", defaultValue = "") - public ResponseResult acceptSubmit(@RequestBody Map map) { + public ResponseResult rejectSubmit(@RequestBody Map map) { System.out.println(map); List ids = new ArrayList<>(); - ids = (List) map.get("ids"); - DataSubmit dataSubmit = null; DataFile dataFile = new DataFile(); - DataFile new_dataFile = null; - FileToMenu fileToMenu = new FileToMenu(); int sum = 0; + ids = (List) map.get("ids"); for (int i = 0; i < ids.size(); i++) { Integer id = ids.get(i); - dataSubmit = dataSubmitService.queryById(id); - dataSubmit.setReviewTime(new Date()); - System.out.println(dataSubmit); - dataFile.setFileName(dataSubmit.getTitle()); - dataFile.setFilePath(dataSubmit.getPath()); - dataFile.setRegion(dataSubmit.getArea()); - dataFile.setFileYear(dataSubmit.getYear()); - dataFile.setFileDiscription(dataSubmit.getFileDiscription()); - dataFile.setFileNumbers(dataSubmit.getFileNumbers()); - dataFile.setFileSize(dataSubmit.getFileSize()); - dataFile.setFileSecurity(dataSubmit.getPlevel().toString()); - dataFile.setApprover(dataSubmit.getApprover()); - dataFile.setSubmitor(dataSubmit.getSubmitor()); - dataFile.setFileType(dataSubmit.getFileType()); - if (i != 0) { - dataFile.setId(dataFile.getId() + i); - } - int flag_file = dataFileService.insertDataFile(dataFile); - new_dataFile = dataFile; - System.out.println(new_dataFile); - fileToMenu.setFileId(new_dataFile.getId()); - fileToMenu.setMenuId(dataSubmit.getMenuid()); - int flag_filetomenu = fileToMenuService.insert(fileToMenu); - if (flag_file > 0 && flag_filetomenu > 0) { - if (dataSubmitService.acceptSubmit(dataSubmit) > 0) { - sum = sum + 1; - } + dataFile = dataFileService.queryById(id.longValue()); + dataFile.setStatus("审批拒绝"); + dataFile.setApproveTime(new Date()); + if (dataFileService.updatebyId(dataFile) > 0) { + String delFile = dataFile.getFilePath(); + FileUtil.deleteDir(delFile); + sum++; } } if (sum == ids.size()) - return ResponseResult.success("已审批通过"); + return ResponseResult.success("已审批拒绝"); return ResponseResult.error("审批失败"); } + + /** * @param page 页码 * @param results 每页显示条数 * @return 分页数据 * */ @ApiOperation(value = "所有待审核的数据") - @PostMapping("/approves") - public PageDataResult myAprroves(@ApiParam(value = "页码") Integer page, @ApiParam(value = "每页数据条数") Integer results) { + @PostMapping("/approvescommon") + public PageDataResult myAprroves(@ApiParam(value = "页码") Integer page, @ApiParam(value = "每页数据条数") Integer results,@ApiParam(value = "编目id") Integer menuid) { if (null == page || page <= 0) page = 1; if (null == results || results <= 0) results = 10; - DataSubmit ds = new DataSubmit(); - ds.setStatus(0); - List list = new ArrayList<>(); - list = dataSubmitService.selectReadyApprove(ds); - List list_new = new ArrayList<>(); - for (int i = 0; i < list.size(); i++) { - String menuName = dataMenuService.queryById(list.get(i).getMenuid()).getMenuName(); - list.get(i).setMenuName(menuName); - } - return new PageDataResult(dataSubmitService.countReadyApprove(ds), + DataFile ds = new DataFile(); + List list = new ArrayList<>(); + list = dataFileService.selectReadyApprove(ds); + return new PageDataResult(dataFileService.countReadyApprove(ds), list, (page - 1) * results); } + /** + * 根据目录节点id和文件视图对象查询文件 + * + * @param dataFile + * @return pdr + * 备注:无 + */ + @ApiOperation(value = "查询所有数据接口", notes = "至少传入page,和current两个参数") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "页码", paramType = "body", dataType = "Integer", required = true, defaultValue = "1"), + @ApiImplicitParam(name = "results", value = "每页数据条数", paramType = "body", dataType = "Integer", required = true, defaultValue = "10"), + @ApiImplicitParam(name = "fileName", value = "文件名称", paramType = "body", defaultValue = ""), + @ApiImplicitParam(name = "fileYear", value = "文件年份", paramType = "body", dataType = "Integer", defaultValue = ""), + @ApiImplicitParam(name = "fileType", value = "文件类型", paramType = "body", defaultValue = ""), + @ApiImplicitParam(name = "fileSecurity", value = "文件安全等级", paramType = "body", dataType = "Integer", defaultValue = ""), + @ApiImplicitParam(name = "region", value = "文件区域", paramType = "body", defaultValue = ""), + @ApiImplicitParam(name = "menuId", value = "目录节点", paramType = "body", dataType = "Integer", defaultValue = "") + }) + @PostMapping("/find") + public PageDataResult queryFilesByObj(@RequestBody DataFile dataFile) { + System.out.println(dataFile.getMenuId()); + Integer page = dataFile.getPage(); + Integer results = dataFile.getResults(); + + if (page == null || page <= 0) { + page = 1; + } + if (results == null || results <= 0) + results = 10; + + int offset = (page - 1) * results; + + return new PageDataResult(dataFileService.countFilesByObj(dataFile), + dataFileService.queryFilesByObj(offset, results, dataFile), + offset); + + } + /** * 提交数据 // * @param dataSubmit 数据信息 * @return 返回提交结果 * */ - @ApiOperation(value = "提交数据", notes = "id不传参数") + @ApiOperation(value = "提交数据") @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "记录id号(不传参)", paramType = "body", dataType = "Integer", required = false), - @ApiImplicitParam(name = "subtype", value = "提交类型", paramType = "body", dataType = "String", defaultValue = ""), @ApiImplicitParam(name = "fileType", value = "文件类型", paramType = "body", dataType = "String", defaultValue = ""), - @ApiImplicitParam(name = "plevel", value = "文件等级", paramType = "body", dataType = "Integer", defaultValue = ""), - @ApiImplicitParam(name = "status", value = "文件状态", paramType = "body", dataType = "Integer", defaultValue = ""), - @ApiImplicitParam(name = "submitor", value = "提交者", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "fileSecurity", value = "文件等级", paramType = "body", dataType = "Integer", defaultValue = ""), + @ApiImplicitParam(name = "region", value = "区域", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "fileTime", value = "文件年份", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "fileDiscription", value = "文件描述", paramType = "body", dataType = "String", defaultValue = ""), @ApiImplicitParam(name = "approver", value = "审核人", paramType = "body", dataType = "String", defaultValue = ""), - @ApiImplicitParam(name = "menuid", value = "编目号", paramType = "body", dataType = "Integer", defaultValue = ""), + @ApiImplicitParam(name = "menuId", value = "编目号", paramType = "body", dataType = "Integer", defaultValue = ""), @ApiImplicitParam(name = "menuName", value = "编目名称", paramType = "body", dataType = "String", defaultValue = ""), - @ApiImplicitParam(name = "year", value = "年份", paramType = "body", dataType = "Integer", defaultValue = ""), - @ApiImplicitParam(name = "title", value = "标题", paramType = "body", dataType = "String", defaultValue = ""), - @ApiImplicitParam(name = "area", value = "区域", paramType = "body", dataType = "String", defaultValue = ""), - @ApiImplicitParam(name = "path", value = "提交路径(不传参)", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "title", value = "文件标识", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "gcs", value = "图像地理坐标系", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "scanLevel", value = "图像级别(1-20)", paramType = "body", dataType = "Integer", defaultValue = ""), + @ApiImplicitParam(name = "scale", value = "图像比例尺", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "lan", value = "经度(左上)", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "lon", value = "纬度(左上)", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "fileConfig", value = "文件标识别,数据标识", paramType = "body", dataType = "String", defaultValue = ""), @ApiImplicitParam(name = "userId", value = "用户id", paramType = "body", dataType = "Integer"), }) - @PostMapping("/sub") - public ResponseResult DataSub(@RequestBody DataSubmit dataSubmit) { - String userId=dataSubmit.getUserId(); + @PostMapping("/subcommon") + public ResponseResult DataSub(@RequestBody DataFile dataFile) { + Integer userId=dataFile.getUserId(); String upCachePath=upLoadPath+"_user"+userId; - System.out.println("文件类型"+dataSubmit.getFileType()); + System.out.println("文件类型"+dataFile.getFileType()); String fileName = null; Integer count = 0; - dataSubmit.setSubtype("1"); - dataSubmit.setStatus(0); - dataSubmit.setApprover("审核人"); - if((adminUserService.getUserById(Integer.parseInt(userId)))!=null){ - dataSubmit.setSubmitor(adminUserService.getUserById(Integer.parseInt(userId)).getSysUserName()); + dataFile.setStatus("未审核"); + if((adminUserService.getUserById(userId))!=null){ + dataFile.setSubmitor(adminUserService.getUserById(userId).getSysUserName()); } - DataSubmit dataSubmit_new = dataSubmit; - DataSubmit dataSubmit_new2 = dataSubmit; - String path_move = dataMenuService.queryById(dataSubmit.getMenuid()).getUrl(); + DataFile dataFile_new = dataFile; + DataFile dataFile_new2 = dataFile; + String path_move = dataMenuService.queryById(dataFile.getMenuId().longValue()).getUrl(); // dataSubmit.setPath(path); File baseFile = new File(upCachePath); + if(baseFile==null){ + return ResponseResult.error("未上传文件"); + } File[] files = baseFile.listFiles(); File file = null; // List pathListNew = new ArrayList<>(); for (int i = 0; i < files.length; i++) { file = files[i]; if (file.isDirectory()) { - dataSubmit.setFileNumbers(FileUtil.getAllFile(upCachePath +File.separator+ file.getName()).size()); - dataSubmit.setFileSize(FileUtil.FormetFileSize(FileUtils.sizeOfDirectory(file))); + dataFile.setFileNumbers(FileUtil.getAllFile(upCachePath +File.separator+ file.getName()).size()); + dataFile.setFileSize(FileUtil.FormetFileSize(FileUtils.sizeOfDirectory(file))); fileName = FileUtil.getFileName(file.getName()); file.renameTo(new File(upCachePath +File.separator+ fileName)); } else { fileName = file.getName(); - dataSubmit.setFileSize(FileUtil.FormetFileSize(file.length())); - dataSubmit.setFileNumbers(1); + dataFile.setFileSize(FileUtil.FormetFileSize(file.length())); + dataFile.setFileNumbers(1); } - dataSubmit.setTitle(fileName); - String path = dataMenuService.queryById(dataSubmit.getMenuid()).getUrl()+File.separator+fileName; - dataSubmit.setPath(path); - dataSubmit.setSubtime(new Date()); - dataSubmit_new = dataSubmit; - if (dataSubmitService.insertDataSubmit(dataSubmit_new) >= 0) { + dataFile.setFileName(fileName); + String path = dataMenuService.queryById(dataFile.getMenuId().longValue()).getUrl()+File.separator+fileName; + dataFile.setFilePath(path); +// dataFile.setCreateTime(new Date()); + dataFile_new = dataFile; + if (dataFileService.insertDataFile(dataFile_new) >= 0) { count++; } - dataSubmit_new2 = dataSubmit_new; - dataSubmit_new2.setId(dataSubmit_new.getId() + i + 1); - dataSubmit_new.setId(dataSubmit_new2.getId()); + dataFile_new2 = dataFile_new; + dataFile_new2.setId(dataFile_new.getId() + i + 1); + dataFile_new.setId(dataFile_new2.getId()); } if (FileUtil.copyFolder(upCachePath, path_move) && count == files.length) { @@ -321,6 +338,149 @@ public class FileSubmitController { } + /** + * 目录/文件上传 + * @param file 目录,文件 + * @return 返回提交结果 + * */ + @ApiOperation(value = "文件上传") + @RequestMapping(value = "/updateFile", method = RequestMethod.POST) + @ApiImplicitParams({ + @ApiImplicitParam(name = "file", value = "文件夹下的文件list", paramType = "body", dataType = "List", defaultValue = ""), + @ApiImplicitParam(name = "fileId", value = "文件id", paramType = "body", dataType = "Integer"), + }) + public ResponseResult updateFile(@ApiParam(value = "二进制文件流") MultipartFile[] file,String fileId) { + String upCachePath = "/root/update/"+"file"+fileId; + String filepath = upCachePath; + String result = FileUtil.uploadFile(file, filepath); + if (!result.contains("上传失败")) + return ResponseResult.success(result); + return ResponseResult.error(result); + } + + + /** + * 下载文件文件,文件夹 + * + * @return String + */ + @ApiImplicitParams({ + @ApiImplicitParam(name = "fileIds", value = "文件id", paramType = "body", dataType = "List"), + }) + @GetMapping("/downloadMulFile") + public String downloadMulFile(String[] fileIds, HttpServletResponse response) { +// System.out.println(fileIds.length+"xxxxxxxxx"); + + if (fileIds.length == 1) { + Long fileId = Long.parseLong(fileIds[0]); + String fileName = dataFileService.queryById(fileId).getFileName(); +// String filePath = dataFileService.queryById(fileId).getFilePath() + File.separator + dataFileService.queryById(fileId).getFileName(); + String filePath = dataFileService.queryById(fileId).getFilePath(); + if (!FileUtil.isDirectory(filePath)) { + FileUtil.downloadFile(response, fileName, filePath); + } + } + + String message= null; + String directory = "/root/load"; + File directoryFile = new File(directory); + if (!directoryFile.isDirectory() && !directoryFile.exists()) { + directoryFile.mkdirs(); + } + //设置最终输出zip文件的目录+文件名 + String zipFileName = "已下载文件" + ".zip"; + String strZipPath = directory + "/" + zipFileName; + File zipFile = new File(strZipPath); + //读取需要压缩的文件 + Long fileId =null; + String fileName=null; + + List fileNames = new ArrayList<>(); + List filePaths = new ArrayList<>(); + for(int i=0;i stringList = FileUtil.getAllFile(fileName); + for (int j = 0; j < stringList.size(); j++) { + fileNames.add(stringList.get(j)); + filePaths.add(fileName.substring(0,fileName.lastIndexOf("/"))); +// filePaths.add(dataFileService.queryById(fileId).getFilePath()); + } + } else { + fileNames.add(fileName); + filePaths.add(fileName.substring(0,fileName.lastIndexOf("/"))); +// filePaths.add(dataFileService.queryById(fileId).getFilePath()); + } + } + } + + ZipOutputStream zipStream = null; + FileInputStream zipSource = null; + BufferedInputStream bufferStream = null; + try { + //构造最终压缩包的输出流 + zipStream = new ZipOutputStream(new FileOutputStream(zipFile)); + for (int i = 0; i < fileNames.size(); i++) { + //解码获取真实路径与文件名 +// String realFilePath = java.net.URLDecoder.decode(fileNames.get(i), "UTF-8"); + String realFilePath = fileNames.get(i); + System.out.println(realFilePath); + File file = new File(realFilePath); + //TODO:未对文件不存在时进行操作,后期优化。 + if (file.exists()) { + zipSource = new FileInputStream(file);//将需要压缩的文件格式化为输入流 + /** + * 压缩条目不是具体独立的文件,而是压缩包文件列表中的列表项,称为条目,就像索引一样这里的name就是文件名, + * 文件名和之前的重复就会导致文件被覆盖 + */ +// ZipEntry zipEntry = new ZipEntry("("+i+")"+fileNames.get(i).split("/")[fileNames.get(i).split("/").length-1]);//在压缩目录中文件的名字 + ZipEntry zipEntry = new ZipEntry(fileNames.get(i).replace(filePaths.get(i),""));//在压缩目录中文件的名字 + zipStream.putNextEntry(zipEntry);//定位该压缩条目位置,开始写入文件到压缩包中 + bufferStream = new BufferedInputStream(zipSource, 1024 * 10); + int read = 0; + byte[] buf = new byte[1024 * 10]; + while ((read = bufferStream.read(buf, 0, 1024 * 10)) != -1) { + zipStream.write(buf, 0, read); + } + }else{ + message=message+file.getName()+"不存在!"+"\n"; + System.out.println(file.getName()+"不存在!"); + } + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + //关闭流 + try { + if (null != bufferStream) bufferStream.close(); + if (null != zipStream) { + zipStream.flush(); + zipStream.close(); + } + if (null != zipSource) zipSource.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + //判断系统压缩文件是否存在:true-把该压缩文件通过流输出给客户端后删除该压缩文件 false-未处理 + if (zipFile.exists()) { + System.out.println(zipFileName); + System.out.println(strZipPath); + FileUtil.downloadFile(response, zipFileName, strZipPath); + FileUtil.deleteDir(directory); + } + if(message==null){ + message="全部文件下载成功!"; + } + return message; + + } + + + /** * 文件上传缓冲区清空 @@ -339,6 +499,24 @@ public class FileSubmitController { return ResponseResult.error("历史上传清空失败"); } + + /** + * 文件上传缓冲区清空 + * @return 返回文件清空结果 + * */ + @ApiOperation(value = "清空历史上传") + @RequestMapping(value = "/clearUpdateile", method = RequestMethod.POST) + @ApiImplicitParam(name = "userId", value = "当前用户id") + public ResponseResult clearUpdateile(String fileId) { + String upCachePath="/root/update/"+"file"+fileId; + FileUtil.deleteDir(upCachePath); + File file = new File(upCachePath); + if (!file.exists()) { + return ResponseResult.success("历史上传清空成功"); + } + return ResponseResult.error("历史上传清空失败"); + } + /** * 显示文件夹中文件详情 * @return 返回文件夹中文件结果 @@ -376,48 +554,332 @@ public class FileSubmitController { @ApiImplicitParam(name = "oldmenuid", value = "原编目号", paramType = "body", dataType = "Integer", defaultValue = ""), @ApiImplicitParam(name = "menuid", value = "编目号", paramType = "body", dataType = "Integer", defaultValue = ""), @ApiImplicitParam(name = "menuName", value = "编目名称", paramType = "body", dataType = "String", defaultValue = ""), - @ApiImplicitParam(name = "year", value = "年份", paramType = "body", dataType = "Integer", defaultValue = ""), - @ApiImplicitParam(name = "title", value = "标题", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "year", value = "文件数据年份", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "title", value = "文件数据名称", paramType = "body", dataType = "String", defaultValue = ""), + @ApiImplicitParam(name = "config", value = "文件数据标识", paramType = "body", dataType = "String", defaultValue = ""), @ApiImplicitParam(name = "area", value = "区域", paramType = "body", dataType = "String", defaultValue = ""), -// @ApiImplicitParam(name = "userId", value = "用户id", paramType = "body", dataType = "Integer"), + @ApiImplicitParam(name = "desciption", value = "描述", paramType = "body", dataType = "String", defaultValue = ""), }) @PostMapping("/update") public ResponseResult DataUpdate(@RequestBody Map map) { - Long id = (Long)map.get("id"); + + String updateCachePath = "/root/update/"+"file"+map.get("id"); + File updateCache = new File(updateCachePath); + if(updateCache.exists()){ + File[] files=updateCache.listFiles(); + if(files.length>1){ + return ResponseResult.error("上传文件或文件夹只允许一个,上传个数超出范围!"); + } + } + +// FileToMenu fileToMenu = new FileToMenu(); + Long id = ((Integer)map.get("id")).longValue(); + Long oldmenuid =((Integer)map.get("oldmenuid")).longValue(); + String year =(String) map.get("year"); + String area = (String)map.get("area"); + String fileType = (String)map.get("fileType"); + String plevel = ((Integer)map.get("plevel")).toString(); + String desciption = (String)map.get("desciption"); + String title = (String)map.get("title"); + String config = (String)map.get("config"); + Long menuid =null; + Boolean flag = true; + if(map.get("menuid")!=null) { + menuid = ((Integer) map.get("menuid")).longValue(); + } DataFile dataFile = dataFileService.queryById(id); - if((String)map.get("title")!=null){ - dataFile.setFileName((String)map.get("title")); + if(year!=null&&year!=dataFile.getFileTime()){ + dataFile.setFileTime(year); } - if((Integer)map.get("year")!=null){ - dataFile.setFileYear((Integer)map.get("year")); + if(config!=null&&config!=dataFile.getFileConfig()){ + dataFile.setFileConfig(config); } - if((String)map.get("area")!=null){ - dataFile.setRegion((String)map.get("area")); + if(area!=null&&area!=dataFile.getRegion()){ + dataFile.setRegion(area); } - if((String)map.get("fileType")!=null){ - dataFile.setFileType((String)map.get("fileType")); + if(fileType!=null&&fileType!=dataFile.getFileType()){ + dataFile.setFileType(fileType); } - if((String)map.get("plevel")!=null){ - dataFile.setFileSecurity((String)map.get("plevel")); + if(plevel!=null&&plevel!=dataFile.getFileSecurity()){ + dataFile.setFileSecurity(plevel); + } + if(desciption!=null){ + dataFile.setFileDiscription(desciption); } - if((Long)map.get("menuid")!=null){ - String old_menuPath = dataMenuService.queryById((Long)map.get("oldmenuid")).getUrl(); - String new_menuPath = dataMenuService.queryById((Long)map.get("menuid")).getUrl(); - if(FileUtil.copyFolder(dataFileService.queryById(id).getFilePath(),new_menuPath)){ - dataFile.setFilePath(dataFile.getFilePath().replace(old_menuPath,new_menuPath)); - } + String title_cmp = ""; + if(dataFile.getFileName().contains(".")){ + title_cmp=dataFile.getFileName().substring(0,dataFile.getFileName().lastIndexOf(".")); + } + if(title!=null&&(title!=dataFile.getFileName())&&title!=title_cmp){ + flag =false; + String filePath = dataFile.getFilePath(); + String old_filename =dataFile.getFileName(); + String new_filePath=filePath.replace(old_filename,(String)map.get("title")); + if(old_filename.contains(".")){ + new_filePath=new_filePath+old_filename.substring(old_filename.lastIndexOf(".")); + title=(title+old_filename.substring(old_filename.lastIndexOf("."))); + } + File file =new File(filePath); + flag = file.renameTo(new File(new_filePath)); + dataFile.setFileName(title); + dataFile.setFilePath(new_filePath); + } + if(flag){ + if(menuid!=null&&menuid!=oldmenuid){ + flag=false; + String new_menuPath = dataMenuService.queryById(menuid).getUrl()+File.separator+dataFile.getFileName(); + if(new_menuPath.contains(".")){ + new File(dataMenuService.queryById(menuid).getUrl()).mkdirs(); + }else { + FileUtil.makeDir(new_menuPath); + } + File file_mv = new File(dataFile.getFilePath()); + flag = file_mv.renameTo(new File(new_menuPath)); + if (flag) { + FileUtil.deleteDir(dataFile.getFilePath()); + dataFile.setFilePath(new_menuPath); +// fileToMenuService.deleteFtoM(oldmenuid,id); +// fileToMenu.setMenuId(menuid); +// fileToMenu.setFileId(id); +// fileToMenuService.insert(fileToMenu); + } + } } + if(updateCache.exists()&&flag==true){ + if(updateCache.listFiles().length==1){ + FileUtil.deleteDir(dataFile.getFilePath()); + File[] files=updateCache.listFiles(); + if(!files[0].isDirectory()){ + String path = dataFile.getFilePath(); + String old_name =dataFile.getFileName(); + if(dataFile.getFilePath().contains(".")){ + path = dataFile.getFilePath().substring(0,dataFile.getFilePath().lastIndexOf(".")); + old_name =dataFile.getFileName().substring(0,dataFile.getFileName().lastIndexOf(".")); + + } + System.out.println(path); + String file_append =files[0].getName().substring(files[0].getName().lastIndexOf(".")) ; + flag = files[0].renameTo(new File(path+file_append)); + dataFile.setFilePath(path+file_append); + dataFile.setFileName(old_name+file_append); + if(flag){ + dataFile.setFileSize(FileUtil.FormetFileSize(files[0].length())); + dataFile.setFileNumbers(1); + } + }else{ + if(dataFile.getFilePath().contains(".")){ + dataFile.setFilePath(dataFile.getFilePath().substring(0,dataFile.getFilePath().lastIndexOf("."))); + dataFile.setFileName(dataFile.getFileName().substring(0,dataFile.getFileName().lastIndexOf("."))); + } + flag = files[0].renameTo(new File(dataFile.getFilePath())); + if(flag){ + dataFile.setFileSize(FileUtil.FormetFileSize(FileUtils.sizeOfDirectory(new File(dataFile.getFilePath())))); + dataFile.setFileNumbers(FileUtil.getAllFile(dataFile.getFilePath()).size()); + } + } + FileUtil.deleteDir(updateCachePath); + } + } + if(dataFileService.updatebyId(dataFile)>0){ + return ResponseResult.success("信息修改成功"); + } + return ResponseResult.error("信息修改失败"); - return ResponseResult.error("表单信息提交失败!"); } + +// /** +// * @param page 页码 +// * @param results 每页显示条数 +// * @return 分页数据 +// * */ +// @ApiOperation(value = "所有待审核的数据") +// @PostMapping("/approves") +// public PageDataResult myAprroves(@ApiParam(value = "页码") Integer page, @ApiParam(value = "每页数据条数") Integer results) { +// if (null == page || page <= 0) +// page = 1; +// if (null == results || results <= 0) +// results = 10; +// DataSubmit ds = new DataSubmit(); +// ds.setStatus(0); +// List list = new ArrayList<>(); +// list = dataSubmitService.selectReadyApprove(ds); +// List list_new = new ArrayList<>(); +// for (int i = 0; i < list.size(); i++) { +// String menuName = dataMenuService.queryById(list.get(i).getMenuid()).getMenuName(); +// list.get(i).setMenuName(menuName); +// } +// return new PageDataResult(dataSubmitService.countReadyApprove(ds), +// list, (page - 1) * results); +// } + + +// /** +// * 提交数据 +// // * @param dataSubmit 数据信息 +// * @return 返回提交结果 +// * */ +// @ApiOperation(value = "提交数据", notes = "id不传参数") +// @ApiImplicitParams({ +// @ApiImplicitParam(name = "id", value = "记录id号(不传参)", paramType = "body", dataType = "Integer", required = false), +// @ApiImplicitParam(name = "subtype", value = "提交类型", paramType = "body", dataType = "String", defaultValue = ""), +// @ApiImplicitParam(name = "fileType", value = "文件类型", paramType = "body", dataType = "String", defaultValue = ""), +// @ApiImplicitParam(name = "plevel", value = "文件等级", paramType = "body", dataType = "Integer", defaultValue = ""), +// @ApiImplicitParam(name = "status", value = "文件状态", paramType = "body", dataType = "Integer", defaultValue = ""), +// @ApiImplicitParam(name = "submitor", value = "提交者", paramType = "body", dataType = "String", defaultValue = ""), +// @ApiImplicitParam(name = "approver", value = "审核人", paramType = "body", dataType = "String", defaultValue = ""), +// @ApiImplicitParam(name = "menuid", value = "编目号", paramType = "body", dataType = "Integer", defaultValue = ""), +// @ApiImplicitParam(name = "menuName", value = "编目名称", paramType = "body", dataType = "String", defaultValue = ""), +// @ApiImplicitParam(name = "year", value = "年份", paramType = "body", dataType = "Integer", defaultValue = ""), +// @ApiImplicitParam(name = "title", value = "标题", paramType = "body", dataType = "String", defaultValue = ""), +// @ApiImplicitParam(name = "area", value = "区域", paramType = "body", dataType = "String", defaultValue = ""), +// @ApiImplicitParam(name = "path", value = "提交路径(不传参)", paramType = "body", dataType = "String", defaultValue = ""), +// @ApiImplicitParam(name = "userId", value = "用户id", paramType = "body", dataType = "Integer"), +// }) +// @PostMapping("/sub") +// public ResponseResult DataSub(@RequestBody DataSubmit dataSubmit) { +// String userId=dataSubmit.getUserId(); +// String upCachePath=upLoadPath+"_user"+userId; +// System.out.println("文件类型"+dataSubmit.getFileType()); +// String fileName = null; +// Integer count = 0; +// dataSubmit.setSubtype("1"); +// dataSubmit.setStatus(0); +// dataSubmit.setApprover("审核人"); +// if((adminUserService.getUserById(Integer.parseInt(userId)))!=null){ +// dataSubmit.setSubmitor(adminUserService.getUserById(Integer.parseInt(userId)).getSysUserName()); +// } +// DataSubmit dataSubmit_new = dataSubmit; +// DataSubmit dataSubmit_new2 = dataSubmit; +// String path_move = dataMenuService.queryById(dataSubmit.getMenuid()).getUrl(); +//// dataSubmit.setPath(path); +// File baseFile = new File(upCachePath); +// File[] files = baseFile.listFiles(); +// File file = null; +//// List pathListNew = new ArrayList<>(); +// for (int i = 0; i < files.length; i++) { +// file = files[i]; +// if (file.isDirectory()) { +// dataSubmit.setFileNumbers(FileUtil.getAllFile(upCachePath +File.separator+ file.getName()).size()); +// dataSubmit.setFileSize(FileUtil.FormetFileSize(FileUtils.sizeOfDirectory(file))); +// fileName = FileUtil.getFileName(file.getName()); +// file.renameTo(new File(upCachePath +File.separator+ fileName)); +// } else { +// fileName = file.getName(); +// dataSubmit.setFileSize(FileUtil.FormetFileSize(file.length())); +// dataSubmit.setFileNumbers(1); +// } +// dataSubmit.setTitle(fileName); +// String path = dataMenuService.queryById(dataSubmit.getMenuid()).getUrl()+File.separator+fileName; +// dataSubmit.setPath(path); +// dataSubmit.setSubtime(new Date()); +// dataSubmit_new = dataSubmit; +// if (dataSubmitService.insertDataSubmit(dataSubmit_new) >= 0) { +// count++; +// } +// dataSubmit_new2 = dataSubmit_new; +// dataSubmit_new2.setId(dataSubmit_new.getId() + i + 1); +// dataSubmit_new.setId(dataSubmit_new2.getId()); +// } +// +// if (FileUtil.copyFolder(upCachePath, path_move) && count == files.length) { +// FileUtil.deleteDir(upCachePath); +// return ResponseResult.success("表单信息提交成功!"); +// } +// +// return ResponseResult.error("表单信息提交失败!"); +// } + + + // /** +// * 拒绝导入请求 +// * @param map +// * @return 返回执行结果 +// * **/ +// @ApiOperation(value = "拒绝请求") +// @PostMapping("/reject") +// @ApiImplicitParam(name = "ids", value = "申请审批的记录id", dataType = "List", defaultValue = "") +// public ResponseResult rejectSubmit(@RequestBody Map map) { +// List ids = new ArrayList<>(); +// ids = (List) map.get("ids"); +// DataSubmit dataSubmit = null; +// int sum = 0; +// for (int i = 0; i < ids.size(); i++) { +// Integer id = ids.get(i); +// dataSubmit = dataSubmitService.queryById(id); +// if (dataSubmitService.rejectSubmit(dataSubmit) > 0) { +//// String delFile = dataSubmit.getPath() + File.separator + dataSubmit.getTitle(); +// String delFile = dataSubmit.getPath() ; +// System.out.println(delFile); +// FileUtil.deleteDir(delFile); +// sum = sum + 1; +// } +// } +// if (sum == ids.size()) +// return ResponseResult.success("已审批拒绝"); +// return ResponseResult.error("审批失败"); +// } + +// /** +// * 拒绝导入请求 +// * @return 返回执行结果 +// * **/ +// @ApiOperation(value = "审核通过") +// @PostMapping("/accept") +// @ApiImplicitParam(name = "ids", value = "申请审批的记录id", dataType = "List", defaultValue = "") +// public ResponseResult acceptSubmit(@RequestBody Map map) { +// System.out.println(map); +// List ids = new ArrayList<>(); +// ids = (List) map.get("ids"); +// DataSubmit dataSubmit = null; +// DataFile dataFile = new DataFile(); +// DataFile new_dataFile = null; +// FileToMenu fileToMenu = new FileToMenu(); +// int sum = 0; +// for (int i = 0; i < ids.size(); i++) { +// Integer id = ids.get(i); +// dataSubmit = dataSubmitService.queryById(id); +// dataSubmit.setReviewTime(new Date()); +// System.out.println(dataSubmit); +// dataFile.setFileName(dataSubmit.getTitle()); +// dataFile.setFilePath(dataSubmit.getPath()); +// dataFile.setRegion(dataSubmit.getArea()); +//// dataFile.setFileYear(dataSubmit.getYear()); +// dataFile.setFileDiscription(dataSubmit.getFileDiscription()); +// dataFile.setFileNumbers(dataSubmit.getFileNumbers()); +// dataFile.setFileSize(dataSubmit.getFileSize()); +// dataFile.setFileSecurity(dataSubmit.getPlevel().toString()); +// dataFile.setApprover(dataSubmit.getApprover()); +// dataFile.setSubmitor(dataSubmit.getSubmitor()); +// dataFile.setFileType(dataSubmit.getFileType()); +// if (i != 0) { +// dataFile.setId(dataFile.getId() + i); +// } +// int flag_file = dataFileService.insertDataFile(dataFile); +// new_dataFile = dataFile; +// System.out.println(new_dataFile); +// fileToMenu.setFileId(new_dataFile.getId()); +// fileToMenu.setMenuId(dataSubmit.getMenuid()); +// int flag_filetomenu = fileToMenuService.insert(fileToMenu); +// if (flag_file > 0 && flag_filetomenu > 0) { +// if (dataSubmitService.acceptSubmit(dataSubmit) > 0) { +// sum = sum + 1; +// } +// } +// } +// if (sum == ids.size()) +// return ResponseResult.success("已审批通过"); +// return ResponseResult.error("审批失败"); +// } + + } diff --git a/src/main/java/com/cetc32/dh/controller/rest/VfileMenuController.java b/src/main/java/com/cetc32/dh/controller/rest/VfileMenuController.java index 6250e2c74d829479ab7913b8fdc4643c9b3f2c6d..0517807ab408621320c9d35c1878b8287798abc5 100644 --- a/src/main/java/com/cetc32/dh/controller/rest/VfileMenuController.java +++ b/src/main/java/com/cetc32/dh/controller/rest/VfileMenuController.java @@ -253,21 +253,37 @@ public class VfileMenuController { */ @ApiOperation(value = "查询所有区域", notes = "不需要传参数") @PostMapping("/AllRegion") + public ResponseResult distinctAllRegion() { List optionsList = optionsService.selectByCategory("region"); - List regionList = new ArrayList(); - for(int i=0;i resultList = new ArrayList(); - resultList.add("全部区域"); - for (int i = 0; i < regionList.size(); i++) { - resultList.add(regionList.get(i).toString()); + List hashMapList = new ArrayList<>(); + Map hashmap = new HashMap<>(); + hashmap.put("value", "全部区域"); + hashmap.put("label", "全部区域"); + hashMapList.add(hashmap); + for (int i = 0; i < optionsList.size(); i++) { + Map hashmap2 = new HashMap<>(); + hashmap2.put("value", optionsList.get(i).getValue()); + hashmap2.put("label", optionsList.get(i).getValueName()); + hashMapList.add(hashmap2); } - - return ResponseResult.success(resultList); + return ResponseResult.success(hashMapList); } +// public ResponseResult distinctAllRegion() { +// List optionsList = optionsService.selectByCategory("region"); +// List regionList = new ArrayList(); +// for(int i=0;i resultList = new ArrayList(); +// resultList.add("全部区域"); +// for (int i = 0; i < regionList.size(); i++) { +// resultList.add(regionList.get(i).toString()); +// } +// +// return ResponseResult.success(resultList); +// } diff --git a/src/main/java/com/cetc32/dh/entity/DataFile.java b/src/main/java/com/cetc32/dh/entity/DataFile.java index a7cccc60c577110611293bd543b8a17caf3a244c..c47e76fa9bbb69f663e9a680646b03d911a2d1c3 100644 --- a/src/main/java/com/cetc32/dh/entity/DataFile.java +++ b/src/main/java/com/cetc32/dh/entity/DataFile.java @@ -1,24 +1,10 @@ -/** - * Copyright(C): CETC-32 - * @Description: 数据管理文件实体 - * @author: youqing - * @version: 1.0 - * @date: 2020/9/11 10:55 - * 更改描述: - */ package com.cetc32.dh.entity; import java.util.Date; import javax.persistence.*; -/** - * @Title: DataFile - * @Description: 文件实体 - * @author: youqing - * @version: 1.0 - * @date: 2020/11/21 13:43 - */ + @Table(name = "data_file") -public class DataFile { +public class DataFile extends NumberS { /** * 无参构造函数 @@ -33,12 +19,22 @@ public class DataFile { * @param filePath * @param createTime * @param region - * @param fileYear + * @param fileTime + * @param gcs + * @param lan + * @param lon + * @param catagory + * @param scale + * @param scanLevel + * @param status + * @param menuId + * @param fileConfig + * @param approveTime * 有参构造函数 */ - public DataFile(Long id, String fileName, String fileType, String fileSecurity, String filePath, Date createTime, - String region, Integer fileYear, String fileSize, Integer fileNumbers, String fileDiscription, - String submitor, String approver){ + public DataFile(Long id, String fileName, String fileType, String fileSecurity, String filePath, Date createTime, String region, String fileTime, String fileSize, + Integer fileNumbers, String fileDiscription, String submitor, String approver, String gcs,Integer scanLevel,String scale,String lan,String lon, + String catagory,String status,Integer menuId, String fileConfig,Date approveTime){ this.id=id; this.fileName=fileName; this.fileType=fileType; @@ -46,63 +42,66 @@ public class DataFile { this.createTime=createTime; this.filePath=filePath; this.region=region; - this.fileYear=fileYear; + this.fileTime=fileTime; this.fileSize=fileSize; this.fileNumbers=fileNumbers; this.fileDiscription=fileDiscription; this.submitor=submitor; this.approver=approver; + this.gcs=gcs; + this.scale=scale; + this.scanLevel=scanLevel; + this.lan=lan; + this.lon=lon; + this.catagory=catagory; + this.status=status; + this.menuId=menuId; + this.fileConfig = fileConfig; + this.approveTime = approveTime; } - /** - * 文件(夹)id + * 数据id,文件(夹)id */ @Id private Long id; /** - * 文件(夹)所属年份 - */ - @Column(name = "file_year") - private Integer fileYear; - - /** - * 文件(夹)名字 + * 文件名称 */ @Column(name = "file_name") private String fileName; /** - * 文件(夹)类型 + * 数据类型,文件(夹)类型 */ @Column(name = "file_type") private String fileType; /** - * 文件(夹)安全等级 + * 数据安全等级,文件(夹)安全等级 */ @Column(name = "file_security") private String fileSecurity; /** - * 文件(夹)存放路径 + * 数据路径,文件(夹)存放路径 */ @Column(name = "file_path") private String filePath; /** - * 文件(夹)创建时间 + * 数据审批时间,文件(夹)创建时间 */ @Column(name = "create_time") private Date createTime; /** - * 文件(夹)所属区域 + * 数据区域,文件(夹)所属区域 */ private String region; /** - * 文件(夹)大小 + * 数据大小,文件(夹)大小 */ @Column(name = "file_size") private String fileSize; @@ -114,172 +113,253 @@ public class DataFile { private Integer fileNumbers; /** - * 文件(夹)描述 + * 数据描述,文件(夹)描述 */ @Column(name = "file_discription") private String fileDiscription; + /** + * 提交人 + */ private String submitor; + /** + * 审批人 + */ private String approver; /** - * 获取文件(夹)id + * 图像地理坐标系(北京54、西安80、WGS-84、2000国家大地坐标系) + */ + private String gcs; + + /** + * 图像级别(1-20) + */ + @Column(name = "scan_level") + private Integer scanLevel; + + /** + * 图像比例尺(1:10万 1:25万 1:50万 1:100万) + */ + private String scale; + + /** + * 经度(左上) + */ + private String lan; + + /** + * 纬度(左上) + */ + private String lon; + + /** + * 保留 + */ + private String catagory; + + /** + * 数据日期,文件(夹)所属年份 + */ + @Column(name = "file_time") + private String fileTime; + + /** + * 审核状态 + */ + private String status; + + /** + * 数据日期,文件(夹)所属年份 + */ + @Column(name = "menu_id") + private Integer menuId; + + /** + * 文件标识,数据标识 + */ + @Column(name = "file_config") + private String fileConfig; + + /** + * 文件、数据审批时间 + */ + @Column(name = "approve_time") + private Date approveTime; + + + Integer userId; + + + /** + * 获取数据id,文件(夹)id * - * @return id - 文件(夹)id + * @return id - 数据id,文件(夹)id */ public Long getId() { return id; } /** - * 设置文件(夹)id + * 设置数据id,文件(夹)id * - * @param id 文件(夹)id + * @param id 数据id,文件(夹)id */ public void setId(Long id) { this.id = id; } /** - * 获取文件(夹)所属年份 - * - * @return file_year - 文件(夹)所属年份 + * @return menuId */ - public Integer getFileYear() { - return fileYear; + public Integer getMenuId() { + return menuId; } /** - * 设置文件(夹)所属年份 - * - * @param fileYear 文件(夹)所属年份 + * @param menuId + */ + public void setMenuId(Integer menuId) { + this.menuId = menuId; + } + + + /** + * @return userId + */ + public Integer getUserId() { + return userId; + } + + /** + * @param userId */ - public void setFileYear(Integer fileYear) { - this.fileYear = fileYear; + public void setUserId(Integer userId) { + this.userId = userId; } /** - * 获取文件(夹)名字 + * 获取数据标识 ,文件名称 * - * @return file_name - 文件(夹)名字 + * @return file_name - 数据标识 ,文件名称 */ public String getFileName() { return fileName; } /** - * 设置文件(夹)名字 + * 设置数据标识 ,文件名称 * - * @param fileName 文件(夹)名字 + * @param fileName 数据标识 ,文件名称 */ public void setFileName(String fileName) { this.fileName = fileName == null ? null : fileName.trim(); } /** - * 获取文件(夹)类型 + * 获取数据类型,文件(夹)类型 * - * @return file_type - 文件(夹)类型 + * @return file_type - 数据类型,文件(夹)类型 */ public String getFileType() { return fileType; } /** - * 设置文件(夹)类型 + * 设置数据类型,文件(夹)类型 * - * @param fileType 文件(夹)类型 + * @param fileType 数据类型,文件(夹)类型 */ public void setFileType(String fileType) { this.fileType = fileType == null ? null : fileType.trim(); } /** - * 获取文件(夹)安全等级 + * 获取数据安全等级,文件(夹)安全等级 * - * @return file_security - 文件(夹)安全等级 + * @return file_security - 数据安全等级,文件(夹)安全等级 */ public String getFileSecurity() { return fileSecurity; } /** - * 设置文件(夹)安全等级 + * 设置数据安全等级,文件(夹)安全等级 * - * @param fileSecurity 文件(夹)安全等级 + * @param fileSecurity 数据安全等级,文件(夹)安全等级 */ public void setFileSecurity(String fileSecurity) { this.fileSecurity = fileSecurity == null ? null : fileSecurity.trim(); } /** - * 获取文件(夹)存放路径 + * 获取数据路径,文件(夹)存放路径 * - * @return file_path - 文件(夹)存放路径 + * @return file_path - 数据路径,文件(夹)存放路径 */ public String getFilePath() { return filePath; } /** - * 设置文件(夹)存放路径 + * 设置数据路径,文件(夹)存放路径 * - * @param filePath 文件(夹)存放路径 + * @param filePath 数据路径,文件(夹)存放路径 */ public void setFilePath(String filePath) { this.filePath = filePath == null ? null : filePath.trim(); } /** - * 获取文件(夹)创建时间 + * 获取数据审批时间,文件(夹)创建时间 * - * @return create_time - 文件(夹)创建时间 + * @return create_time - 数据审批时间,文件(夹)创建时间 */ public Date getCreateTime() { return createTime; } /** - * 设置文件(夹)创建时间 + * 设置数据审批时间,文件(夹)创建时间 * - * @param createTime 文件(夹)创建时间 + * @param createTime 数据审批时间,文件(夹)创建时间 */ public void setCreateTime(Date createTime) { this.createTime = createTime; } /** - * 获取文件(夹)所属区域 + * 获取数据区域,文件(夹)所属区域 * - * @return region - 文件(夹)所属区域 + * @return region - 数据区域,文件(夹)所属区域 */ public String getRegion() { return region; } /** - * 设置文件(夹)所属区域 + * 设置数据区域,文件(夹)所属区域 * - * @param region 文件(夹)所属区域 + * @param region 数据区域,文件(夹)所属区域 */ public void setRegion(String region) { this.region = region == null ? null : region.trim(); } /** - * 获取文件(夹)大小 + * 获取数据大小,文件(夹)大小 * - * @return file_size - 文件(夹)大小 + * @return file_size - 数据大小,文件(夹)大小 */ public String getFileSize() { return fileSize; } /** - * 设置文件(夹)大小 + * 设置数据大小,文件(夹)大小 * - * @param fileSize 文件(夹)大小 + * @param fileSize 数据大小,文件(夹)大小 */ public void setFileSize(String fileSize) { this.fileSize = fileSize == null ? null : fileSize.trim(); @@ -304,51 +384,238 @@ public class DataFile { } /** - * 获取文件(夹)描述 + * 获取数据描述,文件(夹)描述 * - * @return file_discription - 文件(夹)描述 + * @return file_discription - 数据描述,文件(夹)描述 */ public String getFileDiscription() { return fileDiscription; } /** - * 设置文件(夹)描述 + * 设置数据描述,文件(夹)描述 * - * @param fileDiscription 文件(夹)描述 + * @param fileDiscription 数据描述,文件(夹)描述 */ public void setFileDiscription(String fileDiscription) { this.fileDiscription = fileDiscription == null ? null : fileDiscription.trim(); } /** - * @return submitor + * 获取提交人 + * + * @return submitor - 提交人 */ public String getSubmitor() { return submitor; } /** - * @param submitor + * 设置提交人 + * + * @param submitor 提交人 */ public void setSubmitor(String submitor) { this.submitor = submitor == null ? null : submitor.trim(); } /** - * @return approver + * 获取审批人 + * + * @return approver - 审批人 */ public String getApprover() { return approver; } /** - * @param approver + * 设置审批人 + * + * @param approver 审批人 */ public void setApprover(String approver) { this.approver = approver == null ? null : approver.trim(); } + /** + * 获取图像地理坐标系(北京54、西安80、WGS-84、2000国家大地坐标系) + * + * @return gcs - 图像地理坐标系(北京54、西安80、WGS-84、2000国家大地坐标系) + */ + public String getGcs() { + return gcs; + } + + /** + * 设置图像地理坐标系(北京54、西安80、WGS-84、2000国家大地坐标系) + * + * @param gcs 图像地理坐标系(北京54、西安80、WGS-84、2000国家大地坐标系) + */ + public void setGcs(String gcs) { + this.gcs = gcs == null ? null : gcs.trim(); + } + + /** + * 获取图像级别(1-20) + * + * @return scan_level - 图像级别(1-20) + */ + public Integer getScanLevel() { + return scanLevel; + } + + /** + * 设置图像级别(1-20) + * + * @param scanLevel 图像级别(1-20) + */ + public void setScanLevel(Integer scanLevel) { + this.scanLevel = scanLevel; + } + + /** + * 获取图像比例尺(1:10万 1:25万 1:50万 1:100万) + * + * @return scale - 图像比例尺(1:10万 1:25万 1:50万 1:100万) + */ + public String getScale() { + return scale; + } + + /** + * 设置图像比例尺(1:10万 1:25万 1:50万 1:100万) + * + * @param scale 图像比例尺(1:10万 1:25万 1:50万 1:100万) + */ + public void setScale(String scale) { + this.scale = scale == null ? null : scale.trim(); + } + + /** + * 获取经度(左上) + * + * @return lan - 经度(左上) + */ + public String getLan() { + return lan; + } + + /** + * 设置经度(左上) + * + * @param lan 经度(左上) + */ + public void setLan(String lan) { + this.lan = lan == null ? null : lan.trim(); + } + + /** + * 获取纬度(左上) + * + * @return lon - 纬度(左上) + */ + public String getLon() { + return lon; + } + + /** + * 设置纬度(左上) + * + * @param lon 纬度(左上) + */ + public void setLon(String lon) { + this.lon = lon == null ? null : lon.trim(); + } + + /** + * 获取保留 + * + * @return catagory - 保留 + */ + public String getCatagory() { + return catagory; + } + + /** + * 设置保留 + * + * @param catagory 保留 + */ + public void setCatagory(String catagory) { + this.catagory = catagory == null ? null : catagory.trim(); + } + + /** + * 获取数据日期,文件(夹)所属年份 + * + * @return file_time - 数据日期,文件(夹)所属年份 + */ + public String getFileTime() { + return fileTime; + } + + /** + * 设置数据日期,文件(夹)所属年份 + * + * @param fileTime 数据日期,文件(夹)所属年份 + */ + public void setFileTime(String fileTime) { + this.fileTime = fileTime == null ? null : fileTime.trim(); + } + + /** + * 获取审核状态 + * + * @return status - 审核状态 + */ + public String getStatus() { + return status; + } + + /** + * 设置审核状态 + * + * @param status 审核状态 + */ + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + /** + * 获取文件标识,数据标识 + * + * @return file_config - 文件标识,数据标识 + */ + public String getFileConfig() { + return fileConfig; + } + + /** + * 设置数据标识,文件标识 + * + * @param fileConfig 数据标识,文件标识 + */ + public void setFileConfig(String fileConfig) { + this.fileConfig = fileConfig == null ? null : fileConfig.trim(); + } + + + /** + * 返回数据、文件审批时间 + * @return approve_time + */ + public Date getApproveTime() { + return approveTime; + } + + /** + * 获取文件数据审批时间 + * @param approveTime + */ + public void setApproveTime(Date approveTime) { + this.approveTime = approveTime; + } + /** * 返回文件实体类的字符串形式 */ diff --git a/src/main/java/com/cetc32/dh/entity/DataPlp.java b/src/main/java/com/cetc32/dh/entity/DataPlp.java new file mode 100644 index 0000000000000000000000000000000000000000..7318b4825cda94b597d89f3f4b3711e6f33d293c --- /dev/null +++ b/src/main/java/com/cetc32/dh/entity/DataPlp.java @@ -0,0 +1,453 @@ +package com.cetc32.dh.entity; + +import java.util.Date; +import javax.persistence.*; + +@Table(name = "data_plp") +public class DataPlp { + + /** + * 无参构造函数 + */ + public DataPlp(){ } + + /** + * @param id + * @param fileName + * @param fileType + * @param createTime + * @param region + * @param fileTime + * @param status + * @param fileConfig + * @param approveTime + * @param photoByte + * @param points + * @param approver + * @param reserver1 + * @param reserver2 + * @param userid + * @param security + * @param description + * 有参构造函数 + */ + public DataPlp(Integer id, String fileName, String fileType, String security, Date createTime, String region, String fileTime, + String description, Integer userid, String approver, String status, String fileConfig,Date approveTime, + String points,String reserver1,String reserver2,byte[] photoByte){ + this.id=id; + this.fileName=fileName; + this.fileType=fileType; + this.security=security; + this.createTime=createTime; + this.region=region; + this.fileTime=fileTime; + this.description=description; + this.userid=userid; + this.approver=approver; + this.status=status; + this.fileConfig = fileConfig; + this.approveTime = approveTime; + this.photoByte=photoByte; + this.points=points; + this.reserver1=reserver1; + this.reserver2=reserver2; + } + + /** + * 提交用户id + */ + private Integer userid; + + /** + * 数据类型-8:点,线:64,面:128 + */ + @Column(name = "file_type") + private String fileType; + + /** + * 点集wkt格式 + */ + private String points; + + /** + * 当前区域 + */ + private String region; + + /** + * 上传时间 + */ + @Column(name = "create_time") + private Date createTime; + + /** + * 数据描述 + */ + private String description; + + /** + * 预留字段1 + */ + private String reserver1; + + /** + * 预留字段2 + */ + private String reserver2; + + /** + * 唯一标识 + */ + private Integer id; + + /** + * 数据安全等级 + */ + private String security; + + /** + * 审核人 + */ + private String approver; + + /** + * 审核时间 + */ + @Column(name = "approve_time") + private Date approveTime; + + /** + * 审核状态 + */ + private String status; + + /** + * 数据标识 + */ + @Column(name = "file_config") + private String fileConfig; + + /** + * 数据名称 + */ + @Column(name = "file_name") + private String fileName; + + /** + * 数据所属年份 + */ + @Column(name = "file_time") + private String fileTime; + + /** + * 照片流 + */ + @Column(name = "photo_byte") + private byte[] photoByte; + + /** + * 获取提交用户id + * + * @return userid - 提交用户id + */ + public Integer getUserid() { + return userid; + } + + /** + * 设置提交用户id + * + * @param userid 提交用户id + */ + public void setUserid(Integer userid) { + this.userid = userid; + } + + /** + * 获取数据类型-8:点,线:64,面:128 + * + * @return file_type - 数据类型-8:点,线:64,面:128 + */ + public String getFileType() { + return fileType; + } + + /** + * 设置数据类型-8:点,线:64,面:128 + * + * @param fileType 数据类型-8:点,线:64,面:128 + */ + public void setFileType(String fileType) { + this.fileType = fileType == null ? null : fileType.trim(); + } + + /** + * 获取点集wkt格式 + * + * @return points - 点集wkt格式 + */ + public String getPoints() { + return points; + } + + /** + * 设置点集wkt格式 + * + * @param points 点集wkt格式 + */ + public void setPoints(String points) { + this.points = points == null ? null : points.trim(); + } + + /** + * 获取当前区域 + * + * @return region - 当前区域 + */ + public String getRegion() { + return region; + } + + /** + * 设置当前区域 + * + * @param region 当前区域 + */ + public void setRegion(String region) { + this.region = region == null ? null : region.trim(); + } + + /** + * 获取上传时间 + * + * @return create_time - 上传时间 + */ + public Date getCreateTime() { + return createTime; + } + + /** + * 设置上传时间 + * + * @param createTime 上传时间 + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * 获取数据描述 + * + * @return description - 数据描述 + */ + public String getDescription() { + return description; + } + + /** + * 设置数据描述 + * + * @param description 数据描述 + */ + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + /** + * 获取预留字段1 + * + * @return reserver1 - 预留字段1 + */ + public String getReserver1() { + return reserver1; + } + + /** + * 设置预留字段1 + * + * @param reserver1 预留字段1 + */ + public void setReserver1(String reserver1) { + this.reserver1 = reserver1 == null ? null : reserver1.trim(); + } + + /** + * 获取预留字段2 + * + * @return reserver2 - 预留字段2 + */ + public String getReserver2() { + return reserver2; + } + + /** + * 设置预留字段2 + * + * @param reserver2 预留字段2 + */ + public void setReserver2(String reserver2) { + this.reserver2 = reserver2 == null ? null : reserver2.trim(); + } + + /** + * 获取唯一标识 + * + * @return id - 唯一标识 + */ + public Integer getId() { + return id; + } + + /** + * 设置唯一标识 + * + * @param id 唯一标识 + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * 获取数据安全等级 + * + * @return security - 数据安全等级 + */ + public String getSecurity() { + return security; + } + + /** + * 设置数据安全等级 + * + * @param security 数据安全等级 + */ + public void setSecurity(String security) { + this.security = security == null ? null : security.trim(); + } + + /** + * 获取审核人 + * + * @return approver - 审核人 + */ + public String getApprover() { + return approver; + } + + /** + * 设置审核人 + * + * @param approver 审核人 + */ + public void setApprover(String approver) { + this.approver = approver == null ? null : approver.trim(); + } + + /** + * 获取审核时间 + * + * @return approve_time - 审核时间 + */ + public Date getApproveTime() { + return approveTime; + } + + /** + * 设置审核时间 + * + * @param approveTime 审核时间 + */ + public void setApproveTime(Date approveTime) { + this.approveTime = approveTime; + } + + /** + * 获取审核状态 + * + * @return status - 审核状态 + */ + public String getStatus() { + return status; + } + + /** + * 设置审核状态 + * + * @param status 审核状态 + */ + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + /** + * 获取数据标识 + * + * @return file_config - 数据标识 + */ + public String getFileConfig() { + return fileConfig; + } + + /** + * 设置数据标识 + * + * @param fileConfig 数据标识 + */ + public void setFileConfig(String fileConfig) { + this.fileConfig = fileConfig == null ? null : fileConfig.trim(); + } + + /** + * 获取数据名称 + * + * @return file_name - 数据名称 + */ + public String getFileName() { + return fileName; + } + + /** + * 设置数据名称 + * + * @param fileName 数据名称 + */ + public void setFileName(String fileName) { + this.fileName = fileName == null ? null : fileName.trim(); + } + + /** + * 获取数据所属年份 + * + * @return file_time - 数据所属年份 + */ + public String getFileTime() { + return fileTime; + } + + /** + * 设置数据所属年份 + * + * @param fileTime 数据所属年份 + */ + public void setFileTime(String fileTime) { + this.fileTime = fileTime == null ? null : fileTime.trim(); + } + + /** + * 获取照片流 + * + * @return photo_byte - 照片流 + */ + public byte[] getPhotoByte() { + return photoByte; + } + + /** + * 设置照片流 + * + * @param photoByte 照片流 + */ + public void setPhotoByte(byte[] photoByte) { + this.photoByte = photoByte; + } +} \ No newline at end of file diff --git a/src/main/java/com/cetc32/dh/entity/DataTrace.java b/src/main/java/com/cetc32/dh/entity/DataTrace.java new file mode 100644 index 0000000000000000000000000000000000000000..15723a47c6921feb06adf1cb8984640ef0039ab2 --- /dev/null +++ b/src/main/java/com/cetc32/dh/entity/DataTrace.java @@ -0,0 +1,580 @@ +package com.cetc32.dh.entity; + +import java.util.Date; +import javax.persistence.*; + +@Table(name = "data_trace") +public class DataTrace { + + /** + * 无参构造函数 + */ + public DataTrace(){ } + + /** + * @param id + * @param createTime + * @param fileTime + * @param status + * @param fileConfig + * @param approveTime + * @param points + * @param approver + * @param userid + * @param security + * @param description + * @param speed + * @param locsource + * @param deviceid + * @param direction + * @param lat + * @param linkid + * @param lon + * @param enccrylatitude + * @param encrylongitude + * @param flag + * 有参构造函数 + */ + public DataTrace(Integer id, String security, Date createTime, String fileTime, String description, Integer userid, String approver, String status, + String fileConfig,Date approveTime,String lat,String lon,Integer speed,Integer direction,Integer locsource,Integer coordinateerror, + String deviceid,Integer encrylongitude,Integer enccrylatitude,Boolean flag,String points,String linkid){ + this.id=id; + this.security=security; + this.createTime=createTime; + this.fileTime=fileTime; + this.description=description; + this.userid=userid; + this.approver=approver; + this.status=status; + this.fileConfig = fileConfig; + this.approveTime = approveTime; + this.points=points; + this.deviceid=deviceid; + this.enccrylatitude=enccrylatitude; + this.encrylongitude=encrylongitude; + this.flag=flag; + this.speed=speed; + this.direction=direction; + this.lat=lat; + this.lon=lon; + this.locsource=locsource; + this.coordinateerror=coordinateerror; + this.linkid=linkid; + } + + /** + * 纬度 + */ + private String lat; + + /** + * 经度 + */ + private String lon; + + /** + * 速度 + */ + private Integer speed; + + /** + * 方向 + */ + private Integer direction; + + /** + * 数据源 + */ + @Column(name = "locSource") + private Integer locsource; + + /** + * 精度 + */ + @Column(name = "coordinateError") + private Integer coordinateerror; + + /** + * 创建时间 + */ + @Column(name = "create_time") + private Date createTime; + + /** + * 设备ID + */ + @Column(name = "deviceId") + private String deviceid; + + /** + * 偏移经度 + */ + @Column(name = "encryLongitude") + private Integer encrylongitude; + + /** + * 偏移纬度 + */ + @Column(name = "enccryLatitude") + private Integer enccrylatitude; + + /** + * 点集wkt点位 + */ + private String points; + + /** + * 标志 + */ + private Boolean flag; + + /** + * linkID + */ + @Column(name = "linkID") + private String linkid; + + /** + * 用户ID + */ + private Integer userid; + + /** + * 唯一标识 + */ + private Integer id; + + /** + * 审核人 + */ + private String approver; + + /** + * 审核时间 + */ + @Column(name = "approve_time") + private Date approveTime; + + /** + * 审核状态 + */ + private String status; + + /** + * 数据标识 + */ + @Column(name = "file_config") + private String fileConfig; + + /** + * 数据所属时间 + */ + @Column(name = "file_time") + private String fileTime; + + /** + * 数据描述 + */ + private String description; + + /** + * 安全等级 + */ + private String security; + + /** + * 获取纬度 + * + * @return lat - 纬度 + */ + public String getLat() { + return lat; + } + + /** + * 设置纬度 + * + * @param lat 纬度 + */ + public void setLat(String lat) { + this.lat = lat == null ? null : lat.trim(); + } + + /** + * 获取经度 + * + * @return lon - 经度 + */ + public String getLon() { + return lon; + } + + /** + * 设置经度 + * + * @param lon 经度 + */ + public void setLon(String lon) { + this.lon = lon == null ? null : lon.trim(); + } + + /** + * 获取速度 + * + * @return speed - 速度 + */ + public Integer getSpeed() { + return speed; + } + + /** + * 设置速度 + * + * @param speed 速度 + */ + public void setSpeed(Integer speed) { + this.speed = speed; + } + + /** + * 获取方向 + * + * @return direction - 方向 + */ + public Integer getDirection() { + return direction; + } + + /** + * 设置方向 + * + * @param direction 方向 + */ + public void setDirection(Integer direction) { + this.direction = direction; + } + + /** + * 获取数据源 + * + * @return locSource - 数据源 + */ + public Integer getLocsource() { + return locsource; + } + + /** + * 设置数据源 + * + * @param locsource 数据源 + */ + public void setLocsource(Integer locsource) { + this.locsource = locsource; + } + + /** + * 获取精度 + * + * @return coordinateError - 精度 + */ + public Integer getCoordinateerror() { + return coordinateerror; + } + + /** + * 设置精度 + * + * @param coordinateerror 精度 + */ + public void setCoordinateerror(Integer coordinateerror) { + this.coordinateerror = coordinateerror; + } + + /** + * 获取创建时间 + * + * @return create_time - 创建时间 + */ + public Date getCreateTime() { + return createTime; + } + + /** + * 设置创建时间 + * + * @param createTime 创建时间 + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * 获取设备ID + * + * @return deviceId - 设备ID + */ + public String getDeviceid() { + return deviceid; + } + + /** + * 设置设备ID + * + * @param deviceid 设备ID + */ + public void setDeviceid(String deviceid) { + this.deviceid = deviceid == null ? null : deviceid.trim(); + } + + /** + * 获取偏移经度 + * + * @return encryLongitude - 偏移经度 + */ + public Integer getEncrylongitude() { + return encrylongitude; + } + + /** + * 设置偏移经度 + * + * @param encrylongitude 偏移经度 + */ + public void setEncrylongitude(Integer encrylongitude) { + this.encrylongitude = encrylongitude; + } + + /** + * 获取偏移纬度 + * + * @return enccryLatitude - 偏移纬度 + */ + public Integer getEnccrylatitude() { + return enccrylatitude; + } + + /** + * 设置偏移纬度 + * + * @param enccrylatitude 偏移纬度 + */ + public void setEnccrylatitude(Integer enccrylatitude) { + this.enccrylatitude = enccrylatitude; + } + + /** + * 获取点集wkt点位 + * + * @return points - 点集wkt点位 + */ + public String getPoints() { + return points; + } + + /** + * 设置点集wkt点位 + * + * @param points 点集wkt点位 + */ + public void setPoints(String points) { + this.points = points == null ? null : points.trim(); + } + + /** + * 获取标志 + * + * @return flag - 标志 + */ + public Boolean getFlag() { + return flag; + } + + /** + * 设置标志 + * + * @param flag 标志 + */ + public void setFlag(Boolean flag) { + this.flag = flag; + } + + /** + * 获取linkID + * + * @return linkID - linkID + */ + public String getLinkid() { + return linkid; + } + + /** + * 设置linkID + * + * @param linkid linkID + */ + public void setLinkid(String linkid) { + this.linkid = linkid == null ? null : linkid.trim(); + } + + /** + * 获取用户ID + * + * @return userid - 用户ID + */ + public Integer getUserid() { + return userid; + } + + /** + * 设置用户ID + * + * @param userid 用户ID + */ + public void setUserid(Integer userid) { + this.userid = userid; + } + + /** + * 获取唯一标识 + * + * @return id - 唯一标识 + */ + public Integer getId() { + return id; + } + + /** + * 设置唯一标识 + * + * @param id 唯一标识 + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * 获取审核人 + * + * @return approver - 审核人 + */ + public String getApprover() { + return approver; + } + + /** + * 设置审核人 + * + * @param approver 审核人 + */ + public void setApprover(String approver) { + this.approver = approver == null ? null : approver.trim(); + } + + /** + * 获取审核时间 + * + * @return approve_time - 审核时间 + */ + public Date getApproveTime() { + return approveTime; + } + + /** + * 设置审核时间 + * + * @param approveTime 审核时间 + */ + public void setApproveTime(Date approveTime) { + this.approveTime = approveTime; + } + + /** + * 获取审核状态 + * + * @return status - 审核状态 + */ + public String getStatus() { + return status; + } + + /** + * 设置审核状态 + * + * @param status 审核状态 + */ + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + /** + * 获取数据标识 + * + * @return file_config - 数据标识 + */ + public String getFileConfig() { + return fileConfig; + } + + /** + * 设置数据标识 + * + * @param fileConfig 数据标识 + */ + public void setFileConfig(String fileConfig) { + this.fileConfig = fileConfig == null ? null : fileConfig.trim(); + } + + /** + * 获取数据所属时间 + * + * @return file_time - 数据所属时间 + */ + public String getFileTime() { + return fileTime; + } + + /** + * 设置数据所属时间 + * + * @param fileTime 数据所属时间 + */ + public void setFileTime(String fileTime) { + this.fileTime = fileTime == null ? null : fileTime.trim(); + } + + /** + * 获取数据描述 + * + * @return description - 数据描述 + */ + public String getDiscription() { + return description; + } + + /** + * 设置数据描述 + * + * @param description 数据描述 + */ + public void setDiscription(String description) { + this.description = description == null ? null : description.trim(); + } + + /** + * 获取安全等级 + * + * @return security - 安全等级 + */ + public String getSecurity() { + return security; + } + + /** + * 设置安全等级 + * + * @param security 安全等级 + */ + public void setSecurity(String security) { + this.security = security == null ? null : security.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/cetc32/dh/entity/VfileMenu.java b/src/main/java/com/cetc32/dh/entity/VfileMenu.java index 045156a1771b6290aeab05051bb6392c0a3f1395..a743648a29a1b35e5031bc04310fa19755a0a148 100644 --- a/src/main/java/com/cetc32/dh/entity/VfileMenu.java +++ b/src/main/java/com/cetc32/dh/entity/VfileMenu.java @@ -1,31 +1,15 @@ - -/** - * Copyright(C): CETC-32 - * @Description: 文件目录视图 - * @author: youqing - * @version: 1.0 - * @date: 2020/9/11 10:55 - * 更改描述: - */ package com.cetc32.dh.entity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.StringUtils; - import java.util.Date; import javax.persistence.*; -/** - * @Title: RoleController - * @Description: 文件目录视图 - * @author: youqing - * @version: 1.0 - * @date: 2020/11/21 13:43 - */ @ApiModel("文件实体") @Table(name = "vfile_menu") public class VfileMenu extends NumberS{ + /** * 无参构造函数 */ @@ -39,13 +23,25 @@ public class VfileMenu extends NumberS{ * @param filePath * @param createTime * @param region - * @param fileYear + * @param fileTime * @param menuId + * @param scale + * @param scanLevel + * @param lan + * @param lon + * @param fileDiscription + * @param catagory + * @param gcs + * @param submitor + * @param fileNumbers + * @param fileSize + * @param approver + * @param status * 有参构造函数 */ - public VfileMenu( Long fileId, String fileName, String fileType, String fileSecurity, String filePath,Date createTime, - String region,Long menuId,Integer fileYear,String fileSize,Integer fileNumbers,String fileDiscription, - String submitor, String approver){ + public VfileMenu(Long fileId, String fileName, String fileType, String fileSecurity, String filePath, Date createTime, String region, Long menuId, + String fileTime, String fileSize, Integer fileNumbers, String fileDiscription, String submitor, String approver,String gcs,Integer scanLevel, + String scale,String lan,String lon, String catagory,String status){ this.fileId=fileId; this.fileName=fileName; this.fileType=fileType; @@ -54,83 +50,49 @@ public class VfileMenu extends NumberS{ this.createTime=createTime; this.region=region; this.menuId=menuId; - this.fileYear=fileYear; + this.fileTime=fileTime; this.fileSize=fileSize; this.fileNumbers=fileNumbers; this.fileDiscription=fileDiscription; this.submitor=submitor; this.approver=approver; + this.gcs=gcs; + this.scale=scale; + this.scanLevel=scanLevel; + this.lan=lan; + this.lon=lon; + this.catagory=catagory; } - /** - * 显示序号numberId - @ApiModelProperty(hidden = true) - private Integer numberId;*/ + @Column(name = "menu_id") + private Long menuId; - /** - * 文件fileId - */ - @ApiModelProperty(hidden = true) @Column(name = "file_id") private Long fileId; - /** - * 文件名字fileName - */ - @ApiModelProperty(value="文件名") @Column(name = "file_name") private String fileName; - /** - * 文件类型fileType - */ - @ApiModelProperty(value="文件类型") @Column(name = "file_type") private String fileType; - /** - * 文件安全等级fileSecurity - */ - @ApiModelProperty(value="文件安全等级") @Column(name = "file_security") private String fileSecurity; - /** - * 文件路径filePath - */ - @ApiModelProperty(hidden = true) @Column(name = "file_path") private String filePath; - /** - * 文件创建时间createTime - */ - @ApiModelProperty(hidden = true) @Column(name = "create_time") private Date createTime; - /** - * 文件区域region - */ - @ApiModelProperty(value="文件区域") - @Column(name = "region") private String region; - /** - * 文件(夹)大小 - */ @Column(name = "file_size") private String fileSize; - /** - * 文件夹中文件个数 - */ @Column(name = "file_numbers") private Integer fileNumbers; - /** - * 文件(夹)描述 - */ @Column(name = "file_discription") private String fileDiscription; @@ -138,27 +100,43 @@ public class VfileMenu extends NumberS{ private String approver; + private String gcs; + + @Column(name = "scan_level") + private Integer scanLevel; + + private String scale; + + private String lan; + + private String lon; + + private String catagory; + + @Column(name = "file_time") + private String fileTime; + + String status; + /** - * 目录节点menuId + * @return menu_id */ - @ApiModelProperty(value="目录节点") - @Column(name = "menu_id") - private Long menuId; + public Long getMenuId() { + return menuId; + } /** - * 文件年份fileYear + * @param menuId */ - @ApiModelProperty(value="文件年份") - @Column(name = "file_year") - private Integer fileYear; + public void setMenuId(Long menuId) { + this.menuId = menuId; + } /** * @return file_id */ public Long getFileId() { - if(null!=fileId) - return fileId; - return null; + return fileId; } /** @@ -172,8 +150,6 @@ public class VfileMenu extends NumberS{ * @return file_name */ public String getFileName() { - if(StringUtils.isBlank(fileName)) - return null; return fileName; } @@ -188,8 +164,6 @@ public class VfileMenu extends NumberS{ * @return file_type */ public String getFileType() { - if(StringUtils.isBlank(fileType)) - return null; return fileType; } @@ -204,8 +178,6 @@ public class VfileMenu extends NumberS{ * @return file_security */ public String getFileSecurity() { - if(StringUtils.isBlank(fileSecurity)) - return null; return fileSecurity; } @@ -220,9 +192,6 @@ public class VfileMenu extends NumberS{ * @return file_path */ public String getFilePath() { - - if(StringUtils.isBlank(filePath)) - return null; return filePath; } @@ -251,8 +220,6 @@ public class VfileMenu extends NumberS{ * @return region */ public String getRegion() { - if(StringUtils.isBlank(region)) - return null; return region; } @@ -264,100 +231,47 @@ public class VfileMenu extends NumberS{ } /** - * @return menu_id - */ - public Long getMenuId() { - return menuId; - } - - /** - * @param menuId - */ - public void setMenuId(Long menuId) { - this.menuId = menuId; - } - - /** - * @return file_year - */ - public Integer getFileYear() { - return fileYear; - } - - /** - * @param fileYear - */ - public void setFileYear(Integer fileYear) { - this.fileYear = fileYear; - } - /** - * @param f - */ - public void setFileYear(String f) { - try { - fileYear=Integer.valueOf(f); - }catch (Exception e){ - fileYear=null; - } - - } - - /** - * 获取文件(夹)大小 - * - * @return file_size - 文件(夹)大小 + * @return file_size */ public String getFileSize() { return fileSize; } /** - * 设置文件(夹)大小 - * - * @param fileSize 文件(夹)大小 + * @param fileSize */ public void setFileSize(String fileSize) { this.fileSize = fileSize == null ? null : fileSize.trim(); } /** - * 获取文件夹中文件个数 - * - * @return file_numbers - 文件夹中文件个数 + * @return file_numbers */ public Integer getFileNumbers() { return fileNumbers; } /** - * 设置文件夹中文件个数 - * - * @param fileNumbers 文件夹中文件个数 + * @param fileNumbers */ public void setFileNumbers(Integer fileNumbers) { this.fileNumbers = fileNumbers; } /** - * 获取文件(夹)描述 - * - * @return file_discription - 文件(夹)描述 + * @return file_discription */ public String getFileDiscription() { return fileDiscription; } /** - * 设置文件(夹)描述 - * - * @param fileDiscription 文件(夹)描述 + * @param fileDiscription */ public void setFileDiscription(String fileDiscription) { this.fileDiscription = fileDiscription == null ? null : fileDiscription.trim(); } - - /** * @return submitor */ @@ -387,16 +301,114 @@ public class VfileMenu extends NumberS{ } /** - * @return numberId - *//* - public Integer getNumberId() { - return super.numberId; + * @return gcs + */ + public String getGcs() { + return gcs; + } + + /** + * @param gcs + */ + public void setGcs(String gcs) { + this.gcs = gcs == null ? null : gcs.trim(); + } + + /** + * @return scan_level + */ + public Integer getScanLevel() { + return scanLevel; + } + + /** + * @param scanLevel + */ + public void setScanLevel(Integer scanLevel) { + this.scanLevel = scanLevel; } - *//** - * @param numberId - *//* - public void setNumberId(Integer numberId) { - this.numberId = numberId; - }*/ -} + /** + * @return scale + */ + public String getScale() { + return scale; + } + + /** + * @param scale + */ + public void setScale(String scale) { + this.scale = scale == null ? null : scale.trim(); + } + + /** + * @return lan + */ + public String getLan() { + return lan; + } + + /** + * @param lan + */ + public void setLan(String lan) { + this.lan = lan == null ? null : lan.trim(); + } + + /** + * @return lon + */ + public String getLon() { + return lon; + } + + /** + * @param lon + */ + public void setLon(String lon) { + this.lon = lon == null ? null : lon.trim(); + } + + /** + * @return catagory + */ + public String getCatagory() { + return catagory; + } + + /** + * @param catagory + */ + public void setCatagory(String catagory) { + this.catagory = catagory == null ? null : catagory.trim(); + } + + /** + * @return file_time + */ + public String getFileTime() { + return fileTime; + } + + /** + * @param fileTime + */ + public void setFileTime(String fileTime) { + this.fileTime = fileTime == null ? null : fileTime.trim(); + } + + /** + * @return status + */ + public String getStatus() { + return status; + } + + /** + * @param status + */ + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java b/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java index bf8d2ee2806031ec7198e51dc320251442a3dcfe..4497d0885c6ef0190c7900355008133cc95a308c 100644 --- a/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java +++ b/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java @@ -1,29 +1,17 @@ -/** - * Copyright(C): CETC-32 - * @Description: 数据管理文件数据库实体操作 - * @author: youqing - * @version: 1.0 - * @date: 2020/9/11 10:55 - * 更改描述: - */ package com.cetc32.dh.mybatis; import com.cetc32.dh.entity.DataFile; -import tk.mybatis.mapper.common.Mapper; +import com.cetc32.dh.entity.DataSubmit; +import com.cetc32.dh.entity.VfileMenu; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; +import tk.mybatis.mapper.common.Mapper; + import java.util.Date; import java.util.List; -/** - * @Title: DataFileMapper - * @Description: - * @author: youqing - * @version: 1.0 - * @date: 2020/11/21 11:19 - */ @Repository public interface DataFileMapper extends Mapper { - public Integer countAll(); public Integer insertOne(DataFile dataFile); @@ -40,6 +28,11 @@ public interface DataFileMapper extends Mapper { public List queryAllByFileSecurity(String fileSecurity); -// public List queryByFileStorageId(Long fileStorageId); + public List selectByStatusAndUser(DataFile dataFile); + + public Integer countByStatusAndUser(DataFile dataFile); + + public List queryFilesByObj(@Param("offset") Integer offset, @Param("limit") Integer limit, DataFile dataFile); + public Integer countFilesByObj(DataFile dataFile); } \ No newline at end of file diff --git a/src/main/java/com/cetc32/dh/mybatis/DataPlpMapper.java b/src/main/java/com/cetc32/dh/mybatis/DataPlpMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..5b401381d4dc6d24444dd9ecf684417aa99629ee --- /dev/null +++ b/src/main/java/com/cetc32/dh/mybatis/DataPlpMapper.java @@ -0,0 +1,35 @@ +package com.cetc32.dh.mybatis; + +import com.cetc32.dh.entity.DataFile; +import com.cetc32.dh.entity.DataPlp; +import org.apache.ibatis.annotations.Param; +import tk.mybatis.mapper.common.Mapper; + +import java.util.Date; +import java.util.List; + +public interface DataPlpMapper extends Mapper { + public Integer countAll(); + + public Integer insertOne(DataPlp dataPlp); + + public Integer updateById(DataPlp dataPlp); + + public Integer deleteById(Integer id); + + public DataPlp queryById(Integer id); + + public List queryByTime(Date time); + + public List queryByRegion(String region); + + public List queryAllByFileSecurity(String security); + + public List selectByStatusAndUser(DataPlp dataPlp); + + public Integer countByStatusAndUser(DataPlp dataPlp); + + public List queryFilesByObj(@Param("offset") Integer offset, @Param("limit") Integer limit, DataPlp dataPlp); + + public Integer countFilesByObj(DataPlp dataPlp); +} \ No newline at end of file diff --git a/src/main/java/com/cetc32/dh/mybatis/DataTraceMapper.java b/src/main/java/com/cetc32/dh/mybatis/DataTraceMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..8fc0e132fbdb37c163673cde328cf6c2307ff45b --- /dev/null +++ b/src/main/java/com/cetc32/dh/mybatis/DataTraceMapper.java @@ -0,0 +1,37 @@ +package com.cetc32.dh.mybatis; + +import com.cetc32.dh.entity.DataFile; +import com.cetc32.dh.entity.DataPlp; +import com.cetc32.dh.entity.DataTrace; +import org.apache.ibatis.annotations.Param; +import tk.mybatis.mapper.common.Mapper; + +import java.util.Date; +import java.util.List; + +public interface DataTraceMapper extends Mapper { + + public Integer countAll(); + + public Integer insertOne(DataTrace dataTrace); + + public Integer updateById(DataTrace dataTrace); + + public Integer deleteById(Integer id); + + public DataTrace queryById(Integer id); + + public List queryByTime(Date time); + + public List queryByRegion(String region); + + public List queryAllByFileSecurity(String security); + + public List selectByStatusAndUser(DataTrace dataTrace); + + public Integer countByStatusAndUser(DataTrace dataTrace); + + public List queryFilesByObj(@Param("offset") Integer offset, @Param("limit") Integer limit, DataTrace dataTrace); + + public Integer countFilesByObj(DataTrace dataTrace); +} \ No newline at end of file diff --git a/src/main/java/com/cetc32/dh/mybatis/FileToMenuMapper.java b/src/main/java/com/cetc32/dh/mybatis/FileToMenuMapper.java index 463441161af9fd1b9e2eff003c2e671819a825a4..fe028b84117e43af18bf27fc26e12205332555bb 100644 --- a/src/main/java/com/cetc32/dh/mybatis/FileToMenuMapper.java +++ b/src/main/java/com/cetc32/dh/mybatis/FileToMenuMapper.java @@ -28,4 +28,8 @@ public interface FileToMenuMapper extends Mapper { public List selectByMenuId(Long menuId); public int insert(FileToMenu fileToMenu); + + public FileToMenu selectByFileIdAndMenuId(Long menuId,Long fileId); + + public Integer deleteFtoM(Long menuId,Long fileId); } \ No newline at end of file diff --git a/src/main/java/com/cetc32/dh/mybatis/VfileMenuMapper.java b/src/main/java/com/cetc32/dh/mybatis/VfileMenuMapper.java index 2507efd667f188e27c6ad0437d54e7095ec71714..d6b18ca50a6b855fb06708629bf1f4b57653dd4b 100644 --- a/src/main/java/com/cetc32/dh/mybatis/VfileMenuMapper.java +++ b/src/main/java/com/cetc32/dh/mybatis/VfileMenuMapper.java @@ -1,31 +1,17 @@ -/** - * Copyright(C): CETC-32 - * @Description: 数据管理文件目录视图数据库实体操作 - * @author: youqing - * @version: 1.0 - * @date: 2020/9/11 10:55 - * 更改描述: - */ package com.cetc32.dh.mybatis; import com.cetc32.dh.entity.VfileMenu; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import tk.mybatis.mapper.common.Mapper; + import java.util.Date; import java.util.List; -/** - * @Title: VfileMenuMapper - * @Description: - * @author: youqing - * @version: 1.0 - * @date: 2020/11/21 11:19 - */ @Repository public interface VfileMenuMapper extends Mapper { - public List queryByFileSecurityAndMenuId(Long menuId,String fileSecurity); + public List queryByFileSecurityAndMenuId(Long menuId, String fileSecurity); public List queryFilesByMenuId(Long menuId); @@ -35,7 +21,7 @@ public interface VfileMenuMapper extends Mapper { public List queryFilesByChoose(String fileName, Integer fileYear,String region,String fileType,String fileSecurity); - public List queryFilesByObj(@Param("offset") Integer offset,@Param("limit") Integer limit,VfileMenu vfileMenu); + public List queryFilesByObj(@Param("offset") Integer offset, @Param("limit") Integer limit, VfileMenu vfileMenu); public Integer countFilesByObj(VfileMenu vfileMenu); @@ -43,6 +29,4 @@ public interface VfileMenuMapper extends Mapper { public List distinctAllRegion(); - - } \ No newline at end of file diff --git a/src/main/java/com/cetc32/dh/service/DataFileService.java b/src/main/java/com/cetc32/dh/service/DataFileService.java index 555f65052b34656564d7f9f6eda791aacff91adf..5b49c8d46c30e1ffb88f0149a8125149aef7e5fa 100644 --- a/src/main/java/com/cetc32/dh/service/DataFileService.java +++ b/src/main/java/com/cetc32/dh/service/DataFileService.java @@ -10,6 +10,9 @@ package com.cetc32.dh.service; import com.cetc32.dh.entity.DataFile; import com.cetc32.dh.entity.DataMenu; +import com.cetc32.dh.entity.DataSubmit; +import com.cetc32.dh.entity.VfileMenu; + import java.util.Date; import java.util.List; @@ -41,4 +44,13 @@ public interface DataFileService { public List queryByRegion(String region); public List queryAllByFileSecurity(String fileSecurity); + + public List selectReadyApprove(DataFile dataFile); + + public Integer countReadyApprove(DataFile dataFile); + + public List queryFilesByObj(Integer offset, Integer limit, DataFile dataFile); + + public Integer countFilesByObj(DataFile dataFile); + } diff --git a/src/main/java/com/cetc32/dh/service/FileToMenuService.java b/src/main/java/com/cetc32/dh/service/FileToMenuService.java index ae20213d37191c33bc589d43c9ae16cf6007e992..a91d2f90e5fe18945c839194c7a1d6e89c37c646 100644 --- a/src/main/java/com/cetc32/dh/service/FileToMenuService.java +++ b/src/main/java/com/cetc32/dh/service/FileToMenuService.java @@ -3,8 +3,14 @@ package com.cetc32.dh.service; import com.cetc32.dh.entity.FileToMenu; import org.springframework.stereotype.Repository; +import java.util.List; + @Repository public interface FileToMenuService { public int insert(FileToMenu fileToMenu); + + public FileToMenu selectByFileIdAndMenuId(Long menuId, Long fileId); + + public Integer deleteFtoM(Long menuId,Long fileId); } diff --git a/src/main/java/com/cetc32/dh/service/impl/DataFileServiceImpl.java b/src/main/java/com/cetc32/dh/service/impl/DataFileServiceImpl.java index bb69fef0073b9142ccd50728ba3ae000dd37bb86..077889f93801e84224d2f1b14e1d54969d9f0766 100644 --- a/src/main/java/com/cetc32/dh/service/impl/DataFileServiceImpl.java +++ b/src/main/java/com/cetc32/dh/service/impl/DataFileServiceImpl.java @@ -8,9 +8,7 @@ */ package com.cetc32.dh.service.impl; -import com.cetc32.dh.entity.DataFile; -import com.cetc32.dh.entity.DataMenu; -import com.cetc32.dh.entity.FileToMenu; +import com.cetc32.dh.entity.*; import com.cetc32.dh.mybatis.DataFileMapper; import com.cetc32.dh.service.DataFileService; import org.springframework.beans.factory.annotation.Autowired; @@ -140,4 +138,60 @@ public class DataFileServiceImpl implements DataFileService { return dataFileMapper.queryAllByFileSecurity(fileSecurity); } + /** + * 查询当前登陆用户需要审核的提交信息 + * + * @param dataFile 待查询的数据 + * @return 反馈查询到的结果 + **/ + @Override + public List selectReadyApprove(DataFile dataFile) { + + return dataFileMapper.selectByStatusAndUser(dataFile); + } + + /** + * 根据当前用户统计所有任务个数 + * + * @param dataFile 通常dataSubmit一次查询只包含submitor。 + * @return 反馈查询到的数据个数 + */ + @Override + public Integer countReadyApprove(DataFile dataFile) { + return dataFileMapper.countByStatusAndUser(dataFile); + } + + /**动态查询文件目录视图列表 + * @param offset + * @param limit + * @param dataFile + * @return List + */ + @Override + public List queryFilesByObj(Integer offset, Integer limit, DataFile dataFile){ + if(dataFile.getFileName()!=null){ + String fileName="%"+dataFile.getFileName()+"%"; + dataFile.setFileName(fileName); + } + if(dataFile.getRegion().equals("全部区域")){ + dataFile.setRegion(null); + } + if(dataFile.getFileType().equals("全部类型")){ + dataFile.setFileType(null); + } + return dataFileMapper.queryFilesByObj(offset,limit,dataFile); + } + + /**动态查询获取文件目录视图列表个数 + * @param dataFile + * @return Integer + */ + @Override + public Integer countFilesByObj(DataFile dataFile){ + return dataFileMapper.countFilesByObj(dataFile); + } + + + + } diff --git a/src/main/java/com/cetc32/dh/service/impl/FileToMenuServiceImpl.java b/src/main/java/com/cetc32/dh/service/impl/FileToMenuServiceImpl.java index 2f79e6c798aa70742344014d5241c31bb6eaeafc..4123f2d74ce67d6ffa43343554c161944269feda 100644 --- a/src/main/java/com/cetc32/dh/service/impl/FileToMenuServiceImpl.java +++ b/src/main/java/com/cetc32/dh/service/impl/FileToMenuServiceImpl.java @@ -6,6 +6,8 @@ import com.cetc32.dh.service.FileToMenuService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class FileToMenuServiceImpl implements FileToMenuService { @@ -16,4 +18,14 @@ public class FileToMenuServiceImpl implements FileToMenuService { public int insert(FileToMenu fileToMenu){ return fileToMenuMapper.insert(fileToMenu); } + + @Override + public FileToMenu selectByFileIdAndMenuId(Long menuId, Long fileId){ + return fileToMenuMapper.selectByFileIdAndMenuId(menuId,fileId); + } + + @Override + public Integer deleteFtoM(Long menuId,Long fileId){ + return fileToMenuMapper.deleteFtoM(menuId,fileId); + } } diff --git a/src/main/java/com/cetc32/dh/utils/FileUtil.java b/src/main/java/com/cetc32/dh/utils/FileUtil.java index 5c64aafc9deaf8fbe43785ab3f5683b8b79d2eae..d5b98a21b28d7895cba51144be771044974c5a54 100644 --- a/src/main/java/com/cetc32/dh/utils/FileUtil.java +++ b/src/main/java/com/cetc32/dh/utils/FileUtil.java @@ -52,7 +52,7 @@ public class FileUtil { * * @param filePath */ - private static void makeDir(String filePath) { + public static void makeDir(String filePath) { if (filePath.lastIndexOf('/') > 0) { String dirPath = filePath.substring(0, filePath.lastIndexOf('/')); File dir = new File(dirPath); diff --git a/src/main/resources/generator.xml b/src/main/resources/generator.xml index 9165c04cfdaa03f403ac6dd79ed7e34edb61fa6e..be6f924b0ff4f8a8167d5abfe5aa213c2f3dab8f 100644 --- a/src/main/resources/generator.xml +++ b/src/main/resources/generator.xml @@ -27,7 +27,7 @@ @@ -55,7 +55,7 @@ -
+
- - - + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - select * from data_file - where time= #{time,jdbcType=TIMESTAMP} - + - + - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/DataPlpMapper.xml b/src/main/resources/mapper/DataPlpMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..21a0c4e208c82c5871c02880503f6e200858b8bc --- /dev/null +++ b/src/main/resources/mapper/DataPlpMapper.xml @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into data_plp + + + + id, + + + + userid, + + + + file_type, + + + + points, + + + + region, + + + create_time, + + + description, + + + + security, + + + + + approver, + + + + approve_time, + + + + status, + + + + file_config, + + + + file_name, + + + + file_time, + + + + photo_byte, + + + + reserver1, + + + + reserver2, + + + + + + + + + #{id,jdbcType=INTEGER}, + + + + #{userid,jdbcType=INTEGER}, + + + + #{fileType ,jdbcType=VARCHAR}, + + + + #{points,jdbcType=VARCHAR}, + + + + #{region,jdbcType=VARCHAR}, + + + now(), + + + #{description,jdbcType=VARCHAR}, + + + + #{security,jdbcType=VARCHAR}, + + + + #{approver,jdbcType=VARCHAR}, + + + + #{approveTime,jdbcType=TIMESTAMP}, + + + + #{status,jdbcType=VARCHAR}, + + + + #{fileConfig,jdbcType=VARCHAR}, + + + + #{fileName,jdbcType=VARCHAR}, + + + + #{fileTime,jdbcType=VARCHAR}, + + + + #{photoByte,jdbcType=VARCHAR}, + + + + #{reserver1,jdbcType=VARCHAR}, + + + + #{reserver2,jdbcType=VARCHAR}, + + + + + + + + update data_plp + + + + #{userid,jdbcType=INTEGER}, + + + + #{fileType ,jdbcType=VARCHAR}, + + + + #{points,jdbcType=VARCHAR}, + + + + #{region,jdbcType=VARCHAR}, + + + + #{description,jdbcType=VARCHAR}, + + + + #{security,jdbcType=VARCHAR}, + + + + #{approver,jdbcType=VARCHAR}, + + + + #{status,jdbcType=VARCHAR}, + + + + #{fileConfig,jdbcType=VARCHAR}, + + + + #{fileName,jdbcType=VARCHAR}, + + + + #{fileTime,jdbcType=VARCHAR}, + + + + #{photoByte,jdbcType=VARCHAR}, + + + + #{reserver1,jdbcType=VARCHAR}, + + + + #{reserver2,jdbcType=VARCHAR}, + + + approve_time = now() + + + where id = #{id,jdbcType=INTEGER} + + + + + + delete from data_plp + where id = #{id,jdbcType=INTEGER} + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/DataTraceMapper.xml b/src/main/resources/mapper/DataTraceMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..9973d793398d1258f1a06b812c3a60f4b805f1f7 --- /dev/null +++ b/src/main/resources/mapper/DataTraceMapper.xml @@ -0,0 +1,383 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into data_trace + + + + id, + + + + userid, + + + + points, + + + create_time, + + + description, + + + + security, + + + + approver, + + + + approve_time, + + + + status, + + + + file_config, + + + + file_time, + + + + lat, + + + + lon, + + + + linkID, + + + + speed, + + + + direction, + + + + locSource, + + + + coordinateError, + + + + deviceId, + + + + encryLongitude, + + + + enccryLatitude, + + + + flag, + + + + + + + + + #{id,jdbcType=INTEGER}, + + + + #{userid,jdbcType=INTEGER}, + + + + #{points,jdbcType=VARCHAR}, + + + now(), + + + #{description,jdbcType=VARCHAR}, + + + + #{security,jdbcType=VARCHAR}, + + + + #{approver,jdbcType=VARCHAR}, + + + + #{approveTime,jdbcType=TIMESTAMP}, + + + + #{status,jdbcType=VARCHAR}, + + + + #{fileConfig,jdbcType=VARCHAR}, + + + + #{fileTime,jdbcType=VARCHAR}, + + + + #{lat,jdbcType=VARCHAR}, + + + + #{lon,jdbcType=VARCHAR}, + + + + #{linkID,jdbcType=VARCHAR}, + + + + #{speed,jdbcType=INTEGER}, + + + + #{direction,jdbcType=INTEGER}, + + + + #{locsource,jdbcType=INTEGER}, + + + + #{coordinateerror,jdbcType=INTEGER}, + + + + #{deviceid,jdbcType=VARCHAR}, + + + + #{encrylongitude,jdbcType=INTEGER}, + + + + #{enccrylatitude,jdbcType=INTEGER}, + + + + #{flag,jdbcType=BIT}, + + + + + + + + update data_trace + + + + #{userid,jdbcType=INTEGER}, + + + + #{points,jdbcType=VARCHAR}, + + + + #{description,jdbcType=VARCHAR}, + + + + #{security,jdbcType=VARCHAR}, + + + + #{approver,jdbcType=VARCHAR}, + + + + #{approveTime,jdbcType=TIMESTAMP}, + + + + #{status,jdbcType=VARCHAR}, + + + + #{fileConfig,jdbcType=VARCHAR}, + + + + #{fileTime,jdbcType=VARCHAR}, + + + + #{lat,jdbcType=VARCHAR}, + + + + #{lon,jdbcType=VARCHAR}, + + + + #{linkID,jdbcType=VARCHAR}, + + + + #{speed,jdbcType=INTEGER}, + + + + #{direction,jdbcType=INTEGER}, + + + + #{locsource,jdbcType=INTEGER}, + + + + #{coordinateerror,jdbcType=INTEGER}, + + + + #{deviceid,jdbcType=VARCHAR}, + + + + #{encrylongitude,jdbcType=INTEGER}, + + + + #{enccrylatitude,jdbcType=INTEGER}, + + + + #{flag,jdbcType=BIT}, + + + approve_time = now() + + + where id = #{id,jdbcType=INTEGER} + + + + + + delete from data_trace + where id = #{id,jdbcType=INTEGER} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/FileToMenuMapper.xml b/src/main/resources/mapper/FileToMenuMapper.xml index aabc0b603e344c1fc8b98236d16c39e345f78050..30f05bb3db6929722c047cfd950842753f2d6043 100644 --- a/src/main/resources/mapper/FileToMenuMapper.xml +++ b/src/main/resources/mapper/FileToMenuMapper.xml @@ -15,11 +15,16 @@ where file_id= #{fileId,jdbcType=BIGINT} - select * from file_to_menu where menu_id= #{menuId,jdbcType=BIGINT} + + insert into file_to_menu @@ -47,5 +52,10 @@ + + delete from file_to_menu + where menu_id= #{menuId} and file_id= #{fileId} + + \ No newline at end of file diff --git a/src/main/resources/mapper/VfileMenuMapper.xml b/src/main/resources/mapper/VfileMenuMapper.xml index 3a6f3d6ef8915a86cf030ae940726b3366c1043e..4869110f4b335c290d863d83490f70de1603a45a 100644 --- a/src/main/resources/mapper/VfileMenuMapper.xml +++ b/src/main/resources/mapper/VfileMenuMapper.xml @@ -1,27 +1,33 @@ - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + - + select * from vfile_menu + + + and menu_id = #{vfileMenu.menuId} + + + and file_name like #{vfileMenu.fileName} + + + and file_time = #{vfileMenu.fileTime} + + + and region = #{vfileMenu.region} + + + and file_type = #{vfileMenu.fileType} + + + and file_security = #{vfileMenu.fileSecurity} + + + and status = #{status} + + - LIMIT #{limit} OFFSET #{offset} - - + LIMIT #{limit} OFFSET #{offset} - + + + + - + select distinct file_time from vfile_menu - select distinct region from vfile_menu - - \ No newline at end of file