Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
EncryptedFileSystem
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhangshuang
EncryptedFileSystem
Commits
a73b36d4
提交
a73b36d4
authored
4月 10, 2020
作者:
LJJ
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of…
Merge branch 'develop' of
https://git.yfzx.zjtys.com.cn/zhuangshuang/EncryptedFileSystem
into develop
上级
d2054fa0
d036300a
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
60 行增加
和
9 行删除
+60
-9
NoticeDao.java
efs-bus/src/main/java/com/zjty/efs/bus/Dao/NoticeDao.java
+1
-0
NoticeController.java
...in/java/com/zjty/efs/bus/controller/NoticeController.java
+8
-0
Attention.java
efs-bus/src/main/java/com/zjty/efs/bus/entity/Attention.java
+1
-0
Notice.java
efs-bus/src/main/java/com/zjty/efs/bus/entity/Notice.java
+7
-0
NoticeService.java
...src/main/java/com/zjty/efs/bus/service/NoticeService.java
+7
-0
NoticeServiceImpl.java
...java/com/zjty/efs/bus/service/impl/NoticeServiceImpl.java
+21
-3
Job.java
efs-bus/src/main/java/com/zjty/efs/bus/util/Job.java
+5
-5
FileUploadController.java
...ava/com/zjty/efs/ftp/controller/FileUploadController.java
+1
-1
FileUploadServiceImpl.java
.../com/zjty/efs/ftp/service/impl/FileUploadServiceImpl.java
+7
-0
application.properties
efs-union/src/main/resources/application.properties
+2
-0
没有找到文件。
efs-bus/src/main/java/com/zjty/efs/bus/Dao/NoticeDao.java
浏览文件 @
a73b36d4
...
@@ -19,5 +19,6 @@ public interface NoticeDao extends JpaRepository<Notice , Integer> {
...
@@ -19,5 +19,6 @@ public interface NoticeDao extends JpaRepository<Notice , Integer> {
Page
<
Notice
>
findOutByReceiverAndType
(
String
addressee
,
int
type
,
Pageable
pageable
);
Page
<
Notice
>
findOutByReceiverAndType
(
String
addressee
,
int
type
,
Pageable
pageable
);
Page
<
Notice
>
findOutByReceiverAndTypeAndStatus
(
String
addressee
,
int
type
,
int
status
,
Pageable
pageable
);
Page
<
Notice
>
findOutByReceiverAndTypeAndStatus
(
String
addressee
,
int
type
,
int
status
,
Pageable
pageable
);
List
<
Notice
>
findOutByReceiverAndStatus
(
String
receiver
,
int
status
);
List
<
Notice
>
findOutByReceiverAndStatus
(
String
receiver
,
int
status
);
Page
<
Notice
>
findOutBySenderAndTypeAndDeleted
(
String
sender
,
int
type
,
Pageable
pageable
,
String
deleted
);
}
}
efs-bus/src/main/java/com/zjty/efs/bus/controller/NoticeController.java
浏览文件 @
a73b36d4
...
@@ -99,4 +99,12 @@ public class NoticeController {
...
@@ -99,4 +99,12 @@ public class NoticeController {
return
ResponseEntity
.
ok
(
noticeService
.
unreadNum
(
userId
));
return
ResponseEntity
.
ok
(
noticeService
.
unreadNum
(
userId
));
}
}
@GetMapping
(
"/deleteDraft"
)
@ApiOperation
(
value
=
"删除草稿"
)
@ApiImplicitParam
(
name
=
"noticeId"
,
value
=
"草稿编号"
,
paramType
=
"query"
,
required
=
true
)
public
ResponseEntity
deleteDraft
(
int
noticeId
){
log
.
info
(
"删除草稿"
);
return
ResponseEntity
.
ok
(
noticeService
.
deleteDraft
(
noticeId
));
}
}
}
efs-bus/src/main/java/com/zjty/efs/bus/entity/Attention.java
浏览文件 @
a73b36d4
...
@@ -63,4 +63,5 @@ public class Attention {
...
@@ -63,4 +63,5 @@ public class Attention {
private
Date
updateTime
;
private
Date
updateTime
;
}
}
efs-bus/src/main/java/com/zjty/efs/bus/entity/Notice.java
浏览文件 @
a73b36d4
...
@@ -136,6 +136,13 @@ public class Notice {
...
@@ -136,6 +136,13 @@ public class Notice {
@Column
(
name
=
"receiver"
)
@Column
(
name
=
"receiver"
)
private
String
receiver
;
private
String
receiver
;
/**
* 是否删除
*/
@ApiModelProperty
(
value
=
"deleted"
,
example
=
""
,
dataType
=
"String"
,
name
=
"是否删除"
,
notes
=
"没有删除0,已删除1"
)
@Column
(
name
=
"deleted"
)
private
String
deleted
;
}
}
efs-bus/src/main/java/com/zjty/efs/bus/service/NoticeService.java
浏览文件 @
a73b36d4
...
@@ -77,4 +77,11 @@ public interface NoticeService {
...
@@ -77,4 +77,11 @@ public interface NoticeService {
* @return 已接收未读数量
* @return 已接收未读数量
*/
*/
int
unreadNum
(
String
userId
);
int
unreadNum
(
String
userId
);
/**
* 删除草稿
* @param noticeId 通知编号
* @return 成功true
*/
boolean
deleteDraft
(
int
noticeId
);
}
}
efs-bus/src/main/java/com/zjty/efs/bus/service/impl/NoticeServiceImpl.java
浏览文件 @
a73b36d4
...
@@ -68,6 +68,7 @@ public class NoticeServiceImpl implements NoticeService {
...
@@ -68,6 +68,7 @@ public class NoticeServiceImpl implements NoticeService {
}
}
notice
.
setAddressee
(
JSONObject
.
toJSONString
(
addresseeList
));
notice
.
setAddressee
(
JSONObject
.
toJSONString
(
addresseeList
));
notice
.
setDeleted
(
"0"
);
noticeDao
.
save
(
notice
);
noticeDao
.
save
(
notice
);
}
else
{
}
else
{
...
@@ -194,8 +195,8 @@ public class NoticeServiceImpl implements NoticeService {
...
@@ -194,8 +195,8 @@ public class NoticeServiceImpl implements NoticeService {
notice
.
setStatus
(
1
);
notice
.
setStatus
(
1
);
noticeDao
.
save
(
notice
);
noticeDao
.
save
(
notice
);
UserDo
userDo
=
userService
.
findById
(
userId
);
// 当前用户
UserDo
userDo
=
userService
.
findById
(
userId
);
// 当前用户
String
data
=
"["
+
userDo
.
getUnit
()
+
"
]["
+
userDo
.
getDepartment
()
+
"]的[
"
+
userDo
.
getName
()
String
data
=
"["
+
userDo
.
getUnit
()
+
"
_
"
+
userDo
.
getName
()
+
"
查看了关于["
+
notice
.
getTitle
()
+
"的通知
"
;
+
"
]查看了《"
+
notice
.
getTitle
()
+
"》
"
;
efsLogUtil
.
addLog
(
new
EfsLog
(
null
,
userDo
.
getId
(),
data
,
new
Date
()));
efsLogUtil
.
addLog
(
new
EfsLog
(
null
,
userDo
.
getId
(),
data
,
new
Date
()));
return
notice
;
return
notice
;
...
@@ -216,8 +217,11 @@ public class NoticeServiceImpl implements NoticeService {
...
@@ -216,8 +217,11 @@ public class NoticeServiceImpl implements NoticeService {
//已接收
//已接收
// p = noticeDao.findOutByAddresseeLikeAndType("%"+user+"%", type, pageable);
// p = noticeDao.findOutByAddresseeLikeAndType("%"+user+"%", type, pageable);
p
=
noticeDao
.
findOutByReceiverAndType
(
user
,
type
,
pageable
);
p
=
noticeDao
.
findOutByReceiverAndType
(
user
,
type
,
pageable
);
}
else
if
(
type
==
2
){
//草稿
p
=
noticeDao
.
findOutBySenderAndTypeAndDeleted
(
user
,
type
,
pageable
,
"0"
);
}
else
{
}
else
{
//已发送
,草稿
//已发送
p
=
noticeDao
.
findOutBySenderAndType
(
user
,
type
,
pageable
);
p
=
noticeDao
.
findOutBySenderAndType
(
user
,
type
,
pageable
);
}
}
...
@@ -298,5 +302,19 @@ public class NoticeServiceImpl implements NoticeService {
...
@@ -298,5 +302,19 @@ public class NoticeServiceImpl implements NoticeService {
return
noticeList
.
size
();
return
noticeList
.
size
();
}
}
@Override
public
boolean
deleteDraft
(
int
noticeId
)
{
try
{
Notice
notice
=
noticeDao
.
findById
(
noticeId
);
notice
.
setDeleted
(
"1"
);
noticeDao
.
save
(
notice
);
return
true
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
false
;
}
}
}
}
efs-bus/src/main/java/com/zjty/efs/bus/util/Job.java
浏览文件 @
a73b36d4
...
@@ -39,10 +39,10 @@ public class Job {
...
@@ -39,10 +39,10 @@ public class Job {
// updateAtt(notice, days, 1);
// updateAtt(notice, days, 1);
if
(
days
<=
3.001
&&
days
>
2.998
&&
notice
.
getLabel
()
!=
1
){
if
(
days
<=
3.001
&&
days
>
2.998
&&
notice
.
getLabel
()
!=
1
){
updateAtt
(
notice
,
3
,
1
);
updateAtt
(
notice
,
"3"
,
1
);
}
}
if
(
days
<=
1.001
&&
days
>
0.998
&&
notice
.
getLabel
()
!=
2
){
if
(
days
<=
1.001
&&
days
>
0.998
&&
notice
.
getLabel
()
!=
2
){
updateAtt
(
notice
,
1
,
2
);
updateAtt
(
notice
,
"1"
,
2
);
}
}
}
}
...
@@ -57,7 +57,7 @@ public class Job {
...
@@ -57,7 +57,7 @@ public class Job {
* @param days 失效天数
* @param days 失效天数
* @param label 修改通知label 1为提醒过一次,2为提醒过两次
* @param label 修改通知label 1为提醒过一次,2为提醒过两次
*/
*/
private
void
updateAtt
(
Notice
notice
,
double
days
,
int
label
){
private
void
updateAtt
(
Notice
notice
,
String
days
,
int
label
){
String
data
=
""
;
String
data
=
""
;
Attention
attention
=
new
Attention
();
Attention
attention
=
new
Attention
();
// data = "您收到来自["+ notice.getUnit() + "][" + notice.getName() +"]标题为[" + notice.getTitle() + "]的通知,没有查看";
// data = "您收到来自["+ notice.getUnit() + "][" + notice.getName() +"]标题为[" + notice.getTitle() + "]的通知,没有查看";
...
@@ -78,7 +78,7 @@ public class Job {
...
@@ -78,7 +78,7 @@ public class Job {
// System.out.println(downLoadCounts);
// System.out.println(downLoadCounts);
for
(
DownLoadCount
downLoadCount:
downLoadCounts
){
for
(
DownLoadCount
downLoadCount:
downLoadCounts
){
if
(
downLoadCount
.
getCount
()
==
0
){
if
(
downLoadCount
.
getCount
()
==
0
){
data
=
"您收到["
+
notice
.
getUnit
()
+
"
][
"
+
notice
.
getName
()
+
"]的《"
+
notice
.
getTitle
()
+
"》,有文件没有下载"
;
data
=
"您收到["
+
notice
.
getUnit
()
+
"
_
"
+
notice
.
getName
()
+
"]的《"
+
notice
.
getTitle
()
+
"》,有文件没有下载"
;
add
(
days
,
attention
,
data
,
notice
,
label
);
add
(
days
,
attention
,
data
,
notice
,
label
);
}
}
}
}
...
@@ -99,7 +99,7 @@ public class Job {
...
@@ -99,7 +99,7 @@ public class Job {
* @param notice 通知实体
* @param notice 通知实体
* @param label 该通知提醒过几次
* @param label 该通知提醒过几次
*/
*/
private
void
add
(
double
days
,
Attention
attention
,
String
data
,
Notice
notice
,
int
label
){
private
void
add
(
String
days
,
Attention
attention
,
String
data
,
Notice
notice
,
int
label
){
// int d = (int)Math.ceil(days);
// int d = (int)Math.ceil(days);
data
=
data
+
",还有"
+
days
+
"天失效。请尽快下载。"
;
data
=
data
+
",还有"
+
days
+
"天失效。请尽快下载。"
;
attention
.
setData
(
data
);
attention
.
setData
(
data
);
...
...
efs-ftp/src/main/java/com/zjty/efs/ftp/controller/FileUploadController.java
浏览文件 @
a73b36d4
...
@@ -72,7 +72,7 @@ public class FileUploadController {
...
@@ -72,7 +72,7 @@ public class FileUploadController {
})
})
@ResponseBody
@ResponseBody
public
ServerResponse
upload
(
@RequestParam
(
value
=
"file"
,
required
=
false
)
MultipartFile
file
,
public
ServerResponse
upload
(
@RequestParam
(
value
=
"file"
,
required
=
false
)
MultipartFile
file
,
@RequestParam
(
value
=
"md5File"
)
String
md5File
,
@RequestParam
(
value
=
"md5File"
,
required
=
false
)
String
md5File
,
@RequestParam
(
value
=
"chunk"
,
required
=
false
)
Integer
chunk
)
{
//第几片,从0开始
@RequestParam
(
value
=
"chunk"
,
required
=
false
)
Integer
chunk
)
{
//第几片,从0开始
return
fileUploadService
.
upload
(
file
,
md5File
,
chunk
);
return
fileUploadService
.
upload
(
file
,
md5File
,
chunk
);
}
}
...
...
efs-ftp/src/main/java/com/zjty/efs/ftp/service/impl/FileUploadServiceImpl.java
浏览文件 @
a73b36d4
...
@@ -123,6 +123,11 @@ public class FileUploadServiceImpl implements FileUploadService {
...
@@ -123,6 +123,11 @@ public class FileUploadServiceImpl implements FileUploadService {
@Override
@Override
public
ServerResponse
upload
(
MultipartFile
file
,
String
md5File
,
Integer
chunk
)
{
public
ServerResponse
upload
(
MultipartFile
file
,
String
md5File
,
Integer
chunk
)
{
log
.
info
(
"开始文件上传"
);
log
.
info
(
"文件:"
+
file
);
log
.
info
(
"md5File"
+
md5File
);
log
.
info
(
"当前分片"
+
chunk
);
log
.
info
(
"文件名称"
+
file
.
getName
());
String
chunkPath
=
fileAddress
+
"/"
+
md5File
+
"/"
;
//分片存放目录
String
chunkPath
=
fileAddress
+
"/"
+
md5File
+
"/"
;
//分片存放目录
File
dirFile
=
new
File
(
chunkPath
);
File
dirFile
=
new
File
(
chunkPath
);
if
(!
dirFile
.
exists
())
{
//目录不存在,创建目录
if
(!
dirFile
.
exists
())
{
//目录不存在,创建目录
...
@@ -144,6 +149,7 @@ public class FileUploadServiceImpl implements FileUploadService {
...
@@ -144,6 +149,7 @@ public class FileUploadServiceImpl implements FileUploadService {
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
filePath
+
"文件没有保存"
);
log
.
error
(
filePath
+
"文件没有保存"
);
}
}
log
.
info
(
saveFile
.
getAbsolutePath
()
+
"文件保存成功"
);
return
ServerResponse
.
success
(
"true"
);
return
ServerResponse
.
success
(
"true"
);
}
}
...
@@ -183,6 +189,7 @@ public class FileUploadServiceImpl implements FileUploadService {
...
@@ -183,6 +189,7 @@ public class FileUploadServiceImpl implements FileUploadService {
//删除md5目录,及临时文件
//删除md5目录,及临时文件
deleteFile
(
new
File
(
fileAddress
+
"/"
+
md5File
));
deleteFile
(
new
File
(
fileAddress
+
"/"
+
md5File
));
fileOutputStream
.
flush
();
fileOutputStream
.
flush
();
log
.
info
(
savePath
+
"文件合并成功"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
fileSave
.
getPath
()
+
"文件保存失败"
);
log
.
error
(
fileSave
.
getPath
()
+
"文件保存失败"
);
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
efs-union/src/main/resources/application.properties
浏览文件 @
a73b36d4
...
@@ -21,6 +21,8 @@ spring.jpa.open-in-view=true
...
@@ -21,6 +21,8 @@ spring.jpa.open-in-view=true
spring.servlet.multipart.max-file-size
=
100MB
spring.servlet.multipart.max-file-size
=
100MB
spring.servlet.multipart.max-request-size
=
100MB
spring.servlet.multipart.max-request-size
=
100MB
server.tomcat.max-http-form-post-size
=
100*1024*1024
file.address
=
/Users/ljj/software/ftp
file.address
=
/Users/ljj/software/ftp
# SSL config
# SSL config
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论