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
90458f9e
Commit
90458f9e
authored
Oct 21, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.gicdev.com/haoban3.0/haoban-manage3.0
into developer
parents
05677f4f
8a3eac9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
21 deletions
+33
-21
StaffClerkRelationApiServiceImpl.java
...ce/service/out/impl/StaffClerkRelationApiServiceImpl.java
+32
-20
WxStaffController.java
...m/gic/haoban/manage/web/controller/WxStaffController.java
+1
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffClerkRelationApiServiceImpl.java
View file @
90458f9e
...
@@ -123,8 +123,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
...
@@ -123,8 +123,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
}
@Override
@Override
public
List
<
StaffClerkRelationDTO
>
listBindCode
(
String
wxEnterpriseId
,
String
enterpriseId
,
Set
<
String
>
clerkCodeList
)
{
public
List
<
StaffClerkRelationDTO
>
listBindCode
(
String
wxEnterpriseId
,
String
enterpriseId
,
Set
<
String
>
clerkCodeList
)
{
return
staffClerkRelationService
.
listBindCode
(
wxEnterpriseId
,
enterpriseId
,
clerkCodeList
);
return
staffClerkRelationService
.
listBindCode
(
wxEnterpriseId
,
enterpriseId
,
clerkCodeList
);
}
}
@Override
@Override
...
@@ -163,9 +163,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
...
@@ -163,9 +163,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
@Override
public
ServiceResponse
bindStaffClerk
(
StaffClerkRelationDTO
staffClerkRelationDTO
,
String
optStaffId
,
int
channelCode
)
{
public
ServiceResponse
bindStaffClerk
(
StaffClerkRelationDTO
staffClerkRelationDTO
,
String
optStaffId
,
int
channelCode
)
{
ServiceResponse
resp
=
this
.
bindCheck
(
staffClerkRelationDTO
,
optStaffId
,
channelCode
)
;
ServiceResponse
resp
=
this
.
bindCheck
(
staffClerkRelationDTO
,
optStaffId
,
channelCode
);
if
(
null
!=
resp
)
{
if
(
resp
!=
null
&&
!
resp
.
isSuccess
())
{
return
resp
;
logger
.
error
(
"不允许绑定:{}"
,
resp
.
getMessage
());
return
resp
;
}
}
String
relationId
=
staffClerkRelationService
.
bind
(
staffClerkRelationDTO
,
optStaffId
,
channelCode
);
String
relationId
=
staffClerkRelationService
.
bind
(
staffClerkRelationDTO
,
optStaffId
,
channelCode
);
return
ServiceResponse
.
success
(
relationId
);
return
ServiceResponse
.
success
(
relationId
);
...
@@ -186,30 +187,35 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
...
@@ -186,30 +187,35 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
else
{
}
else
{
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getBindByClerkId
(
clerkId
,
wxEnterpriseId
);
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getBindByClerkId
(
clerkId
,
wxEnterpriseId
);
if
(
null
!=
relationDTO
)
{
if
(
null
!=
relationDTO
)
{
logger
.
info
(
"已经被绑定,不能绑定"
);
return
ServiceResponse
.
failure
(
"2"
,
"已经被绑定,不能绑定"
);
return
ServiceResponse
.
failure
(
"2"
,
"已经被绑定,不能绑定"
);
}
}
}
}
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkId
,
AuditType
.
CLERK_BIND
.
getCode
(),
wxEnterpriseId
,
enterpriseId
);
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkId
,
AuditType
.
CLERK_BIND
.
getCode
(),
wxEnterpriseId
,
enterpriseId
);
if
(
null
!=
auditDTO
)
{
if
(
null
!=
auditDTO
)
{
logger
.
info
(
"该导购已经被被申请绑定,请审核处理后再绑定"
);
return
ServiceResponse
.
failure
(
"4"
,
"该导购已经被被申请绑定,请审核处理后再绑定"
);
return
ServiceResponse
.
failure
(
"4"
,
"该导购已经被被申请绑定,请审核处理后再绑定"
);
}
}
List
<
AuditDTO
>
list
=
auditApiService
.
listByStoreId
(
staffClerkRelationDTO
.
getStoreId
());
List
<
AuditDTO
>
list
=
auditApiService
.
listByStoreId
(
staffClerkRelationDTO
.
getStoreId
());
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
Set
<
String
>
staffIds
=
list
.
stream
().
map
(
AuditDTO:
:
getCommitStaffId
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
staffIds
=
list
.
stream
().
map
(
AuditDTO:
:
getCommitStaffId
).
collect
(
Collectors
.
toSet
());
if
(
staffIds
.
contains
(
staffId
))
{
if
(
staffIds
.
contains
(
staffId
))
{
logger
.
info
(
"该成员已经已经在该门店下申请了绑定,请审核处理后再绑定"
);
return
ServiceResponse
.
failure
(
"5"
,
"该成员已经已经在该门店下申请了绑定,请审核处理后再绑定"
);
return
ServiceResponse
.
failure
(
"5"
,
"该成员已经已经在该门店下申请了绑定,请审核处理后再绑定"
);
}
}
}
}
StaffClerkRelationDTO
storeHasBind
=
staffClerkRelationService
.
getOneBindByStoreId
(
staffId
,
staffClerkRelationDTO
.
getStoreId
());
StaffClerkRelationDTO
storeHasBind
=
staffClerkRelationService
.
getOneBindByStoreId
(
staffId
,
staffClerkRelationDTO
.
getStoreId
());
if
(
storeHasBind
!=
null
)
{
if
(
storeHasBind
!=
null
)
{
logger
.
info
(
"该导购已在该门店下有其它成员绑定"
);
return
ServiceResponse
.
failure
(
"3"
,
"该导购已在该门店下有其它成员绑定"
);
return
ServiceResponse
.
failure
(
"3"
,
"该导购已在该门店下有其它成员绑定"
);
}
}
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listManageBindByStaffId
(
staffId
);
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listManageBindByStaffId
(
staffId
);
if
(
CollectionUtils
.
isNotEmpty
(
staffClerkRelationDTOS
))
{
if
(
CollectionUtils
.
isNotEmpty
(
staffClerkRelationDTOS
))
{
logger
.
info
(
"该导购已绑定区经,不允许绑定导购"
);
return
ServiceResponse
.
failure
(
"3"
,
"该导购已绑定区经,不允许绑定导购"
);
return
ServiceResponse
.
failure
(
"3"
,
"该导购已绑定区经,不允许绑定导购"
);
}
}
return
null
;
return
null
;
}
}
@Override
@Override
...
@@ -230,7 +236,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
...
@@ -230,7 +236,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
if
(
CollectionUtil
.
isEmpty
(
clerkIds
))
{
if
(
CollectionUtil
.
isEmpty
(
clerkIds
))
{
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
return
EntityUtil
.
changeEntityListNew
(
StaffClerkRelationDTO
.
class
,
tabHaobanStaffClerkRelationMapper
.
listByClerkIds
(
clerkIds
,
null
));
return
EntityUtil
.
changeEntityListNew
(
StaffClerkRelationDTO
.
class
,
tabHaobanStaffClerkRelationMapper
.
listByClerkIds
(
clerkIds
,
null
));
}
}
@Override
@Override
...
@@ -238,7 +244,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
...
@@ -238,7 +244,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
if
(
CollectionUtil
.
isEmpty
(
clerkIds
))
{
if
(
CollectionUtil
.
isEmpty
(
clerkIds
))
{
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
return
EntityUtil
.
changeEntityListNew
(
StaffClerkRelationDTO
.
class
,
tabHaobanStaffClerkRelationMapper
.
listByClerkIds
(
clerkIds
,
wxEnterpriseId
));
return
EntityUtil
.
changeEntityListNew
(
StaffClerkRelationDTO
.
class
,
tabHaobanStaffClerkRelationMapper
.
listByClerkIds
(
clerkIds
,
wxEnterpriseId
));
}
}
@Override
@Override
...
@@ -299,6 +305,12 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
...
@@ -299,6 +305,12 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
return
serviceResponse
;
return
serviceResponse
;
}
}
}
}
String
staffId
=
staffClerkRelation
.
getStaffId
();
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listManageBindByStaffId
(
staffId
);
if
(
CollectionUtils
.
isNotEmpty
(
staffClerkRelationDTOS
))
{
logger
.
info
(
"该导购已绑定区经,不允许绑定导购"
);
return
ServiceResponse
.
failure
(
"3"
,
"该导购已绑定区经,不允许绑定导购"
);
}
if
(
StringUtils
.
isNotBlank
(
staffClerkRelation
.
getStaffClerkRelationId
()))
{
if
(
StringUtils
.
isNotBlank
(
staffClerkRelation
.
getStaffClerkRelationId
()))
{
TabHaobanStaffClerkRelation
oldStaffClerkRelation
=
tabHaobanStaffClerkRelationMapper
.
selectByPrimaryKey
(
staffClerkRelation
.
getStaffClerkRelationId
());
TabHaobanStaffClerkRelation
oldStaffClerkRelation
=
tabHaobanStaffClerkRelationMapper
.
selectByPrimaryKey
(
staffClerkRelation
.
getStaffClerkRelationId
());
tabHaobanStaffClerkRelationMapper
.
delByPrimaryKey
(
staffClerkRelation
.
getStaffClerkRelationId
());
tabHaobanStaffClerkRelationMapper
.
delByPrimaryKey
(
staffClerkRelation
.
getStaffClerkRelationId
());
...
@@ -492,9 +504,9 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
...
@@ -492,9 +504,9 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
}
}
else
if
(
type
==
2
)
{
}
else
if
(
type
==
2
)
{
logger
.
info
(
"导购门店转移,新的导购和门店,clerkId={},storeId={}"
,
clerkId
,
clerkSyncQDTO
.
getStoreId
());
logger
.
info
(
"导购门店转移,新的导购和门店,clerkId={},storeId={}"
,
clerkId
,
clerkSyncQDTO
.
getStoreId
());
StaffClerkRelationDTO
oldRelationDTO
=
staffClerkRelationService
.
getByCodeAndEnterpriseId
(
clerkCode
,
enterpriseId
);
StaffClerkRelationDTO
oldRelationDTO
=
staffClerkRelationService
.
getByCodeAndEnterpriseId
(
clerkCode
,
enterpriseId
);
if
(
null
==
oldRelationDTO
)
{
if
(
null
==
oldRelationDTO
)
{
logger
.
info
(
"导购未关联成员,clerkCode={}"
,
clerkCode
);
logger
.
info
(
"导购未关联成员,clerkCode={}"
,
clerkCode
);
return
;
return
;
}
}
/* StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getByClerkId(oldClerkId);
/* StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getByClerkId(oldClerkId);
...
@@ -534,25 +546,25 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
...
@@ -534,25 +546,25 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
}
}
}
}
}
// 导购门店转移
// 导购门店转移
private
void
moveOrAddClerk
(
ClerkSyncQDTO
clerkSyncQDTO
,
StaffClerkRelationDTO
oldRelationDTO
)
{
private
void
moveOrAddClerk
(
ClerkSyncQDTO
clerkSyncQDTO
,
StaffClerkRelationDTO
oldRelationDTO
)
{
boolean
flag
=
false
;
boolean
flag
=
false
;
if
(
null
!=
RedisUtil
.
getCache
(
"clerkMoveFlag2022"
))
{
if
(
null
!=
RedisUtil
.
getCache
(
"clerkMoveFlag2022"
))
{
flag
=
true
;
flag
=
true
;
}
}
if
(
flag
)
{
if
(
flag
)
{
String
oldClerkId
=
oldRelationDTO
.
getClerkId
();
String
oldClerkId
=
oldRelationDTO
.
getClerkId
();
this
.
staffClerkRelationService
.
delBind
(
oldClerkId
,
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
(),
clerkSyncQDTO
.
getClerkId
());
this
.
staffClerkRelationService
.
delBind
(
oldClerkId
,
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
(),
clerkSyncQDTO
.
getClerkId
());
// 设置新的ID
// 设置新的ID
oldRelationDTO
.
setClerkId
(
clerkSyncQDTO
.
getClerkId
());
oldRelationDTO
.
setClerkId
(
clerkSyncQDTO
.
getClerkId
());
oldRelationDTO
.
setStoreId
(
clerkSyncQDTO
.
getStoreId
());
oldRelationDTO
.
setStoreId
(
clerkSyncQDTO
.
getStoreId
());
ServiceResponse
response
=
this
.
bindCheck
(
oldRelationDTO
,
"-1"
,
ChannelCodeEnum
.
SYNC_BIND
.
getCode
())
;
ServiceResponse
response
=
this
.
bindCheck
(
oldRelationDTO
,
"-1"
,
ChannelCodeEnum
.
SYNC_BIND
.
getCode
());
logger
.
info
(
"绑定结果正常:{},{}"
,
JSONObject
.
toJSONString
(
response
),
oldRelationDTO
.
getClerkId
());
logger
.
info
(
"绑定结果正常:{},{}"
,
JSONObject
.
toJSONString
(
response
),
oldRelationDTO
.
getClerkId
());
if
(
response
==
null
)
{
if
(
response
==
null
)
{
this
.
staffClerkRelationService
.
insert
(
oldRelationDTO
)
;
this
.
staffClerkRelationService
.
insert
(
oldRelationDTO
);
}
}
}
else
{
}
else
{
String
oldClerkId
=
oldRelationDTO
.
getClerkId
();
String
oldClerkId
=
oldRelationDTO
.
getClerkId
();
this
.
staffClerkRelationService
.
delBind
(
oldClerkId
,
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
(),
null
);
this
.
staffClerkRelationService
.
delBind
(
oldClerkId
,
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
(),
null
);
// 设置新的ID
// 设置新的ID
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxStaffController.java
View file @
90458f9e
...
@@ -1011,7 +1011,7 @@ public class WxStaffController extends WebBaseController {
...
@@ -1011,7 +1011,7 @@ public class WxStaffController extends WebBaseController {
List
<
BindClerkVO
>
bindList
=
new
ArrayList
<>();
List
<
BindClerkVO
>
bindList
=
new
ArrayList
<>();
List
<
BindClerkVO
>
unBindList
=
new
ArrayList
<>();
List
<
BindClerkVO
>
unBindList
=
new
ArrayList
<>();
for
(
ClerkDTO
dto
:
list
)
{
for
(
ClerkDTO
dto
:
list
)
{
BindClerkVO
vo
=
EntityUtil
.
changeEntity
ByJSON
(
BindClerkVO
.
class
,
dto
);
BindClerkVO
vo
=
EntityUtil
.
changeEntity
New
(
BindClerkVO
.
class
,
dto
);
if
(
bindCodeMap
.
containsKey
(
dto
.
getClerkCode
()))
{
if
(
bindCodeMap
.
containsKey
(
dto
.
getClerkCode
()))
{
String
staffId
=
bindCodeMap
.
get
(
dto
.
getClerkCode
()).
getStaffId
();
String
staffId
=
bindCodeMap
.
get
(
dto
.
getClerkCode
()).
getStaffId
();
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
...
...
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