Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
EncryptedFileSystem
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhangshuang
EncryptedFileSystem
Commits
76f8a95b
提交
76f8a95b
authored
3月 31, 2020
作者:
xc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xc
上级
ce68cb6f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
61 行增加
和
13 行删除
+61
-13
NoticeController.java
...in/java/com/zjty/efs/bus/controller/NoticeController.java
+1
-1
Addressee.java
efs-bus/src/main/java/com/zjty/efs/bus/entity/Addressee.java
+2
-2
NoticeServiceImpl.java
...java/com/zjty/efs/bus/service/impl/NoticeServiceImpl.java
+58
-10
没有找到文件。
efs-bus/src/main/java/com/zjty/efs/bus/controller/NoticeController.java
浏览文件 @
76f8a95b
...
@@ -61,7 +61,7 @@ public class NoticeController {
...
@@ -61,7 +61,7 @@ public class NoticeController {
@GetMapping
(
"/getNoticeList"
)
@GetMapping
(
"/getNoticeList"
)
@ApiOperation
(
value
=
"获取通知列表接口"
,
notes
=
"获取列表,type为通知类型,接收 0,发送 1,草稿 2"
)
@ApiOperation
(
value
=
"获取通知列表接口"
,
notes
=
"获取列表,type为通知类型,接收 0,发送 1,草稿 2"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"user"
,
value
=
"当前用户名称"
,
paramType
=
"query"
,
required
=
true
,
example
=
"account"
,
dataType
=
"
int
"
),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"user"
,
value
=
"当前用户名称"
,
paramType
=
"query"
,
required
=
true
,
example
=
"account"
,
dataType
=
"
String
"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"通知类型"
,
paramType
=
"query"
,
required
=
true
,
example
=
"0"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"通知类型"
,
paramType
=
"query"
,
required
=
true
,
example
=
"0"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageNum"
,
value
=
"页码"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageNum"
,
value
=
"页码"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"条数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)})
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"条数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)})
...
...
efs-bus/src/main/java/com/zjty/efs/bus/entity/
FileList
.java
→
efs-bus/src/main/java/com/zjty/efs/bus/entity/
Addressee
.java
浏览文件 @
76f8a95b
...
@@ -10,8 +10,8 @@ import java.lang.annotation.Documented;
...
@@ -10,8 +10,8 @@ import java.lang.annotation.Documented;
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
@Data
@Data
public
class
FileList
{
public
class
Addressee
{
private
String
id
;
private
String
id
;
private
String
address
;
private
String
name
;
}
}
efs-bus/src/main/java/com/zjty/efs/bus/service/impl/NoticeServiceImpl.java
浏览文件 @
76f8a95b
package
com
.
zjty
.
efs
.
bus
.
service
.
impl
;
package
com
.
zjty
.
efs
.
bus
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zjty.efs.bus.Dao.NoticeDao
;
import
com.zjty.efs.bus.Dao.NoticeDao
;
import
com.zjty.efs.bus.entity.Addressee
;
import
com.zjty.efs.bus.entity.Notice
;
import
com.zjty.efs.bus.entity.Notice
;
import
com.zjty.efs.bus.entity.Paging
;
import
com.zjty.efs.bus.entity.Paging
;
import
com.zjty.efs.bus.service.NoticeService
;
import
com.zjty.efs.bus.service.NoticeService
;
...
@@ -8,6 +10,7 @@ import com.zjty.efs.log.subject.entity.EfsLog;
...
@@ -8,6 +10,7 @@ import com.zjty.efs.log.subject.entity.EfsLog;
import
com.zjty.efs.log.tool.EfsLogUtil
;
import
com.zjty.efs.log.tool.EfsLogUtil
;
import
com.zjty.efs.user.subject.entity.UserDo
;
import
com.zjty.efs.user.subject.entity.UserDo
;
import
com.zjty.efs.user.subject.service.UserService
;
import
com.zjty.efs.user.subject.service.UserService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.data.domain.*
;
import
org.springframework.data.domain.*
;
...
@@ -54,27 +57,22 @@ public class NoticeServiceImpl implements NoticeService {
...
@@ -54,27 +57,22 @@ public class NoticeServiceImpl implements NoticeService {
//如果是发送,就新增接收
//如果是发送,就新增接收
String
[]
addressees
=
notice
.
getAddressee
().
split
(
","
);
String
[]
addressees
=
notice
.
getAddressee
().
split
(
","
);
List
<
Notice
>
noticeList
=
new
ArrayList
<>();
for
(
String
addressee:
addressees
){
for
(
String
addressee:
addressees
){
Notice
notice2
=
notice
;
Notice
notice2
=
transform
(
notice
)
;
notice2
.
setAddressee
(
addressee
);
notice2
.
setAddressee
(
addressee
);
notice
Dao
.
save
(
notice2
);
notice
List
.
add
(
notice2
);
//已发送保存
UserDo
userDo1
=
userService
.
findById
(
addressee
);
//接收人
UserDo
userDo1
=
userService
.
findById
(
addressee
);
//接收人
data
=
"["
+
userDo
.
getUnit
()
+
"]["
+
userDo
.
getDepartment
()
+
"]的["
+
userDo
.
getName
()
data
=
"["
+
userDo
.
getUnit
()
+
"]["
+
userDo
.
getDepartment
()
+
"]的["
+
userDo
.
getName
()
+
"]给["
+
userDo1
.
getUnit
()
+
"]["
+
userDo1
.
getDepartment
()
+
"]的["
+
userDo1
.
getName
()
+
"]给["
+
userDo1
.
getUnit
()
+
"]["
+
userDo1
.
getDepartment
()
+
"]的["
+
userDo1
.
getName
()
+
"发送了关于["
+
notice
.
getTitle
()
+
"]的通知"
;
+
"发送了关于["
+
notice
.
getTitle
()
+
"]的通知"
;
Notice
notice1
=
new
Notice
();
// Notice notice1 = new Notice();
Notice
notice1
=
transform
(
notice
);
//已接收
notice1
.
setType
(
0
);
notice1
.
setType
(
0
);
notice1
.
setTitle
(
notice
.
getTitle
());
notice1
.
setTitle
(
notice
.
getTitle
());
notice1
.
setAddressee
(
addressee
);
notice1
.
setAddressee
(
addressee
);
notice1
.
setDeadline
(
notice
.
getDeadline
());
notice1
.
setFileList
(
notice
.
getFileList
());
notice1
.
setMessage
(
notice
.
getMessage
());
notice1
.
setNote
(
notice
.
getNote
());
notice1
.
setSender
(
notice
.
getSender
());
notice1
.
setStatus
(
notice
.
getStatus
());
notice1
.
setUpdateTime
(
notice
.
getUpdateTime
());
notice1
.
setUnit
(
userDo1
.
getUnit
());
notice1
.
setUnit
(
userDo1
.
getUnit
());
noticeDao
.
save
(
notice1
);
noticeDao
.
save
(
notice1
);
String
data1
=
"["
+
userDo1
.
getUnit
()
+
"]["
+
userDo1
.
getDepartment
()
+
"]的["
+
userDo1
.
getName
()
String
data1
=
"["
+
userDo1
.
getUnit
()
+
"]["
+
userDo1
.
getDepartment
()
+
"]的["
+
userDo1
.
getName
()
...
@@ -82,6 +80,8 @@ public class NoticeServiceImpl implements NoticeService {
...
@@ -82,6 +80,8 @@ public class NoticeServiceImpl implements NoticeService {
+
"]关于["
+
notice
.
getTitle
()
+
"的通知"
;
+
"]关于["
+
notice
.
getTitle
()
+
"的通知"
;
efsLogUtil
.
addLog
(
new
EfsLog
(
null
,
userDo1
.
getId
(),
data1
,
new
Date
()));
efsLogUtil
.
addLog
(
new
EfsLog
(
null
,
userDo1
.
getId
(),
data1
,
new
Date
()));
}
}
System
.
out
.
println
(
noticeList
);
noticeDao
.
saveAll
(
noticeList
);
}
}
efsLogUtil
.
addLog
(
new
EfsLog
(
null
,
userDo
.
getId
(),
data
,
new
Date
()));
efsLogUtil
.
addLog
(
new
EfsLog
(
null
,
userDo
.
getId
(),
data
,
new
Date
()));
...
@@ -93,6 +93,21 @@ public class NoticeServiceImpl implements NoticeService {
...
@@ -93,6 +93,21 @@ public class NoticeServiceImpl implements NoticeService {
}
}
}
}
private
Notice
transform
(
Notice
notice
){
Notice
notice1
=
new
Notice
();
notice1
.
setTitle
(
notice
.
getTitle
());
notice1
.
setAddressee
(
notice
.
getAddressee
());
notice1
.
setDeadline
(
notice
.
getDeadline
());
notice1
.
setFileList
(
notice
.
getFileList
());
notice1
.
setMessage
(
notice
.
getMessage
());
notice1
.
setNote
(
notice
.
getNote
());
notice1
.
setSender
(
notice
.
getSender
());
notice1
.
setStatus
(
notice
.
getStatus
());
notice1
.
setUpdateTime
(
notice
.
getUpdateTime
());
notice1
.
setType
(
notice
.
getType
());
notice1
.
setUnit
(
notice
.
getUnit
());
return
notice1
;
}
@Override
@Override
@Transactional
@Transactional
...
@@ -127,6 +142,14 @@ public class NoticeServiceImpl implements NoticeService {
...
@@ -127,6 +142,14 @@ public class NoticeServiceImpl implements NoticeService {
String
data
=
"["
+
userDo
.
getUnit
()
+
"]["
+
userDo
.
getDepartment
()
+
"]的["
+
userDo
.
getName
()
String
data
=
"["
+
userDo
.
getUnit
()
+
"]["
+
userDo
.
getDepartment
()
+
"]的["
+
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
()));
UserDo
addressee
=
userService
.
findById
(
notice
.
getAddressee
());
Addressee
addressee1
=
new
Addressee
();
addressee1
.
setId
(
addressee
.
getId
());
addressee1
.
setName
(
addressee
.
getName
());
String
json
=
JSONObject
.
toJSONString
(
addressee1
);
notice
.
setAddressee
(
json
);
return
notice
;
return
notice
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -149,6 +172,31 @@ public class NoticeServiceImpl implements NoticeService {
...
@@ -149,6 +172,31 @@ public class NoticeServiceImpl implements NoticeService {
p
=
noticeDao
.
findOutBySenderAndType
(
user
,
type
,
pageable
);
p
=
noticeDao
.
findOutBySenderAndType
(
user
,
type
,
pageable
);
}
}
// for (Notice notice:p.getContent()){
String
addresseeId
=
""
;
//收件人编号
UserDo
addressee
=
new
UserDo
();
//收件人实体
for
(
int
i
=
0
;
i
<
p
.
getContent
().
size
();
i
++){
List
<
Addressee
>
addressees
=
new
ArrayList
<>();
Notice
notice
=
p
.
getContent
().
get
(
i
);
if
(
i
==
0
)
{
addresseeId
=
notice
.
getAddressee
();
addressee
=
userService
.
findById
(
notice
.
getAddressee
());
}
else
{
if
(!
addresseeId
.
equals
(
notice
.
getAddressee
())){
//如果两个收件人不一样,重新获取user
addressee
=
userService
.
findById
(
notice
.
getAddressee
());
}
}
Addressee
addressee1
=
new
Addressee
();
addressee1
.
setId
(
addressee
.
getId
());
addressee1
.
setName
(
addressee
.
getName
());
addressees
.
add
(
addressee1
);
String
json
=
JSONObject
.
toJSONString
(
addressees
);
notice
.
setAddressee
(
json
);
}
Paging
<
Notice
>
paging
=
new
Paging
<>();
Paging
<
Notice
>
paging
=
new
Paging
<>();
paging
.
setData
(
p
.
getContent
());
paging
.
setData
(
p
.
getContent
());
paging
.
setPageSize
(
pageSize
);
paging
.
setPageSize
(
pageSize
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论