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
3cf1e268
Commit
3cf1e268
authored
May 18, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
针对多个商户使用一个企微时,导出所属商户名称
parent
a7c6baed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
2 deletions
+45
-2
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+5
-0
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+28
-2
StaffExportVO.java
...main/java/com/gic/haoban/manage/web/vo/StaffExportVO.java
+12
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
3cf1e268
...
...
@@ -93,6 +93,11 @@ public class StaffServiceImpl implements StaffService {
}
String
sortField
=
"a."
+
staffListBO
.
getSortField
();
staffListBO
.
setSortField
(
sortField
);
//业务需求:许可激活时间和过期时间增加升序和降序排序,时间为空的数据无论升序还是降序排序均排在最后
if
(
"asc"
.
equals
(
staffListBO
.
getSortType
())
||
"ASC"
.
equals
(
staffListBO
.
getSortType
())){
String
s
=
"ISNULL("
+
sortField
+
"),"
+
sortField
;
staffListBO
.
setSortField
(
s
);
}
return
mapper
.
pageStaff
(
staffListBO
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
3cf1e268
...
...
@@ -6,6 +6,7 @@ import java.util.stream.Collectors;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
cn.hutool.core.collection.CollUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.qdto.TransferActiveCodeQDTO
;
...
...
@@ -503,6 +504,12 @@ public class StaffController extends WebBaseController {
pageNum
++;
}
List
<
StaffExportVO
>
voList
=
new
ArrayList
<>();
//针对多个商户使用一个企微时,导出所属商户名称
Boolean
flag
=
false
;
List
<
WxEnterpriseRelatedDTO
>
result
=
staffApiService
.
getWxEnterpriseRelatedList
(
wxEnterpriseId
).
getResult
();
if
(
CollUtil
.
isNotEmpty
(
result
)
&&
result
.
size
()>
1
){
flag
=
true
;
}
for
(
StaffDTO
staffDTO
:
staffAllList
)
{
StaffExportVO
vo
=
new
StaffExportVO
();
vo
.
setStaffId
(
staffDTO
.
getStaffId
());
...
...
@@ -511,6 +518,15 @@ public class StaffController extends WebBaseController {
vo
.
setPosition
(
staffDTO
.
getPostion
());
vo
.
setDepartmentName
(
departmentMap
.
get
(
staffDTO
.
getDepartmentIds
())
==
null
?
null
:
departmentMap
.
get
(
staffDTO
.
getDepartmentIds
()).
getDepartmentName
());
vo
.
setRelationFlag
((
Objects
.
isNull
(
staffDTO
.
getRelationFlag
())
||
staffDTO
.
getRelationFlag
()
==
0
)
?
"未关联"
:
"已关联"
);
if
(
flag
){
List
<
String
>
enterpriseNameList
=
staffDTO
.
getEnterpriseNameList
();
if
(
CollUtil
.
isNotEmpty
(
enterpriseNameList
)){
String
enterpriseName
=
String
.
join
(
","
,
enterpriseNameList
);
vo
.
setEnterpriseName
(
enterpriseName
);
}
else
{
vo
.
setEnterpriseName
(
"无归属"
);
}
}
voList
.
add
(
vo
);
}
//拼接导购信息
...
...
@@ -521,8 +537,15 @@ public class StaffController extends WebBaseController {
}
mergeClerkInfo
(
voList
,
wxEnterpriseId
);
String
fileName
=
wxEnterpriseName
+
"通讯录"
+
DateUtil
.
dateToStr
(
new
Date
(),
DateUtil
.
FORMAT_DATE_8
);
List
<
String
>
titleList
=
Arrays
.
asList
(
"姓名"
,
"职务"
,
"部门"
,
"手机号"
,
"关联状态"
,
"关联导购"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"staffName"
,
"position"
,
"departmentName"
,
"phoneNumber"
,
"relationFlag"
,
"clerkName"
);
List
<
String
>
titleList
=
new
ArrayList
<>();
List
<
String
>
fileList
=
new
ArrayList
<>();
if
(
flag
){
titleList
=
Arrays
.
asList
(
"姓名"
,
"职务"
,
"部门"
,
"手机号"
,
"关联状态"
,
"关联导购"
,
"所属商户"
);
fileList
=
Arrays
.
asList
(
"staffName"
,
"position"
,
"departmentName"
,
"phoneNumber"
,
"relationFlag"
,
"clerkName"
,
"enterpriseName"
);
}
else
{
titleList
=
Arrays
.
asList
(
"姓名"
,
"职务"
,
"部门"
,
"手机号"
,
"关联状态"
,
"关联导购"
);
fileList
=
Arrays
.
asList
(
"staffName"
,
"position"
,
"departmentName"
,
"phoneNumber"
,
"relationFlag"
,
"clerkName"
);
}
try
{
ExcelUtils
.
xls
(
response
,
request
,
fileName
,
voList
,
fileList
,
titleList
);
}
catch
(
Exception
e
)
{
...
...
@@ -642,6 +665,9 @@ public class StaffController extends WebBaseController {
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
ServiceResponse
<
List
<
WxEnterpriseRelatedDTO
>>
response
=
staffApiService
.
getWxEnterpriseRelatedList
(
wxEnterpriseId
);
List
<
WxEnterpriseRelatedVO
>
vo
=
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
response
.
getResult
()),
WxEnterpriseRelatedVO
.
class
);
if
(
CollUtil
.
isEmpty
(
vo
)){
return
RestResponse
.
successResult
(
new
ArrayList
<>());
}
return
RestResponse
.
successResult
(
vo
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/StaffExportVO.java
View file @
3cf1e268
...
...
@@ -27,6 +27,18 @@ public class StaffExportVO implements Serializable{
* 关联状态为 员工是否关联某门店导购
*/
private
String
relationFlag
;
/**
* gic品牌名称
*/
private
String
enterpriseName
;
public
String
getEnterpriseName
()
{
return
enterpriseName
;
}
public
void
setEnterpriseName
(
String
enterpriseName
)
{
this
.
enterpriseName
=
enterpriseName
;
}
public
String
getActiveFlag
()
{
return
activeFlag
;
...
...
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