feat:包厢预约

This commit is contained in:
dzc committed 2025-01-07 17:03:14 +08:00
1 parent c55c99d30d
commit 2eba69bed6
2 files changed
+37 -30

No files matched your search

@@ -40,52 +40,55 @@ import java.util.Objects;
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/boxesInfo" )
@Tag(description = "boxesInfo" , name = "包厢信息管理" )
@RequestMapping("/boxesInfo")
@Tag(description = "boxesInfo", name = "包厢信息管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class BoxesInfoController {
private final BoxesInfoService boxesInfoService;
private final BoxesInfoService boxesInfoService;
private final BoxesBookingService bookingService;
/**
* 分页查询
* @param page 分页对象
*
* @param page 分页对象
* @param boxesInfo 包厢信息
* @return
*/
@Operation(summary = "分页查询" , description = "分页查询" )
@GetMapping("/page" )
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_view')" )
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_view')")
public R getBoxesInfoPage(@ParameterObject Page page, @ParameterObject BoxesInfoEntity boxesInfo) {
LambdaQueryWrapper<BoxesInfoEntity> wrapper = Wrappers.lambdaQuery();
wrapper.eq(StrUtil.isNotBlank(boxesInfo.getName()),BoxesInfoEntity::getName,boxesInfo.getName());
wrapper.eq(StrUtil.isNotBlank(boxesInfo.getName()), BoxesInfoEntity::getName, boxesInfo.getName());
return R.ok(boxesInfoService.pageScope(page, wrapper));
}
/**
* 通过id查询包厢信息
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询" , description = "通过id查询" )
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_view')" )
public R getById(@PathVariable("id" ) Long id) {
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_view')")
public R getById(@PathVariable("id") Long id) {
return R.ok(boxesInfoService.getById(id));
}
/**
* 新增包厢信息
*
* @param boxesInfo 包厢信息
* @return R
*/
@Operation(summary = "新增包厢信息" , description = "新增包厢信息" )
@SysLog("新增包厢信息" )
@Operation(summary = "新增包厢信息", description = "新增包厢信息")
@SysLog("新增包厢信息")
@PostMapping
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_add')" )
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_add')")
public R save(@RequestBody BoxesInfoEntity boxesInfo) {
boxesInfo.setDeptId(SecurityUtils.getUser().getDeptId());
return R.ok(boxesInfoService.saveInfo(boxesInfo));
@@ -93,26 +96,28 @@ public class BoxesInfoController {
/**
* 修改包厢信息
*
* @param boxesInfo 包厢信息
* @return R
*/
@Operation(summary = "修改包厢信息" , description = "修改包厢信息" )
@SysLog("修改包厢信息" )
@Operation(summary = "修改包厢信息", description = "修改包厢信息")
@SysLog("修改包厢信息")
@PutMapping
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_edit')" )
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_edit')")
public R updateById(@RequestBody BoxesInfoEntity boxesInfo) {
return R.ok(boxesInfoService.updateById(boxesInfo));
}
/**
* 通过id删除包厢信息
*
* @param ids id列表
* @return R
*/
@Operation(summary = "通过id删除包厢信息" , description = "通过id删除包厢信息" )
@SysLog("通过id删除包厢信息" )
@Operation(summary = "通过id删除包厢信息", description = "通过id删除包厢信息")
@SysLog("通过id删除包厢信息")
@DeleteMapping
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_del')" )
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_del')")
public R removeById(@RequestBody Long[] ids) {
return R.ok(boxesInfoService.removeBatchByIds(CollUtil.toList(ids)));
}
@@ -120,26 +125,27 @@ public class BoxesInfoController {
/**
* 导出excel 表格
*
* @param boxesInfo 查询条件
* @param ids 导出指定ID
* @param ids 导出指定ID
* @return excel 文件流
*/
@ResponseExcel
@GetMapping("/export")
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_export')" )
public List<BoxesInfoEntity> export(BoxesInfoEntity boxesInfo,Long[] ids) {
@PreAuthorize("@pms.hasPermission('canteen_boxesInfo_export')")
public List<BoxesInfoEntity> export(BoxesInfoEntity boxesInfo, Long[] ids) {
return boxesInfoService.list(Wrappers.lambdaQuery(boxesInfo).in(ArrayUtil.isNotEmpty(ids), BoxesInfoEntity::getId, ids));
}
// --------------------移动端接口---------------------------
// --------------------移动端接口---------------------------
@GetMapping("/getInfo")
@Operation(summary = "获得包厢固定的基础信息")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public R<AppBXInfoRespVO> getInfo(@RequestParam("id") Long id) {
BoxesInfoEntity byId = boxesInfoService.getById(id);
AppBXInfoRespVO appBXInfoRespVO = new AppBXInfoRespVO();
BeanUtils.copyProperties(byId,appBXInfoRespVO);
BeanUtils.copyProperties(byId, appBXInfoRespVO);
return R.ok(appBXInfoRespVO);
}
@@ -154,12 +160,13 @@ public class BoxesInfoController {
@GetMapping("/appPage")
@Operation(summary = "获得包厢信息分页")
public R getInfoPage(@ParameterObject Page page,@ParameterObject BoxesInfoEntity boxesInfo) {
public R getInfoPage(@ParameterObject Page page, @ParameterObject BoxesInfoEntity boxesInfo) {
LambdaQueryWrapper<BoxesInfoEntity> wrapper = Wrappers.lambdaQuery();
wrapper.eq(StrUtil.isNotBlank(boxesInfo.getName()),BoxesInfoEntity::getName,boxesInfo.getName());
wrapper.eq(StrUtil.isNotBlank(boxesInfo.getName()), BoxesInfoEntity::getName, boxesInfo.getName());
wrapper.eq(ObjectUtil.isNotEmpty(boxesInfo.getStatus()), BoxesInfoEntity::getStatus, boxesInfo.getStatus());
Page pageResult = boxesInfo.selectPage(page, wrapper);
List<AppBoxesInfoVO> appInfoRespVOS = new ArrayList<>();
pageResult.getRecords().forEach(x->{
pageResult.getRecords().forEach(x -> {
AppBoxesInfoVO appBoxesInfoVO = com.bsd.pjcloud.common.core.util.BeanUtils.toBean(x, AppBoxesInfoVO.class);
appInfoRespVOS.add(appBoxesInfoVO);
});
@@ -1,5 +1,5 @@
server:
port: 6060
port: 6080
spring:
application: