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