Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
email
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈天仲
email
Commits
c00ceef6
Commit
c00ceef6
authored
Nov 05, 2023
by
chentianzhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
天天改,代码都乱玩了
parent
adb33e9f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
27 deletions
+43
-27
src/main/java/com/zq/email/controller/EmailApiController.java
+2
-2
src/main/java/com/zq/email/entity/EmailPerson.java
+6
-0
src/main/java/com/zq/email/service/impl/EmailPersonServiceImpl.java
+35
-25
No files found.
src/main/java/com/zq/email/controller/EmailApiController.java
View file @
c00ceef6
...
@@ -118,9 +118,9 @@ public class EmailApiController {
...
@@ -118,9 +118,9 @@ public class EmailApiController {
reqVo
.
setIsPerson
(
WhetherEnum
.
YES
.
getKey
());
reqVo
.
setIsPerson
(
WhetherEnum
.
YES
.
getKey
());
reqVo
.
setIsSend
(
WhetherEnum
.
YES
.
getKey
());
reqVo
.
setIsSend
(
WhetherEnum
.
YES
.
getKey
());
reqVo
.
setIsRead
(
WhetherEnum
.
NO
.
getKey
());
reqVo
.
setIsRead
(
WhetherEnum
.
NO
.
getKey
());
LocalDateTime
startTime
=
LocalDateTimeUtil
.
endOfDay
(
LocalDateTime
.
now
(
));
LocalDateTime
startTime
=
LocalDateTimeUtil
.
beginOfDay
(
DateUtils
.
getRangeStart
(
0
));
reqVo
.
setSearchStartTime
(
startTime
);
reqVo
.
setSearchStartTime
(
startTime
);
LocalDateTime
endTime
=
LocalDateTimeUtil
.
beginOfDay
(
DateUtils
.
getRangeStart
(
0
));
LocalDateTime
endTime
=
LocalDateTimeUtil
.
endOfDay
(
LocalDateTime
.
now
(
));
reqVo
.
setSearchStopTime
(
endTime
);
reqVo
.
setSearchStopTime
(
endTime
);
// reqVo.setSearchStartTime();
// reqVo.setSearchStartTime();
// reqVo.setSearchStopTime();
// reqVo.setSearchStopTime();
...
...
src/main/java/com/zq/email/entity/EmailPerson.java
View file @
c00ceef6
...
@@ -76,6 +76,12 @@ public class EmailPerson implements Serializable {
...
@@ -76,6 +76,12 @@ public class EmailPerson implements Serializable {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
List
<
EmailPerson
>
receiverList
;
private
List
<
EmailPerson
>
receiverList
;
@TableField
(
exist
=
false
)
private
String
sendUserPhoto
;
@TableField
(
exist
=
false
)
private
String
sendUserDeptName
;
//发送人信息
//发送人信息
// @TableField(exist = false)
// @TableField(exist = false)
// private UserDto sender;
// private UserDto sender;
...
...
src/main/java/com/zq/email/service/impl/EmailPersonServiceImpl.java
View file @
c00ceef6
...
@@ -109,14 +109,6 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
...
@@ -109,14 +109,6 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
.
le
(
vo
.
getSearchStopTime
()!=
null
,
EmailPerson:
:
getSendTime
,
vo
.
getSearchStopTime
());
.
le
(
vo
.
getSearchStopTime
()!=
null
,
EmailPerson:
:
getSendTime
,
vo
.
getSearchStopTime
());
// if (DateUtils.getRangeStart(vo.getSearchRange()) !=null){
// queryWrapper.ge(EmailPerson::getSendTime, DateUtils.getRangeStart(vo.getSearchRange()));
// queryWrapper.le(EmailPerson::getSendTime, LocalDateTime.now());
// }
//queryWrapper.orderByAsc(EmailPerson::getIsRead).orderByDesc(EmailPerson::getSendTime);
//queryWrapper.orderByAsc(EmailPerson::getIsRead).orderByDesc(EmailPerson::getSendTime);
queryWrapper
.
orderByDesc
(
EmailPerson:
:
getSendTime
);
//.orderByAsc(EmailPerson::getIsRead);
queryWrapper
.
orderByDesc
(
EmailPerson:
:
getSendTime
);
//.orderByAsc(EmailPerson::getIsRead);
page
=
this
.
page
(
page
,
queryWrapper
);
page
=
this
.
page
(
page
,
queryWrapper
);
...
@@ -125,30 +117,54 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
...
@@ -125,30 +117,54 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
for
(
EmailPerson
record
:
page
.
getRecords
())
{
for
(
EmailPerson
record
:
page
.
getRecords
())
{
EmailContent
content
=
this
.
emailContentService
.
getById
(
record
.
getEmailContentId
());
EmailContent
content
=
this
.
emailContentService
.
getById
(
record
.
getEmailContentId
());
//已发送
if
(
vo
.
getFolderId
().
equals
(
EmailFolderEnum
.
FOLDER_ALREADY_SEND
.
getKey
()))
{
if
(
vo
.
getFolderId
().
equals
(
EmailFolderEnum
.
FOLDER_ALREADY_SEND
.
getKey
()))
{
record
.
setEmailAttachList
(
this
.
emailAttachService
.
findByContentId
(
content
.
getId
()));
record
.
setEmailAttachList
(
this
.
emailAttachService
.
findByContentId
(
content
.
getId
()));
record
.
setReceiverList
(
this
.
findReceiverByContentId
(
content
.
getId
(),
null
));
List
<
EmailPerson
>
receiverByContentId
=
this
.
findReceiverByContentId
(
content
.
getId
(),
null
);
for
(
EmailPerson
person
:
receiverByContentId
)
{
ResultVo
<
UserDto
>
reviceList
=
adminFeignClient
.
findById
(
person
.
getUserId
());
if
(
reviceList
.
isSuccess
()
&&
reviceList
.
getData
()
!=
null
){
UserDto
data
=
reviceList
.
getData
();
if
(
profile
.
contains
(
"wan"
))
{
if
(
StrUtil
.
isNotBlank
(
data
.
getPhoto
())){
String
replace
=
data
.
getPhoto
()
.
replace
(
"http://147.1.3.87"
,
"http://172.28.1.159:82"
)
.
replace
(
"http://147.2.3.3"
,
"http://172.28.1.71"
);
person
.
setSendUserPhoto
(
replace
);
}
}
else
{
content
.
setSendUserPhoto
(
data
.
getPhoto
());
}
ResultVo
<
String
>
deptWholeName
=
adminFeignClient
.
getDeptWholeName
(
data
.
getDept
().
getId
());
person
.
setSendUserDeptName
(
deptWholeName
.
getData
());
}
}
}
record
.
setReceiverList
(
receiverByContentId
);
//其他文件夹
}
else
{
//发送人头像
//发送人头像
if
(
vo
.
getIsSenderPhoto
()
!=
null
&&
vo
.
getIsSenderPhoto
()){
ResultVo
<
UserDto
>
senderVo
=
adminFeignClient
.
findById
(
content
.
getSendUserId
());
ResultVo
<
UserDto
>
senderVo
=
adminFeignClient
.
findById
(
content
.
getSendUserId
());
if
(
senderVo
.
isSuccess
()
&&
senderVo
.
getData
()
!=
null
)
{
if
(
senderVo
.
isSuccess
()
&&
senderVo
.
getData
()
!=
null
)
{
UserDto
data
=
senderVo
.
getData
();
UserDto
data
=
senderVo
.
getData
();
if
(
profile
.
contains
(
"wan"
))
{
if
(
profile
.
contains
(
"wan"
))
{
if
(
StrUtil
.
isNotBlank
(
data
.
getPhoto
())){
if
(
StrUtil
.
isNotBlank
(
data
.
getPhoto
()))
{
String
replace
=
data
.
getPhoto
()
String
replace
=
data
.
getPhoto
()
.
replace
(
"http://147.1.3.87"
,
"http://172.28.1.159:82"
)
.
replace
(
"http://147.1.3.87"
,
"http://172.28.1.159:82"
)
.
replace
(
"http://147.2.3.3"
,
"http://172.28.1.71"
);
.
replace
(
"http://147.2.3.3"
,
"http://172.28.1.71"
);
content
.
setSendUserPhoto
(
replace
);
content
.
setSendUserPhoto
(
replace
);
}
}
}
else
{
}
else
{
content
.
setSendUserPhoto
(
data
.
getPhoto
());
content
.
setSendUserPhoto
(
data
.
getPhoto
());
}
}
ResultVo
<
String
>
deptWholeName
=
adminFeignClient
.
getDeptWholeName
(
data
.
getDept
().
getId
());
ResultVo
<
String
>
deptWholeName
=
adminFeignClient
.
getDeptWholeName
(
data
.
getDept
().
getId
());
content
.
setSendUserDeptName
(
deptWholeName
.
getData
());
content
.
setSendUserDeptName
(
deptWholeName
.
getData
());
}
}
}
}
record
.
setEmailContent
(
content
);
record
.
setEmailContent
(
content
);
}
}
...
@@ -185,7 +201,6 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
...
@@ -185,7 +201,6 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
person
.
setReceiverList
(
this
.
findReceiverByContentId
(
content
.
getId
(),
null
));
person
.
setReceiverList
(
this
.
findReceiverByContentId
(
content
.
getId
(),
null
));
}
}
//发送人头像
//发送人头像
if
(
vo
.
getIsSenderPhoto
()
!=
null
&&
vo
.
getIsSenderPhoto
()){
ResultVo
<
UserDto
>
senderVo
=
adminFeignClient
.
findById
(
content
.
getSendUserId
());
ResultVo
<
UserDto
>
senderVo
=
adminFeignClient
.
findById
(
content
.
getSendUserId
());
if
(
senderVo
.
isSuccess
()
&&
senderVo
.
getData
()
!=
null
){
if
(
senderVo
.
isSuccess
()
&&
senderVo
.
getData
()
!=
null
){
UserDto
data
=
senderVo
.
getData
();
UserDto
data
=
senderVo
.
getData
();
...
@@ -197,7 +212,6 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
...
@@ -197,7 +212,6 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
ResultVo
<
String
>
deptWholeName
=
adminFeignClient
.
getDeptWholeName
(
data
.
getDept
().
getId
());
ResultVo
<
String
>
deptWholeName
=
adminFeignClient
.
getDeptWholeName
(
data
.
getDept
().
getId
());
content
.
setSendUserDeptName
(
deptWholeName
.
getData
());
content
.
setSendUserDeptName
(
deptWholeName
.
getData
());
}
}
}
person
.
setEmailContent
(
content
);
person
.
setEmailContent
(
content
);
}
}
}
}
...
@@ -398,8 +412,8 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
...
@@ -398,8 +412,8 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
List
<
EmailPerson
>
list
=
List
<
EmailPerson
>
list
=
this
.
lambdaQuery
()
this
.
lambdaQuery
()
.
in
(
EmailPerson:
:
getId
,
vo
.
getPersonIdList
())
.
in
(
EmailPerson:
:
getId
,
vo
.
getPersonIdList
())
.
ge
(
EmailPerson:
:
getSendTime
,
DateUtils
.
getRangeStart
(
vo
.
getSearchRange
()))
//
.ge(EmailPerson::getSendTime, DateUtils.getRangeStart(vo.getSearchRange()))
.
le
(
EmailPerson:
:
getSendTime
,
LocalDateTime
.
now
())
//
.le(EmailPerson::getSendTime, LocalDateTime.now())
.
list
();
.
list
();
for
(
EmailPerson
person
:
list
)
{
for
(
EmailPerson
person
:
list
)
{
...
@@ -443,14 +457,12 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
...
@@ -443,14 +457,12 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
public
void
readAllEmails
(
Long
folderId
)
{
public
void
readAllEmails
(
Long
folderId
)
{
OnlineUserDto
adminContext
=
TokenUtils
.
getAdminContext
();
OnlineUserDto
adminContext
=
TokenUtils
.
getAdminContext
();
AssertUtils
.
notNull
(
adminContext
,
"登录已失效,请重新登录后再次尝试!"
);
AssertUtils
.
notNull
(
adminContext
,
"登录已失效,请重新登录后再次尝试!"
);
LocalDateTime
rangeStart
=
DateUtils
.
getRangeStart
(
2
);
//
LocalDateTime rangeStart = DateUtils.getRangeStart(2);
List
<
EmailPerson
>
personList
=
this
.
lambdaQuery
().
eq
(
EmailPerson:
:
getUserId
,
adminContext
.
getUserId
())
List
<
EmailPerson
>
personList
=
this
.
lambdaQuery
().
eq
(
EmailPerson:
:
getUserId
,
adminContext
.
getUserId
())
.
eq
(
EmailPerson:
:
getFolderId
,
folderId
)
.
eq
(
EmailPerson:
:
getFolderId
,
folderId
)
.
eq
(
EmailPerson:
:
getPersonType
,
EmailConstant
.
TYPE_EMAIL_RECEIVE
)
.
eq
(
EmailPerson:
:
getPersonType
,
EmailConstant
.
TYPE_EMAIL_RECEIVE
)
.
eq
(
EmailPerson:
:
getIsRead
,
WhetherEnum
.
NO
.
getKey
())
.
eq
(
EmailPerson:
:
getIsRead
,
WhetherEnum
.
NO
.
getKey
())
.
ge
(
EmailPerson:
:
getSendTime
,
rangeStart
)
.
le
(
EmailPerson:
:
getSendTime
,
LocalDateTime
.
now
())
.
list
();
.
list
();
if
(
CollectionUtil
.
isNotEmpty
(
personList
)){
if
(
CollectionUtil
.
isNotEmpty
(
personList
)){
List
<
Long
>
ids
=
personList
.
stream
().
map
(
EmailPerson:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
ids
=
personList
.
stream
().
map
(
EmailPerson:
:
getId
).
collect
(
Collectors
.
toList
());
...
@@ -471,8 +483,8 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
...
@@ -471,8 +483,8 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
AssertUtils
.
notNull
(
adminContext
,
"登录已失效,请重新登录后再次尝试!"
);
AssertUtils
.
notNull
(
adminContext
,
"登录已失效,请重新登录后再次尝试!"
);
List
<
EmailPerson
>
personList
=
this
.
lambdaQuery
()
List
<
EmailPerson
>
personList
=
this
.
lambdaQuery
()
.
ge
(
vo
.
getSearchRange
()
!=
null
,
EmailPerson:
:
getSendTime
,
DateUtils
.
getRangeStart
(
vo
.
getSearchRange
()))
//
.ge(vo.getSearchRange() != null, EmailPerson::getSendTime, DateUtils.getRangeStart(vo.getSearchRange()))
.
le
(
EmailPerson:
:
getSendTime
,
LocalDateTime
.
now
())
//
.le(EmailPerson::getSendTime, LocalDateTime.now())
.
in
(
EmailPerson:
:
getId
,
vo
.
getPersonIdList
())
.
in
(
EmailPerson:
:
getId
,
vo
.
getPersonIdList
())
.
list
();
.
list
();
...
@@ -592,7 +604,7 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
...
@@ -592,7 +604,7 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
if
(
type
.
equals
(
WhetherEnum
.
YES
.
getKey
())){
//下
if
(
type
.
equals
(
WhetherEnum
.
YES
.
getKey
())){
//下
queryWrapper
.
ge
(
DateUtils
.
getRangeStart
(
vo
.
getSearchRange
())!=
null
,
EmailPerson:
:
getSendTime
,
DateUtils
.
getRangeStart
(
vo
.
getSearchRange
()));
//
queryWrapper.ge(DateUtils.getRangeStart(vo.getSearchRange())!=null, EmailPerson::getSendTime, DateUtils.getRangeStart(vo.getSearchRange()));
queryWrapper
.
lt
(
EmailPerson:
:
getSendTime
,
currentPerson
.
getSendTime
());
queryWrapper
.
lt
(
EmailPerson:
:
getSendTime
,
currentPerson
.
getSendTime
());
queryWrapper
.
orderByDesc
(
EmailPerson:
:
getSendTime
);
queryWrapper
.
orderByDesc
(
EmailPerson:
:
getSendTime
);
//log.info(">>下一封");
//log.info(">>下一封");
...
@@ -833,7 +845,6 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
...
@@ -833,7 +845,6 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
person
.
setReceiverList
(
this
.
findReceiverByContentId
(
content
.
getId
(),
null
));
person
.
setReceiverList
(
this
.
findReceiverByContentId
(
content
.
getId
(),
null
));
//}
//}
//发送人头像
//发送人头像
if
(
vo
.
getIsSenderPhoto
()){
ResultVo
<
UserDto
>
senderVo
=
adminFeignClient
.
findById
(
content
.
getSendUserId
());
ResultVo
<
UserDto
>
senderVo
=
adminFeignClient
.
findById
(
content
.
getSendUserId
());
if
(
senderVo
.
isSuccess
()
&&
senderVo
.
getData
()
!=
null
){
if
(
senderVo
.
isSuccess
()
&&
senderVo
.
getData
()
!=
null
){
UserDto
data
=
senderVo
.
getData
();
UserDto
data
=
senderVo
.
getData
();
...
@@ -854,7 +865,6 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
...
@@ -854,7 +865,6 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
content
.
setSendUserDeptName
(
deptWholeName
.
getData
());
content
.
setSendUserDeptName
(
deptWholeName
.
getData
());
}
}
}
person
.
setEmailContent
(
content
);
person
.
setEmailContent
(
content
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment