Commit 37b16bc0 by 徐高华

导购解绑

parent 94207e58
...@@ -116,12 +116,18 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -116,12 +116,18 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
logger.info("老的绑定关联不存在,oldClerkId={}", oldClerkId); logger.info("老的绑定关联不存在,oldClerkId={}", oldClerkId);
return true; return true;
} }
// 如果是区经
if(clerkRelation.getManageFlag()==1) {
this.mapper.changeStatusByClerkId(oldClerkId, 0);
return true ;
}
wxEnterpriseId = clerkRelation.getWxEnterpriseId() ; wxEnterpriseId = clerkRelation.getWxEnterpriseId() ;
String enterpriseId = clerkRelation.getEnterpriseId(); String enterpriseId = clerkRelation.getEnterpriseId();
logger.info("当前删除换绑的商户={},{}",enterpriseId,wxEnterpriseId); logger.info("当前删除换绑的商户={},{}",enterpriseId,wxEnterpriseId);
String staffId = clerkRelation.getStaffId() ; String staffId = clerkRelation.getStaffId() ;
String storeId = clerkRelation.getStoreId() ; String storeId = clerkRelation.getStoreId() ;
boolean needFlush = false ; boolean needFlush = false ;
boolean delFlag = true ;
if(StringUtils.isEmpty(newClerkId)) { if(StringUtils.isEmpty(newClerkId)) {
// 成员关联的门店 // 成员关联的门店
List<StaffClerkRelationDTO> relationList = this.listByStaffId(wxEnterpriseId, staffId) ; List<StaffClerkRelationDTO> relationList = this.listByStaffId(wxEnterpriseId, staffId) ;
...@@ -146,6 +152,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -146,6 +152,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
if(mainStoreEnterpriseId.equals(enterpriseId)) { if(mainStoreEnterpriseId.equals(enterpriseId)) {
// 删除关联关系 // 删除关联关系
this.mapper.changeStatusByClerkId(oldClerkId, 0); this.mapper.changeStatusByClerkId(oldClerkId, 0);
delFlag = false ;
TabHaobanClerkMainStoreRelated mainStoreRelation = this.clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, wxEnterpriseId, storeIdList) ; TabHaobanClerkMainStoreRelated mainStoreRelation = this.clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, wxEnterpriseId, storeIdList) ;
String newStoreId = mainStoreRelation.getStoreId() ; String newStoreId = mainStoreRelation.getStoreId() ;
StaffClerkRelationDTO mainClerk = this.getOneBindByStoreId(staffId, newStoreId) ; StaffClerkRelationDTO mainClerk = this.getOneBindByStoreId(staffId, newStoreId) ;
...@@ -156,6 +163,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -156,6 +163,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}else { }else {
// 删除关联关系 // 删除关联关系
this.mapper.changeStatusByClerkId(oldClerkId, 0); this.mapper.changeStatusByClerkId(oldClerkId, 0);
delFlag = false ;
TabHaobanClerkMainStoreRelated mainStore = this.clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, wxEnterpriseId, storeIdList) ; TabHaobanClerkMainStoreRelated mainStore = this.clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, wxEnterpriseId, storeIdList) ;
String newStoreId = mainStore.getStoreId() ; String newStoreId = mainStore.getStoreId() ;
StaffClerkRelationDTO mainClerk = this.getOneBindByStoreId(staffId, newStoreId) ; StaffClerkRelationDTO mainClerk = this.getOneBindByStoreId(staffId, newStoreId) ;
...@@ -164,6 +172,10 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -164,6 +172,10 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
} }
} }
} }
// 删除关联关系
if(delFlag) {
this.mapper.changeStatusByClerkId(oldClerkId, 0);
}
if(StringUtils.isNotBlank(newClerkId)) { if(StringUtils.isNotBlank(newClerkId)) {
List<String> memberIdList = this.externalClerkRelatedMapper.listByClerkId(staffId, oldClerkId) ; List<String> memberIdList = this.externalClerkRelatedMapper.listByClerkId(staffId, oldClerkId) ;
this.externalClerkRelatedService.updateClerkInfo(staffId , oldClerkId , newClerkId) ; this.externalClerkRelatedService.updateClerkInfo(staffId , oldClerkId , newClerkId) ;
......
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