品牌下拉

This commit is contained in:
zjf committed 2024-12-25 16:14:15 +08:00
1 parent 8936fcfe5f
commit 6ecf07d2b6
2 files changed
+34

No files matched your search

@@ -0,0 +1,17 @@
package com.bsd.pjcloud.supermarket.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class SupermarketBrandSimpleVo {
@Schema(description = "品牌id")
private Long id;
@Schema(description = "品牌名称")
private String name;
}
@@ -6,10 +6,14 @@ import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bsd.pjcloud.common.core.util.BeanUtils;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.log.annotation.SysLog;
import com.bsd.pjcloud.supermarket.entity.SupermarketBrandEntity;
import com.bsd.pjcloud.supermarket.entity.SupermarketCategoryEntity;
import com.bsd.pjcloud.supermarket.service.SupermarketBrandService;
import com.bsd.pjcloud.supermarket.vo.SupermarketBrandSimpleVo;
import com.bsd.pjcloud.supermarket.vo.SupermarketCategorySimpleVo;
import org.springframework.security.access.prepost.PreAuthorize;
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
@@ -118,4 +122,17 @@ public class SupermarketBrandController {
public List<SupermarketBrandEntity> export(SupermarketBrandEntity supermarketBrand,Long[] ids) {
return supermarketBrandService.list(Wrappers.lambdaQuery(supermarketBrand).in(ArrayUtil.isNotEmpty(ids), SupermarketBrandEntity::getId, ids));
}
/**
* 下拉查询
* @return
*/
@Operation(summary = "下拉查询")
@GetMapping("/simpleAll")
public R getSimpleAll() {
List<SupermarketBrandEntity> list = supermarketBrandService.list();
List<SupermarketBrandSimpleVo> bean = BeanUtils.toBean(list, SupermarketBrandSimpleVo.class);
return R.ok(bean);
}
}