From a333338f6b988bf80a77f9d1c1e8d5fe557643fb Mon Sep 17 00:00:00 2001 From: root <123> Date: Thu, 3 Dec 2020 16:08:43 +0800 Subject: [PATCH 01/10] =?UTF-8?q?20201201=20=E6=95=B0=E7=AE=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/rest/FileSubmitController.java | 137 +++++++++++++++--- .../cetc32/dh/mybatis/FileToMenuMapper.java | 4 + .../cetc32/dh/service/FileToMenuService.java | 6 + .../service/impl/FileToMenuServiceImpl.java | 12 ++ .../java/com/cetc32/dh/utils/FileUtil.java | 2 +- .../resources/mapper/FileToMenuMapper.xml | 12 +- 6 files changed, 152 insertions(+), 21 deletions(-) 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 a21d66a..63e768d 100644 --- a/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java +++ b/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java @@ -25,6 +25,7 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.commons.io.FileUtils; +import org.bouncycastle.crypto.tls.SupplementalDataEntry; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; @@ -379,44 +380,142 @@ public class FileSubmitController { @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 = "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 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(); + Integer year =(Integer)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"); + 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.getFileYear()){ + dataFile.setFileYear(year); } - if((Integer)map.get("year")!=null){ - dataFile.setFileYear((Integer)map.get("year")); + if(area!=null&&area!=dataFile.getRegion()){ + dataFile.setRegion(area); } - if((String)map.get("area")!=null){ - dataFile.setRegion((String)map.get("area")); + if(fileType!=null&&fileType!=dataFile.getFileType()){ + dataFile.setFileType(fileType); } - if((String)map.get("fileType")!=null){ - dataFile.setFileType((String)map.get("fileType")); + if(plevel!=null&&plevel!=dataFile.getFileSecurity()){ + dataFile.setFileSecurity(plevel); } - if((String)map.get("plevel")!=null){ - dataFile.setFileSecurity((String)map.get("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("表单信息提交失败!"); } diff --git a/src/main/java/com/cetc32/dh/mybatis/FileToMenuMapper.java b/src/main/java/com/cetc32/dh/mybatis/FileToMenuMapper.java index 4634411..fe028b8 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/service/FileToMenuService.java b/src/main/java/com/cetc32/dh/service/FileToMenuService.java index ae20213..a91d2f9 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/FileToMenuServiceImpl.java b/src/main/java/com/cetc32/dh/service/impl/FileToMenuServiceImpl.java index 2f79e6c..4123f2d 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 5c64aaf..d5b98a2 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/mapper/FileToMenuMapper.xml b/src/main/resources/mapper/FileToMenuMapper.xml index aabc0b6..30f05bb 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 -- Gitee From ec269d17bcc3cd23e2d779d34c6461e11383547a Mon Sep 17 00:00:00 2001 From: root <123> Date: Thu, 3 Dec 2020 16:11:26 +0800 Subject: [PATCH 02/10] =?UTF-8?q?20201203=20=E6=95=B0=E7=AE=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cetc32/dh/controller/rest/FileSubmitController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 63e768d..dd688da 100644 --- a/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java +++ b/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java @@ -385,7 +385,7 @@ public class FileSubmitController { @PostMapping("/update") public ResponseResult DataUpdate(@RequestBody Map map) { - String updateCachePath = "/root/update"; + String updateCachePath = "/root/update/"+"file"+map.get("id"); File updateCache = new File(updateCachePath); if(updateCache.exists()){ File[] files=updateCache.listFiles(); -- Gitee From e6070b5fe91b53945128911506e974fb841019c5 Mon Sep 17 00:00:00 2001 From: root <123> Date: Thu, 3 Dec 2020 16:14:30 +0800 Subject: [PATCH 03/10] =?UTF-8?q?20201203=20=E6=95=B0=E7=AE=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cetc32/dh/controller/rest/FileSubmitController.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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 dd688da..21d0d21 100644 --- a/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java +++ b/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java @@ -14,18 +14,13 @@ 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.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; import io.swagger.annotations.ApiParam; import org.apache.commons.io.FileUtils; -import org.bouncycastle.crypto.tls.SupplementalDataEntry; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; @@ -512,7 +507,6 @@ public class FileSubmitController { if(dataFileService.updatebyId(dataFile)>0){ return ResponseResult.success("信息修改成功"); - } return ResponseResult.error("信息修改失败"); -- Gitee From 3d640e63936360c383633553c885e00afcaefe2b Mon Sep 17 00:00:00 2001 From: root <123> Date: Thu, 3 Dec 2020 17:05:11 +0800 Subject: [PATCH 04/10] =?UTF-8?q?20201203=E2=80=94=E2=80=94333=20=E6=95=B0?= =?UTF-8?q?=E7=AE=A1=E6=9B=B4=E6=96=B0=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/rest/FileSubmitController.java | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) 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 21d0d21..b31acb8 100644 --- a/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java +++ b/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java @@ -318,6 +318,28 @@ 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 返回文件清空结果 @@ -335,6 +357,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 返回文件夹中文件结果 @@ -387,7 +427,6 @@ public class FileSubmitController { if(files.length>1){ return ResponseResult.error("上传文件或文件夹只允许一个,上传个数超出范围!"); } - } FileToMenu fileToMenu = new FileToMenu(); @@ -502,7 +541,6 @@ public class FileSubmitController { } - } if(dataFileService.updatebyId(dataFile)>0){ -- Gitee From 96d08c3a9ead0c1db0ed723ca1525514a3636919 Mon Sep 17 00:00:00 2001 From: root <123> Date: Fri, 4 Dec 2020 10:50:15 +0800 Subject: [PATCH 05/10] =?UTF-8?q?20201204=E2=80=94=E2=80=94=E6=95=B0?= =?UTF-8?q?=E7=AE=A1datafile=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/rest/FileSubmitController.java | 8 +- .../java/com/cetc32/dh/entity/DataFile.java | 369 ------------------ .../com/cetc32/dh/mybatis/DataFileMapper.java | 45 --- src/main/resources/generator.xml | 4 +- src/main/resources/mapper/DataFileMapper.xml | 208 ---------- 5 files changed, 6 insertions(+), 628 deletions(-) delete mode 100644 src/main/java/com/cetc32/dh/entity/DataFile.java delete mode 100644 src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java delete mode 100644 src/main/resources/mapper/DataFileMapper.xml 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 b31acb8..73e2e9a 100644 --- a/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java +++ b/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java @@ -164,7 +164,7 @@ public class FileSubmitController { dataFile.setFileName(dataSubmit.getTitle()); dataFile.setFilePath(dataSubmit.getPath()); dataFile.setRegion(dataSubmit.getArea()); - dataFile.setFileYear(dataSubmit.getYear()); +// dataFile.setFileYear(dataSubmit.getYear()); dataFile.setFileDiscription(dataSubmit.getFileDiscription()); dataFile.setFileNumbers(dataSubmit.getFileNumbers()); dataFile.setFileSize(dataSubmit.getFileSize()); @@ -446,9 +446,9 @@ public class FileSubmitController { DataFile dataFile = dataFileService.queryById(id); - if(year!=null&&year!=dataFile.getFileYear()){ - dataFile.setFileYear(year); - } +// if(year!=null&&year!=dataFile.getFileYear()){ +// dataFile.setFileYear(year); +// } if(area!=null&&area!=dataFile.getRegion()){ dataFile.setRegion(area); } diff --git a/src/main/java/com/cetc32/dh/entity/DataFile.java b/src/main/java/com/cetc32/dh/entity/DataFile.java deleted file mode 100644 index a7cccc6..0000000 --- a/src/main/java/com/cetc32/dh/entity/DataFile.java +++ /dev/null @@ -1,369 +0,0 @@ -/** - * 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 DataFile(){ } - - /** - * @param id - * @param fileName - * @param fileType - * @param fileSecurity - * @param filePath - * @param createTime - * @param region - * @param fileYear - * 有参构造函数 - */ - 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){ - this.id=id; - this.fileName=fileName; - this.fileType=fileType; - this.fileSecurity=fileSecurity; - this.createTime=createTime; - this.filePath=filePath; - this.region=region; - this.fileYear=fileYear; - this.fileSize=fileSize; - this.fileNumbers=fileNumbers; - this.fileDiscription=fileDiscription; - this.submitor=submitor; - this.approver=approver; - } - - /** - * 文件(夹)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; - - /** - * 文件夹中文件个数 - */ - @Column(name = "file_numbers") - private Integer fileNumbers; - - /** - * 文件(夹)描述 - */ - @Column(name = "file_discription") - private String fileDiscription; - - private String submitor; - - private String approver; - - /** - * 获取文件(夹)id - * - * @return id - 文件(夹)id - */ - public Long getId() { - return id; - } - - /** - * 设置文件(夹)id - * - * @param id 文件(夹)id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * 获取文件(夹)所属年份 - * - * @return file_year - 文件(夹)所属年份 - */ - public Integer getFileYear() { - return fileYear; - } - - /** - * 设置文件(夹)所属年份 - * - * @param fileYear 文件(夹)所属年份 - */ - public void setFileYear(Integer fileYear) { - this.fileYear = fileYear; - } - - /** - * 获取文件(夹)名字 - * - * @return file_name - 文件(夹)名字 - */ - public String getFileName() { - return fileName; - } - - /** - * 设置文件(夹)名字 - * - * @param fileName 文件(夹)名字 - */ - public void setFileName(String fileName) { - this.fileName = fileName == null ? null : fileName.trim(); - } - - /** - * 获取文件(夹)类型 - * - * @return file_type - 文件(夹)类型 - */ - public String getFileType() { - return fileType; - } - - /** - * 设置文件(夹)类型 - * - * @param fileType 文件(夹)类型 - */ - public void setFileType(String fileType) { - this.fileType = fileType == null ? null : fileType.trim(); - } - - /** - * 获取文件(夹)安全等级 - * - * @return file_security - 文件(夹)安全等级 - */ - public String getFileSecurity() { - return fileSecurity; - } - - /** - * 设置文件(夹)安全等级 - * - * @param fileSecurity 文件(夹)安全等级 - */ - public void setFileSecurity(String fileSecurity) { - this.fileSecurity = fileSecurity == null ? null : fileSecurity.trim(); - } - - /** - * 获取文件(夹)存放路径 - * - * @return file_path - 文件(夹)存放路径 - */ - public String getFilePath() { - return filePath; - } - - /** - * 设置文件(夹)存放路径 - * - * @param filePath 文件(夹)存放路径 - */ - public void setFilePath(String filePath) { - this.filePath = filePath == null ? null : filePath.trim(); - } - - /** - * 获取文件(夹)创建时间 - * - * @return create_time - 文件(夹)创建时间 - */ - public Date getCreateTime() { - return createTime; - } - - /** - * 设置文件(夹)创建时间 - * - * @param createTime 文件(夹)创建时间 - */ - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - /** - * 获取文件(夹)所属区域 - * - * @return region - 文件(夹)所属区域 - */ - public String getRegion() { - return region; - } - - /** - * 设置文件(夹)所属区域 - * - * @param region 文件(夹)所属区域 - */ - public void setRegion(String region) { - this.region = region == null ? null : region.trim(); - } - - /** - * 获取文件(夹)大小 - * - * @return file_size - 文件(夹)大小 - */ - public String getFileSize() { - return fileSize; - } - - /** - * 设置文件(夹)大小 - * - * @param fileSize 文件(夹)大小 - */ - public void setFileSize(String fileSize) { - this.fileSize = fileSize == null ? null : fileSize.trim(); - } - - /** - * 获取文件夹中文件个数 - * - * @return file_numbers - 文件夹中文件个数 - */ - public Integer getFileNumbers() { - return fileNumbers; - } - - /** - * 设置文件夹中文件个数 - * - * @param fileNumbers 文件夹中文件个数 - */ - public void setFileNumbers(Integer fileNumbers) { - this.fileNumbers = fileNumbers; - } - - /** - * 获取文件(夹)描述 - * - * @return file_discription - 文件(夹)描述 - */ - public String getFileDiscription() { - return fileDiscription; - } - - /** - * 设置文件(夹)描述 - * - * @param fileDiscription 文件(夹)描述 - */ - public void setFileDiscription(String fileDiscription) { - this.fileDiscription = fileDiscription == null ? null : fileDiscription.trim(); - } - - /** - * @return submitor - */ - public String getSubmitor() { - return submitor; - } - - /** - * @param submitor - */ - public void setSubmitor(String submitor) { - this.submitor = submitor == null ? null : submitor.trim(); - } - - /** - * @return approver - */ - public String getApprover() { - return approver; - } - - /** - * @param approver - */ - public void setApprover(String approver) { - this.approver = approver == null ? null : approver.trim(); - } - - /** - * 返回文件实体类的字符串形式 - */ - public String toString() { - return "{" + - "id=" + id +'\'' + - "fileName=" + fileName +'\''+ - ", fileType='" + fileType + '\'' + - ", fileSecurity=" + fileSecurity+'\'' + - ", filePath=" + filePath +'\'' + - ", createTime=" + createTime +'\'' + - ", region=" + region +'\'' + - ", fileSize=" + fileSize +'\'' + - ", fileNumbers=" + fileNumbers +'\'' + - ", fileDiscription=" + fileDiscription + - '}'; - } -} \ 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 deleted file mode 100644 index bf8d2ee..0000000 --- a/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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 org.springframework.stereotype.Repository; -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); - - public Integer updateById(DataFile dataFile); - - public Integer deleteById(Long id); - - public DataFile queryById(Long id); - - public List queryByTime(Date time); - - public List queryByRegion(String region); - - public List queryAllByFileSecurity(String fileSecurity); - -// public List queryByFileStorageId(Long fileStorageId); - -} \ No newline at end of file diff --git a/src/main/resources/generator.xml b/src/main/resources/generator.xml index 9165c04..c4ae906 100644 --- a/src/main/resources/generator.xml +++ b/src/main/resources/generator.xml @@ -27,7 +27,7 @@ @@ -55,7 +55,7 @@ -
+
- - - - - - - - - - - - - - - - - - - - - - - insert into data_file - - - - id, - - - - file_name, - - - - file_type, - - - - file_security, - - - - file_path, - - - create_time, - - - region, - - - - file_year, - - - - file_size, - - - - file_numbers, - - - - file_discription, - - - - approver, - - - - submitor, - - - - - - - - - #{id,jdbcType=BIGINT}, - - - - #{fileName ,jdbcType=VARCHAR}, - - - - #{fileType,jdbcType=VARCHAR}, - - - - #{fileSecurity,jdbcType=VARCHAR}, - - - - #{filePath,jdbcType=VARCHAR}, - - - now(), - - - #{region,jdbcType=VARCHAR}, - - - - #{fileYear,jdbcType=INTEGER}, - - - - #{fileSize,jdbcType=VARCHAR}, - - - - #{fileNumbers,jdbcType=INTEGER}, - - - - #{fileDiscription,jdbcType=VARCHAR}, - - - - #{approver,jdbcType=VARCHAR}, - - - - #{submitor,jdbcType=VARCHAR}, - - - - - - - - update data_file - - - file_name = #{fileName,jdbcType=VARCHAR}, - - - file_type = #{fileType,jdbcType=VARCHAR}, - - - file_security = #{fileSecurity,jdbcType=VARCHAR}, - - - file_path = #{filePath,jdbcType=VARCHAR}, - - - region = #{region,jdbcType=VARCHAR}, - - - file_year = #{fileYear,jdbcType=INTEGER}, - - - file_size = #{fileSize,jdbcType=VARCHAR}, - - - file_numbers = #{fileNumbers,jdbcType=INTEGER}, - - - file_discription = #{fileDiscription,jdbcType=VARCHAR}, - - - approver = #{approver,jdbcType=VARCHAR}, - - - - submitor = #{submitor,jdbcType=VARCHAR}, - - - - where id = #{id,jdbcType=BIGINT} - - - - - - delete from data_file - where id = #{id,jdbcType=BIGINT} - - - - - - - - - - \ No newline at end of file -- Gitee From 39648047c0b9bf43df1a7579ff5314eaa6973b51 Mon Sep 17 00:00:00 2001 From: root <123> Date: Fri, 4 Dec 2020 11:27:03 +0800 Subject: [PATCH 06/10] =?UTF-8?q?20201204=E2=80=94=E2=80=94=E6=95=B0?= =?UTF-8?q?=E7=AE=A1vfile=5Fmenu=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/{VfileMenu.java => DataFile.java} | 441 +++++++++++------- .../com/cetc32/dh/mybatis/DataFileMapper.java | 27 ++ .../cetc32/dh/mybatis/VfileMenuMapper.java | 48 -- src/main/resources/generator.xml | 2 +- src/main/resources/mapper/DataFileMapper.xml | 273 +++++++++++ src/main/resources/mapper/VfileMenuMapper.xml | 128 ----- 6 files changed, 580 insertions(+), 339 deletions(-) rename src/main/java/com/cetc32/dh/entity/{VfileMenu.java => DataFile.java} (36%) create mode 100644 src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java delete mode 100644 src/main/java/com/cetc32/dh/mybatis/VfileMenuMapper.java create mode 100644 src/main/resources/mapper/DataFileMapper.xml delete mode 100644 src/main/resources/mapper/VfileMenuMapper.xml diff --git a/src/main/java/com/cetc32/dh/entity/VfileMenu.java b/src/main/java/com/cetc32/dh/entity/DataFile.java similarity index 36% rename from src/main/java/com/cetc32/dh/entity/VfileMenu.java rename to src/main/java/com/cetc32/dh/entity/DataFile.java index 045156a..1b6ce8b 100644 --- a/src/main/java/com/cetc32/dh/entity/VfileMenu.java +++ b/src/main/java/com/cetc32/dh/entity/DataFile.java @@ -1,123 +1,99 @@ - -/** - * 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{ +@Table(name = "data_file") +public class DataFile { + /** * 无参构造函数 */ - public VfileMenu(){ } + public DataFile(){ } /** - * @param fileId + * @param id * @param fileName * @param fileType * @param fileSecurity * @param filePath * @param createTime * @param region - * @param fileYear - * @param menuId + * @param fileTime + * @param gcs + * @param lan + * @param lon + * @param catagory + * @param scale + * @param scanLevel * 有参构造函数 */ - 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){ - this.fileId=fileId; + 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 ){ + this.id=id; this.fileName=fileName; this.fileType=fileType; this.fileSecurity=fileSecurity; - this.filePath=filePath; this.createTime=createTime; + this.filePath=filePath; 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;*/ - /** - * 文件fileId + * 数据id,文件(夹)id */ - @ApiModelProperty(hidden = true) - @Column(name = "file_id") - private Long fileId; + @Id + private Long id; /** - * 文件名字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; @@ -129,192 +105,197 @@ public class VfileMenu extends NumberS{ private Integer fileNumbers; /** - * 文件(夹)描述 + * 数据描述,文件(夹)描述 */ @Column(name = "file_discription") private String fileDiscription; + /** + * 提交人 + */ private String submitor; + /** + * 审批人 + */ private String approver; /** - * 目录节点menuId + * 图像地理坐标系(北京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万) */ - @ApiModelProperty(value="目录节点") - @Column(name = "menu_id") - private Long menuId; + private String scale; /** - * 文件年份fileYear + * 经度(左上) */ - @ApiModelProperty(value="文件年份") - @Column(name = "file_year") - private Integer fileYear; + private String lan; /** - * @return file_id + * 纬度(左上) */ - public Long getFileId() { - if(null!=fileId) - return fileId; - return null; + private String lon; + + /** + * 保留 + */ + private String catagory; + + /** + * 数据日期,文件(夹)所属年份 + */ + @Column(name = "file_time") + private String fileTime; + + /** + * 获取数据id,文件(夹)id + * + * @return id - 数据id,文件(夹)id + */ + public Long getId() { + return id; } /** - * @param fileId + * 设置数据id,文件(夹)id + * + * @param id 数据id,文件(夹)id */ - public void setFileId(Long fileId) { - this.fileId = fileId; + public void setId(Long id) { + this.id = id; } /** - * @return file_name + * 获取数据标识 ,文件名称 + * + * @return file_name - 数据标识 ,文件名称 */ public String getFileName() { - if(StringUtils.isBlank(fileName)) - return null; 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() { - if(StringUtils.isBlank(fileType)) - return null; 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() { - if(StringUtils.isBlank(fileSecurity)) - return null; 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() { - - if(StringUtils.isBlank(filePath)) - return null; 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() { - if(StringUtils.isBlank(region)) - return null; return region; } /** - * @param region + * 设置数据区域,文件(夹)所属区域 + * + * @param region 数据区域,文件(夹)所属区域 */ public void setRegion(String region) { this.region = region == null ? null : region.trim(); } /** - * @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(); @@ -339,64 +320,200 @@ public class VfileMenu extends NumberS{ } /** - * 获取文件(夹)描述 + * 获取数据描述,文件(夹)描述 * - * @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(); } /** - * @return numberId - *//* - public Integer getNumberId() { - return super.numberId; + * 获取图像地理坐标系(北京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(); } - *//** - * @param numberId - *//* - public void setNumberId(Integer numberId) { - this.numberId = numberId; - }*/ -} + /** + * 获取经度(左上) + * + * @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(); + } + + /** + * 返回文件实体类的字符串形式 + */ + public String toString() { + return "{" + + "id=" + id +'\'' + + "fileName=" + fileName +'\''+ + ", fileType='" + fileType + '\'' + + ", fileSecurity=" + fileSecurity+'\'' + + ", filePath=" + filePath +'\'' + + ", createTime=" + createTime +'\'' + + ", region=" + region +'\'' + + ", fileSize=" + fileSize +'\'' + + ", fileNumbers=" + fileNumbers +'\'' + + ", fileDiscription=" + fileDiscription + + '}'; + } +} \ 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 new file mode 100644 index 0000000..6d57b90 --- /dev/null +++ b/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java @@ -0,0 +1,27 @@ +package com.cetc32.dh.mybatis; + +import com.cetc32.dh.entity.DataFile; +import org.springframework.stereotype.Repository; +import tk.mybatis.mapper.common.Mapper; + +import java.util.Date; +import java.util.List; + +@Repository +public interface DataFileMapper extends Mapper { + public Integer countAll(); + + public Integer insertOne(DataFile dataFile); + + public Integer updateById(DataFile dataFile); + + public Integer deleteById(Long id); + + public DataFile queryById(Long id); + + public List queryByTime(Date time); + + public List queryByRegion(String region); + + public List queryAllByFileSecurity(String fileSecurity); +} \ 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 deleted file mode 100644 index 2507efd..0000000 --- a/src/main/java/com/cetc32/dh/mybatis/VfileMenuMapper.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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 queryFilesByMenuId(Long menuId); - - public List queryFilesByTime(Long menuId, Date time); - - public List queryFilesByRegion(Long menuId, String region); - - 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 Integer countFilesByObj(VfileMenu vfileMenu); - - public List distinctAllYear(); - - public List distinctAllRegion(); - - - -} \ No newline at end of file diff --git a/src/main/resources/generator.xml b/src/main/resources/generator.xml index c4ae906..3298ed7 100644 --- a/src/main/resources/generator.xml +++ b/src/main/resources/generator.xml @@ -55,7 +55,7 @@ -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into data_file + + + + id, + + + + file_name, + + + + file_type, + + + + file_security, + + + + file_path, + + + create_time, + + + region, + + + + file_time, + + + + file_size, + + + + file_numbers, + + + + file_discription, + + + + approver, + + + + submitor, + + + + gcs, + + + + scan_level, + + + + scale, + + + + lan, + + + + lon, + + + + + + + + + #{id,jdbcType=BIGINT}, + + + + #{fileName ,jdbcType=VARCHAR}, + + + + #{fileType,jdbcType=VARCHAR}, + + + + #{fileSecurity,jdbcType=VARCHAR}, + + + + #{filePath,jdbcType=VARCHAR}, + + + now(), + + + #{region,jdbcType=VARCHAR}, + + + + #{fileTime,jdbcType=VARCHAR}, + + + + #{fileSize,jdbcType=VARCHAR}, + + + + #{fileNumbers,jdbcType=INTEGER}, + + + + #{fileDiscription,jdbcType=VARCHAR}, + + + + #{approver,jdbcType=VARCHAR}, + + + + #{submitor,jdbcType=VARCHAR}, + + + + #{gcs,jdbcType=VARCHAR}, + + + + #{scanLevel,jdbcType=INTEGER}, + + + + #{scale,jdbcType=VARCHAR}, + + + + #{lan,jdbcType=VARCHAR}, + + + + #{lon,jdbcType=VARCHAR}, + + + + + + + + update data_file + + + file_name = #{fileName,jdbcType=VARCHAR}, + + + file_type = #{fileType,jdbcType=VARCHAR}, + + + file_security = #{fileSecurity,jdbcType=VARCHAR}, + + + file_path = #{filePath,jdbcType=VARCHAR}, + + + region = #{region,jdbcType=VARCHAR}, + + + file_time = #{fileTime,jdbcType=VARCHAR}, + + + file_size = #{fileSize,jdbcType=VARCHAR}, + + + file_numbers = #{fileNumbers,jdbcType=INTEGER}, + + + file_discription = #{fileDiscription,jdbcType=VARCHAR}, + + + approver = #{approver,jdbcType=VARCHAR}, + + + + submitor = #{submitor,jdbcType=VARCHAR}, + + + + gcs = #{gcs,jdbcType=VARCHAR}, + + + + scan_level = #{scanLevel,jdbcType=INTEGER}, + + + + scale = #{scale,jdbcType=VARCHAR}, + + + + lan = #{lan,jdbcType=VARCHAR}, + + + + lon = #{lon,jdbcType=VARCHAR}, + + + + where id = #{id,jdbcType=BIGINT} + + + + + + delete from data_file + where id = #{id,jdbcType=BIGINT} + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/VfileMenuMapper.xml b/src/main/resources/mapper/VfileMenuMapper.xml deleted file mode 100644 index 3a6f3d6..0000000 --- a/src/main/resources/mapper/VfileMenuMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file -- Gitee From 5e45af6fdbb359ab6aa40fa1a2e526a27175652b Mon Sep 17 00:00:00 2001 From: root <123> Date: Fri, 4 Dec 2020 11:27:49 +0800 Subject: [PATCH 07/10] =?UTF-8?q?20201204=E2=80=94=E2=80=94=E6=95=B0?= =?UTF-8?q?=E7=AE=A1vfile=5Fmenu=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cetc32/dh/entity/VfileMenu.java | 397 ++++++++++++++++++ .../cetc32/dh/mybatis/VfileMenuMapper.java | 32 ++ src/main/resources/mapper/VfileMenuMapper.xml | 132 ++++++ 3 files changed, 561 insertions(+) create mode 100644 src/main/java/com/cetc32/dh/entity/VfileMenu.java create mode 100644 src/main/java/com/cetc32/dh/mybatis/VfileMenuMapper.java create mode 100644 src/main/resources/mapper/VfileMenuMapper.xml diff --git a/src/main/java/com/cetc32/dh/entity/VfileMenu.java b/src/main/java/com/cetc32/dh/entity/VfileMenu.java new file mode 100644 index 0000000..cf2f4b5 --- /dev/null +++ b/src/main/java/com/cetc32/dh/entity/VfileMenu.java @@ -0,0 +1,397 @@ +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.*; + +@ApiModel("文件实体") +@Table(name = "vfile_menu") +public class VfileMenu extends NumberS{ + + /** + * 无参构造函数 + */ + public VfileMenu(){ } + + /** + * @param fileId + * @param fileName + * @param fileType + * @param fileSecurity + * @param filePath + * @param createTime + * @param region + * @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 + * 有参构造函数 + */ + 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){ + this.fileId=fileId; + this.fileName=fileName; + this.fileType=fileType; + this.fileSecurity=fileSecurity; + this.filePath=filePath; + this.createTime=createTime; + this.region=region; + this.menuId=menuId; + 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; + } + + @Column(name = "menu_id") + private Long menuId; + + @Column(name = "file_id") + private Long fileId; + + @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; + + @Column(name = "file_numbers") + private Integer fileNumbers; + + @Column(name = "file_discription") + private String fileDiscription; + + private String submitor; + + 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; + + /** + * @return menu_id + */ + public Long getMenuId() { + return menuId; + } + + /** + * @param menuId + */ + public void setMenuId(Long menuId) { + this.menuId = menuId; + } + + /** + * @return file_id + */ + public Long getFileId() { + return fileId; + } + + /** + * @param fileId + */ + public void setFileId(Long fileId) { + this.fileId = fileId; + } + + /** + * @return file_name + */ + public String getFileName() { + return fileName; + } + + /** + * @param fileName + */ + public void setFileName(String fileName) { + this.fileName = fileName == null ? null : fileName.trim(); + } + + /** + * @return file_type + */ + public String getFileType() { + return fileType; + } + + /** + * @param fileType + */ + public void setFileType(String fileType) { + this.fileType = fileType == null ? null : fileType.trim(); + } + + /** + * @return file_security + */ + public String getFileSecurity() { + return fileSecurity; + } + + /** + * @param fileSecurity + */ + public void setFileSecurity(String fileSecurity) { + this.fileSecurity = fileSecurity == null ? null : fileSecurity.trim(); + } + + /** + * @return file_path + */ + public String getFilePath() { + return filePath; + } + + /** + * @param filePath + */ + public void setFilePath(String filePath) { + this.filePath = filePath == null ? null : filePath.trim(); + } + + /** + * @return create_time + */ + public Date getCreateTime() { + return createTime; + } + + /** + * @param createTime + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * @return region + */ + public String getRegion() { + return region; + } + + /** + * @param region + */ + public void setRegion(String region) { + this.region = region == null ? null : region.trim(); + } + + /** + * @return file_size + */ + public String getFileSize() { + return fileSize; + } + + /** + * @param fileSize + */ + public void setFileSize(String fileSize) { + this.fileSize = fileSize == null ? null : fileSize.trim(); + } + + /** + * @return file_numbers + */ + public Integer getFileNumbers() { + return fileNumbers; + } + + /** + * @param fileNumbers + */ + public void setFileNumbers(Integer fileNumbers) { + this.fileNumbers = fileNumbers; + } + + /** + * @return file_discription + */ + public String getFileDiscription() { + return fileDiscription; + } + + /** + * @param fileDiscription + */ + public void setFileDiscription(String fileDiscription) { + this.fileDiscription = fileDiscription == null ? null : fileDiscription.trim(); + } + + /** + * @return submitor + */ + public String getSubmitor() { + return submitor; + } + + /** + * @param submitor + */ + public void setSubmitor(String submitor) { + this.submitor = submitor == null ? null : submitor.trim(); + } + + /** + * @return approver + */ + public String getApprover() { + return approver; + } + + /** + * @param approver + */ + public void setApprover(String approver) { + this.approver = approver == null ? null : approver.trim(); + } + + /** + * @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; + } + + /** + * @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(); + } +} \ 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 new file mode 100644 index 0000000..d6b18ca --- /dev/null +++ b/src/main/java/com/cetc32/dh/mybatis/VfileMenuMapper.java @@ -0,0 +1,32 @@ +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; + +@Repository +public interface VfileMenuMapper extends Mapper { + + public List queryByFileSecurityAndMenuId(Long menuId, String fileSecurity); + + public List queryFilesByMenuId(Long menuId); + + public List queryFilesByTime(Long menuId, Date time); + + public List queryFilesByRegion(Long menuId, String region); + + 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 Integer countFilesByObj(VfileMenu vfileMenu); + + public List distinctAllYear(); + + public List distinctAllRegion(); + +} \ No newline at end of file diff --git a/src/main/resources/mapper/VfileMenuMapper.xml b/src/main/resources/mapper/VfileMenuMapper.xml new file mode 100644 index 0000000..9e821d0 --- /dev/null +++ b/src/main/resources/mapper/VfileMenuMapper.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- Gitee From 09c3fdf5617d1eadc362fb890a4fca11671f0aaf Mon Sep 17 00:00:00 2001 From: root <123> Date: Fri, 4 Dec 2020 15:42:52 +0800 Subject: [PATCH 08/10] =?UTF-8?q?20201204=E2=80=94=E2=80=94=E6=95=B0?= =?UTF-8?q?=E7=AE=A1common=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/rest/FileSubmitController.java | 393 +++++++++++++----- .../java/com/cetc32/dh/entity/DataFile.java | 69 ++- .../java/com/cetc32/dh/entity/VfileMenu.java | 23 +- .../com/cetc32/dh/mybatis/DataFileMapper.java | 11 + .../cetc32/dh/service/DataFileService.java | 12 + .../dh/service/impl/DataFileServiceImpl.java | 60 ++- src/main/resources/mapper/DataFileMapper.xml | 111 +++++ src/main/resources/mapper/VfileMenuMapper.xml | 10 + 8 files changed, 583 insertions(+), 106 deletions(-) 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 73e2e9a..f033787 100644 --- a/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java +++ b/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java @@ -14,6 +14,7 @@ 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.entity.VfileMenu; import com.cetc32.dh.service.*; import com.cetc32.dh.utils.FileUtil; import io.swagger.annotations.ApiImplicitParam; @@ -111,151 +112,161 @@ 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("审核通过"); + 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("审批拒绝"); + if (dataFileService.updatebyId(dataFile) > 0) { + 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 = "String", 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 = "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 = "scan_level", 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 = "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) { + String 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("审核人"); + dataFile.setStatus("未审核"); if((adminUserService.getUserById(Integer.parseInt(userId)))!=null){ - dataSubmit.setSubmitor(adminUserService.getUserById(Integer.parseInt(userId)).getSysUserName()); + dataFile.setSubmitor(adminUserService.getUserById(Integer.parseInt(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); File[] files = baseFile.listFiles(); @@ -264,26 +275,26 @@ public class FileSubmitController { 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) { @@ -551,4 +562,190 @@ public class FileSubmitController { } + +// /** +// * @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/entity/DataFile.java b/src/main/java/com/cetc32/dh/entity/DataFile.java index 1b6ce8b..2968134 100644 --- a/src/main/java/com/cetc32/dh/entity/DataFile.java +++ b/src/main/java/com/cetc32/dh/entity/DataFile.java @@ -4,7 +4,7 @@ import java.util.Date; import javax.persistence.*; @Table(name = "data_file") -public class DataFile { +public class DataFile extends NumberS { /** * 无参构造函数 @@ -26,11 +26,13 @@ public class DataFile { * @param catagory * @param scale * @param scanLevel + * @param status + * @param menuId * 有参构造函数 */ 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 gcs,Integer scanLevel,String scale,String lan,String lon, String catagory,String status,Integer menuId){ this.id=id; this.fileName=fileName; this.fileType=fileType; @@ -50,6 +52,8 @@ public class DataFile { this.lan=lan; this.lon=lon; this.catagory=catagory; + this.status=status; + this.menuId=menuId; } /** * 数据id,文件(夹)id @@ -157,6 +161,20 @@ public class DataFile { @Column(name = "file_time") private String fileTime; + /** + * 审核状态 + */ + private String status; + + /** + * 数据日期,文件(夹)所属年份 + */ + @Column(name = "menu_id") + private Integer menuId; + + String userId; + + /** * 获取数据id,文件(夹)id * @@ -175,6 +193,35 @@ public class DataFile { this.id = id; } + /** + * @return menuId + */ + public Integer getMenuId() { + return menuId; + } + + /** + * @param menuId + */ + public void setMenuId(Integer menuId) { + this.menuId = menuId; + } + + + /** + * @return userId + */ + public String getUserId() { + return userId; + } + + /** + * @param userId + */ + public void setUserId(String userId) { + this.userId = userId; + } + /** * 获取数据标识 ,文件名称 * @@ -499,6 +546,24 @@ public class DataFile { 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(); + } + /** * 返回文件实体类的字符串形式 */ diff --git a/src/main/java/com/cetc32/dh/entity/VfileMenu.java b/src/main/java/com/cetc32/dh/entity/VfileMenu.java index cf2f4b5..a743648 100644 --- a/src/main/java/com/cetc32/dh/entity/VfileMenu.java +++ b/src/main/java/com/cetc32/dh/entity/VfileMenu.java @@ -36,11 +36,12 @@ public class VfileMenu extends NumberS{ * @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, String fileTime, String fileSize, Integer fileNumbers, String fileDiscription, - String submitor, String approver,String gcs,Integer scanLevel,String scale,String lan,String lon, String catagory){ + 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; @@ -115,6 +116,8 @@ public class VfileMenu extends NumberS{ @Column(name = "file_time") private String fileTime; + String status; + /** * @return menu_id */ @@ -394,4 +397,18 @@ public class VfileMenu extends NumberS{ 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 6d57b90..c77131f 100644 --- a/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java +++ b/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java @@ -1,6 +1,9 @@ package com.cetc32.dh.mybatis; import com.cetc32.dh.entity.DataFile; +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; @@ -24,4 +27,12 @@ public interface DataFileMapper extends Mapper { public List queryByRegion(String region); public List queryAllByFileSecurity(String fileSecurity); + + 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/service/DataFileService.java b/src/main/java/com/cetc32/dh/service/DataFileService.java index 555f650..5b49c8d 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/impl/DataFileServiceImpl.java b/src/main/java/com/cetc32/dh/service/impl/DataFileServiceImpl.java index bb69fef..077889f 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/resources/mapper/DataFileMapper.xml b/src/main/resources/mapper/DataFileMapper.xml index 33e92c3..86de293 100644 --- a/src/main/resources/mapper/DataFileMapper.xml +++ b/src/main/resources/mapper/DataFileMapper.xml @@ -24,6 +24,8 @@ + + + select * from data_file + + + status = #{status} + + + and approver = #{approver} + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/VfileMenuMapper.xml b/src/main/resources/mapper/VfileMenuMapper.xml index 9e821d0..e9fc58c 100644 --- a/src/main/resources/mapper/VfileMenuMapper.xml +++ b/src/main/resources/mapper/VfileMenuMapper.xml @@ -25,6 +25,7 @@ + @@ -89,6 +93,9 @@ and file_security = #{vfileMenu.fileSecurity} + + and status = #{status} + LIMIT #{limit} OFFSET #{offset} @@ -117,6 +124,9 @@ and file_security = #{fileSecurity} + + and status = #{status} + -- Gitee From a1a67c0351c2f00739198f063433236157e73dba Mon Sep 17 00:00:00 2001 From: root <123> Date: Fri, 4 Dec 2020 16:41:18 +0800 Subject: [PATCH 09/10] =?UTF-8?q?20201204=E2=80=94=E2=80=94=E6=95=B0?= =?UTF-8?q?=E7=AE=A1common=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cetc32/dh/controller/rest/FileSubmitController.java | 2 -- src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java | 2 +- src/main/resources/mapper/DataFileMapper.xml | 2 +- src/main/resources/mapper/VfileMenuMapper.xml | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) 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 f033787..e831391 100644 --- a/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java +++ b/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java @@ -328,8 +328,6 @@ public class FileSubmitController { } - - /** * 目录/文件上传 * @param file 目录,文件 diff --git a/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java b/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java index c77131f..4497d08 100644 --- a/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java +++ b/src/main/java/com/cetc32/dh/mybatis/DataFileMapper.java @@ -30,7 +30,7 @@ public interface DataFileMapper extends Mapper { public List selectByStatusAndUser(DataFile dataFile); - public Integer countByStatusAndUser(DataFile dataFile); + public Integer countByStatusAndUser(DataFile dataFile); public List queryFilesByObj(@Param("offset") Integer offset, @Param("limit") Integer limit, DataFile dataFile); diff --git a/src/main/resources/mapper/DataFileMapper.xml b/src/main/resources/mapper/DataFileMapper.xml index 86de293..6a13d2a 100644 --- a/src/main/resources/mapper/DataFileMapper.xml +++ b/src/main/resources/mapper/DataFileMapper.xml @@ -306,7 +306,7 @@ - select * from data_file diff --git a/src/main/resources/mapper/VfileMenuMapper.xml b/src/main/resources/mapper/VfileMenuMapper.xml index e9fc58c..4869110 100644 --- a/src/main/resources/mapper/VfileMenuMapper.xml +++ b/src/main/resources/mapper/VfileMenuMapper.xml @@ -72,7 +72,7 @@ - select * from vfile_menu -- Gitee From 266163032a57004fa796ab13043593631b830d36 Mon Sep 17 00:00:00 2001 From: root <123> Date: Mon, 7 Dec 2020 19:04:39 +0800 Subject: [PATCH 10/10] =?UTF-8?q?20201207=E2=80=94=E2=80=94=E6=95=B0?= =?UTF-8?q?=E7=AE=A1=E6=96=87=E4=BB=B6=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/rest/FileSubmitController.java | 178 +++++- .../controller/rest/VfileMenuController.java | 38 +- .../java/com/cetc32/dh/entity/DataFile.java | 66 +- .../java/com/cetc32/dh/entity/DataPlp.java | 453 ++++++++++++++ .../java/com/cetc32/dh/entity/DataTrace.java | 580 ++++++++++++++++++ .../com/cetc32/dh/mybatis/DataPlpMapper.java | 35 ++ .../cetc32/dh/mybatis/DataTraceMapper.java | 37 ++ src/main/resources/generator.xml | 2 +- src/main/resources/mapper/DataFileMapper.xml | 17 + src/main/resources/mapper/DataPlpMapper.xml | 332 ++++++++++ src/main/resources/mapper/DataTraceMapper.xml | 383 ++++++++++++ 11 files changed, 2081 insertions(+), 40 deletions(-) create mode 100644 src/main/java/com/cetc32/dh/entity/DataPlp.java create mode 100644 src/main/java/com/cetc32/dh/entity/DataTrace.java create mode 100644 src/main/java/com/cetc32/dh/mybatis/DataPlpMapper.java create mode 100644 src/main/java/com/cetc32/dh/mybatis/DataTraceMapper.java create mode 100644 src/main/resources/mapper/DataPlpMapper.xml create mode 100644 src/main/resources/mapper/DataTraceMapper.xml 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 e831391..5ddabd6 100644 --- a/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java +++ b/src/main/java/com/cetc32/dh/controller/rest/FileSubmitController.java @@ -27,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 @@ -133,6 +135,7 @@ public class FileSubmitController { Integer id = ids.get(i); dataFile = dataFileService.queryById(id.longValue()); dataFile.setStatus("审核通过"); + dataFile.setApproveTime(new Date()); if (dataFileService.updatebyId(dataFile) > 0) { sum++; } @@ -161,7 +164,10 @@ public class FileSubmitController { Integer id = ids.get(i); dataFile = dataFileService.queryById(id.longValue()); dataFile.setStatus("审批拒绝"); + dataFile.setApproveTime(new Date()); if (dataFileService.updatebyId(dataFile) > 0) { + String delFile = dataFile.getFilePath(); + FileUtil.deleteDir(delFile); sum++; } } @@ -238,37 +244,41 @@ public class FileSubmitController { @ApiOperation(value = "提交数据") @ApiImplicitParams({ @ApiImplicitParam(name = "fileType", value = "文件类型", paramType = "body", dataType = "String", defaultValue = ""), - @ApiImplicitParam(name = "fileSecurity", 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 = "title", value = "文件标识", paramType = "body", dataType = "String", defaultValue = ""), @ApiImplicitParam(name = "gcs", value = "图像地理坐标系", paramType = "body", dataType = "String", defaultValue = ""), - @ApiImplicitParam(name = "scan_level", value = "图像级别(1-20)", paramType = "body", dataType = "Integer", 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("/subcommon") public ResponseResult DataSub(@RequestBody DataFile dataFile) { - String userId=dataFile.getUserId(); + Integer userId=dataFile.getUserId(); String upCachePath=upLoadPath+"_user"+userId; System.out.println("文件类型"+dataFile.getFileType()); String fileName = null; Integer count = 0; dataFile.setStatus("未审核"); - if((adminUserService.getUserById(Integer.parseInt(userId)))!=null){ - dataFile.setSubmitor(adminUserService.getUserById(Integer.parseInt(userId)).getSysUserName()); + if((adminUserService.getUserById(userId))!=null){ + dataFile.setSubmitor(adminUserService.getUserById(userId).getSysUserName()); } 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<>(); @@ -349,6 +359,129 @@ public class FileSubmitController { } + /** + * 下载文件文件,文件夹 + * + * @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; + + } + + + + /** * 文件上传缓冲区清空 * @return 返回文件清空结果 @@ -421,8 +554,9 @@ 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 = "desciption", value = "描述", paramType = "body", dataType = "String", defaultValue = ""), }) @@ -438,26 +572,28 @@ public class FileSubmitController { } } - FileToMenu fileToMenu = new FileToMenu(); +// FileToMenu fileToMenu = new FileToMenu(); Long id = ((Integer)map.get("id")).longValue(); Long oldmenuid =((Integer)map.get("oldmenuid")).longValue(); - Integer year =(Integer)map.get("year"); + 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(year!=null&&year!=dataFile.getFileYear()){ -// dataFile.setFileYear(year); -// } + if(year!=null&&year!=dataFile.getFileTime()){ + dataFile.setFileTime(year); + } + if(config!=null&&config!=dataFile.getFileConfig()){ + dataFile.setFileConfig(config); + } if(area!=null&&area!=dataFile.getRegion()){ dataFile.setRegion(area); } @@ -505,10 +641,10 @@ public class FileSubmitController { if (flag) { FileUtil.deleteDir(dataFile.getFilePath()); dataFile.setFilePath(new_menuPath); - fileToMenuService.deleteFtoM(oldmenuid,id); - fileToMenu.setMenuId(menuid); - fileToMenu.setFileId(id); - fileToMenuService.insert(fileToMenu); +// fileToMenuService.deleteFtoM(oldmenuid,id); +// fileToMenu.setMenuId(menuid); +// fileToMenu.setFileId(id); +// fileToMenuService.insert(fileToMenu); } } 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 6250e2c..0517807 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 2968134..c47e76f 100644 --- a/src/main/java/com/cetc32/dh/entity/DataFile.java +++ b/src/main/java/com/cetc32/dh/entity/DataFile.java @@ -28,11 +28,13 @@ public class DataFile extends NumberS { * @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, - 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){ + 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; @@ -54,6 +56,8 @@ public class DataFile extends NumberS { this.catagory=catagory; this.status=status; this.menuId=menuId; + this.fileConfig = fileConfig; + this.approveTime = approveTime; } /** * 数据id,文件(夹)id @@ -62,7 +66,7 @@ public class DataFile extends NumberS { private Long id; /** - * 数据标识 ,文件名称 + * 文件名称 */ @Column(name = "file_name") private String fileName; @@ -172,7 +176,20 @@ public class DataFile extends NumberS { @Column(name = "menu_id") private Integer menuId; - String userId; + /** + * 文件标识,数据标识 + */ + @Column(name = "file_config") + private String fileConfig; + + /** + * 文件、数据审批时间 + */ + @Column(name = "approve_time") + private Date approveTime; + + + Integer userId; /** @@ -211,14 +228,14 @@ public class DataFile extends NumberS { /** * @return userId */ - public String getUserId() { + public Integer getUserId() { return userId; } /** * @param userId */ - public void setUserId(String userId) { + public void setUserId(Integer userId) { this.userId = userId; } @@ -564,6 +581,41 @@ public class DataFile extends NumberS { 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 0000000..7318b48 --- /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 0000000..15723a4 --- /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/mybatis/DataPlpMapper.java b/src/main/java/com/cetc32/dh/mybatis/DataPlpMapper.java new file mode 100644 index 0000000..5b40138 --- /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 0000000..8fc0e13 --- /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/resources/generator.xml b/src/main/resources/generator.xml index 3298ed7..be6f924 100644 --- a/src/main/resources/generator.xml +++ b/src/main/resources/generator.xml @@ -55,7 +55,7 @@ -
+
+ + + SELECT count(*) FROM data_plp + + + + 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 0000000..9973d79 --- /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 -- Gitee