会议
This commit is contained in:
1 parent
8cf0d92343
commit
cd18d85743
8 files changed
+311
-3
No files matched your search
+121
@@ -0,0 +1,121 @@
|
||||
package com.bsd.pjcloud.integrated.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.integrated.entity.MeetingBookingEntity;
|
||||
import com.bsd.pjcloud.integrated.service.MeetingBookingService;
|
||||
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 2025-05-20 10:51:29
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/meetingBooking" )
|
||||
@Tag(description = "meetingBooking" , name = "会议室预约管理" )
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class MeetingBookingController {
|
||||
|
||||
private final MeetingBookingService meetingBookingService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param meetingBooking 会议室预约
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('integrated_meetingBooking_view')" )
|
||||
public R getMeetingBookingPage(@ParameterObject Page page, @ParameterObject MeetingBookingEntity meetingBooking) {
|
||||
LambdaQueryWrapper<MeetingBookingEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(StrUtil.isNotBlank(meetingBooking.getTitle()),MeetingBookingEntity::getTitle,meetingBooking.getTitle());
|
||||
return R.ok(meetingBookingService.page(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询会议室预约
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('integrated_meetingBooking_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
return R.ok(meetingBookingService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会议室预约
|
||||
* @param meetingBooking 会议室预约
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增会议室预约" , description = "新增会议室预约" )
|
||||
@SysLog("新增会议室预约" )
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('integrated_meetingBooking_add')" )
|
||||
public R save(@RequestBody MeetingBookingEntity meetingBooking) {
|
||||
return R.ok(meetingBookingService.save(meetingBooking));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会议室预约
|
||||
* @param meetingBooking 会议室预约
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改会议室预约" , description = "修改会议室预约" )
|
||||
@SysLog("修改会议室预约" )
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('integrated_meetingBooking_edit')" )
|
||||
public R updateById(@RequestBody MeetingBookingEntity meetingBooking) {
|
||||
return R.ok(meetingBookingService.updateById(meetingBooking));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除会议室预约
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除会议室预约" , description = "通过id删除会议室预约" )
|
||||
@SysLog("通过id删除会议室预约" )
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('integrated_meetingBooking_del')" )
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(meetingBookingService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param meetingBooking 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('integrated_meetingBooking_export')" )
|
||||
public List<MeetingBookingEntity> export(MeetingBookingEntity meetingBooking,Long[] ids) {
|
||||
return meetingBookingService.list(Wrappers.lambdaQuery(meetingBooking).in(ArrayUtil.isNotEmpty(ids), MeetingBookingEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -82,14 +82,15 @@ public class MeetingRoomController {
|
||||
@Transactional
|
||||
public R save(@RequestBody MeetingRoomEntity meetingRoom) {
|
||||
meetingRoom.setDeptId(SecurityUtils.getUser().getDeptId());
|
||||
List<MeetingRoomEquipmentEntity> meetingRoomEquipmentEntityList = meetingRoom.getMeetingRoomEquipmentEntityList();
|
||||
List<MeetingRoomEquipmentEntity> meetingRoomEquipmentEntityList = meetingRoom.getEquipmentList();
|
||||
boolean save = meetingRoomService.save(meetingRoom);
|
||||
if (CollUtil.isNotEmpty(meetingRoomEquipmentEntityList)) {
|
||||
meetingRoomEquipmentEntityList.forEach(meetingRoomEquipmentEntity -> {
|
||||
meetingRoomEquipmentEntity.setRoomId(meetingRoom.getId());
|
||||
});
|
||||
meetingRoomEquipmentService.saveBatch(meetingRoomEquipmentEntityList);
|
||||
}
|
||||
return R.ok(meetingRoomService.save(meetingRoom));
|
||||
return R.ok(save);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
package com.bsd.pjcloud.integrated.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;
|
||||
|
||||
/**
|
||||
* 会议室预约
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2025-05-20 10:51:29
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("meeting_booking")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "会议室预约")
|
||||
public class MeetingBookingEntity extends Model<MeetingBookingEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 会议主题
|
||||
*/
|
||||
@Schema(description="会议主题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 会议室id
|
||||
*/
|
||||
@Schema(description="会议室id")
|
||||
private Long roomId;
|
||||
|
||||
/**
|
||||
* 会议说明
|
||||
*/
|
||||
@Schema(description="会议说明")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
@Schema(description="审批状态")
|
||||
private String meetingStatus;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
@Schema(description="申请人id")
|
||||
private Long applicantId;
|
||||
|
||||
/**
|
||||
* 会议负责人id
|
||||
*/
|
||||
@Schema(description="会议负责人id")
|
||||
private Long assigneeId;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@Schema(description="开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@Schema(description="结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@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;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@Schema(description="租户编号")
|
||||
private Long tenantId;
|
||||
}
|
||||
+1
-1
@@ -135,5 +135,5 @@ public class MeetingRoomEntity extends Model<MeetingRoomEntity> {
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description="设备会议室关联")
|
||||
private List<MeetingRoomEquipmentEntity> meetingRoomEquipmentEntityList;
|
||||
private List<MeetingRoomEquipmentEntity> equipmentList;
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.integrated.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.integrated.entity.MeetingBookingEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface MeetingBookingMapper extends PjcloudBaseMapper<MeetingBookingEntity> {
|
||||
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.integrated.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.integrated.entity.MeetingBookingEntity;
|
||||
|
||||
public interface MeetingBookingService extends IService<MeetingBookingEntity> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.integrated.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.integrated.entity.MeetingBookingEntity;
|
||||
import com.bsd.pjcloud.integrated.mapper.MeetingBookingMapper;
|
||||
import com.bsd.pjcloud.integrated.service.MeetingBookingService;
|
||||
import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 会议室预约
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2025-05-20 10:51:29
|
||||
*/
|
||||
@Service
|
||||
public class MeetingBookingServiceImpl extends ServiceImpl<MeetingBookingMapper, MeetingBookingEntity> implements MeetingBookingService {
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?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.integrated.mapper.MeetingBookingMapper">
|
||||
|
||||
<resultMap id="meetingBookingMap" type="com.bsd.pjcloud.integrated.entity.MeetingBookingEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="roomId" column="room_id"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="meetingStatus" column="meeting_status"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="applicantId" column="applicant_id"/>
|
||||
<result property="assigneeId" column="assignee_id"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<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