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
0c1d7c6e
Commit
0c1d7c6e
authored
Oct 23, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
群成员导出
parent
abeae912
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
0 deletions
+134
-0
GroupChatController.java
...aoban/manage/web/controller/chat/GroupChatController.java
+60
-0
GroupChatUserExcelVO.java
...m/gic/haoban/manage/web/vo/chat/GroupChatUserExcelVO.java
+74
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/chat/GroupChatController.java
View file @
0c1d7c6e
...
...
@@ -24,6 +24,7 @@ import com.gic.haoban.manage.api.service.StaffApiService;
import
com.gic.haoban.manage.api.service.chat.GroupChatApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.log.LogRecordUserServiceImpl
;
import
com.gic.haoban.manage.web.vo.chat.GroupChatUserExcelVO
;
import
com.gic.haoban.manage.web.vo.chat.GroupChatUserQuitVO
;
import
com.gic.log.record.anno.GicLogRecord
;
import
com.gic.log.record.util.GicLogRecordCategoryEnum
;
...
...
@@ -154,6 +155,65 @@ public class GroupChatController {
}
@RequestMapping
(
"user/detail/excel"
)
public
RestResponse
<
Boolean
>
detailExcel
(
HttpServletRequest
request
,
HttpServletResponse
response
,
GroupChatUserSearchQDTO
qdto
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
qdto
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
qdto
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
BasePageInfo
basePageInfo
=
new
BasePageInfo
()
;
basePageInfo
.
setPageNum
(
1
);
basePageInfo
.
setPageSize
(
1000
);
ServiceResponse
<
Page
<
GroupChatUserDTO
>>
resp
=
this
.
groupChatApiService
.
listUserPage
(
qdto
,
basePageInfo
);
Long
groupChatId
=
qdto
.
getGroupChatId
()
;
ServiceResponse
<
GroupChatDTO
>
detailResp
=
this
.
groupChatApiService
.
detail
(
loginUser
.
getWxEnterpriseId
(),
groupChatId
);
List
<
GroupChatUserDTO
>
list
=
resp
.
getResult
().
getResult
()
;
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
RestResponse
.
failure
(
"9999"
,
"无相关群成员"
);
}
String
s
=
DateUtil
.
formatString
(
new
Date
(),
DateUtil
.
FORMAT_DATE_10
);
String
fileName
=
"客户群成员-"
+
detailResp
.
getResult
().
getName
()+
"-"
+
s
;
List
<
String
>
titleList
=
Arrays
.
asList
(
"群成员名称"
,
"群成员昵称"
,
"身份"
,
"入群方式"
,
"入群时间"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"userName"
,
"nickName"
,
"userTypeExcel"
,
"sceneExcel"
,
"addTimeExcel"
);
List
<
GroupChatUserExcelVO
>
voList
=
new
ArrayList
<>()
;
for
(
GroupChatUserDTO
dto
:
list
)
{
GroupChatUserExcelVO
vo
=
EntityUtil
.
changeEntityByJSON
(
GroupChatUserExcelVO
.
class
,
dto
)
;
vo
.
setAddTimeExcel
(
DateUtil
.
dateToStr
(
dto
.
getUserQuitTime
(),
"yyyy-MM-dd HH:mm:ss"
));
if
(
dto
.
getUserType
()==
1
)
{
vo
.
setUserTypeExcel
(
"企业成员"
);
}
else
if
(
dto
.
getUserType
()==
2
)
{
vo
.
setUserTypeExcel
(
"外部成员"
);
}
else
{
vo
.
setUserTypeExcel
(
"客户"
);
}
Integer
joinScene
=
dto
.
getJoinScene
()
;
if
(
null
!=
joinScene
)
{
String
invitor_user_name
=
dto
.
getInvitorUserName
()
;
if
(
StringUtils
.
isBlank
(
invitor_user_name
))
{
invitor_user_name
=
"群成员"
;
}
if
(
joinScene
==
1
)
{
// 由群成员邀请入群(直接邀请入群)
vo
.
setSceneExcel
(
String
.
format
(
"由%s直接邀请入群"
,
invitor_user_name
));
}
else
if
(
joinScene
==
2
)
{
// 由群成员邀请入群(通过邀请链接入群)
vo
.
setSceneExcel
(
String
.
format
(
"通过%s分享链接入群"
,
invitor_user_name
));
}
else
if
(
joinScene
==
3
)
{
// 通过扫描群二维码入群
vo
.
setSceneExcel
(
String
.
format
(
"通过扫描%s分享的二维码入群"
,
invitor_user_name
));
}
voList
.
add
(
vo
)
;
}
}
try
{
ExcelUtils
.
xls
(
response
,
request
,
fileName
,
voList
,
fileList
,
titleList
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"异常"
,
e
);
logger
.
info
(
"导出失败"
);
}
return
RestResponse
.
successResult
(
true
);
}
@RequestMapping
(
"user/quit/excel"
)
public
RestResponse
<
Boolean
>
excel
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
searchParams
,
Integer
userType
,
Date
startDate
,
Date
endDate
,
@RequestParam
(
defaultValue
=
"2"
)
Integer
status
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/chat/GroupChatUserExcelVO.java
0 → 100644
View file @
0c1d7c6e
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
chat
;
import
java.io.Serializable
;
/**
*
* @ClassName: TabHaobanGroupChatUser
* @Description: TODO
* @Author 徐高华
* @Date 2022年11月25日 15:42:52
* @Modify
* @CopyRight
*/
public
class
GroupChatUserExcelVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
21771431486600L
;
/**
* 1企业成员2外部联系人3客户
*/
private
String
userTypeExcel
;
/**
* 姓名
*/
private
String
userName
;
/**
* 昵称
*/
private
String
nickName
;
private
String
sceneExcel
;
private
String
addTimeExcel
;
public
String
getUserTypeExcel
()
{
return
userTypeExcel
;
}
public
void
setUserTypeExcel
(
String
userTypeExcel
)
{
this
.
userTypeExcel
=
userTypeExcel
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getNickName
()
{
return
nickName
;
}
public
void
setNickName
(
String
nickName
)
{
this
.
nickName
=
nickName
;
}
public
String
getSceneExcel
()
{
return
sceneExcel
;
}
public
void
setSceneExcel
(
String
sceneExcel
)
{
this
.
sceneExcel
=
sceneExcel
;
}
public
String
getAddTimeExcel
()
{
return
addTimeExcel
;
}
public
void
setAddTimeExcel
(
String
addTimeExcel
)
{
this
.
addTimeExcel
=
addTimeExcel
;
}
}
\ No newline at end of file
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