Commit 4247722e by 徐高华

转换后的新导购

parent 5da3fa49
......@@ -99,14 +99,32 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId) {
return this.filterDelClerkList(mapper.listBindCodeByStaffId(enterpriseIdList, staffId));
}
private String changeExistClerk(String wxEnterpriseId , String staffId , String newClerkId) {
if(StringUtils.isBlank(newClerkId)) {
return newClerkId ;
}
ClerkDTO clerkDTO = this.clerkService.getclerkById(newClerkId) ;
String storeId = clerkDTO.getStoreId() ;
List<StaffClerkRelationDTO> relationList = this.listByStaffId(wxEnterpriseId, staffId) ;
if(CollectionUtils.isEmpty(relationList)) {
return newClerkId ;
}
relationList = relationList.stream().filter(o->o.getStoreId().equals(storeId)).collect(Collectors.toList()) ;
if(CollectionUtils.isEmpty(relationList)) {
return newClerkId ;
}
return relationList.get(0).getClerkId() ;
}
/*
* 导购进行解绑/换导购,更新好友和导购关联关系
*/
@Override
public boolean delBind(String oldClerkId, String optStaffId, int channelCode, String newClerkId, String wxEnterpriseId) {
boolean changeClerkFlag = StringUtils.isNotEmpty(newClerkId) ;
logger.info("导购解绑/换导购={},oldClerkId={},optStaffId={}",changeClerkFlag,oldClerkId,optStaffId);
logger.info("导购解绑/换导购={},oldClerkId={},optStaffId={},newClerkId={},channelCode={}",changeClerkFlag,oldClerkId,optStaffId,newClerkId,channelCode);
if(StringUtils.isNotEmpty(optStaffId) && !"-1".equals(optStaffId)) {
TabHaobanStaff staff = this.staffService.selectById(optStaffId) ;
if(null != staff) {
......@@ -119,6 +137,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
logger.info("老的绑定关联不存在,oldClerkId={}", oldClerkId);
return true;
}
newClerkId = this.changeExistClerk(clerkRelation.getWxEnterpriseId() ,clerkRelation.getStaffId() , newClerkId) ;
logger.info("转换后的新导购={}",newClerkId);
// 如果是区经
if(clerkRelation.getManageFlag()==1) {
this.mapper.changeStatusByClerkId(oldClerkId, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment