微信-菜品
This commit is contained in:
@ -43,7 +43,7 @@ public class DishesController {
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建菜品管理")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes:create')")
|
||||
public CommonResult<Long> createDishes(@Valid DishesSaveReqVO createReqVO) {
|
||||
public CommonResult<Long> createDishes(@Valid @RequestBody DishesSaveReqVO createReqVO) {
|
||||
return success(dishesService.createDishes(createReqVO));
|
||||
}
|
||||
|
||||
|
@ -15,30 +15,30 @@ public class DishesSaveReqVO {
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "菜品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "菜品名称不能为空")
|
||||
// @NotEmpty(message = "菜品名称不能为空")
|
||||
private String dishesName;
|
||||
|
||||
@Schema(description = "菜品图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
||||
private String file;
|
||||
private String dishesImageUrl;
|
||||
|
||||
@Schema(description = "菜品属性", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "菜品属性不能为空")
|
||||
// @NotEmpty(message = "菜品属性不能为空")
|
||||
private String dishesAttribute;
|
||||
|
||||
@Schema(description = "基本价格(标准)", requiredMode = Schema.RequiredMode.REQUIRED, example = "27937")
|
||||
@NotNull(message = "基本价格(标准)不能为空")
|
||||
// @NotNull(message = "基本价格(标准)不能为空")
|
||||
private BigDecimal dishesBasePrice;
|
||||
|
||||
@Schema(description = "会员价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "21531")
|
||||
@NotNull(message = "会员价格不能为空")
|
||||
// @NotNull(message = "会员价格不能为空")
|
||||
private BigDecimal dishesVipBasePrice;
|
||||
|
||||
@Schema(description = "门店编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotNull(message = "门店编号不能为空")
|
||||
// @NotNull(message = "门店编号不能为空")
|
||||
private Long carteenId;
|
||||
|
||||
@Schema(description = "分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotNull(message = "分类编号不能为空")
|
||||
// @NotNull(message = "分类编号不能为空")
|
||||
private Long typeId;
|
||||
@Schema(description = "称重价格(标准)", requiredMode = Schema.RequiredMode.REQUIRED, example = "6375")
|
||||
private BigDecimal dishesWeighPrice;
|
||||
|
@ -37,34 +37,34 @@ public class DishesAppController {
|
||||
@Resource
|
||||
private DishesService dishesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建菜品管理")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes:create')")
|
||||
public CommonResult<Long> createDishes(@Valid DishesSaveReqVO createReqVO) {
|
||||
return success(dishesService.createDishes(createReqVO));
|
||||
}
|
||||
// @PostMapping("/create")
|
||||
// @Operation(summary = "创建菜品管理")
|
||||
//// @PreAuthorize("@ss.hasPermission('t:dishes:create')")
|
||||
// public CommonResult<Long> createDishes(@Valid @RequestBody DishesSaveReqVO createReqVO) {
|
||||
// return success(dishesService.createDishes(createReqVO));
|
||||
// }
|
||||
//
|
||||
// @PutMapping("/update")
|
||||
// @Operation(summary = "更新菜品管理")
|
||||
//// @PreAuthorize("@ss.hasPermission('t:dishes:update')")
|
||||
// public CommonResult<Boolean> updateDishes(@Valid @RequestBody DishesSaveReqVO updateReqVO) {
|
||||
// dishesService.updateDishes(updateReqVO);
|
||||
// return success(true);
|
||||
// }
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新菜品管理")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes:update')")
|
||||
public CommonResult<Boolean> updateDishes(@Valid @RequestBody DishesSaveReqVO updateReqVO) {
|
||||
dishesService.updateDishes(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除菜品管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes:delete')")
|
||||
public CommonResult<Boolean> deleteDishes(@RequestParam("id") Long id) {
|
||||
dishesService.deleteDishes(id);
|
||||
return success(true);
|
||||
}
|
||||
// @DeleteMapping("/delete")
|
||||
// @Operation(summary = "删除菜品管理")
|
||||
// @Parameter(name = "id", description = "编号", required = true)
|
||||
//// @PreAuthorize("@ss.hasPermission('t:dishes:delete')")
|
||||
// public CommonResult<Boolean> deleteDishes(@RequestParam("id") Long id) {
|
||||
// dishesService.deleteDishes(id);
|
||||
// return success(true);
|
||||
// }
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得菜品管理")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes:query')")
|
||||
public CommonResult<DishesRespVO> getDishes(@RequestParam("id") Long id) {
|
||||
DishesDO dishes = dishesService.getDishes(id);
|
||||
return success(BeanUtils.toBean(dishes, DishesRespVO.class));
|
||||
@ -72,23 +72,23 @@ public class DishesAppController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得菜品管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes:query')")
|
||||
public CommonResult<PageResult<DishesRespVO>> getDishesPage(@Valid DishesPageReqVO pageReqVO) {
|
||||
PageResult<DishesDO> pageResult = dishesService.getDishesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DishesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出菜品管理 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportDishesExcel(@Valid DishesPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DishesDO> list = dishesService.getDishesPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "菜品管理.xls", "数据", DishesRespVO.class,
|
||||
BeanUtils.toBean(list, DishesRespVO.class));
|
||||
}
|
||||
// @GetMapping("/export-excel")
|
||||
// @Operation(summary = "导出菜品管理 Excel")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes:export')")
|
||||
// @OperateLog(type = EXPORT)
|
||||
// public void exportDishesExcel(@Valid DishesPageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<DishesDO> list = dishesService.getDishesPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "菜品管理.xls", "数据", DishesRespVO.class,
|
||||
// BeanUtils.toBean(list, DishesRespVO.class));
|
||||
// }
|
||||
|
||||
}
|
@ -37,39 +37,39 @@ public class DishesNutritionAppController {
|
||||
@Resource
|
||||
private DishesNutritionService dishesNutritionService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建菜品营养")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-nutrition:create')")
|
||||
public CommonResult<Long> createDishesNutrition(@Valid @RequestBody DishesNutritionSaveReqVO createReqVO) {
|
||||
return success(dishesNutritionService.createDishesNutrition(createReqVO));
|
||||
}
|
||||
@PostMapping("/createbtch")
|
||||
@Operation(summary = "创建菜品营养")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-nutrition:create')")
|
||||
public CommonResult<Long> createDishesNutrition(@Valid @RequestBody List<DishesNutritionSaveReqVO> createReqVO) {
|
||||
return success(dishesNutritionService.createDishesNutritionList(createReqVO));
|
||||
}
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新菜品营养")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-nutrition:update')")
|
||||
public CommonResult<Boolean> updateDishesNutrition(@Valid @RequestBody DishesNutritionSaveReqVO updateReqVO) {
|
||||
dishesNutritionService.updateDishesNutrition(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
// @PostMapping("/create")
|
||||
// @Operation(summary = "创建菜品营养")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-nutrition:create')")
|
||||
// public CommonResult<Long> createDishesNutrition(@Valid @RequestBody DishesNutritionSaveReqVO createReqVO) {
|
||||
// return success(dishesNutritionService.createDishesNutrition(createReqVO));
|
||||
// }
|
||||
// @PostMapping("/createbtch")
|
||||
// @Operation(summary = "创建菜品营养")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-nutrition:create')")
|
||||
// public CommonResult<Long> createDishesNutrition(@Valid @RequestBody List<DishesNutritionSaveReqVO> createReqVO) {
|
||||
// return success(dishesNutritionService.createDishesNutritionList(createReqVO));
|
||||
// }
|
||||
// @PutMapping("/update")
|
||||
// @Operation(summary = "更新菜品营养")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-nutrition:update')")
|
||||
// public CommonResult<Boolean> updateDishesNutrition(@Valid @RequestBody DishesNutritionSaveReqVO updateReqVO) {
|
||||
// dishesNutritionService.updateDishesNutrition(updateReqVO);
|
||||
// return success(true);
|
||||
// }
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除菜品营养")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-nutrition:delete')")
|
||||
public CommonResult<Boolean> deleteDishesNutrition(@RequestParam("id") Long id) {
|
||||
dishesNutritionService.deleteDishesNutrition(id);
|
||||
return success(true);
|
||||
}
|
||||
// @DeleteMapping("/delete")
|
||||
// @Operation(summary = "删除菜品营养")
|
||||
// @Parameter(name = "id", description = "编号", required = true)
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-nutrition:delete')")
|
||||
// public CommonResult<Boolean> deleteDishesNutrition(@RequestParam("id") Long id) {
|
||||
// dishesNutritionService.deleteDishesNutrition(id);
|
||||
// return success(true);
|
||||
// }
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得菜品营养")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-nutrition:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-nutrition:query')")
|
||||
public CommonResult<DishesNutritionRespVO> getDishesNutrition(@RequestParam("id") Long id) {
|
||||
DishesNutritionDO dishesNutrition = dishesNutritionService.getDishesNutrition(id);
|
||||
return success(BeanUtils.toBean(dishesNutrition, DishesNutritionRespVO.class));
|
||||
@ -77,29 +77,29 @@ public class DishesNutritionAppController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得菜品营养分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-nutrition:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-nutrition:query')")
|
||||
public CommonResult<PageResult<DishesNutritionRespVO>> getDishesNutritionPage(@Valid DishesNutritionPageReqVO pageReqVO) {
|
||||
PageResult<DishesNutritionDO> pageResult = dishesNutritionService.getDishesNutritionPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DishesNutritionRespVO.class));
|
||||
}
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得菜品营养集合")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-nutrition:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-nutrition:query')")
|
||||
public CommonResult<List<DishesNutritionRespVO>> getDishesNutritionList(@Valid DishesNutritionPageReqVO pageReqVO) {
|
||||
List<DishesNutritionDO> pageResult = dishesNutritionService.getDishesNutritionList(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DishesNutritionRespVO.class));
|
||||
}
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出菜品营养 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-nutrition:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportDishesNutritionExcel(@Valid DishesNutritionPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DishesNutritionDO> list = dishesNutritionService.getDishesNutritionPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "菜品营养.xls", "数据", DishesNutritionRespVO.class,
|
||||
BeanUtils.toBean(list, DishesNutritionRespVO.class));
|
||||
}
|
||||
// @GetMapping("/export-excel")
|
||||
// @Operation(summary = "导出菜品营养 Excel")
|
||||
//// @PreAuthorize("@ss.hasPermission('t:dishes-nutrition:export')")
|
||||
// @OperateLog(type = EXPORT)
|
||||
// public void exportDishesNutritionExcel(@Valid DishesNutritionPageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<DishesNutritionDO> list = dishesNutritionService.getDishesNutritionPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "菜品营养.xls", "数据", DishesNutritionRespVO.class,
|
||||
// BeanUtils.toBean(list, DishesNutritionRespVO.class));
|
||||
// }
|
||||
|
||||
}
|
@ -37,34 +37,34 @@ public class DishesRawAppController {
|
||||
@Resource
|
||||
private DishesRawService dishesRawService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建菜品原材料")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-raw:create')")
|
||||
public CommonResult<Long> createDishesRaw(@Valid @RequestBody List<DishesRawSaveReqVO> createReqVO) {
|
||||
return success(dishesRawService.createDishesRawList(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新菜品原材料")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-raw:update')")
|
||||
public CommonResult<Boolean> updateDishesRaw(@Valid @RequestBody DishesRawSaveReqVO updateReqVO) {
|
||||
dishesRawService.updateDishesRaw(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除菜品原材料")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-raw:delete')")
|
||||
public CommonResult<Boolean> deleteDishesRaw(@RequestParam("id") Long id) {
|
||||
dishesRawService.deleteDishesRaw(id);
|
||||
return success(true);
|
||||
}
|
||||
// @PostMapping("/create")
|
||||
// @Operation(summary = "创建菜品原材料")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-raw:create')")
|
||||
// public CommonResult<Long> createDishesRaw(@Valid @RequestBody List<DishesRawSaveReqVO> createReqVO) {
|
||||
// return success(dishesRawService.createDishesRawList(createReqVO));
|
||||
// }
|
||||
//
|
||||
// @PutMapping("/update")
|
||||
// @Operation(summary = "更新菜品原材料")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-raw:update')")
|
||||
// public CommonResult<Boolean> updateDishesRaw(@Valid @RequestBody DishesRawSaveReqVO updateReqVO) {
|
||||
// dishesRawService.updateDishesRaw(updateReqVO);
|
||||
// return success(true);
|
||||
// }
|
||||
//
|
||||
// @DeleteMapping("/delete")
|
||||
// @Operation(summary = "删除菜品原材料")
|
||||
// @Parameter(name = "id", description = "编号", required = true)
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-raw:delete')")
|
||||
// public CommonResult<Boolean> deleteDishesRaw(@RequestParam("id") Long id) {
|
||||
// dishesRawService.deleteDishesRaw(id);
|
||||
// return success(true);
|
||||
// }
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得菜品原材料")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-raw:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-raw:query')")
|
||||
public CommonResult<DishesRawRespVO> getDishesRaw(@RequestParam("id") Long id) {
|
||||
DishesRawDO dishesRaw = dishesRawService.getDishesRaw(id);
|
||||
return success(BeanUtils.toBean(dishesRaw, DishesRawRespVO.class));
|
||||
@ -72,23 +72,23 @@ public class DishesRawAppController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得菜品原材料分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-raw:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-raw:query')")
|
||||
public CommonResult<PageResult<DishesRawRespVO>> getDishesRawPage(@Valid DishesRawPageReqVO pageReqVO) {
|
||||
PageResult<DishesRawDO> pageResult = dishesRawService.getDishesRawPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DishesRawRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出菜品原材料 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-raw:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportDishesRawExcel(@Valid DishesRawPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DishesRawDO> list = dishesRawService.getDishesRawPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "菜品原材料.xls", "数据", DishesRawRespVO.class,
|
||||
BeanUtils.toBean(list, DishesRawRespVO.class));
|
||||
}
|
||||
// @GetMapping("/export-excel")
|
||||
// @Operation(summary = "导出菜品原材料 Excel")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-raw:export')")
|
||||
// @OperateLog(type = EXPORT)
|
||||
// public void exportDishesRawExcel(@Valid DishesRawPageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<DishesRawDO> list = dishesRawService.getDishesRawPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "菜品原材料.xls", "数据", DishesRawRespVO.class,
|
||||
// BeanUtils.toBean(list, DishesRawRespVO.class));
|
||||
// }
|
||||
|
||||
}
|
@ -37,34 +37,34 @@ public class DishesTypeAppController {
|
||||
@Resource
|
||||
private DishesTypeService dishesTypeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建菜品分类")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-type:create')")
|
||||
public CommonResult<Long> createDishesType(@Valid @RequestBody DishesTypeSaveReqVO createReqVO) {
|
||||
return success(dishesTypeService.createDishesType(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新菜品分类")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-type:update')")
|
||||
public CommonResult<Boolean> updateDishesType(@Valid @RequestBody DishesTypeSaveReqVO updateReqVO) {
|
||||
dishesTypeService.updateDishesType(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除菜品分类")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-type:delete')")
|
||||
public CommonResult<Boolean> deleteDishesType(@RequestParam("id") Long id) {
|
||||
dishesTypeService.deleteDishesType(id);
|
||||
return success(true);
|
||||
}
|
||||
// @PostMapping("/create")
|
||||
// @Operation(summary = "创建菜品分类")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-type:create')")
|
||||
// public CommonResult<Long> createDishesType(@Valid @RequestBody DishesTypeSaveReqVO createReqVO) {
|
||||
// return success(dishesTypeService.createDishesType(createReqVO));
|
||||
// }
|
||||
//
|
||||
// @PutMapping("/update")
|
||||
// @Operation(summary = "更新菜品分类")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-type:update')")
|
||||
// public CommonResult<Boolean> updateDishesType(@Valid @RequestBody DishesTypeSaveReqVO updateReqVO) {
|
||||
// dishesTypeService.updateDishesType(updateReqVO);
|
||||
// return success(true);
|
||||
// }
|
||||
//
|
||||
// @DeleteMapping("/delete")
|
||||
// @Operation(summary = "删除菜品分类")
|
||||
// @Parameter(name = "id", description = "编号", required = true)
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-type:delete')")
|
||||
// public CommonResult<Boolean> deleteDishesType(@RequestParam("id") Long id) {
|
||||
// dishesTypeService.deleteDishesType(id);
|
||||
// return success(true);
|
||||
// }
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得菜品分类")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-type:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-type:query')")
|
||||
public CommonResult<DishesTypeRespVO> getDishesType(@RequestParam("id") Long id) {
|
||||
DishesTypeDO dishesType = dishesTypeService.getDishesType(id);
|
||||
return success(BeanUtils.toBean(dishesType, DishesTypeRespVO.class));
|
||||
@ -72,24 +72,24 @@ public class DishesTypeAppController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得菜品分类分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-type:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-type:query')")
|
||||
public CommonResult<PageResult<DishesTypeRespVO>> getDishesTypePage(@Valid DishesTypePageReqVO pageReqVO) {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
PageResult<DishesTypeDO> pageResult = dishesTypeService.getDishesTypePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DishesTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出菜品分类 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-type:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportDishesTypeExcel(@Valid DishesTypePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DishesTypeDO> list = dishesTypeService.getDishesTypePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "菜品分类.xls", "数据", DishesTypeRespVO.class,
|
||||
BeanUtils.toBean(list, DishesTypeRespVO.class));
|
||||
}
|
||||
// @GetMapping("/export-excel")
|
||||
// @Operation(summary = "导出菜品分类 Excel")
|
||||
// @PreAuthorize("@ss.hasPermission('t:dishes-type:export')")
|
||||
// @OperateLog(type = EXPORT)
|
||||
// public void exportDishesTypeExcel(@Valid DishesTypePageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<DishesTypeDO> list = dishesTypeService.getDishesTypePage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "菜品分类.xls", "数据", DishesTypeRespVO.class,
|
||||
// BeanUtils.toBean(list, DishesTypeRespVO.class));
|
||||
// }
|
||||
|
||||
}
|
Reference in New Issue
Block a user