修改品管controller
This commit is contained in:
parent
7b38a28e0c
commit
41bdad5ab4
@ -1,12 +1,10 @@
|
|||||||
package com.cpop.oam.business.bo;
|
package com.cpop.oam.business.bo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,39 +14,39 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(value = "BrandManager对象", description = "品牌管理员")
|
@Schema(description = "品牌管理员对象")
|
||||||
public class BrandManagerBo {
|
public class BrandManagerBo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("主键")
|
@Schema(description = "主键")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 姓名
|
* 姓名
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "姓名不能为空")
|
@NotBlank(message = "姓名不能为空")
|
||||||
@ApiModelProperty(value = "姓名",required = true)
|
@Schema(description = "姓名",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号
|
* 手机号
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "手机号不能为空")
|
@NotBlank(message = "手机号不能为空")
|
||||||
@ApiModelProperty(value = "手机号",required = true)
|
@Schema(description = "手机号",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 品牌
|
* 品牌
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "品牌不能为空")
|
@NotBlank(message = "品牌不能为空")
|
||||||
@ApiModelProperty(value = "品牌",required = true )
|
@Schema(description = "品牌",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private String brandId;
|
private String brandId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校区id集合
|
* 校区id集合
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "校区id集合")
|
@Schema(description = "校区id集合")
|
||||||
private List<String> storeIds;
|
private List<String> storeIds;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package com.cpop.oam.business.bo;
|
package com.cpop.oam.business.bo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,24 +9,24 @@ import lombok.Data;
|
|||||||
* @since 2023-12-07 17:25
|
* @since 2023-12-07 17:25
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ApiModel(value = "品牌管理员参数")
|
@Schema(description = "品牌管理员参数")
|
||||||
public class BrandManagerPageBo {
|
public class BrandManagerPageBo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 品牌名
|
* 品牌名
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "品牌名")
|
@Schema(description = "品牌名")
|
||||||
private String brandName;
|
private String brandName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号
|
* 手机号
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "手机号")
|
@Schema(description = "手机号")
|
||||||
private String phoneNumber;
|
private String phoneNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* 姓名
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "姓名")
|
@Schema(description = "姓名")
|
||||||
private String name;
|
private String name;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.cpop.oam.business.bo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DB
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-04-18 17:17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@Schema(description = "根据品牌校区列表")
|
||||||
|
public class StoreListByBrandBo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌主键集合
|
||||||
|
*/
|
||||||
|
@Schema(description = "品牌主键集合")
|
||||||
|
private List<String> brandIds;
|
||||||
|
}
|
||||||
@ -3,8 +3,8 @@ package com.cpop.oam.business.controller.backstage;
|
|||||||
import com.cpop.core.base.entity.R;
|
import com.cpop.core.base.entity.R;
|
||||||
import com.cpop.oam.business.bo.BrandManagerBo;
|
import com.cpop.oam.business.bo.BrandManagerBo;
|
||||||
import com.cpop.oam.business.bo.BrandManagerPageBo;
|
import com.cpop.oam.business.bo.BrandManagerPageBo;
|
||||||
|
import com.cpop.oam.business.bo.StoreListByBrandBo;
|
||||||
import com.cpop.oam.business.service.BrandManagerService;
|
import com.cpop.oam.business.service.BrandManagerService;
|
||||||
import com.cpop.system.business.entity.table.BrandTableDef;
|
|
||||||
import com.cpop.system.business.entity.table.StoreTableDef;
|
import com.cpop.system.business.entity.table.StoreTableDef;
|
||||||
import com.cpop.system.business.service.BrandService;
|
import com.cpop.system.business.service.BrandService;
|
||||||
import com.cpop.system.business.service.StoreService;
|
import com.cpop.system.business.service.StoreService;
|
||||||
@ -13,15 +13,16 @@ import com.cpop.oam.business.vo.BrandManagePageVo;
|
|||||||
import com.cpop.system.business.vo.StoreListByBrandVo;
|
import com.cpop.system.business.vo.StoreListByBrandVo;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 品牌管理员表 控制层。
|
* 品牌管理员表 控制层。
|
||||||
*
|
*
|
||||||
@ -29,9 +30,10 @@ import java.util.List;
|
|||||||
* @since 2023-12-07
|
* @since 2023-12-07
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "品牌管理员表接口")
|
@Tag(name = "品牌管理员表接口")
|
||||||
@RequestMapping("/backstage/brandManage")
|
@RequestMapping("/backstage/brandManage")
|
||||||
public class BackstageBrandManagerController {
|
public class BackstageBrandManagerController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BrandManagerService brandManageService;
|
private BrandManagerService brandManageService;
|
||||||
|
|
||||||
@ -48,9 +50,8 @@ public class BackstageBrandManagerController {
|
|||||||
* @param bo 请求参数
|
* @param bo 请求参数
|
||||||
* @return R<Page<BrandManagePageVo>>
|
* @return R<Page<BrandManagePageVo>>
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询品牌管理员分页")
|
@Operation(summary = "查询品牌管理员分页")
|
||||||
@GetMapping("/getBrandManagePage")
|
@GetMapping("/getBrandManagePage")
|
||||||
@PreAuthorize("@aps.hasPermission('brandStore:brandStaff:list')")
|
|
||||||
public R<Page<BrandManagePageVo>> getBrandManagePage(BrandManagerPageBo bo) {
|
public R<Page<BrandManagePageVo>> getBrandManagePage(BrandManagerPageBo bo) {
|
||||||
Page<BrandManagePageVo> page = brandManageService.getBrandManagerPage(bo);
|
Page<BrandManagePageVo> page = brandManageService.getBrandManagerPage(bo);
|
||||||
return R.ok(page);
|
return R.ok(page);
|
||||||
@ -62,10 +63,10 @@ public class BackstageBrandManagerController {
|
|||||||
* @since 2023/09/07 18:07
|
* @since 2023/09/07 18:07
|
||||||
* @return R<List<BrandListVo>>
|
* @return R<List<BrandListVo>>
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询品牌列表")
|
@Operation(summary = "查询品牌列表")
|
||||||
@GetMapping("/getBrandList")
|
@GetMapping("/getBrandList")
|
||||||
public R<List<BrandListVo>> getBrandList(String query) {
|
public R<List<BrandListVo>> getBrandList(String query) {
|
||||||
List<BrandListVo> list = brandService.listAs(QueryWrapper.create().and(BrandTableDef.BRAND.BRAND_NAME.like(query)), BrandListVo.class);
|
List<BrandListVo> list = brandService.listAs(QueryWrapper.create().and(BRAND.BRAND_NAME.like(query)), BrandListVo.class);
|
||||||
return R.ok(list);
|
return R.ok(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ public class BackstageBrandManagerController {
|
|||||||
* @author DB
|
* @author DB
|
||||||
* @since 2023/6/2 17:37
|
* @since 2023/6/2 17:37
|
||||||
**/
|
**/
|
||||||
@ApiOperation("根据品牌查询校区列表")
|
@Operation(summary = "根据品牌查询校区列表")
|
||||||
@PostMapping("/getStoreListByBrand")
|
@PostMapping("/getStoreListByBrand")
|
||||||
public R<List<StoreListByBrandVo>> getCampusListByBrand(@RequestBody StoreListByBrandBo bo) {
|
public R<List<StoreListByBrandVo>> getCampusListByBrand(@RequestBody StoreListByBrandBo bo) {
|
||||||
List<StoreListByBrandVo> vos = storeService.listAs(QueryWrapper.create().and(StoreTableDef.STORE.BRAND_ID.in(bo.getBrandIds())), StoreListByBrandVo.class);
|
List<StoreListByBrandVo> vos = storeService.listAs(QueryWrapper.create().and(StoreTableDef.STORE.BRAND_ID.in(bo.getBrandIds())), StoreListByBrandVo.class);
|
||||||
@ -89,7 +90,7 @@ public class BackstageBrandManagerController {
|
|||||||
* @param id 主键
|
* @param id 主键
|
||||||
* @return R<Void>
|
* @return R<Void>
|
||||||
*/
|
*/
|
||||||
@ApiOperation("删除品牌管理员")
|
@Operation(summary = "删除品牌管理员")
|
||||||
@DeleteMapping("/removeBrandManageById/{id}")
|
@DeleteMapping("/removeBrandManageById/{id}")
|
||||||
public R<Void> removeBrandManageById(@PathVariable String id) {
|
public R<Void> removeBrandManageById(@PathVariable String id) {
|
||||||
brandManageService.removeBrandManagerById(id);
|
brandManageService.removeBrandManagerById(id);
|
||||||
@ -103,7 +104,7 @@ public class BackstageBrandManagerController {
|
|||||||
* @param bo 请求
|
* @param bo 请求
|
||||||
* @return R<Void>
|
* @return R<Void>
|
||||||
*/
|
*/
|
||||||
@ApiOperation("新增品牌管理员")
|
@Operation(summary = "新增品牌管理员")
|
||||||
@PostMapping("insertBrandManage")
|
@PostMapping("insertBrandManage")
|
||||||
public R<Void> insertBrandManage(@RequestBody @Validated BrandManagerBo bo) {
|
public R<Void> insertBrandManage(@RequestBody @Validated BrandManagerBo bo) {
|
||||||
brandManageService.insertBrandManager(bo);
|
brandManageService.insertBrandManager(bo);
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
package com.cpop.oam.business.vo;
|
package com.cpop.oam.business.vo;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
@ -15,43 +14,43 @@ import java.time.LocalDateTime;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(value = "BrandManage对象", description = "品牌管理员")
|
@Schema(description = "品牌管理员分页对象")
|
||||||
public class BrandManagePageVo {
|
public class BrandManagePageVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("主键")
|
@Schema(description = "主键")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 姓名
|
* 姓名
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("姓名")
|
@Schema(description = "姓名")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号
|
* 手机号
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("手机号")
|
@Schema(description = "手机号")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||||
@ApiModelProperty("创建时间")
|
@Schema(description = "创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 品牌名
|
* 品牌名
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("品牌名")
|
@Schema(description = "品牌名")
|
||||||
private String brandName;
|
private String brandName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校区名
|
* 校区名
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("校区名")
|
@Schema(description = "校区名")
|
||||||
private String storeName;
|
private String storeName;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user