feat:预约时间段管理
This commit is contained in:
1 parent
67f8d21819
commit
7fbb8bc636
9 files changed
+297
No files matched your search
@@ -367,6 +367,26 @@ CREATE TABLE hard_broadcast
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='设备广播';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS hard_appt;
|
||||
CREATE TABLE hard_appt
|
||||
(
|
||||
id bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||
title bigint NOT NULL COMMENT '标题',
|
||||
start_time datetime DEFAULT NULL COMMENT '开始时间',
|
||||
end_time datetime DEFAULT NULL COMMENT '结束时间',
|
||||
sort int DEFAULT 0 NOT NULL COMMENT '排序',
|
||||
status varchar(32) NOT NULL COMMENT '状态',
|
||||
remark varchar(256) DEFAULT NULL COMMENT '备注',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='设备预约管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_auth
|
||||
-- ----------------------------
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.HardApptEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardApptDto extends HardApptEntity {
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
package com.bsd.pjcloud.hard.api.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 com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 设备预约管理
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("hard_appt")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "设备预约管理")
|
||||
public class HardApptEntity extends Model<HardApptEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "标题")
|
||||
private Long title;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.hard.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.HardApptEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardApptVo extends HardApptEntity {
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package com.bsd.pjcloud.hard.controller;
|
||||
|
||||
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.hard.api.entity.HardApptEntity;
|
||||
import com.bsd.pjcloud.hard.service.HardApptService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 设备预约管理
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/hard-appt")
|
||||
@Tag(description = "hard-appt", name = "设备预约管理管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardApptController {
|
||||
|
||||
private final HardApptService hardApptService;
|
||||
|
||||
|
||||
/* ************************************* start app start ************************************* */
|
||||
|
||||
@Operation(summary = "小程序列表", description = "小程序列表")
|
||||
@GetMapping("/app/list")
|
||||
public R<List<HardApptEntity>> appList() {
|
||||
return R.ok(hardApptService.list(new LambdaQueryWrapper<HardApptEntity>().orderByDesc(HardApptEntity::getSort)));
|
||||
}
|
||||
|
||||
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAppt_view')")
|
||||
public R getHardApptPage(@ParameterObject Page page, @ParameterObject HardApptEntity hardAppt) {
|
||||
LambdaQueryWrapper<HardApptEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(hardApptService.page(page, wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAppt_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(hardApptService.getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增设备预约管理", description = "新增设备预约管理")
|
||||
@SysLog("新增设备预约管理")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAppt_add')")
|
||||
public R save(@RequestBody HardApptEntity hardAppt) {
|
||||
return R.ok(hardApptService.save(hardAppt));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改设备预约管理", description = "修改设备预约管理")
|
||||
@SysLog("修改设备预约管理")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAppt_edit')")
|
||||
public R updateById(@RequestBody HardApptEntity hardAppt) {
|
||||
return R.ok(hardApptService.updateById(hardAppt));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id删除设备预约管理", description = "通过id删除设备预约管理")
|
||||
@SysLog("通过id删除设备预约管理")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAppt_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(hardApptService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAppt_export')")
|
||||
public List<HardApptEntity> export(HardApptEntity hardAppt, Long[] ids) {
|
||||
return hardApptService.list(Wrappers.lambdaQuery(hardAppt).in(ArrayUtil.isNotEmpty(ids), HardApptEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.hard.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardApptEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface HardApptMapper extends PjcloudBaseMapper<HardApptEntity> {
|
||||
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.hard.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardApptEntity;
|
||||
|
||||
public interface HardApptService extends IService<HardApptEntity> {
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.hard.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardApptEntity;
|
||||
import com.bsd.pjcloud.hard.mapper.HardApptMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardApptService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* 设备预约管理
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class HardApptServiceImpl extends ServiceImpl<HardApptMapper, HardApptEntity> implements HardApptService {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.hard.mapper.HardApptMapper">
|
||||
|
||||
<resultMap id="hardApptMap" type="com.bsd.pjcloud.hard.api.entity.HardApptEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user