Commit 0ed25011 by 墨竹

feat:新增该门店好办是否有权限接口

parent f959cb0c
......@@ -268,6 +268,19 @@ public interface StaffApiService {
* @date 2022-05-09 16:34:56
*/
List<String> getHaoBanStoreRolesByStoreWidgetId(String storeWidgetId,String enterpriseId);
/**
* 该门店好办是否有权限 true有,false 否
*
* @param storeId 存储id
* @param enterpriseId 企业标识
* @param wxEnterpriseId wx企业标识
* @return boolean
* @author mozhu
* @date 2022-05-18 14:19:11
*/
boolean isFlagByStoreIdAndEnterpriseId(String storeId,String enterpriseId,String wxEnterpriseId);
public void updateDefaultGicEid(String staffid , String gicEnterpriseId) ;
......
......@@ -15,6 +15,7 @@ import com.gic.commons.util.GlobalVar;
import com.gic.commons.util.ImageUtil;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.dto.StoreGroupDTO;
import com.gic.enterprise.api.dto.StoreWidgetDTO;
import com.gic.enterprise.api.service.StoreGroupService;
import com.gic.enterprise.api.service.StoreService;
import com.gic.enterprise.api.service.StoreWidgetService;
......@@ -404,6 +405,7 @@ public class StaffApiServiceImpl implements StaffApiService {
/**
* 获取wxopenid
*
* @param userId
* @param corpid
* @return
......@@ -1112,8 +1114,8 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public List<StaffDTO> listByWxUserId(String wxUserId,String wxEnterpriseId) {
List<TabHaobanStaff> list = staffMapper.listByWxUserId(wxUserId,wxEnterpriseId);
public List<StaffDTO> listByWxUserId(String wxUserId, String wxEnterpriseId) {
List<TabHaobanStaff> list = staffMapper.listByWxUserId(wxUserId, wxEnterpriseId);
return EntityUtil.changeEntityListByJSON(StaffDTO.class, list);
}
......@@ -1312,6 +1314,13 @@ public class StaffApiServiceImpl implements StaffApiService {
return enterpriseIdStoreIds;
}
List<String> gicStoreIds = getStoreIdList(clerkId);
if (CollectionUtils.isEmpty(gicStoreIds)) {
return Collections.emptyList();
}
if (gicStoreIds.contains("-1")) {
//gic管理员返回好办企业
return enterpriseIdStoreIds;
}
//取交集
Sets.SetView<String> intersection = Sets.intersection(Sets.newHashSet(enterpriseIdStoreIds), Sets.newHashSet(gicStoreIds));
return intersection.stream().collect(Collectors.toList());
......@@ -1331,6 +1340,15 @@ public class StaffApiServiceImpl implements StaffApiService {
return intersection.stream().collect(Collectors.toList());
}
@Override
public boolean isFlagByStoreIdAndEnterpriseId(String storeId, String enterpriseId, String wxEnterpriseId) {
List<String> enterpriseIdStoreIds = storeRangeService.listStoreIdByWxEnterpriseId(enterpriseId, wxEnterpriseId);
if (CollectionUtils.isEmpty(enterpriseIdStoreIds)) {
return false;
}
return enterpriseIdStoreIds.contains(storeId);
}
/**
* 门店筛选器id企业端获取gic门店id列表
*
......@@ -1340,12 +1358,23 @@ public class StaffApiServiceImpl implements StaffApiService {
* @date 2022-05-06 16:00:05
*/
private List<String> getStoreIdList(String clerkId) {
PowerClerkDTO clerkDetail = powerService.getClerkDetail(clerkId);
if (clerkDetail == null) {
return Collections.emptyList();
}
return getStoreWidgetIdStoreIds(clerkDetail.getStoreWidgetId(), clerkDetail.getEnterpriseId());
String storeWidgetId = clerkDetail.getStoreWidgetId();
StoreWidgetDTO storeWidgetDTO = this.storeWidgetService.getStoreWidgetBykey(storeWidgetId);
if (storeWidgetDTO == null) {
return Collections.emptyList();
}
Integer selectType = storeWidgetDTO.getSelectType();
if (selectType == 0) {
//gic超管
List<String> all = new ArrayList<>();
all.add("-1");
return all;
}
return getStoreWidgetIdStoreIds(storeWidgetId, clerkDetail.getEnterpriseId());
}
/**
......@@ -1357,7 +1386,7 @@ public class StaffApiServiceImpl implements StaffApiService {
* @author mozhu
* @date 2022-05-09 16:43:50
*/
private List<String> getStoreWidgetIdStoreIds(String storeWidgetId,String enterpriseId) {
private List<String> getStoreWidgetIdStoreIds(String storeWidgetId, String enterpriseId) {
// 门店id列表
List<String> storeIdList = storeWidgetService.getStoreWidgetStore(storeWidgetId, enterpriseId, null, null, 2);
if (CollectionUtils.isEmpty(storeIdList)) {
......@@ -1366,8 +1395,9 @@ public class StaffApiServiceImpl implements StaffApiService {
logger.info("门店筛选器查询结果:{}", JSON.toJSONString(storeIdList));
return storeIdList;
}
public void updateDefaultGicEid(String staffid , String gicEnterpriseId) {
@Override
public void updateDefaultGicEid(String staffid, String gicEnterpriseId) {
this.staffService.updateDefaultGicEid(staffid, gicEnterpriseId);
}
}
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