diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/BoxesBookingController.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/BoxesBookingController.java new file mode 100644 index 000000000..a59e6b27c --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/BoxesBookingController.java @@ -0,0 +1,122 @@ +package com.bsd.pjcloud.canteen.controller; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.ArrayUtil; +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.R; +import com.bsd.pjcloud.common.log.annotation.SysLog; +import com.bsd.pjcloud.canteen.entity.BoxesBookingEntity; +import com.bsd.pjcloud.canteen.service.BoxesBookingService; +import org.springframework.security.access.prepost.PreAuthorize; +import com.bsd.pjcloud.common.excel.annotation.ResponseExcel; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import org.springdoc.core.annotations.ParameterObject; +import org.springframework.http.HttpHeaders; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Objects; + +/** + * 包厢预约记录表 + * + * @author zjf + * @date 2024-12-16 22:39:45 + */ +@RestController +@RequiredArgsConstructor +@RequestMapping("/boxesBooking" ) +@Tag(description = "boxesBooking" , name = "包厢预约记录表管理" ) +@SecurityRequirement(name = HttpHeaders.AUTHORIZATION) +public class BoxesBookingController { + + private final BoxesBookingService boxesBookingService; + + /** + * 分页查询 + * @param page 分页对象 + * @param boxesBooking 包厢预约记录表 + * @return + */ + @Operation(summary = "分页查询" , description = "分页查询" ) + @GetMapping("/page" ) + @PreAuthorize("@pms.hasPermission('canteen_boxesBooking_view')" ) + public R getBoxesBookingPage(@ParameterObject Page page, @ParameterObject BoxesBookingEntity boxesBooking) { + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); + wrapper.eq(Objects.nonNull(boxesBooking.getBoxesId()),BoxesBookingEntity::getBoxesId,boxesBooking.getBoxesId()); + wrapper.like(Objects.nonNull(boxesBooking.getUserId()),BoxesBookingEntity::getUserId,boxesBooking.getUserId()); + return R.ok(boxesBookingService.page(page, wrapper)); + } + + + /** + * 通过id查询包厢预约记录表 + * @param id id + * @return R + */ + @Operation(summary = "通过id查询" , description = "通过id查询" ) + @GetMapping("/{id}" ) + @PreAuthorize("@pms.hasPermission('canteen_boxesBooking_view')" ) + public R getById(@PathVariable("id" ) Long id) { + return R.ok(boxesBookingService.getById(id)); + } + + /** + * 新增包厢预约记录表 + * @param boxesBooking 包厢预约记录表 + * @return R + */ + @Operation(summary = "新增包厢预约记录表" , description = "新增包厢预约记录表" ) + @SysLog("新增包厢预约记录表" ) + @PostMapping + @PreAuthorize("@pms.hasPermission('canteen_boxesBooking_add')" ) + public R save(@RequestBody BoxesBookingEntity boxesBooking) { + return R.ok(boxesBookingService.save(boxesBooking)); + } + + /** + * 修改包厢预约记录表 + * @param boxesBooking 包厢预约记录表 + * @return R + */ + @Operation(summary = "修改包厢预约记录表" , description = "修改包厢预约记录表" ) + @SysLog("修改包厢预约记录表" ) + @PutMapping + @PreAuthorize("@pms.hasPermission('canteen_boxesBooking_edit')" ) + public R updateById(@RequestBody BoxesBookingEntity boxesBooking) { + return R.ok(boxesBookingService.updateById(boxesBooking)); + } + + /** + * 通过id删除包厢预约记录表 + * @param ids id列表 + * @return R + */ + @Operation(summary = "通过id删除包厢预约记录表" , description = "通过id删除包厢预约记录表" ) + @SysLog("通过id删除包厢预约记录表" ) + @DeleteMapping + @PreAuthorize("@pms.hasPermission('canteen_boxesBooking_del')" ) + public R removeById(@RequestBody Long[] ids) { + return R.ok(boxesBookingService.removeBatchByIds(CollUtil.toList(ids))); + } + + + /** + * 导出excel 表格 + * @param boxesBooking 查询条件 + * @param ids 导出指定ID + * @return excel 文件流 + */ + @ResponseExcel + @GetMapping("/export") + @PreAuthorize("@pms.hasPermission('canteen_boxesBooking_export')" ) + public List export(BoxesBookingEntity boxesBooking,Long[] ids) { + return boxesBookingService.list(Wrappers.lambdaQuery(boxesBooking).in(ArrayUtil.isNotEmpty(ids), BoxesBookingEntity::getId, ids)); + } +} \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/entity/BoxesBookingEntity.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/entity/BoxesBookingEntity.java new file mode 100644 index 000000000..46f425145 --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/entity/BoxesBookingEntity.java @@ -0,0 +1,116 @@ +package com.bsd.pjcloud.canteen.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 包厢预约记录表 + * + * @author zjf + * @date 2024-12-16 22:39:45 + */ +@Data +@TableName("boxes_booking") +@EqualsAndHashCode(callSuper = true) +@Schema(description = "包厢预约记录表") +public class BoxesBookingEntity extends Model { + + + /** + * 主键id + */ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description="主键id") + private Long id; + + /** + * 包厢Id + */ + @Schema(description="包厢Id") + private Long boxesId; + + /** + * 开始时间 + */ + @Schema(description="开始时间") + private Object startTime; + + /** + * 结束时间 + */ + @Schema(description="结束时间") + private Object endTime; + + /** + * 审核人id + */ + @Schema(description="审核人id") + private Long checkUserId; + + /** + * 1审核中 2通过 3驳回 4 + */ + @Schema(description="1审核中 2通过 3驳回 4") + private String checkStatus; + + /** + * 创建人 + */ + @Schema(description="创建人") + private String creator; + + /** + * 更新人 + */ + @Schema(description="更新人") + private Double updater; + + /** + * 是否删除 + */ + @Schema(description="是否删除") + private Boolean deleted; + + /** + * 预约日期 + */ + @Schema(description="预约日期") + private LocalDate bookingDate; + + /** + * 用户id + */ + @Schema(description="用户id") + private Long userId; + + /** + * 预约状态(0 预约成功,1预约失败 2取消预约 ) + */ + @Schema(description="预约状态(0 预约成功,1预约失败 2取消预约 )") + private Integer status; + + /** + * 总价单位分 + */ + @Schema(description="总价单位分") + private Integer totalPrice; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + @Schema(description="创建时间") + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + @Schema(description="更新时间") + private LocalDateTime updateTime; +} \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/mapper/BoxesBookingMapper.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/mapper/BoxesBookingMapper.java new file mode 100644 index 000000000..705555e0e --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/mapper/BoxesBookingMapper.java @@ -0,0 +1,11 @@ +package com.bsd.pjcloud.canteen.mapper; + +import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper; +import com.bsd.pjcloud.canteen.entity.BoxesBookingEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface BoxesBookingMapper extends PjcloudBaseMapper { + + +} \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/BoxesBookingService.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/BoxesBookingService.java new file mode 100644 index 000000000..1d7d3ddc0 --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/BoxesBookingService.java @@ -0,0 +1,8 @@ +package com.bsd.pjcloud.canteen.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.bsd.pjcloud.canteen.entity.BoxesBookingEntity; + +public interface BoxesBookingService extends IService { + +} \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/BoxesBookingServiceImpl.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/BoxesBookingServiceImpl.java new file mode 100644 index 000000000..e8808c910 --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/BoxesBookingServiceImpl.java @@ -0,0 +1,16 @@ +package com.bsd.pjcloud.canteen.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bsd.pjcloud.canteen.entity.BoxesBookingEntity; +import com.bsd.pjcloud.canteen.mapper.BoxesBookingMapper; +import com.bsd.pjcloud.canteen.service.BoxesBookingService; +import org.springframework.stereotype.Service; +/** + * 包厢预约记录表 + * + * @author zjf + * @date 2024-12-16 22:39:45 + */ +@Service +public class BoxesBookingServiceImpl extends ServiceImpl implements BoxesBookingService { +} \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/BoxesBookingMapper.xml b/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/BoxesBookingMapper.xml new file mode 100644 index 000000000..7ff8b29f6 --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/BoxesBookingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file