|  |  |  | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | QueryWrapper<Brand> wrapper = new QueryWrapper<>(brand); | 
|---|
|  |  |  | wrapper.lambda().eq(Brand::getIsdeleted,Constants.ZERO); | 
|---|
|  |  |  | wrapper.lambda().eq(Brand::getStatus,Constants.ZERO); | 
|---|
|  |  |  | //        wrapper.lambda().eq(Brand::getStatus,Constants.ZERO); | 
|---|
|  |  |  | wrapper.lambda().orderByAsc(Brand::getSortnum); | 
|---|
|  |  |  | // 类型 0企业 1平台 | 
|---|
|  |  |  | if (Objects.isNull(user.getCompanyId())) { | 
|---|
|  |  |  | if (Constants.equalsInteger(user.getType(), Constants.UserType.SYSTEM.getKey())) { | 
|---|
|  |  |  | wrapper.lambda().eq(Brand::getType,Constants.ONE); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | wrapper.lambda().eq(Brand::getType,brand.getCompanyId()) | 
|---|
|  |  |  | .or().eq(Brand::getType,Constants.ZERO); | 
|---|
|  |  |  | wrapper.lambda().and(i->i.eq(Brand::getCompanyId,user.getCompanyId()) | 
|---|
|  |  |  | .or().eq(Brand::getType,Constants.ZERO) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<Brand> list = brandMapper.selectList(wrapper); | 
|---|
|  |  |  | String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() | 
|---|
|  |  |  | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.BRAND_IMG).getCode(); | 
|---|
|  |  |  | for (Brand b:list) { | 
|---|
|  |  |  | b.setImgfullurl(prefixUrl+b.getImgurl()); | 
|---|
|  |  |  | if(StringUtils.isNotBlank(b.getImgurl())){ | 
|---|
|  |  |  | b.setImgfullurl(prefixUrl+b.getImgurl()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return list; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (Objects.isNull(user.getCompanyId())) { | 
|---|
|  |  |  | queryWrapper.lambda().eq(Brand::getType,Constants.ONE); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | queryWrapper.lambda().and(wreapper->{ | 
|---|
|  |  |  | wreapper.eq(Brand::getType,pageWrap.getModel().getCompanyId()) | 
|---|
|  |  |  | .or().eq(Brand::getType,Constants.ZERO);}); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | queryWrapper.lambda().and(i->i.eq(Brand::getCompanyId,user.getCompanyId()) | 
|---|
|  |  |  | .or().eq(Brand::getType,Constants.ONE) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | queryWrapper.lambda().orderByAsc(Brand::getSortnum); | 
|---|
|  |  |  | IPage<Brand> brandIPage = brandMapper.selectPage(page, queryWrapper); | 
|---|