diff --git a/src/main/java/cn/com/tenlion/systemoa/controller/app/api/fileupload/FileUploadAppController.java b/src/main/java/cn/com/tenlion/systemoa/controller/app/api/fileupload/FileUploadAppController.java index 83685ea..7aded41 100644 --- a/src/main/java/cn/com/tenlion/systemoa/controller/app/api/fileupload/FileUploadAppController.java +++ b/src/main/java/cn/com/tenlion/systemoa/controller/app/api/fileupload/FileUploadAppController.java @@ -106,6 +106,7 @@ public class FileUploadAppController extends DefaultBaseController { @GetMapping("listpagefileupload") public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) { Map params = requestParams(); + params.put("token", token); page.setParams(params); return fileUploadService.listPage(page); } diff --git a/src/main/java/cn/com/tenlion/systemoa/controller/route/fileupload/FileUploadRouteController.java b/src/main/java/cn/com/tenlion/systemoa/controller/route/fileupload/FileUploadRouteController.java index 5fa2e55..5fc4b3a 100644 --- a/src/main/java/cn/com/tenlion/systemoa/controller/route/fileupload/FileUploadRouteController.java +++ b/src/main/java/cn/com/tenlion/systemoa/controller/route/fileupload/FileUploadRouteController.java @@ -48,4 +48,9 @@ public class FileUploadRouteController extends DefaultBaseController { return new ModelAndView("fileupload/list-share-public"); } + @GetMapping("list-share-share") + public ModelAndView listShareShare() { + return new ModelAndView("fileupload/list-share-share"); + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemoa/dao/filetype/IFileTypeDao.java b/src/main/java/cn/com/tenlion/systemoa/dao/filetype/IFileTypeDao.java index 800af3c..5982485 100644 --- a/src/main/java/cn/com/tenlion/systemoa/dao/filetype/IFileTypeDao.java +++ b/src/main/java/cn/com/tenlion/systemoa/dao/filetype/IFileTypeDao.java @@ -117,4 +117,6 @@ public interface IFileTypeDao { */ Integer count(Map params) throws SearchException; + FileTypeDTO getName(Map params); + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemoa/service/filerole/IFileRoleService.java b/src/main/java/cn/com/tenlion/systemoa/service/filerole/IFileRoleService.java index db8bcc5..75a6436 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/filerole/IFileRoleService.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/filerole/IFileRoleService.java @@ -1,5 +1,6 @@ package cn.com.tenlion.systemoa.service.filerole; +import cn.com.tenlion.systemoa.pojo.dtos.filetype.FileTypeDTO; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResultList; import cn.com.tenlion.systemoa.pojo.dtos.filerole.FileRoleDTO; @@ -184,5 +185,4 @@ public interface IFileRoleService { * @return */ Integer count(Map params); - } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemoa/service/filetype/IFileTypeService.java b/src/main/java/cn/com/tenlion/systemoa/service/filetype/IFileTypeService.java index 03993bc..8a2dafb 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/filetype/IFileTypeService.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/filetype/IFileTypeService.java @@ -1,5 +1,6 @@ package cn.com.tenlion.systemoa.service.filetype; +import cn.com.tenlion.systemoa.pojo.dtos.filerole.FileRoleDTO; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResultList; import cn.com.tenlion.systemoa.pojo.dtos.filetype.FileTypeDTO; @@ -185,4 +186,9 @@ public interface IFileTypeService { */ Integer count(Map params); + List getShare(Map params); + + FileTypeDTO getName(String fileTypeId); + + FileTypeDTO getName(Map params); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemoa/service/filetype/impl/FileTypeServiceImpl.java b/src/main/java/cn/com/tenlion/systemoa/service/filetype/impl/FileTypeServiceImpl.java index 886cfae..61b48a4 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/filetype/impl/FileTypeServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/filetype/impl/FileTypeServiceImpl.java @@ -1,5 +1,7 @@ package cn.com.tenlion.systemoa.service.filetype.impl; +import cn.com.tenlion.systemoa.pojo.dtos.filerole.FileRoleDTO; +import cn.com.tenlion.systemoa.service.filerole.IFileRoleService; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.bos.UserInfoBO; @@ -33,6 +35,8 @@ public class FileTypeServiceImpl extends DefaultBaseService implements IFileType @Autowired private IFileTypeDao fileTypeDao; + @Autowired + private IFileRoleService fileRoleService; @Override public void save(FileTypeVO fileTypeVO) { @@ -106,6 +110,11 @@ public class FileTypeServiceImpl extends DefaultBaseService implements IFileType @Override public FileTypeDTO get(Map params) { + /*if(null != params.get("typeBelong")) { + if("共享文档".equals(params.get("typeBelong").toString())) { + params.put("typeBelong", "个人文档"); + } + }*/ return fileTypeDao.get(params); } @@ -150,6 +159,11 @@ public class FileTypeServiceImpl extends DefaultBaseService implements IFileType if(null != userInfoBO) { params.put("creator", userInfoBO.getUserId()); } + if(null != params.get("typeBelong")) { + if("共享文档".equals(params.get("typeBelong").toString())) { + params.put("typeBelong", "个人文档"); + } + } List fileTypeDTOList = fileTypeDao.list(params); Iterator it = fileTypeDTOList.iterator(); while (it.hasNext()) { @@ -194,4 +208,22 @@ public class FileTypeServiceImpl extends DefaultBaseService implements IFileType return count == null ? 0 : count; } + @Override + public List getShare(Map params) { + List list = fileRoleService.list(params); + return list; + } + + @Override + public FileTypeDTO getName(String fileTypeId) { + Map params = super.getHashMap(2); + params.put("fileTypeId", fileTypeId); + return getName(params); + } + + @Override + public FileTypeDTO getName(Map params) { + return fileTypeDao.getName(params); + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java b/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java index adeb97f..17c547f 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java @@ -3,6 +3,7 @@ package cn.com.tenlion.systemoa.service.fileupload.impl; import cn.com.tenlion.systemoa.config.properties.ConfigPro; import cn.com.tenlion.systemoa.dao.fileupload.IFileUploadDao; import cn.com.tenlion.systemoa.pojo.bos.fileupload.FileUploadBO; +import cn.com.tenlion.systemoa.pojo.dtos.filerole.FileRoleDTO; import cn.com.tenlion.systemoa.pojo.dtos.filetype.FileTypeDTO; import cn.com.tenlion.systemoa.pojo.dtos.fileupload.FileUploadDTO; import cn.com.tenlion.systemoa.pojo.pos.fileupload.FileUploadPO; @@ -18,6 +19,7 @@ import ink.wgink.exceptions.SearchException; import ink.wgink.module.file.dao.IFileDao; import ink.wgink.module.file.service.IFileService; import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.app.AppTokenUser; import ink.wgink.pojo.bos.UserInfoBO; import ink.wgink.pojo.pos.FilePO; import ink.wgink.pojo.result.SuccessResultList; @@ -141,10 +143,13 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp FileUploadDTO fileUploadDTO = fileUploadDao.get(params); if(null != fileUploadDTO) { if(!StringUtils.isEmpty(fileUploadDTO.getFileTypeId())) { - FileTypeDTO fileTypeDTO = fileTypeService.get(fileUploadDTO.getFileTypeId()); + FileTypeDTO fileTypeDTO = fileTypeService.getName(fileUploadDTO.getFileTypeId()); if(null != fileTypeDTO) { fileUploadDTO.setOldFileType(fileTypeDTO.getTypeName()); fileUploadDTO.setFileTypeName(fileTypeDTO.getTypeName()); + + fileUploadDTO.setCatalogueType(fileTypeDTO.getTypeBelong()); + fileUploadDTO.setCatalogueName(fileTypeDTO.getTypeName()); } } if(!StringUtils.isEmpty(fileUploadDTO.getFileId())) { @@ -205,38 +210,62 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp @Override public List list(Map params) { UserInfoBO userInfoBO = this.securityComponent.getCurrentUser(); - if(null != userInfoBO) { + if (null != userInfoBO) { params.put("creator", userInfoBO.getUserId()); } + String token = null; + if(null != params.get("token")) { + token = params.get("token").toString(); + try { + AppTokenUser appTokenUser = securityComponent.getAppTokenUser(token); + if(null != appTokenUser) { + params.put("creator", appTokenUser.getId()); + } + }catch (Exception e) { + e.printStackTrace(); + } + + } List fileUploadDTOList = fileUploadDao.list(params); if(null != fileUploadDTOList && fileUploadDTOList.size() > 0) { Iterator it = fileUploadDTOList.iterator(); while(it.hasNext()) { FileUploadDTO fileUploadDTO = (FileUploadDTO) it.next(); params.put("fileTypeId", fileUploadDTO.getFileTypeId()); + params.put("fileUploadId", fileUploadDTO.getFileUploadId()); + String typeBelong = null; + if(null != params.get("typeBelong")) { + typeBelong = params.get("typeBelong").toString(); + if("共享文档".equals(typeBelong)) { + typeBelong = "个人文档"; + } + } + if(null != params.get("typeBelong") && "共享文档".equals(params.get("typeBelong").toString())) { + List fileRoleDTOList = fileTypeService.getShare(params); + if(null == fileRoleDTOList || fileRoleDTOList.size() == 0) { + it.remove(); + continue; + } + } + params.remove("typeBelong"); + params.remove("creator"); FileTypeDTO fileTypeDTO = fileTypeService.get(params); + params.put("typeBelong", typeBelong); if(null != params.get("typeBelong") && null != fileTypeDTO) { if(!params.get("typeBelong").toString().equals(fileTypeDTO.getTypeBelong())) { it.remove(); continue; } } - if(null != fileTypeDTO) { - fileUploadDTO.setCatalogueType(fileTypeDTO.getTypeBelong()); - fileUploadDTO.setCatalogueName(fileTypeDTO.getTypeName()); + + + FileTypeDTO fileTypeDTO1 = fileTypeService.getName(fileUploadDTO.getFileTypeId()); + if(null != fileTypeDTO1) { + fileUploadDTO.setCatalogueType(fileTypeDTO1.getTypeBelong()); + fileUploadDTO.setCatalogueName(fileTypeDTO1.getTypeName()); } } } - /*if(null != fileUploadDTOList && fileUploadDTOList.size() > 0) { - for(FileUploadDTO fileUploadDTO: fileUploadDTOList) { - params.put("fileCatalogueId", fileUploadDTO.getCatalogueId()); - FileCatalogueDTO fileCatalogueDTO = fileCatalogueService.get(params); - if(null != fileCatalogueDTO) { - fileUploadDTO.setCatalogueName(fileCatalogueDTO.getName()); - fileUploadDTO.setCatalogueType(fileCatalogueDTO.getType()); - } - } - }*/ return fileUploadDTOList; } diff --git a/src/main/resources/mybatis/mapper/filerole/file-role-mapper.xml b/src/main/resources/mybatis/mapper/filerole/file-role-mapper.xml index 31bab19..83c8ae8 100644 --- a/src/main/resources/mybatis/mapper/filerole/file-role-mapper.xml +++ b/src/main/resources/mybatis/mapper/filerole/file-role-mapper.xml @@ -235,6 +235,9 @@ t1.id LIKE CONCAT('%', #{keywords}, '%') ) + + AND t1.file_upload_id = #{fileUploadId} + AND LEFT(t1.gmt_create, 10) = ]]> #{startTime} diff --git a/src/main/resources/mybatis/mapper/filetype/file-type-mapper.xml b/src/main/resources/mybatis/mapper/filetype/file-type-mapper.xml index a5d233a..75261cd 100644 --- a/src/main/resources/mybatis/mapper/filetype/file-type-mapper.xml +++ b/src/main/resources/mybatis/mapper/filetype/file-type-mapper.xml @@ -124,6 +124,42 @@ + + -
+
@@ -50,11 +50,11 @@
-
+
diff --git a/src/main/resources/templates/filerole/update.html b/src/main/resources/templates/filerole/update.html index 9ee03b3..d733e2d 100644 --- a/src/main/resources/templates/filerole/update.html +++ b/src/main/resources/templates/filerole/update.html @@ -35,11 +35,11 @@
-
+
@@ -56,11 +56,11 @@
-
+
diff --git a/src/main/resources/templates/filetype/list.html b/src/main/resources/templates/filetype/list.html index cde34db..a7dede3 100644 --- a/src/main/resources/templates/filetype/list.html +++ b/src/main/resources/templates/filetype/list.html @@ -220,7 +220,7 @@ // 文档共享 if('share' == obj.event) { console.log(data) - share(data.fileTypeId, data.typeBelong); + share(data.fileUploadId, data.typeBelong); } }); diff --git a/src/main/resources/templates/fileupload/list-share-personal.html b/src/main/resources/templates/fileupload/list-share-personal.html index a1ea93a..5d02bb8 100644 --- a/src/main/resources/templates/fileupload/list-share-personal.html +++ b/src/main/resources/templates/fileupload/list-share-personal.html @@ -28,8 +28,14 @@ @@ -118,6 +124,12 @@ } return rowData; } + }, + {field: 'share', fixed: 'right', width: 150, title: '共享', align:'center', + templet: function(row) { + var rowData = '文档共享'; + return rowData; + } } ] ], @@ -313,7 +325,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/fileupload/update?fileUploadId={fileUploadId}&typeBelong={typeBelong}', [checkDatas[0].fileUploadId, checkDatas[0].catalogueName]), + content: top.restAjax.path('route/fileupload/update?fileUploadId={fileUploadId}&typeBelong={typeBelong}', [checkDatas[0].fileUploadId, '个人文档']), end: function() { reloadTable(); } diff --git a/src/main/resources/templates/fileupload/list-share-public.html b/src/main/resources/templates/fileupload/list-share-public.html index da63f1a..3728316 100644 --- a/src/main/resources/templates/fileupload/list-share-public.html +++ b/src/main/resources/templates/fileupload/list-share-public.html @@ -125,7 +125,7 @@ return rowData; } }, - {field: 'share', fixed: 'right', width: 150, title: '共享', align:'center', + /*{field: 'share', fixed: 'right', width: 150, title: '共享', align:'center', templet: function(row) { var rowData; if(row['shareRole'] == '否') { @@ -137,7 +137,7 @@ } return rowData; } - } + }*/ ] ], page: true, diff --git a/src/main/resources/templates/fileupload/list-share-share.html b/src/main/resources/templates/fileupload/list-share-share.html new file mode 100644 index 0000000..a825ddd --- /dev/null +++ b/src/main/resources/templates/fileupload/list-share-share.html @@ -0,0 +1,340 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+ +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/templates/fileupload/update.html b/src/main/resources/templates/fileupload/update.html index b23bee1..041d3bb 100644 --- a/src/main/resources/templates/fileupload/update.html +++ b/src/main/resources/templates/fileupload/update.html @@ -159,7 +159,7 @@
diff --git a/src/main/resources/templates/userarchives/dept-user.html b/src/main/resources/templates/userarchives/dept-user.html index 159ea10..61c6e1e 100644 --- a/src/main/resources/templates/userarchives/dept-user.html +++ b/src/main/resources/templates/userarchives/dept-user.html @@ -29,12 +29,12 @@
@@ -69,7 +69,6 @@ height: $win.height() - 60, limit: 20, limits: [20, 40, 60, 80, 100, 200], - toolbar: '#headerToolBar', request: { pageName: 'page', limitName: 'rows'