Commit 0e2c9f23 by 墨竹

feat:获取交集门店id

parent 066ff9ff
...@@ -100,6 +100,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -100,6 +100,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private StoreWidgetService storeWidgetService; private StoreWidgetService storeWidgetService;
@Autowired @Autowired
private PowerService powerService; private PowerService powerService;
@Autowired
private StoreRangeService storeRangeService;
@Override @Override
public StaffDTO selectById(String staffId) { public StaffDTO selectById(String staffId) {
...@@ -1291,7 +1293,25 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1291,7 +1293,25 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override @Override
public List<String> getHaoBanStoreRoles(String clerkId) { public List<String> getHaoBanStoreRoles(String clerkId) {
return null; StaffClerkRelationDTO staffClerkRelationDTO = staffClerkRelationService.getByClerkId(clerkId);
if (staffClerkRelationDTO == null) {
return Collections.emptyList();
}
TabHaobanStaff staff = staffService.selectById(staffClerkRelationDTO.getStaffId());
if (staff == null) {
return Collections.emptyList();
}
List<String> enterpriseIdStoreIds = storeRangeService.listStoreIdByWxEnterpriseId(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getWxEnterpriseId());
Integer superManagerFlag = staff.getSuperManagerFlag();
//超管
if (superManagerFlag != null && superManagerFlag == 1) {
//超管返回好办企业
return enterpriseIdStoreIds;
}
List<String> gicStoreIds = getStoreIdList(clerkId);
//取交集
Sets.SetView<String> intersection = Sets.intersection(Sets.newHashSet(enterpriseIdStoreIds), Sets.newHashSet(gicStoreIds));
return new ArrayList<>(intersection);
} }
......
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