Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
9a9c6982
Commit
9a9c6982
authored
Sep 11, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退群记录导出
parent
3a8770a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
GroupChatController.java
...aoban/manage/web/controller/chat/GroupChatController.java
+34
-7
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/chat/GroupChatController.java
View file @
9a9c6982
...
...
@@ -37,12 +37,14 @@ import org.apache.logging.log4j.Logger;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -153,11 +155,35 @@ public class GroupChatController {
@RequestMapping
(
"user/quit/excel"
)
public
RestResponse
<
Boolean
>
excel
(
HttpServletRequest
request
,
HttpServletResponse
response
,
GroupChatUserSearchQDTO
qdto
,
BasePageInfo
basePageInfo
)
{
ServiceResponse
<
Page
<
GroupChatUserDTO
>>
page
=
this
.
groupChatApiService
.
listUserPage
(
qdto
,
basePageInfo
);
if
(
page
.
isSuccess
()
&&
CollUtil
.
isNotEmpty
(
page
.
getResult
().
getResult
())){
public
RestResponse
<
Boolean
>
excel
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
searchParams
,
Integer
userType
,
Date
startDate
,
Date
endDate
,
@RequestParam
(
defaultValue
=
"2"
)
Integer
status
)
{
GroupChatUserSearchQDTO
qdto
=
new
GroupChatUserSearchQDTO
();
BasePageInfo
basePageInfo
=
new
BasePageInfo
();
int
pageNum
=
1
;
int
pageSize
=
1000
;
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
qdto
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
qdto
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
qdto
.
setSearchParams
(
searchParams
);
qdto
.
setUserType
(
userType
);
qdto
.
setStartDate
(
startDate
);
qdto
.
setEndDate
(
endDate
);
qdto
.
setStatus
(
status
);
basePageInfo
.
setPageSize
(
pageSize
);
List
<
GroupChatUserDTO
>
result
=
new
ArrayList
<>();
while
(
true
)
{
basePageInfo
.
setPageNum
(
pageNum
);
ServiceResponse
<
Page
<
GroupChatUserDTO
>>
page
=
this
.
groupChatApiService
.
listUserPage
(
qdto
,
basePageInfo
);
List
<
GroupChatUserDTO
>
list
=
page
.
getResult
().
getResult
();
if
(
CollectionUtils
.
isEmpty
(
list
))
{
break
;
}
result
.
addAll
(
list
);
pageNum
++;
}
if
(
CollUtil
.
isNotEmpty
(
result
)){
List
<
GroupChatUserQuitVO
>
voList
=
new
ArrayList
<>()
;
for
(
GroupChatUserDTO
dto
:
page
.
getResult
().
getResult
()
)
{
for
(
GroupChatUserDTO
dto
:
result
)
{
GroupChatUserQuitVO
vo
=
EntityUtil
.
changeEntityByJSON
(
GroupChatUserQuitVO
.
class
,
dto
)
;
vo
.
setUserQuitTimeExcel
(
DateUtil
.
dateToStr
(
dto
.
getUserQuitTime
(),
"yyyy-MM-dd HH:mm:ss"
));
if
(
dto
.
getUserType
()==
1
)
{
...
...
@@ -169,9 +195,10 @@ public class GroupChatController {
}
voList
.
add
(
vo
)
;
}
String
fileName
=
"退群记录"
;
List
<
String
>
titleList
=
Arrays
.
asList
(
"群成员"
,
"身份"
,
"群名称"
,
"群主"
,
"退群时间"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"userName"
,
"userTypeExcel"
,
"chatName"
,
"staffName"
,
"userQuitTimeExcel"
);
String
s
=
DateUtil
.
formatString
(
new
Date
(),
DateUtil
.
FORMAT_DATE_10
);
String
fileName
=
"退群记录"
+
s
;
List
<
String
>
titleList
=
Arrays
.
asList
(
"群成员姓名"
,
"群成员昵称"
,
"身份"
,
"群名称"
,
"群主"
,
"退群时间"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"userName"
,
"nickName"
,
"userTypeExcel"
,
"chatName"
,
"staffName"
,
"userQuitTimeExcel"
);
try
{
ExcelUtils
.
xls
(
response
,
request
,
fileName
,
voList
,
fileList
,
titleList
);
}
catch
(
Exception
e
)
{
...
...
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