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
1ffdd123
Commit
1ffdd123
authored
Oct 09, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导购转移门店优化
parent
640dc98c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
27 deletions
+25
-27
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+5
-6
StaffClerkRelationApiServiceImpl.java
...ce/service/out/impl/StaffClerkRelationApiServiceImpl.java
+20
-21
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
1ffdd123
...
...
@@ -78,14 +78,13 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
@Override
public
boolean
delBind
(
String
c
lerkId
,
String
optStaffId
,
int
channelCode
)
{
TabHaobanStaffClerkRelation
clerkRelation
=
mapper
.
getByClerkId
(
c
lerkId
);
public
boolean
delBind
(
String
oldC
lerkId
,
String
optStaffId
,
int
channelCode
)
{
TabHaobanStaffClerkRelation
clerkRelation
=
mapper
.
getByClerkId
(
oldC
lerkId
);
if
(
null
==
clerkRelation
)
{
logger
.
info
(
"
已经不存在:{},{}"
,
clerkId
,
optStaff
Id
);
logger
.
info
(
"
老的绑定关联不存在,clerkId={}"
,
oldClerk
Id
);
return
true
;
}
int
i
=
mapper
.
changeStatusByClerkId
(
clerkId
,
0
);
int
i
=
mapper
.
changeStatusByClerkId
(
oldClerkId
,
0
);
String
enterpriseId
=
clerkRelation
.
getEnterpriseId
();
List
<
String
>
memberIds
=
externalClerkRelatedService
.
getByStoreIdAndStaffId
(
clerkRelation
.
getStoreId
(),
clerkRelation
.
getStaffId
());
for
(
String
memberId
:
memberIds
)
{
...
...
@@ -98,7 +97,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
//推入日志
staffClerkBindLogService
.
pushToMq
(
clerkRelation
.
getStaffId
(),
optStaffId
,
BindTypeEnum
.
UNBIND
.
getVal
(),
channelCode
,
clerkRelation
.
getStaffClerkRelationId
());
//废弃活码
hmClerkRelationApiService
.
delByClerkId
(
c
lerkId
,
enterpriseId
,
clerkRelation
.
getWxEnterpriseId
(),
channelCode
);
hmClerkRelationApiService
.
delByClerkId
(
oldC
lerkId
,
enterpriseId
,
clerkRelation
.
getWxEnterpriseId
(),
channelCode
);
return
i
>
0
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffClerkRelationApiServiceImpl.java
View file @
1ffdd123
...
...
@@ -162,7 +162,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public
ServiceResponse
bindStaffClerk
(
StaffClerkRelationDTO
staffClerkRelationDTO
,
String
optStaffId
,
int
channelCode
)
{
logger
.
info
(
"绑定clerk:{}"
,
JSONObject
.
toJSONString
(
staffClerkRelationDTO
));
logger
.
info
(
"
开始
绑定clerk:{}"
,
JSONObject
.
toJSONString
(
staffClerkRelationDTO
));
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getBindByClerkId
(
staffClerkRelationDTO
.
getClerkId
(),
staffClerkRelationDTO
.
getWxEnterpriseId
());
if
(
null
!=
relationDTO
)
{
return
ServiceResponse
.
failure
(
"2"
,
"已经被绑定,不能绑定"
);
...
...
@@ -439,7 +439,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public
void
clerkStoreMoveDel
(
String
param
)
{
logger
.
info
(
"导购转移删除修改:{}"
,
param
);
logger
.
info
(
"导购转移删除修改
通知
:{}"
,
param
);
if
(
StringUtils
.
isBlank
(
param
))
{
logger
.
error
(
"参数为空"
);
return
;
...
...
@@ -447,26 +447,28 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
ClerkSyncQDTO
clerkSyncQDTO
=
JSON
.
parseObject
(
param
,
ClerkSyncQDTO
.
class
);
Integer
type
=
clerkSyncQDTO
.
getType
();
String
clerkId
=
clerkSyncQDTO
.
getClerkId
();
String
clerkCode
=
clerkSyncQDTO
.
getClerkCode
()
;
String
enterpriseId
=
clerkSyncQDTO
.
getEnterpriseId
();
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
,
-
1
);
if
(
clerkDTO
==
null
)
{
logger
.
error
(
"导购为空
"
);
logger
.
error
(
"导购为空
,clerkId={}"
,
clerkId
);
return
;
}
if
(
type
==
1
)
{
Integer
status
=
clerkDTO
.
getStatus
();
logger
.
info
(
"导购删除解绑,clerkId:{},status:{}"
,
clerkId
,
status
);
//导购删除解绑
logger
.
info
(
"导购删除,clerkId:{},status:{}"
,
clerkId
,
status
);
if
(!
status
.
equals
(
1
))
{
//解绑
staffClerkRelationService
.
delBind
(
clerkId
,
"-1"
,
ChannelCodeEnum
.
GIC_CLERK_DEL_UNBIND
.
getCode
());
}
}
else
if
(
type
==
2
)
{
logger
.
info
(
"门店转移、重新绑定,clerkId:{}"
,
clerkId
);
//门店转移、重新绑定
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getOneBindCodeNoStatus
(
clerkDTO
.
getEnterpriseId
(),
clerkDTO
.
getClerkCode
());
moveOrAddClerk
(
clerkSyncQDTO
,
relationDTO
);
logger
.
info
(
"导购门店转移,新的导购和门店,clerkId={},storeId={}"
,
clerkId
,
clerkSyncQDTO
.
getStoreId
());
StaffClerkRelationDTO
oldRelationDTO
=
staffClerkRelationService
.
getOneBindCodeNoStatus
(
enterpriseId
,
clerkCode
);
if
(
null
==
oldRelationDTO
)
{
logger
.
info
(
"导购未关联成员,clerkCode={}"
,
clerkCode
);
return
;
}
logger
.
info
(
"导购门店转移,老的绑定导购id={}"
,
oldRelationDTO
.
getClerkId
());
this
.
moveOrAddClerk
(
clerkSyncQDTO
,
oldRelationDTO
);
}
else
if
(
type
==
3
)
{
//店长任务重新分配
Integer
clerkType
=
clerkDTO
.
getClerkType
();
...
...
@@ -499,17 +501,14 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
private
void
moveOrAddClerk
(
ClerkSyncQDTO
clerkSyncQDTO
,
StaffClerkRelationDTO
relationDTO
)
{
if
(
null
==
relationDTO
)
{
logger
.
info
(
"没有关联导购,不需要新增"
);
return
;
}
private
void
moveOrAddClerk
(
ClerkSyncQDTO
clerkSyncQDTO
,
StaffClerkRelationDTO
oldRelationDTO
)
{
//正常的时候
staffClerkRelationService
.
delBind
(
relationDTO
.
getClerkId
(),
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
relationDTO
.
setClerkId
(
clerkSyncQDTO
.
getClerkId
());
relationDTO
.
setStoreId
(
clerkSyncQDTO
.
getStoreId
());
ServiceResponse
response
=
bindStaffClerk
(
relationDTO
,
"-1"
,
ChannelCodeEnum
.
SYNC_BIND
.
getCode
());
logger
.
info
(
"绑定结果正常:{},{}"
,
JSONObject
.
toJSONString
(
response
),
relationDTO
.
getClerkId
());
String
oldClerkId
=
oldRelationDTO
.
getClerkId
()
;
this
.
staffClerkRelationService
.
delBind
(
oldClerkId
,
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
oldRelationDTO
.
setClerkId
(
clerkSyncQDTO
.
getClerkId
());
oldRelationDTO
.
setStoreId
(
clerkSyncQDTO
.
getStoreId
());
ServiceResponse
response
=
bindStaffClerk
(
oldRelationDTO
,
"-1"
,
ChannelCodeEnum
.
SYNC_BIND
.
getCode
());
logger
.
info
(
"绑定结果正常:{},{}"
,
JSONObject
.
toJSONString
(
response
),
oldRelationDTO
.
getClerkId
());
}
@Override
...
...
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