| | |
| | | jsons[i].unid + "@p@" + jsons[i].seq, jsons[i].domain, jsons[i].dbid, |
| | | false, 60, 60, jsons[i].orgFileType); |
| | | //文件显示信息 |
| | | let title = '文件名: ' + jsons[i].originalFileName + |
| | | ' \n类型: ' + jsons[i].fileType + |
| | | ' \n大小: ' + jsons[i].fileSizeStr + |
| | | ' \n上传者: ' + jsons[i].authorName + |
| | | ' \n上传时间: ' + jsons[i].uploadTimeStr + |
| | | ' \n\n总查看次数: ' + jsons[i].totalViewNums + |
| | | ' \n总下载次数: ' + jsons[i].totalDownNums; |
| | | let title = '文件名:' + jsons[i].originalFileName + |
| | | ' \n类型:' + jsons[i].fileType + |
| | | ' \n大小:' + jsons[i].fileSizeStr + |
| | | ' \n上传者:' + jsons[i].authorName + |
| | | ' \n上传时间:' + jsons[i].uploadTimeStr + |
| | | ' \n\n总查看次数:' + jsons[i].totalViewNums + |
| | | ' \n总下载次数:' + jsons[i].totalDownNums; |
| | | if(jsons[i].hasPermission){ |
| | | title += ' \n\n上传者【' + jsons[i].authorName + '】授权您:' |
| | | title += ' \n允许查看次数: ' + jsons[i].allowViewNums + |
| | | ' \n您已查看: ' + jsons[i].viewNums + '\n'; |
| | | title += ' \n允许下载次数: ' + jsons[i].allowDownNums + |
| | | ' \n您已下载: ' + jsons[i].downNums; |
| | | title += ' \n允许查看次数:' + jsons[i].allowViewNums + |
| | | ' \n您已查看:' + jsons[i].viewNums + '\n'; |
| | | title += ' \n允许下载次数:' + jsons[i].allowDownNums + |
| | | ' \n您已下载:' + jsons[i].downNums; |
| | | let msg="无时间限制" |
| | | if(jsons[i].dateFlag==0){ |
| | | msg="允许访问:"+jsons[i].startTime.split(" ")[1]+" ~ "+jsons[i].endTime.split(" ")[1]; |
| | | } |
| | | if(jsons[i].dateFlag==1){ |
| | | msg="允许访问:"+jsons[i].startTime+" ~ "+jsons[i].endTime; |
| | | } |
| | | title +='\n\n'+msg; |
| | | } |
| | | //下载地址 |
| | | let Down = jsons[i].domain + "/attachment/downLoadAttachment.do?filePath=" + |
| | |
| | | + " declare @unid varchar(100) ,@seq int ,@usercode varchar(50) \n" |
| | | + " declare @formid int,@headflag int,@fieldid varchar(50),@AllowMaxFileSize int,@AllowFileTypes varchar(200) ; \n" |
| | | + " declare @AuthorAllowDelete varchar(50),@AuthorAllowUpdate varchar(50); \n" |
| | | + " declare @AuthorCode varchar(50),@UserName varchar(50),@totalViewNums int = 0,@totalDownNums int = 0 ; \n" |
| | | + " declare @AuthorCode varchar(50),@UserName varchar(50),@totalViewNums int = 0,@totalDownNums int = 0 ,@totalUpdateNums int = 0 ;\n" |
| | | + " declare @readerUserCodes varchar(2000) ,@hasPermission int = 0;\n" |
| | | + " select @unid = ? , @seq = ? ,@usercode = ? \n" |
| | | + " select @formid = ?,@headflag = ?,@fieldid = ? \n" |
| | | + " select @readerUserCodes = ? \n" |
| | | + " select @AllowMaxFileSize = fileSize,@AllowFileTypes = FileType,@AuthorAllowDelete = authorallowdelete,@AuthorAllowUpdate = authorallowupdate \n" |
| | | + " from _sys_AttachmentParameter where formid=@formid and headflag = @headflag and fieldid=@fieldid \n" |
| | | + " select @AuthorCode = AuthorCode,@totalViewNums=viewNums,@totalDownNums=downNums from " + tableName + " where unid = @unid and seq = @seq \n" |
| | | + " select @AuthorCode = AuthorCode,@totalViewNums=viewNums,@totalDownNums=downNums,@totalUpdateNums = updateNums from " + tableName + " where unid = @unid and seq = @seq \n" |
| | | + " select @UserName = UserName from _sys_loginuser where usercode = @usercode \n" |
| | | |
| | | + " if isnull(@AuthorCode,'') = isnull(@usercode,'') \n" |
| | | + " begin \n" |
| | | + " select @unid as unid,@seq as seq,@usercode as UserCode,@UserName as UserName,1 as HasView,1 as HasDownload, \n" |
| | | + " 1 as HasDelete,1 as HasUpdate,convert(datetime,'1901-01-01',120) as StartDate,convert(datetime,'9999-12-31',120) as EndDate,\n" |
| | | + " 2 as DateFlag,0 as AllowDownnums,0 as AllowViewNums,0 as AllowUpdateNums,@totalViewNums as totalViewNums,@totalDownNums as totalDownNums, \n" |
| | | + " @AllowMaxFileSize as AllowMaxFileSize,@AllowFileTypes as AllowFileTypes,@AuthorAllowDelete as AuthorAllowDelete,@AuthorAllowUpdate as AuthorAllowUpdate,@hasPermission as hasPermission \n" |
| | | + " 2 as DateFlag,0 as AllowDownnums,0 as AllowViewNums,0 as AllowUpdateNums,@hasPermission as hasPermission,\n " + |
| | | " 0 as viewnums,0 as downnums,@totalViewNums as totalViewNums,@totalDownNums as totalDownNums,@totalUpdateNums as totalUpdateNums, \n" |
| | | + " @AllowMaxFileSize as AllowMaxFileSize,@AllowFileTypes as AllowFileTypes,@AuthorAllowDelete as AuthorAllowDelete,@AuthorAllowUpdate as AuthorAllowUpdate\n" |
| | | + " return ; \n" |
| | | + " end \n" |
| | | + " if exists(select top 1 1 from _sys_AttachmentPermission \n" |
| | |
| | | + " begin \n" |
| | | + " set @hasPermission = 1 \n"//设置有权限 xin 2022-12-6 08:45:57 |
| | | + " select unid,seq,UserCode,UserName,HasView,HasDownload, \n" |
| | | + " HasDelete,HasUpdate,StartDate,EndDate,DateFlag,AllowDownnums,AllowViewNums,@hasPermission as hasPermission," + |
| | | " viewnums,downnums,@totalViewNums as totalViewNums,@totalDownNums as totalDownNums, \n" |
| | | + " @AllowMaxFileSize as AllowMaxFileSize,@AllowFileTypes as AllowFileTypes,AllowUpdateNums,@AuthorAllowDelete as AuthorAllowDelete,@AuthorAllowUpdate as AuthorAllowUpdate \n" |
| | | + " HasDelete,HasUpdate,StartDate,EndDate,DateFlag,AllowDownnums,AllowViewNums,AllowUpdateNums,@hasPermission as hasPermission,\n" + |
| | | " viewnums,downnums,@totalViewNums as totalViewNums,@totalDownNums as totalDownNums,@totalUpdateNums as totalUpdateNums,\n" |
| | | + " @AllowMaxFileSize as AllowMaxFileSize,@AllowFileTypes as AllowFileTypes,@AuthorAllowDelete as AuthorAllowDelete,@AuthorAllowUpdate as AuthorAllowUpdate \n" |
| | | + " from _sys_AttachmentPermission \n" |
| | | + " where unid= @unid and seq = @seq and usercode= @usercode ; \n" |
| | | + " return ;" |
| | |
| | | + " if exists(select top 1 1 from _sys_AttachmentPermission \n" |
| | | + " where unid= @unid and seq = @seq and ISNULL(usercode,'') <> @usercode) \n " |
| | | + " begin \n" |
| | | + " select @unid as unid,@seq as seq,@usercode as UserCode,@UserName as UserName,1 as HasView,0 as HasDownload, \n" |
| | | + " 0 as HasDelete,0 as HasUpdate,convert(datetime,'1901-01-01',120) as StartDate,convert(datetime,'9999-12-31',120) as EndDate,\n" |
| | | + " 1 as DateFlag,0 as AllowDownnums,0 as AllowViewNums,0 as AllowUpdateNums, @totalViewNums as totalViewNums,@totalDownNums as totalDownNums,@hasPermission as hasPermission, \n" |
| | | + " select @unid as unid,@seq as seq,@usercode as UserCode,@UserName as UserName,1 as HasView,0 as HasDownload, \n" |
| | | + " 0 as HasDelete,0 as HasUpdate,convert(datetime,'9999-12-31',120) as StartDate,convert(datetime,'9999-12-31',120) as EndDate,\n" |
| | | + " 1 as DateFlag,0 as AllowDownnums,0 as AllowViewNums,0 as AllowUpdateNums, @hasPermission as hasPermission,\n " + |
| | | " 0 as viewnums,0 as downnums,@totalViewNums as totalViewNums,@totalDownNums as totalDownNums,@totalUpdateNums as totalUpdateNums,\n" |
| | | + " @AllowMaxFileSize as AllowMaxFileSize,@AllowFileTypes as AllowFileTypes,@AuthorAllowDelete as AuthorAllowDelete,@AuthorAllowUpdate as AuthorAllowUpdate \n" |
| | | + " return ; \n" |
| | | + " end \n" |
| | |
| | | + " begin \n" |
| | | + " select @unid as unid,@seq as seq,@usercode as UserCode,@UserName as UserName,1 as HasView,1 as HasDownload, \n" |
| | | + " 1 as HasDelete,1 as HasUpdate,convert(datetime,'1901-01-01',120) as StartDate,convert(datetime,'9999-12-31',120) as EndDate,\n" |
| | | + " 2 as DateFlag,0 as AllowDownnums,0 as AllowViewNums,0 as AllowUpdateNums, @totalViewNums as totalViewNums,@totalDownNums as totalDownNums,@hasPermission as hasPermission, \n" |
| | | + " 2 as DateFlag,0 as AllowDownnums,0 as AllowViewNums,0 as AllowUpdateNums,@hasPermission as hasPermission,\n " + |
| | | " 0 as viewnums,0 as downnums,@totalViewNums as totalViewNums,@totalDownNums as totalDownNums,@totalUpdateNums as totalUpdateNums, \n" |
| | | + " @AllowMaxFileSize as AllowMaxFileSize,@AllowFileTypes as AllowFileTypes,@AuthorAllowDelete as AuthorAllowDelete,@AuthorAllowUpdate as AuthorAllowUpdate \n" |
| | | + " return ; \n" |
| | | + " end else \n" |
| | | + " begin \n" |
| | | + " select @unid as unid,@seq as seq,@usercode as UserCode,@UserName as UserName,1 as HasView,0 as HasDownload, \n" |
| | | + " 0 as HasDelete,0 as HasUpdate,convert(datetime,'1901-01-01',120) as StartDate,convert(datetime,'9999-12-31',120) as EndDate, \n" |
| | | + " 2 as DateFlag,0 as AllowDownnums,0 as AllowViewNums,0 as AllowUpdateNums, @totalViewNums as totalViewNums,@totalDownNums as totalDownNums,@hasPermission as hasPermission, \n" |
| | | + " 0 as HasDelete,0 as HasUpdate,convert(datetime,'9999-12-31',120) as StartDate,convert(datetime,'9999-12-31',120) as EndDate, \n" |
| | | + " 1 as DateFlag,0 as AllowDownnums,0 as AllowViewNums,0 as AllowUpdateNums, @hasPermission as hasPermission,\n " + |
| | | " 0 as viewnums,0 as downnums,@totalViewNums as totalViewNums,@totalDownNums as totalDownNums,@totalUpdateNums as totalUpdateNums, \n" |
| | | + " @AllowMaxFileSize as AllowMaxFileSize,@AllowFileTypes as AllowFileTypes,@AuthorAllowDelete as AuthorAllowDelete,@AuthorAllowUpdate as AuthorAllowUpdate \n" |
| | | + " return ; \n" |
| | | + " end \n"; |