|
|
|
@ -17,6 +17,7 @@ import com.kiisoo.ic.employee.mapper.PrivilageCpUserDOMapper;
|
|
|
|
|
import com.kiisoo.ic.employee.service.EmployeeService;
|
|
|
|
|
import com.kiisoo.ic.generalize.entity.PrivilageOrganizational;
|
|
|
|
|
import com.kiisoo.ic.generalize.entity.PrivilageOrganizationalMember;
|
|
|
|
|
import com.kiisoo.ic.generalize.service.RetailCompanyService;
|
|
|
|
|
import com.kiisoo.ic.generalize.mapper.RetailCompanyMapper;
|
|
|
|
|
import com.kiisoo.ic.store.bean.PoiStoreStaffDTO;
|
|
|
|
|
import com.kiisoo.ic.store.entity.PoiStore;
|
|
|
|
@ -89,22 +90,37 @@ public class StoreEmployeeService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private RetailCompanyMapper retailCompanyMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private RetailCompanyService retailCompanyService;
|
|
|
|
|
/**
|
|
|
|
|
* 查询门店号
|
|
|
|
|
* @param storeId 门店id
|
|
|
|
|
* @param regionId 区域id
|
|
|
|
|
*/
|
|
|
|
|
public PageInfo<StoreUserDTO> listStoreUser(Long userId ,Long storeId, Long regionId, Integer pageNum, Integer pageSize) {
|
|
|
|
|
public PageInfo<StoreUserDTO> listStoreUser(Long userId ,Long storeId, Long regionId,Long companyId, Integer pageNum, Integer pageSize,String code) {
|
|
|
|
|
Map<String,Object> result = new HashMap<>();
|
|
|
|
|
List<PoiStore> poiStores = null;
|
|
|
|
|
List<Long> shopIds = new ArrayList<>();
|
|
|
|
|
if (storeId != null){
|
|
|
|
|
shopIds.add(storeId);
|
|
|
|
|
}else if(StringUtils.isNotBlank(code)){
|
|
|
|
|
List<PoiStore> store = poiStoreDOMapper.selectShopByNameOrCode(code);
|
|
|
|
|
shopIds = store.stream().map(i -> i.getId()).collect(Collectors.toList());
|
|
|
|
|
List<Long> userAllShops = privilageDomainService.listUserDatePermission(userId);
|
|
|
|
|
shopIds.retainAll(userAllShops);
|
|
|
|
|
}else if(regionId != null){
|
|
|
|
|
shopIds = privilageDomainService.listUserDatePermission(userId);
|
|
|
|
|
//有区域就查区域店铺
|
|
|
|
|
List<PoiStore> stores = poiStoreDOMapper.selectRegionShop(regionId);
|
|
|
|
|
shopIds = stores.stream().map(i -> i.getId()).collect(Collectors.toList());
|
|
|
|
|
List<Long> userAllShops = privilageDomainService.listUserDatePermission(userId);
|
|
|
|
|
shopIds.retainAll(userAllShops);
|
|
|
|
|
}else if(companyId != null){
|
|
|
|
|
//如果有公司则查公司店铺
|
|
|
|
|
List<PoiStore> shops = retailCompanyService.selectShopByCompany(companyId);
|
|
|
|
|
shopIds = shops.stream().map(p -> p.getId()).collect(Collectors.toList());
|
|
|
|
|
List<Long> userAllShops = privilageDomainService.listUserDatePermission(userId);
|
|
|
|
|
shopIds.retainAll(userAllShops);
|
|
|
|
|
}else{
|
|
|
|
|
//查询用户权限店铺
|
|
|
|
|
shopIds = new ArrayList<>(privilageDomainService.listUserDatePermission(userId));
|
|
|
|
@ -139,8 +155,6 @@ public class StoreEmployeeService {
|
|
|
|
|
cpUserStore.setCustomerNum((int)count);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*PageInfo<StoreUserDTO> storeUserDTOPageInfo = ;
|
|
|
|
|
storeUserDTOPageInfo.setTotal(poiStores1.getTotal());*/
|
|
|
|
|
return new PageInfo<>(cpUserStoreDO) ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|