Commit bf44e19e by 徐高华

如果新门店未关联好办,进行解绑

parent ceeda59a
......@@ -113,4 +113,6 @@ public interface StoreRangeService {
List<String> listStoreIdByName( String wxEnterpriseId, String enterpriseId, String storeName) ;
public boolean hasStore(String wxEnterpriseId , String enterpriseId, String storeId) ;
}
......@@ -3,6 +3,8 @@ package com.gic.haoban.manage.service.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.ToolUtil;
import com.gic.enterprise.api.dto.StoreGroupDTO;
import com.gic.enterprise.api.service.StoreGroupService;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
......@@ -45,6 +47,8 @@ public class StoreRangeServiceImpl implements StoreRangeService {
@Autowired
private StaffClerkRelationService staffClerkRelationService;
@Autowired
private StoreGroupService storeGroupService;
@Override
......@@ -267,4 +271,24 @@ public class StoreRangeServiceImpl implements StoreRangeService {
public List<String> listStoreIdByName(String wxEnterpriseId, String enterpriseId, String storeName) {
return tabHaobanStoreRelationMapper.listStoreIdByName(wxEnterpriseId,enterpriseId,storeName);
}
@Override
public boolean hasStore(String wxEnterpriseId , String enterpriseId, String storeId) {
List<String> storeGroupIds = this.listStoreGroupIdByWxEnterpriseId(wxEnterpriseId, enterpriseId);
if (CollectionUtils.isEmpty(storeGroupIds)) {
logger.info("好办门店分组id为空");
return false ;
}
String[] array = storeGroupIds.toArray(new String[0]);
List<StoreGroupDTO> storeGroupDTOS = storeGroupService.listStoreGroup(array, enterpriseId);
List<String> parentGroupIds = storeGroupDTOS.stream().map(StoreGroupDTO::getParentGroupId).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(parentGroupIds) && parentGroupIds.contains("0")) {
logger.info("企微包含所有门店",wxEnterpriseId);
return true ;
}
if(isFlagByStoreId(storeId,wxEnterpriseId,enterpriseId)) {
return true ;
}
return false ;
}
}
......@@ -75,7 +75,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Autowired
private HmQrcodeService hmQrcodeService;
@Autowired
private Config config;
private StoreRangeService storeRangeService;
@Override
public void bindLogMq(String params) {
......@@ -513,11 +513,13 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
logger.info("导购未关联成员,oldClerkId={}", oldClerkId);
return;
}
/* StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getByClerkId(oldClerkId);
if (null == oldRelationDTO) {
logger.info("导购未关联成员,clerkCode={}", clerkCode);
return;
}*/
// 如果新门店未关联好办,进行解绑
boolean hasFlag = this.storeRangeService.hasStore(oldRelationDTO.getWxEnterpriseId(),enterpriseId,clerkDTO.getStoreId()) ;
if(!hasFlag) {
logger.info("新门店未关联好办,storeId={}",clerkDTO.getStoreId());
staffClerkRelationService.delBind(oldClerkId, "-1", ChannelCodeEnum.GIC_CLERK_DEL_UNBIND.getCode(), null,null);
return ;
}
logger.info("导购门店转移,老的绑定导购id={}", oldRelationDTO.getClerkId());
this.moveOrAddClerk(clerkSyncQDTO, oldRelationDTO);
} else if (type == 3) {
......
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