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
0cfc26d9
Commit
0cfc26d9
authored
Sep 22, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:绑定审核修改
parent
14921100
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
294 additions
and
292 deletions
+294
-292
StaffClerkRelationApiService.java
...oban/manage/api/service/StaffClerkRelationApiService.java
+6
-6
TabHaobanStaffClerkRelationMapper.java
...service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
+11
-0
StaffClerkRelationService.java
...ban/manage/service/service/StaffClerkRelationService.java
+195
-175
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+11
-1
StaffClerkRelationApiServiceImpl.java
...ce/service/out/impl/StaffClerkRelationApiServiceImpl.java
+39
-18
KafkaMessageServiceImpl.java
...c/haoban/manage/service/task/KafkaMessageServiceImpl.java
+4
-83
TabHaobanStaffClerkRelationMapper.xml
...in/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
+16
-1
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+3
-3
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+5
-4
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+4
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffClerkRelationApiService.java
View file @
0cfc26d9
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkInfoDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
...
...
@@ -37,18 +37,18 @@ public interface StaffClerkRelationApiService {
*/
ServiceResponse
bindStaffClerk
(
StaffClerkRelationDTO
staffClerkRelationDTO
,
String
optStaffId
,
int
channelCode
);
StaffClerkRelationDTO
getByCodeAndEnterpriseId
(
String
clerkCode
,
String
enterpriseId
);
/**
* 审核绑定
*
小程序-
审核绑定
*
* @param staffClerkRelation
* @param optStaffId
* @param channelCode
*/
void
delAndInsert
(
StaffClerkRelationDTO
staffClerkRelation
,
String
optStaffId
,
int
channelCode
);
ServiceResponse
wxBindStaffClerk
(
StaffClerkRelationDTO
staffClerkRelation
,
String
optStaffId
,
int
channelCode
);
StaffClerkRelationDTO
getByCodeAndEnterpriseId
(
String
clerkCode
,
String
enterpriseId
);
/**
* 解绑导购
* @param staffId
...
...
@@ -145,7 +145,7 @@ public interface StaffClerkRelationApiService {
* @param clerkId
* @return
*/
ServiceResponse
<
String
>
getClerkMemberChatConfig
(
String
clerkId
);
com
.
gic
.
haoban
.
base
.
api
.
common
.
ServiceResponse
<
String
>
getClerkMemberChatConfig
(
String
clerkId
);
/**
* @return 返回值类型: <pre>
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
View file @
0cfc26d9
...
...
@@ -255,4 +255,14 @@ public interface TabHaobanStaffClerkRelationMapper {
void
deleteByEnterpriseId
(
@Param
(
"enterpriseId"
)
String
enterpriseId
)
;
/**
* 获取区经
*
* @param enterpriseId 企业标识
* @return int
*/
int
getBindByManage
(
@Param
(
"enterpriseId"
)
String
enterpriseId
);
int
getBindByStaffIdAndEnterpriseId
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"staffId"
)
String
staffId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffClerkRelationService.java
View file @
0cfc26d9
...
...
@@ -10,179 +10,199 @@ import java.util.Set;
public
interface
StaffClerkRelationService
{
List
<
StaffClerkRelationDTO
>
listBindCode
(
String
enterpriseId
,
Set
<
String
>
clerkCodeList
);
List
<
StaffClerkRelationDTO
>
listBindCodeByStaffId
(
List
<
String
>
enterpriseIdList
,
String
staffId
);
/**
* 解绑-删除绑定(导购级别)
*
* @param clerkId
* @return
*/
boolean
delBind
(
String
clerkId
,
String
optStaffId
,
int
channelCode
);
/**
* 解绑-删除绑定(门店级别)
*
* @param wxEnterpriseId 可以不传
* @param storeIds
* @return
*/
boolean
delBindByStoreIds
(
String
wxEnterpriseId
,
Set
<
String
>
storeIds
,
String
optStaffId
,
int
channelCode
);
/**
* 绑定
*
* @param dto
* @return
*/
String
bind
(
StaffClerkRelationDTO
dto
,
String
optStaffId
,
int
channelCode
);
/**
* 根据clerkId 更新数据
* @param dto
* @return
*/
boolean
updateByClerkId
(
StaffClerkRelationDTO
dto
);
/**
* 查询绑定根据clerkId
*
* @param clerkId
* @param wxEnterpriseId
* @return
*/
StaffClerkRelationDTO
getBindByClerkId
(
String
clerkId
,
String
wxEnterpriseId
);
StaffClerkRelationDTO
getByCodeAndEnterpriseId
(
String
clerkCode
,
String
enterpriseId
);
String
insert
(
StaffClerkRelationDTO
staffClerkRelation
);
int
cleanStaffClerk
(
String
wxEnterpriseId
,
List
<
String
>
staffIds
);
StaffClerkRelationDTO
getOneBindCodeNoStatus
(
String
enterpriseId
,
String
clerkCode
);
StaffClerkRelationDTO
getOneBindByStoreId
(
String
staffId
,
String
storeId
);
StaffClerkRelationDTO
getByClerkId
(
String
clerkId
);
StaffClerkRelationDTO
getByClerkIdForWxUserId
(
String
clerkId
);
StaffClerkRelationDTO
getByClerkIdNoStatus
(
String
clerkId
);
List
<
StaffClerkRelationDTO
>
listByClerkIds
(
List
<
String
>
clerkList
);
List
<
StaffClerkRelationDTO
>
listByStaffId
(
String
wxEnterpriseId
,
String
staffId
);
List
<
StaffClerkRelationDTO
>
listByStaffId
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
storeIdList
);
/**
* 保存
* @param memberClerkChatConfig
*/
void
saveChatConfig
(
MemberClerkChatConfig
memberClerkChatConfig
);
/**
* @param staffId
* @param memberId
* @return
*/
MemberClerkChatConfig
getChatConfig
(
String
staffId
,
String
memberId
);
/**
* 根据企业查询
* @param wxEnterpriseId
* @return
*/
List
<
String
>
listByWxEnterpriseId
(
String
wxEnterpriseId
);
Page
<
StaffClerkRelationDTO
>
pageByWxEnterpriseId
(
String
wxEnterpriseId
,
BasePageInfo
pageInfo
);
/**
* 根据门店获取门店的绑定列表
*
* @param wxEnterpriseId
* @param storeId
* @return
*/
List
<
StaffClerkRelationDTO
>
listBindByStoreId
(
String
wxEnterpriseId
,
String
storeId
);
/**
* 查询门店列表
*
* @param enterpriseId
* @return
*/
List
<
StaffClerkRelationDTO
>
listBindStoreIdByEnterpriseId
(
String
enterpriseId
);
/**
* 查询有关联的员工id列表
*
* @param staffIdList 员工id列表
* @author: YongEn
* @return {@link Set<String>}
*/
List
<
String
>
listRelationsStaffId
(
Set
<
String
>
staffIdList
);
/**
* 根据导购查询wxuserid
*
* @param clerkList 职员名单
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link String }>
* @author mozhu
* @date 2022-07-07 15:25:55
*/
List
<
String
>
listWxUserIdByClerkIds
(
List
<
String
>
clerkList
,
String
wxEnterpriseId
);
/**
* 通过userid 查询id
*
* @param wxUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-08-08 22:01:59
*/
List
<
StaffClerkRelationDTO
>
listIdsByWxUserIds
(
List
<
String
>
wxUserIds
,
String
wxEnterpriseId
,
String
enterpriseId
);
/**
* 通过userid 不在范围内 查询id
*
* @param wxUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-08-08 21:51:52
*/
List
<
StaffClerkRelationDTO
>
listIdsByNotInWxUserIds
(
List
<
String
>
wxUserIds
,
String
wxEnterpriseId
,
String
enterpriseId
);
/**
* 更新联系我状态
*
* @param openConcatFlag 打开concat国旗
* @param staffClerkRelationId 员工职员关系id
* @return int
* @author mozhu
* @date 2022-07-07 15:34:27
*/
int
updateOpenConcatFlagById
(
Integer
openConcatFlag
,
String
staffClerkRelationId
);
/**
* 通过职员id 查询职员id列表
*
* @param clerkIds 职员id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-07-07 16:41:35
*/
List
<
StaffClerkRelationDTO
>
listClerkIdConcatFlagByClerkIds
(
List
<
String
>
clerkIds
,
String
wxEnterpriseId
);
List
<
StaffClerkRelationDTO
>
listBindCode
(
String
enterpriseId
,
Set
<
String
>
clerkCodeList
);
List
<
StaffClerkRelationDTO
>
listBindCodeByStaffId
(
List
<
String
>
enterpriseIdList
,
String
staffId
);
/**
* 解绑-删除绑定(导购级别)
*
* @param clerkId
* @return
*/
boolean
delBind
(
String
clerkId
,
String
optStaffId
,
int
channelCode
);
/**
* 解绑-删除绑定(门店级别)
*
* @param wxEnterpriseId 可以不传
* @param storeIds
* @return
*/
boolean
delBindByStoreIds
(
String
wxEnterpriseId
,
Set
<
String
>
storeIds
,
String
optStaffId
,
int
channelCode
);
/**
* 绑定
*
* @param dto
* @return
*/
String
bind
(
StaffClerkRelationDTO
dto
,
String
optStaffId
,
int
channelCode
);
/**
* 根据clerkId 更新数据
*
* @param dto
* @return
*/
boolean
updateByClerkId
(
StaffClerkRelationDTO
dto
);
/**
* 查询绑定根据clerkId
*
* @param clerkId
* @param wxEnterpriseId
* @return
*/
StaffClerkRelationDTO
getBindByClerkId
(
String
clerkId
,
String
wxEnterpriseId
);
StaffClerkRelationDTO
getByCodeAndEnterpriseId
(
String
clerkCode
,
String
enterpriseId
);
String
insert
(
StaffClerkRelationDTO
staffClerkRelation
);
int
cleanStaffClerk
(
String
wxEnterpriseId
,
List
<
String
>
staffIds
);
StaffClerkRelationDTO
getOneBindCodeNoStatus
(
String
enterpriseId
,
String
clerkCode
);
StaffClerkRelationDTO
getOneBindByStoreId
(
String
staffId
,
String
storeId
);
StaffClerkRelationDTO
getByClerkId
(
String
clerkId
);
StaffClerkRelationDTO
getByClerkIdForWxUserId
(
String
clerkId
);
StaffClerkRelationDTO
getByClerkIdNoStatus
(
String
clerkId
);
List
<
StaffClerkRelationDTO
>
listByClerkIds
(
List
<
String
>
clerkList
);
List
<
StaffClerkRelationDTO
>
listByStaffId
(
String
wxEnterpriseId
,
String
staffId
);
List
<
StaffClerkRelationDTO
>
listByStaffId
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
storeIdList
);
/**
* 保存
*
* @param memberClerkChatConfig
*/
void
saveChatConfig
(
MemberClerkChatConfig
memberClerkChatConfig
);
/**
* @param staffId
* @param memberId
* @return
*/
MemberClerkChatConfig
getChatConfig
(
String
staffId
,
String
memberId
);
/**
* 根据企业查询
*
* @param wxEnterpriseId
* @return
*/
List
<
String
>
listByWxEnterpriseId
(
String
wxEnterpriseId
);
Page
<
StaffClerkRelationDTO
>
pageByWxEnterpriseId
(
String
wxEnterpriseId
,
BasePageInfo
pageInfo
);
/**
* 根据门店获取门店的绑定列表
*
* @param wxEnterpriseId
* @param storeId
* @return
*/
List
<
StaffClerkRelationDTO
>
listBindByStoreId
(
String
wxEnterpriseId
,
String
storeId
);
/**
* 查询门店列表
*
* @param enterpriseId
* @return
*/
List
<
StaffClerkRelationDTO
>
listBindStoreIdByEnterpriseId
(
String
enterpriseId
);
/**
* 查询有关联的员工id列表
*
* @param staffIdList 员工id列表
* @return {@link Set<String>}
* @author: YongEn
*/
List
<
String
>
listRelationsStaffId
(
Set
<
String
>
staffIdList
);
/**
* 根据导购查询wxuserid
*
* @param clerkList 职员名单
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link String }>
* @author mozhu
* @date 2022-07-07 15:25:55
*/
List
<
String
>
listWxUserIdByClerkIds
(
List
<
String
>
clerkList
,
String
wxEnterpriseId
);
/**
* 通过userid 查询id
*
* @param wxUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-08-08 22:01:59
*/
List
<
StaffClerkRelationDTO
>
listIdsByWxUserIds
(
List
<
String
>
wxUserIds
,
String
wxEnterpriseId
,
String
enterpriseId
);
/**
* 通过userid 不在范围内 查询id
*
* @param wxUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-08-08 21:51:52
*/
List
<
StaffClerkRelationDTO
>
listIdsByNotInWxUserIds
(
List
<
String
>
wxUserIds
,
String
wxEnterpriseId
,
String
enterpriseId
);
/**
* 更新联系我状态
*
* @param openConcatFlag 打开concat国旗
* @param staffClerkRelationId 员工职员关系id
* @return int
* @author mozhu
* @date 2022-07-07 15:34:27
*/
int
updateOpenConcatFlagById
(
Integer
openConcatFlag
,
String
staffClerkRelationId
);
/**
* 通过职员id 查询职员id列表
*
* @param clerkIds 职员id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-07-07 16:41:35
*/
List
<
StaffClerkRelationDTO
>
listClerkIdConcatFlagByClerkIds
(
List
<
String
>
clerkIds
,
String
wxEnterpriseId
);
/**
* 是否有区经
*
* @param enterpriseId 企业标识
* @return {@link StaffClerkRelationDTO}
*/
boolean
getBindByManage
(
String
enterpriseId
);
/**
* 是否绑定过
*
* @param enterpriseId 企业标识
* @param staffId 员工id
* @return boolean
*/
boolean
getBindByStaffIdAndEnterpriseId
(
String
enterpriseId
,
String
staffId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
0cfc26d9
...
...
@@ -138,7 +138,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
String
staffId
=
dto
.
getStaffId
();
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectById
(
staffId
);
if
(
tabHaobanStaff
==
null
)
{
logger
.
error
(
"员工不存在:{}"
,
staffId
);
logger
.
error
(
"员工不存在:{}"
,
staffId
);
return
""
;
}
Date
now
=
new
Date
();
...
...
@@ -355,4 +355,14 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public
List
<
StaffClerkRelationDTO
>
listClerkIdConcatFlagByClerkIds
(
List
<
String
>
clerkIds
,
String
wxEnterpriseId
)
{
return
mapper
.
listClerkIdConcatFlagByClerkIds
(
clerkIds
,
wxEnterpriseId
);
}
@Override
public
boolean
getBindByManage
(
String
enterpriseId
)
{
return
mapper
.
getBindByManage
(
enterpriseId
)
>
0
;
}
@Override
public
boolean
getBindByStaffIdAndEnterpriseId
(
String
enterpriseId
,
String
staffId
)
{
return
mapper
.
getBindByStaffIdAndEnterpriseId
(
enterpriseId
,
staffId
)
>
0
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffClerkRelationApiServiceImpl.java
View file @
0cfc26d9
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
...
...
@@ -13,7 +14,6 @@ import com.gic.enterprise.api.dto.StoreDTO;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.qdto.ClerkSyncQDTO
;
import
com.gic.haoban.manage.api.enums.AuditType
;
...
...
@@ -171,30 +171,29 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
ServiceResponse
<
Object
>
response
=
new
ServiceResponse
<>();
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getBindByClerkId
(
staffClerkRelationDTO
.
getClerkId
(),
staffClerkRelationDTO
.
getWxEnterpriseId
());
if
(
null
!=
relationDTO
)
{
response
.
setCode
(
2
);
response
.
setMessage
(
"已经被绑定,不能绑定"
);
return
response
;
return
ServiceResponse
.
failure
(
"2"
,
"已经被绑定,不能绑定"
);
}
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
staffClerkRelationDTO
.
getClerkId
(),
AuditType
.
CLERK_BIND
.
getCode
());
if
(
null
!=
auditDTO
)
{
response
.
setCode
(
4
);
response
.
setMessage
(
"该导购已经被被申请绑定,请审核处理后再绑定"
);
return
response
;
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
()))
{
response
.
setCode
(
5
);
response
.
setMessage
(
"该成员已经已经在该门店下申请了绑定,请审核处理后再绑定"
);
return
response
;
return
ServiceResponse
.
failure
(
"5"
,
"该成员已经已经在该门店下申请了绑定,请审核处理后再绑定"
);
}
}
StaffClerkRelationDTO
storeHasBind
=
staffClerkRelationService
.
getOneBindByStoreId
(
staffClerkRelationDTO
.
getStaffId
(),
staffClerkRelationDTO
.
getStoreId
());
if
(
storeHasBind
!=
null
)
{
response
.
setCode
(
3
);
response
.
setMessage
(
"该导购已在该门店下有其它成员绑定"
);
return
response
;
return
ServiceResponse
.
failure
(
"3"
,
"该导购已在该门店下有其它成员绑定"
);
}
Integer
manageFlag
=
staffClerkRelationDTO
.
getManageFlag
();
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
ServiceResponse
serviceResponse
=
getManageFlagBind
(
staffClerkRelationDTO
);
if
(!
serviceResponse
.
isSuccess
())
{
return
serviceResponse
;
}
}
String
relationId
=
staffClerkRelationService
.
bind
(
staffClerkRelationDTO
,
optStaffId
,
channelCode
);
...
...
@@ -209,7 +208,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public
void
delBindByStoreId
(
String
wxEnterpriseId
,
String
storeId
,
String
staffId
,
int
channelCode
)
{
public
void
delBindByStoreId
(
String
wxEnterpriseId
,
String
storeId
,
String
staffId
,
int
channelCode
)
{
Set
<
String
>
needUnBindStoreIds
=
new
HashSet
<>();
needUnBindStoreIds
.
add
(
storeId
);
staffClerkRelationService
.
delBindByStoreIds
(
wxEnterpriseId
,
needUnBindStoreIds
,
staffId
,
ChannelCodeEnum
.
SELF_UNBIND
.
getCode
());
...
...
@@ -234,7 +233,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
@Override
public
boolean
unbindByStaffAndClerkId
(
String
staffId
,
String
clerkId
,
int
channelCode
)
{
public
boolean
unbindByStaffAndClerkId
(
String
staffId
,
String
clerkId
,
int
channelCode
)
{
return
staffClerkRelationService
.
delBind
(
clerkId
,
staffId
,
channelCode
);
}
...
...
@@ -267,14 +266,36 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
@Override
public
void
delAndInsert
(
StaffClerkRelationDTO
staffClerkRelation
,
String
optStaffId
,
int
channelCode
)
{
public
ServiceResponse
wxBindStaffClerk
(
StaffClerkRelationDTO
staffClerkRelation
,
String
optStaffId
,
int
channelCode
)
{
Integer
manageFlag
=
staffClerkRelation
.
getManageFlag
();
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
ServiceResponse
serviceResponse
=
getManageFlagBind
(
staffClerkRelation
);
if
(!
serviceResponse
.
isSuccess
())
{
return
serviceResponse
;
}
}
if
(
StringUtils
.
isNotBlank
(
staffClerkRelation
.
getStaffClerkRelationId
()))
{
TabHaobanStaffClerkRelation
oldStaffClerkRelation
=
tabHaobanStaffClerkRelationMapper
.
selectByPrimaryKey
(
staffClerkRelation
.
getStaffClerkRelationId
());
tabHaobanStaffClerkRelationMapper
.
delByPrimaryKey
(
staffClerkRelation
.
getStaffClerkRelationId
());
staffClerkBindLogService
.
pushToMq
(
oldStaffClerkRelation
.
getStaffId
(),
optStaffId
,
BindTypeEnum
.
UNBIND
.
getVal
(),
channelCode
,
staffClerkRelation
.
getStaffClerkRelationId
());
clerkMainStoreRelatedService
.
delMainStore
(
oldStaffClerkRelation
.
getStaffId
(),
oldStaffClerkRelation
.
getStoreId
(),
oldStaffClerkRelation
.
getWxEnterpriseId
());
}
staffClerkRelationService
.
bind
(
staffClerkRelation
,
optStaffId
,
channelCode
);
return
ServiceResponse
.
success
();
}
private
ServiceResponse
getManageFlagBind
(
StaffClerkRelationDTO
staffClerkRelation
)
{
boolean
bindFlag
=
staffClerkRelationService
.
getBindByStaffIdAndEnterpriseId
(
staffClerkRelation
.
getWxEnterpriseId
(),
staffClerkRelation
.
getStaffId
());
if
(
bindFlag
)
{
return
ServiceResponse
.
failure
(
"3"
,
"该员工已经绑定过导购,不允许再次绑定区经/督导"
);
}
boolean
flag
=
staffClerkRelationService
.
getBindByManage
(
staffClerkRelation
.
getEnterpriseId
());
if
(
flag
)
{
return
ServiceResponse
.
failure
(
"3"
,
"一个商户只能一个区经/督导"
);
}
return
ServiceResponse
.
success
();
}
@Override
...
...
@@ -357,8 +378,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
@Override
public
ServiceResponse
<
String
>
getClerkMemberChatConfig
(
String
clerkId
)
{
ServiceResponse
response
=
new
ServiceResponse
();
public
com
.
gic
.
haoban
.
base
.
api
.
common
.
ServiceResponse
<
String
>
getClerkMemberChatConfig
(
String
clerkId
)
{
com
.
gic
.
haoban
.
base
.
api
.
common
.
ServiceResponse
response
=
new
com
.
gic
.
haoban
.
base
.
api
.
common
.
ServiceResponse
();
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getByClerkIdForWxUserId
(
clerkId
);
if
(
null
==
relationDTO
)
{
logger
.
info
(
"导购没有关联企业微信:{}"
,
clerkId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/KafkaMessageServiceImpl.java
View file @
0cfc26d9
...
...
@@ -4,31 +4,27 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.binlog.base.entity.GicField
;
import
com.gic.binlog.base.entity.GicRecord
;
import
com.gic.binlog.base.entity.enums.GicRecordType
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.FlushStoreMqDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.StatusEnum
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.service.pojo.BinlogBasePojo
;
import
com.gic.haoban.manage.service.pojo.ClerkSyncPojo
;
import
com.gic.haoban.manage.service.pojo.GroupSyncPojo
;
import
com.gic.haoban.manage.service.pojo.StoreSyncPojo
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.StoreRangeService
;
import
com.gic.haoban.manage.service.service.hm.HmQrcodeService
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.kafka.clients.consumer.ConsumerRecord
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.kafka.listener.MessageListener
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
/**
* Created 2019/4/10.
...
...
@@ -46,15 +42,6 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
private
final
String
GROUP
=
"tab_gic_store_group"
;
@Autowired
private
StaffClerkRelationService
staffClerkRelationService
;
@Autowired
private
StaffClerkRelationApiService
staffClerkRelationApiService
;
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
StoreRangeService
storeRangeService
;
@Autowired
...
...
@@ -92,72 +79,6 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
}
}
private
void
dealClerk
(
ClerkSyncPojo
syncPojo
)
{
GicRecordType
gicRecordType
=
GicRecordType
.
valueOf
(
syncPojo
.
getRecordType
());
if
(
gicRecordType
.
equals
(
GicRecordType
.
DELETE
))
{
staffClerkRelationService
.
delBind
(
syncPojo
.
getClerkId
(),
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
}
else
if
(
gicRecordType
.
equals
(
GicRecordType
.
INSERT
))
{
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getOneBindCodeNoStatus
(
syncPojo
.
getEnterpriseId
(),
syncPojo
.
getClerkCode
());
if
(
syncPojo
.
getStatus
()
!=
0
)
{
// 过滤掉状态为0的同步导购数据
moveOrAddClerk
(
syncPojo
,
relationDTO
);
}
}
else
if
(
gicRecordType
.
equals
(
GicRecordType
.
UPDATE
))
{
StaffClerkRelationDTO
relationDTO
=
new
StaffClerkRelationDTO
();
relationDTO
.
setClerkId
(
syncPojo
.
getClerkId
());
relationDTO
.
setStoreId
(
syncPojo
.
getStoreId
());
relationDTO
.
setClerkCode
(
syncPojo
.
getClerkCode
());
//非正常状态 删除
if
(!
syncPojo
.
getStatus
().
equals
(
1
))
{
logger
.
info
(
"删除操作:{}"
,
syncPojo
.
getClerkId
());
staffClerkRelationService
.
delBind
(
syncPojo
.
getClerkId
(),
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
}
else
{
List
<
String
>
clerkIds
=
new
ArrayList
<>();
clerkIds
.
add
(
syncPojo
.
getClerkId
());
StaffClerkRelationDTO
clerkRelationDTO
=
staffClerkRelationService
.
getByClerkId
(
syncPojo
.
getClerkId
());
if
(
clerkRelationDTO
!=
null
)
{
logger
.
info
(
"更新关联信息1:{}"
,
syncPojo
.
getClerkId
());
staffClerkRelationService
.
updateByClerkId
(
relationDTO
);
return
;
}
StaffClerkRelationDTO
bindRelationDTO
=
staffClerkRelationService
.
getOneBindCodeNoStatus
(
syncPojo
.
getEnterpriseId
(),
syncPojo
.
getClerkCode
());
if
(
null
==
bindRelationDTO
)
{
logger
.
info
(
"没有关联导购,不需要操作:{}"
,
syncPojo
.
getClerkId
());
return
;
}
logger
.
info
(
"走新增逻辑:{}"
,
syncPojo
.
getClerkId
());
//走新增逻辑
moveOrAddClerk
(
syncPojo
,
bindRelationDTO
);
}
}
}
private
void
moveOrAddClerk
(
ClerkSyncPojo
syncPojo
,
StaffClerkRelationDTO
relationDTO
)
{
if
(
null
==
relationDTO
)
{
logger
.
info
(
"没有关联导购,不需要新增"
);
return
;
}
//正常的时候
if
(
relationDTO
.
getStatusFlag
()
!=
StatusEnum
.
DEL
.
getValue
())
{
staffClerkRelationService
.
delBind
(
relationDTO
.
getClerkId
(),
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
relationDTO
.
setClerkId
(
syncPojo
.
getClerkId
());
relationDTO
.
setStoreId
(
syncPojo
.
getStoreId
());
ServiceResponse
response
=
staffClerkRelationApiService
.
bindStaffClerk
(
relationDTO
,
"-1"
,
ChannelCodeEnum
.
SYNC_BIND
.
getCode
());
logger
.
info
(
"绑定结果正常:{},{}"
,
JSONObject
.
toJSONString
(
response
),
relationDTO
.
getClerkId
());
}
else
{
//删除状态 需要判断是否近段时间有操作删除 2分组内有更新 判断是转移操作
Date
timeDiff
=
DateUtils
.
addMinutes
(
new
Date
(),
-
2
);
if
(
relationDTO
.
getUpdateTime
().
after
(
timeDiff
))
{
staffClerkRelationService
.
delBind
(
relationDTO
.
getClerkId
(),
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
relationDTO
.
setClerkId
(
syncPojo
.
getClerkId
());
relationDTO
.
setStoreId
(
syncPojo
.
getStoreId
());
ServiceResponse
response
=
staffClerkRelationApiService
.
bindStaffClerk
(
relationDTO
,
"-1"
,
ChannelCodeEnum
.
SYNC_BIND
.
getCode
());
logger
.
info
(
"绑定结果:{},{}"
,
JSONObject
.
toJSONString
(
response
),
relationDTO
.
getClerkId
());
}
}
}
private
BinlogBasePojo
binlogChange
(
GicRecord
record
)
{
ClerkSyncPojo
pojo
=
new
ClerkSyncPojo
();
pojo
.
setRecordType
(
record
.
getRecordType
().
value
());
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
View file @
0cfc26d9
...
...
@@ -388,7 +388,7 @@
</foreach>
and a.status_flag = 1
group by a.staff_id, a.clerk_id) as scr on scr.staff_id = ecr.staff_id
where ecr.status_flag = 1 AND ecr.`external_status` = 1
where ecr.status_flag = 1 AND ecr.`external_status` = 1
and ecr.enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and ecr.wx_enterprise_id=#{wxEnterpriseId}
and ecr.member_id in
...
...
@@ -542,4 +542,18 @@
update tab_haoban_staff_clerk_relation set status_flag = 0 , update_time=now() where enterprise_id = #{enterpriseId}
</update>
<select
id=
"getBindByManage"
resultType=
"java.lang.Integer"
>
select
count(*)
from tab_haoban_staff_clerk_relation
where status_flag=1 and enterprise_id = #{enterpriseId} and manage_flag = 1
</select>
<select
id=
"getBindByStaffIdAndEnterpriseId"
resultType=
"java.lang.Integer"
>
select
count(*)
from tab_haoban_staff_clerk_relation
where status_flag=1 and enterprise_id = #{enterpriseId} and staff_id = #{staffId}
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
0cfc26d9
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkNewService
;
import
com.gic.clerk.api.service.ClerkService
;
...
...
@@ -13,7 +14,6 @@ import com.gic.enterprise.api.dto.StoreDTO;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.StoreWidgetService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
...
...
@@ -275,7 +275,7 @@ public class StaffController extends WebBaseController {
/**
* 成员关联关系接口
*
* @param
staff
Id
* @param
clerk
Id
* @return
*/
@RequestMapping
(
"del-clerk-relation"
)
...
...
@@ -377,7 +377,7 @@ public class StaffController extends WebBaseController {
ServiceResponse
response
=
staffClerkRelationApiService
.
bindStaffClerk
(
relationDTO
,
login
.
getClerkId
(),
ChannelCodeEnum
.
ADMIN_BIND
.
getCode
());
logger
.
info
(
"返回信息:{}"
,
JSONObject
.
toJSONString
(
response
));
if
(
response
.
getCode
()
==
1
)
{
if
(
response
.
isSuccess
()
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
else
{
HaoBanErrCode
errDefine
=
HaoBanErrCode
.
ERR_DEFINE
;
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
0cfc26d9
...
...
@@ -4,6 +4,7 @@ package com.gic.haoban.manage.web.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
...
...
@@ -269,14 +270,15 @@ public class AuditController extends WebBaseController {
staffClerkRelation
.
setClerkId
(
clerkId
);
staffClerkRelation
.
setStoreId
(
storeId
);
staffClerkRelation
.
setWxEnterpriseId
(
wxEnterpriseId
);
// staffClerkRelation.setWxUserId(wxUserId);
staffClerkRelation
.
setStaffId
(
auditStaffId
);
staffClerkRelationApiService
.
delAndInsert
(
staffClerkRelation
,
staffId
,
ChannelCodeEnum
.
AUDIT_BIND
.
getCode
());
ServiceResponse
serviceResponse
=
staffClerkRelationApiService
.
wxBindStaffClerk
(
staffClerkRelation
,
staffId
,
ChannelCodeEnum
.
AUDIT_BIND
.
getCode
());
if
(!
serviceResponse
.
isSuccess
())
{
return
resultResponse
(
HaoBanErrCode
.
ERR_DEFINE
,
serviceResponse
.
getMessage
());
}
audit
.
setAuditStatus
(
1
);
//发送消息
staffDepartmentRelatedApiService
.
sendBindAuditMessage
(
auditId
,
auditStaffId
,
clerkId
,
""
,
false
);
// staffDepartmentRelatedApiService.sendClerkBind(auditStaffId, clerkCode, storeId, auditStatus, auditReason);
}
}
}
...
...
@@ -287,7 +289,6 @@ public class AuditController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_10010
);
}
audit
.
setAuditStatus
(
1
);
// ClerkDTO clerkDTO = clerkService.getClerkByClerkCode(enterpriseId, clerkCode);
staffDepartmentRelatedApiService
.
sendClerkAdd
(
clerkName
,
clerkCode
,
storeId
,
auditStatus
,
auditReason
);
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
0cfc26d9
...
...
@@ -832,7 +832,10 @@ public class ClerkController extends WebBaseController {
staffClerkRelation
.
setStaffId
(
staffId
);
staffClerkRelation
.
setManageFlag
(
manageFlag
);
staffClerkRelationApiService
.
delAndInsert
(
staffClerkRelation
,
staffId
,
ChannelCodeEnum
.
SELF_BIND
.
getCode
());
ServiceResponse
serviceResponse
=
staffClerkRelationApiService
.
wxBindStaffClerk
(
staffClerkRelation
,
staffId
,
ChannelCodeEnum
.
SELF_BIND
.
getCode
());
if
(!
serviceResponse
.
isSuccess
())
{
return
resultResponse
(
HaoBanErrCode
.
ERR_DEFINE
,
serviceResponse
.
getMessage
());
}
//无需审核
AuditDTO
audit
=
new
AuditDTO
();
...
...
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