| | |
| | | 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().and(i->i.eq(Brand::getCompanyId,user.getCompanyId()) |
| | | .or().eq(Brand::getType,Constants.ZERO) |
| | | .or().eq(Brand::getType,Constants.ONE) |
| | | ); |
| | | } |
| | | 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 (pageWrap.getModel().getStatus() != null) { |
| | | queryWrapper.lambda().eq(Brand::getStatus, pageWrap.getModel().getStatus()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(Brand::getType, pageWrap.getModel().getType()); |
| | | } |
| | | // 类型 0企业 1平台 |
| | | if (Objects.isNull(user.getCompanyId())) { |
| | | queryWrapper.lambda().eq(Brand::getType,Constants.ONE); |
| | | }else { |
| | | queryWrapper.lambda().and(i->i.eq(Brand::getCompanyId,user.getCompanyId()) |
| | | .or().eq(Brand::getType,Constants.ZERO) |
| | | .or().eq(Brand::getType,Constants.ONE) |
| | | ); |
| | | } |
| | | queryWrapper.lambda().orderByAsc(Brand::getType); |
| | | queryWrapper.lambda().orderByAsc(Brand::getSortnum); |
| | | IPage<Brand> brandIPage = brandMapper.selectPage(page, queryWrapper); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |