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
34e27c50
Commit
34e27c50
authored
Sep 29, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:区经,我的相关接口改为门店列表
parent
3a7301b4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
132 additions
and
68 deletions
+132
-68
AuditApiService.java
...va/com/gic/haoban/manage/api/service/AuditApiService.java
+3
-3
StaffClerkRelationApiService.java
...oban/manage/api/service/StaffClerkRelationApiService.java
+4
-2
TabHaobanAuditMapper.java
...aoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
+4
-5
TabHaobanStaffClerkRelationMapper.java
...service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
+4
-0
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+5
-2
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+2
-2
StaffClerkRelationApiServiceImpl.java
...ce/service/out/impl/StaffClerkRelationApiServiceImpl.java
+12
-6
HaobanRoleApiServiceImpl.java
...rvice/service/out/impl/role/HaobanRoleApiServiceImpl.java
+4
-4
TabHaobanAuditMapper.xml
...ervice/src/main/resources/mapper/TabHaobanAuditMapper.xml
+0
-0
TabHaobanStaffClerkRelationMapper.xml
...in/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
+12
-0
TabHaobanMenuMapper.xml
...ce/src/main/resources/mapper/role/TabHaobanMenuMapper.xml
+1
-1
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+17
-5
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+64
-38
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/AuditApiService.java
View file @
34e27c50
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
java.util.List
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.BatchAuditLogDTO
;
import
java.util.List
;
/**
* Created by tgs on 2020/2/9.
...
...
@@ -31,7 +31,7 @@ public interface AuditApiService {
Page
<
AuditDTO
>
listByStaffId
(
String
staffId
,
Integer
auditType
,
Integer
auditStatus
,
BasePageInfo
pageInfo
);
Page
<
AuditDTO
>
pageStoreListByParams
(
String
storeId
,
BasePageInfo
pageInfo
,
Integer
auditType
,
Integer
auditStatus
);
Page
<
AuditDTO
>
pageStoreListByParams
(
List
<
String
>
storeIds
,
BasePageInfo
pageInfo
,
Integer
auditType
,
Integer
auditStatus
);
AuditDTO
findById
(
String
auditId
);
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffClerkRelationApiService.java
View file @
34e27c50
...
...
@@ -80,10 +80,12 @@ public interface StaffClerkRelationApiService {
*/
List
<
StaffClerkRelationDTO
>
listByStoreId
(
String
storeId
);
List
<
StaffClerkRelationDTO
>
listByStoreIds
(
List
<
String
>
storeIds
);
/**
* 查询导购信息
*
* @param
clerk
Id
*
@param storeId
* @param
staff
Id
* @return
*/
StaffClerkRelationDTO
getOneByStoreIdAndStaffId
(
String
storeId
,
String
staffId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
View file @
34e27c50
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.gic.haoban.manage.service.entity.TabHaobanAudit
;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
TabHaobanAuditMapper
{
...
...
@@ -23,7 +22,7 @@ public interface TabHaobanAuditMapper {
com
.
github
.
pagehelper
.
Page
listByStaffId
(
@Param
(
"staffId"
)
String
staffId
,
@Param
(
"auditType"
)
Integer
auditType
,
@Param
(
"auditStatus"
)
Integer
auditStatus
);
com
.
github
.
pagehelper
.
Page
pageStoreListByParams
(
@Param
(
"storeId
"
)
String
storeId
,
@Param
(
"auditType"
)
Integer
auditType
,
@Param
(
"auditStatus"
)
Integer
auditStatus
);
com
.
github
.
pagehelper
.
Page
pageStoreListByParams
(
@Param
(
"storeId
s"
)
List
<
String
>
storeIds
,
@Param
(
"auditType"
)
Integer
auditType
,
@Param
(
"auditStatus"
)
Integer
auditStatus
);
TabHaobanAudit
findByBindRelatedIdAndAuditType
(
@Param
(
"relatedId"
)
String
relatedId
,
@Param
(
"auditType"
)
int
auditType
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
View file @
34e27c50
...
...
@@ -267,4 +267,7 @@ public interface TabHaobanStaffClerkRelationMapper {
int
getBindByStaffIdAndEnterpriseId
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"staffId"
)
String
staffId
);
List
<
TabHaobanStaffClerkRelation
>
listManageBindByStaffId
(
@Param
(
"staffId"
)
String
staffId
);
List
<
TabHaobanStaffClerkRelation
>
listByStoreIds
(
@Param
(
"storeIds"
)
List
<
String
>
storeIds
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
34e27c50
...
...
@@ -153,8 +153,11 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
String
wxEnterpriseId
=
dto
.
getWxEnterpriseId
();
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
wxEnterpriseId
);
//推入日志
staffClerkBindLogService
.
pushToMq
(
staffId
,
optStaffId
,
BindTypeEnum
.
BIND
.
getVal
(),
channelCode
,
dto
.
getStaffClerkRelationId
());
staffClerkBindLogService
.
pushToMq
(
staffId
,
optStaffId
,
BindTypeEnum
.
BIND
.
getVal
(),
channelCode
,
staffClerkRelationId
);
Integer
manageFlag
=
dto
.
getManageFlag
();
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
return
staffClerkRelationId
;
}
// 绑定自动创建活码
HmQrcodeQDTO
hmQrcodeQDTO
=
new
HmQrcodeQDTO
();
hmQrcodeQDTO
.
setHmType
(
1
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
34e27c50
...
...
@@ -401,10 +401,10 @@ public class AuditApiServiceImpl implements AuditApiService {
}
@Override
public
Page
<
AuditDTO
>
pageStoreListByParams
(
String
storeId
,
BasePageInfo
pageInfo
,
Integer
auditType
,
public
Page
<
AuditDTO
>
pageStoreListByParams
(
List
<
String
>
storeIds
,
BasePageInfo
pageInfo
,
Integer
auditType
,
Integer
auditStatus
)
{
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
return
PageUtil
.
changePageHelperToCurrentPage
(
auditMapper
.
pageStoreListByParams
(
storeId
,
auditType
,
auditStatus
),
AuditDTO
.
class
);
return
PageUtil
.
changePageHelperToCurrentPage
(
auditMapper
.
pageStoreListByParams
(
storeId
s
,
auditType
,
auditStatus
),
AuditDTO
.
class
);
}
public
void
insertBatchLog
(
String
batchId
,
int
auditResult
,
TabHaobanAudit
tab
)
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffClerkRelationApiServiceImpl.java
View file @
34e27c50
...
...
@@ -165,22 +165,22 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
logger
.
info
(
"绑定clerk:{}"
,
JSONObject
.
toJSONString
(
staffClerkRelationDTO
));
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getBindByClerkId
(
staffClerkRelationDTO
.
getClerkId
(),
staffClerkRelationDTO
.
getWxEnterpriseId
());
if
(
null
!=
relationDTO
)
{
return
ServiceResponse
.
failure
(
"2"
,
"已经被绑定,不能绑定"
);
return
ServiceResponse
.
failure
(
"2"
,
"已经被绑定,不能绑定"
);
}
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
staffClerkRelationDTO
.
getClerkId
(),
AuditType
.
CLERK_BIND
.
getCode
());
if
(
null
!=
auditDTO
)
{
return
ServiceResponse
.
failure
(
"4"
,
"该导购已经被被申请绑定,请审核处理后再绑定"
);
return
ServiceResponse
.
failure
(
"4"
,
"该导购已经被被申请绑定,请审核处理后再绑定"
);
}
List
<
AuditDTO
>
list
=
auditApiService
.
listByStoreId
(
staffClerkRelationDTO
.
getStoreId
());
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
Set
<
String
>
staffIds
=
list
.
stream
().
map
(
AuditDTO:
:
getCommitStaffId
).
collect
(
Collectors
.
toSet
());
if
(
staffIds
.
contains
(
staffClerkRelationDTO
.
getStaffId
()))
{
return
ServiceResponse
.
failure
(
"5"
,
"该成员已经已经在该门店下申请了绑定,请审核处理后再绑定"
);
return
ServiceResponse
.
failure
(
"5"
,
"该成员已经已经在该门店下申请了绑定,请审核处理后再绑定"
);
}
}
StaffClerkRelationDTO
storeHasBind
=
staffClerkRelationService
.
getOneBindByStoreId
(
staffClerkRelationDTO
.
getStaffId
(),
staffClerkRelationDTO
.
getStoreId
());
if
(
storeHasBind
!=
null
)
{
return
ServiceResponse
.
failure
(
"3"
,
"该导购已在该门店下有其它成员绑定"
);
return
ServiceResponse
.
failure
(
"3"
,
"该导购已在该门店下有其它成员绑定"
);
}
Integer
manageFlag
=
staffClerkRelationDTO
.
getManageFlag
();
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
...
...
@@ -226,6 +226,12 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
@Override
public
List
<
StaffClerkRelationDTO
>
listByStoreIds
(
List
<
String
>
storeIds
)
{
List
<
TabHaobanStaffClerkRelation
>
list
=
tabHaobanStaffClerkRelationMapper
.
listByStoreIds
(
storeIds
);
return
EntityUtil
.
changeEntityListNew
(
StaffClerkRelationDTO
.
class
,
list
);
}
@Override
public
boolean
unbindByStaffAndClerkId
(
String
staffId
,
String
clerkId
,
int
channelCode
)
{
return
staffClerkRelationService
.
delBind
(
clerkId
,
staffId
,
channelCode
);
}
...
...
@@ -261,7 +267,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public
ServiceResponse
wxBindStaffClerk
(
StaffClerkRelationDTO
staffClerkRelation
,
String
optStaffId
,
int
channelCode
)
{
Integer
manageFlag
=
staffClerkRelation
.
getManageFlag
();
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
ServiceResponse
serviceResponse
=
getManageFlagBind
(
staffClerkRelation
);
if
(!
serviceResponse
.
isSuccess
())
{
return
serviceResponse
;
...
...
@@ -282,7 +288,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
private
ServiceResponse
getManageFlagBind
(
StaffClerkRelationDTO
staffClerkRelation
)
{
boolean
bindFlag
=
staffClerkRelationService
.
getBindByStaffIdAndEnterpriseId
(
staffClerkRelation
.
getWxEnterpriseId
(),
staffClerkRelation
.
getStaffId
());
if
(
bindFlag
)
{
return
ServiceResponse
.
failure
(
"3"
,
"该员工已经绑定,不允许绑定区经/督导"
);
return
ServiceResponse
.
failure
(
"3"
,
"该员工已经绑定,不允许绑定区经/督导"
);
}
return
ServiceResponse
.
success
();
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/role/HaobanRoleApiServiceImpl.java
View file @
34e27c50
...
...
@@ -259,9 +259,9 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
boolean
delClerkFlag
=
false
;
for
(
TabHaobanWxEnterpriseRelated
enterpriseRelated
:
enterpriseRelateds
)
{
ClerkEditInfoDTO
clerkEditInfoDTO
=
ClerkEditInfoDTO
.
info
(
enterpriseRelated
.
getClerkEditFlag
());
addClerkFlag
=
clerkEditInfoDTO
.
getAddClerkFlag
()
==
1
?
true
:
false
;
editClerkFlag
=
clerkEditInfoDTO
.
getEditClerkFlag
()
==
1
?
true
:
false
;
delClerkFlag
=
clerkEditInfoDTO
.
getDelClerkFlag
()
==
1
?
true
:
false
;
addClerkFlag
=
clerkEditInfoDTO
.
getAddClerkFlag
()
==
1
;
editClerkFlag
=
clerkEditInfoDTO
.
getEditClerkFlag
()
==
1
;
delClerkFlag
=
clerkEditInfoDTO
.
getDelClerkFlag
()
==
1
;
boolean
searchFlagEnterpriseId
=
manageSettingApiService
.
getEnterpriseIdByFlag
(
enterpriseRelated
.
getEnterpriseId
(),
1
,
null
);
if
(
searchFlagEnterpriseId
)
{
searchFlag
=
true
;
...
...
@@ -294,7 +294,7 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
menuCodes
.
add
(
"userCenter_addClerk"
);
}
if
(
editClerkFlag
)
{
menuCodes
.
add
(
"
userCenter_editClerk
"
);
menuCodes
.
add
(
"
storeClerkList_edit
"
);
}
if
(
delClerkFlag
)
{
menuCodes
.
add
(
"userCenter_delClerk"
);
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanAuditMapper.xml
View file @
34e27c50
This diff is collapsed.
Click to expand it.
haoban-manage3-service/src/main/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
View file @
34e27c50
...
...
@@ -565,4 +565,15 @@
where status_flag=1 and manage_flag = 1 and staff_id = #{staffId}
</select>
<select
id=
"listByStoreIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff_clerk_relation
where status_flag=1
and store_id in
<foreach
collection=
"storeIds"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/role/TabHaobanMenuMapper.xml
View file @
34e27c50
...
...
@@ -177,7 +177,7 @@
<foreach
collection=
"menuCodes"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
</foreach>
and menu_code not in ('customerList_allSearch','customerList_allSearch','userCenter_addClerk','userCenter_delClerk','
userCenter_editClerk
');
and menu_code not in ('customerList_allSearch','customerList_allSearch','userCenter_addClerk','userCenter_delClerk','
storeClerkList_edit
');
</select>
<select
id=
"getHaobanMenuListByCode"
resultMap=
"TabHaobanMenuMap"
>
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
34e27c50
...
...
@@ -26,6 +26,7 @@ import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import
com.gic.haoban.manage.web.vo.AuditVO
;
import
com.gic.haoban.manage.web.vo.StaffClerkBindLogDetailVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -129,12 +130,23 @@ public class AuditController extends WebBaseController {
//门店记录列表
@RequestMapping
(
"store-apply-list"
)
public
HaobanResponse
storeApplyList
(
String
storeId
,
String
wxEnterpriseId
,
BasePageInfo
pageInfo
,
Integer
auditType
,
Integer
auditStatus
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
,
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
public
HaobanResponse
storeApplyList
(
String
storeId
,
BasePageInfo
pageInfo
,
Integer
auditType
,
Integer
auditStatus
,
Integer
manageFlag
,
String
clerkId
)
{
WellDoneLoginDTO
loginUser
=
this
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
List
<
String
>
storeIds
=
new
ArrayList
<>();
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
List
<
String
>
roleStoreIds
=
staffApiService
.
getHaoBanStoreIdsRolesByClerkId
(
clerkId
,
wxEnterpriseId
);
storeIds
.
addAll
(
roleStoreIds
);
}
else
{
storeIds
.
add
(
storeId
);
}
Page
<
AuditDTO
>
page
=
auditApiService
.
pageStoreListByParams
(
storeId
,
pageInfo
,
auditType
,
auditStatus
);
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
}
if
(
storeIds
.
contains
(
"-1"
))
{
storeIds
=
null
;
}
Page
<
AuditDTO
>
page
=
auditApiService
.
pageStoreListByParams
(
storeIds
,
pageInfo
,
auditType
,
auditStatus
);
List
<
AuditDTO
>
list
=
page
.
getResult
();
List
<
AuditVO
>
voList
=
new
ArrayList
<
AuditVO
>();
for
(
AuditDTO
auditDTO
:
list
)
{
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
34e27c50
...
...
@@ -103,11 +103,23 @@ public class ClerkController extends WebBaseController {
//选择成员列表
@RequestMapping
(
"/staff-list"
)
public
HaobanResponse
staffList
(
String
storeId
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
public
HaobanResponse
staffList
(
String
storeId
,
Integer
manageFlag
,
String
clerkId
)
{
WellDoneLoginDTO
loginUser
=
this
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
List
<
String
>
storeIds
=
new
ArrayList
<>();
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
List
<
String
>
roleStoreIds
=
staffApiService
.
getHaoBanStoreIdsRolesByClerkId
(
clerkId
,
wxEnterpriseId
);
storeIds
.
addAll
(
roleStoreIds
);
}
else
{
storeIds
.
add
(
storeId
);
}
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
}
if
(
storeIds
.
contains
(
"-1"
))
{
storeIds
=
null
;
}
List
<
StaffClerkRelationDTO
>
list
=
staffClerkRelationApiService
.
listByStoreId
(
storeId
);
List
<
StaffClerkRelationDTO
>
list
=
staffClerkRelationApiService
.
listByStoreId
s
(
storeIds
);
List
<
String
>
staffIds
=
list
.
stream
().
map
(
StaffClerkRelationDTO:
:
getStaffId
).
collect
(
Collectors
.
toList
());
List
<
StaffDTO
>
resultlist
=
staffApiService
.
listByIds
(
staffIds
);
Map
<
String
,
StaffDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
resultlist
,
"staffId"
);
...
...
@@ -134,20 +146,28 @@ public class ClerkController extends WebBaseController {
//门店成员列表
@RequestMapping
(
"/store-clerks"
)
public
HaobanResponse
storeClerks
(
String
wxEnterpriseId
,
String
storeId
,
String
version
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
public
HaobanResponse
storeClerks
(
String
clerkId
,
String
enterpriseId
,
String
storeId
,
Integer
manageFlag
)
{
WellDoneLoginDTO
loginUser
=
this
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
List
<
String
>
storeIds
=
new
ArrayList
<>();
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
List
<
String
>
roleStoreIds
=
staffApiService
.
getHaoBanStoreIdsRolesByClerkId
(
clerkId
,
wxEnterpriseId
);
storeIds
.
addAll
(
roleStoreIds
);
}
else
{
storeIds
.
add
(
storeId
);
}
StoreDTO
storeDTO
=
storeService
.
getStore
(
storeId
);
if
(
storeDTO
==
null
)
{
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
}
List
<
ClerkListDTO
>
list
=
clerkService
.
getClerkByStoreId
(
storeDTO
.
getEnterpriseId
(),
storeId
);
Set
<
String
>
clerkCodeList
=
list
.
stream
().
map
(
ClerkListDTO:
:
getClerkCode
).
collect
(
Collectors
.
toSet
());
List
<
StaffClerkRelationDTO
>
bindRelationList
=
staffClerkRelationApiService
.
listBindCode
(
storeDTO
.
getEnterpriseId
(),
clerkCodeList
);
if
(
storeIds
.
contains
(
"-1"
))
{
storeIds
=
null
;
}
List
<
ClerkDTO
>
clerkDTOS
=
clerkService
.
listClerkByNameOrCode
(
enterpriseId
,
null
,
storeIds
);
Set
<
String
>
clerkCodeList
=
clerkDTOS
.
stream
().
map
(
ClerkDTO:
:
getClerkCode
).
collect
(
Collectors
.
toSet
());
List
<
StaffClerkRelationDTO
>
bindRelationList
=
staffClerkRelationApiService
.
listBindCode
(
enterpriseId
,
clerkCodeList
);
Map
<
String
,
StaffClerkRelationDTO
>
bindCodeMap
=
bindRelationList
.
stream
().
collect
(
Collectors
.
toMap
(
StaffClerkRelationDTO:
:
getClerkCode
,
s
->
s
));
List
<
StoreClerkVO
>
resultList
=
new
ArrayList
<>();
for
(
Clerk
ListDTO
dto
:
list
)
{
for
(
Clerk
DTO
dto
:
clerkDTOS
)
{
String
clerkCode
=
dto
.
getClerkCode
();
StoreClerkVO
vo
=
new
StoreClerkVO
();
vo
.
setClerkCode
(
clerkCode
);
...
...
@@ -164,19 +184,11 @@ public class ClerkController extends WebBaseController {
}
resultList
.
add
(
vo
);
}
if
(
StringUtils
.
isBlank
(
version
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
resultList
);
}
else
{
WxEnterpriseRelationDetailDTO
enterpriseBindInfo
=
wxEnterpriseRelatedApiService
.
getEnterpriseBindInfo
(
wxEnterpriseId
,
storeDTO
.
getEnterpriseId
());
Map
<
String
,
Object
>
ret
=
new
HashMap
<>();
// 待删除
ret
.
put
(
"clerkEditFlag"
,
ClerkEditInfoVO
.
info
(
enterpriseBindInfo
.
getClerkEditFlag
()).
getEditClerkFlag
());
ret
.
put
(
"clerkList"
,
resultList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
ret
);
}
}
//门店成员列表
@RequestMapping
(
"/clerk-edit-flag"
)
public
HaobanResponse
clerkEditFlag
(
String
wxEnterpriseId
,
String
storeId
)
{
...
...
@@ -645,6 +657,9 @@ public class ClerkController extends WebBaseController {
if
(
StringUtils
.
isAnyBlank
(
staffId
,
wxEnterpriseId
,
keyword
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
if
(
manageFlag
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
if
(
"-1"
.
equals
(
staffId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_400022
);
}
...
...
@@ -662,10 +677,13 @@ public class ClerkController extends WebBaseController {
}
logger
.
info
(
"查询到企微门店数={},{}"
,
storeIds
.
size
(),
storeIds
);
List
<
ClerkDTO
>
clerkList
=
new
ArrayList
<>();
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
clerkList
=
clerkService
.
listClerkEnableHaoban
(
enterpriseIdList
,
keyword
);
if
(
manageFlag
==
-
1
)
{
clerkList
.
addAll
(
clerkService
.
listClerkEnableHaoban
(
enterpriseIdList
,
keyword
));
clerkList
.
addAll
(
clerkNewService
.
listClerkByEnterpriseIdAndSearchAndClerkType
(
enterpriseIdList
,
storeIds
,
keyword
));
}
else
if
(
manageFlag
==
1
)
{
clerkList
.
addAll
(
clerkService
.
listClerkEnableHaoban
(
enterpriseIdList
,
keyword
));
}
else
{
clerkList
=
clerkNewService
.
listClerkByEnterpriseIdAndSearchAndClerkType
(
enterpriseIdList
,
storeIds
,
keyword
);
clerkList
.
addAll
(
clerkNewService
.
listClerkByEnterpriseIdAndSearchAndClerkType
(
enterpriseIdList
,
storeIds
,
keyword
)
);
}
List
<
ClerkStoreVO
>
clerkStoreList
=
buildClerkRelation
(
clerkList
,
enterpriseIdList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
clerkStoreList
);
...
...
@@ -944,28 +962,36 @@ public class ClerkController extends WebBaseController {
//门店导购列表
@RequestMapping
(
"store-clerk-list"
)
public
HaobanResponse
storeClerkList
(
String
storeId
,
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
,
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
public
HaobanResponse
storeClerkList
(
String
storeId
,
String
enterpriseId
,
Integer
manageFlag
,
String
clerkId
)
{
WellDoneLoginDTO
loginUser
=
this
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
List
<
String
>
storeIds
=
new
ArrayList
<>();
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
List
<
String
>
roleStoreIds
=
staffApiService
.
getHaoBanStoreIdsRolesByClerkId
(
clerkId
,
wxEnterpriseId
);
storeIds
.
addAll
(
roleStoreIds
);
}
else
{
storeIds
.
add
(
storeId
);
}
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
if
(
store
==
null
)
{
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
}
List
<
ClerkListDTO
>
list
=
clerkService
.
getClerkByStoreId
(
store
.
getEnterpriseId
(),
storeId
);
Set
<
String
>
clerkCodeList
=
list
.
stream
().
map
(
ClerkListDTO:
:
getClerkCode
).
collect
(
Collectors
.
toSet
());
List
<
StaffClerkRelationDTO
>
bindRelationList
=
staffClerkRelationApiService
.
listBindCode
(
store
.
getEnterpriseId
(),
clerkCodeList
);
if
(
storeIds
.
contains
(
"-1"
))
{
storeIds
=
null
;
}
List
<
ClerkDTO
>
list
=
clerkService
.
listClerkByNameOrCode
(
enterpriseId
,
null
,
storeIds
);
Set
<
String
>
clerkCodeList
=
list
.
stream
().
map
(
ClerkDTO:
:
getClerkCode
).
collect
(
Collectors
.
toSet
());
List
<
StaffClerkRelationDTO
>
bindRelationList
=
staffClerkRelationApiService
.
listBindCode
(
enterpriseId
,
clerkCodeList
);
Map
<
String
,
StaffClerkRelationDTO
>
bindCodeMap
=
bindRelationList
.
stream
().
collect
(
Collectors
.
toMap
(
StaffClerkRelationDTO:
:
getClerkCode
,
s
->
s
));
List
<
BindClerkVO
>
bindList
=
new
ArrayList
<>();
List
<
BindClerkVO
>
unBindList
=
new
ArrayList
<>();
for
(
Clerk
ListDTO
clerkListDTO
:
list
)
{
BindClerkVO
vo
=
EntityUtil
.
changeEntityByJSON
(
BindClerkVO
.
class
,
clerkListDTO
);
if
(
bindCodeMap
.
containsKey
(
clerkListDTO
.
getClerkCode
()))
{
String
staffId
=
bindCodeMap
.
get
(
clerkListDTO
.
getClerkCode
()).
getStaffId
();
for
(
Clerk
DTO
dto
:
list
)
{
BindClerkVO
vo
=
EntityUtil
.
changeEntityByJSON
(
BindClerkVO
.
class
,
dto
);
if
(
bindCodeMap
.
containsKey
(
dto
.
getClerkCode
()))
{
String
staffId
=
bindCodeMap
.
get
(
dto
.
getClerkCode
()).
getStaffId
();
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
vo
.
setStaffId
(
staffId
);
vo
.
setNationCode
(
clerkListDTO
.
getNationcode
());
vo
.
setPhoneNumber
(
clerkListDTO
.
getPhoneNumber
());
vo
.
setNationCode
(
dto
.
getNationcode
());
vo
.
setPhoneNumber
(
dto
.
getPhoneNumber
());
vo
.
setStaffName
(
staffDTO
==
null
?
""
:
staffDTO
.
getStaffName
());
bindList
.
add
(
vo
);
}
else
{
...
...
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