mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 22:59:36 +08:00
新增了会议室的初始化代码
This commit is contained in:
parent
b31c4194c3
commit
97eda73e9b
@ -0,0 +1,79 @@
|
|||||||
|
package com.ics.admin.controller.meeting;
|
||||||
|
|
||||||
|
import com.ics.admin.domain.meeting.RoomContent;
|
||||||
|
import com.ics.admin.service.meeting.IRoomContentService;
|
||||||
|
import com.ics.common.core.controller.BaseController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.ics.common.core.domain.R;
|
||||||
|
import com.ics.common.core.controller.BaseController;
|
||||||
|
import com.ics.admin.domain.meeting.RoomContent;
|
||||||
|
import com.ics.admin.service.meeting.IRoomContentService;
|
||||||
|
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间主体内容 提供者
|
||||||
|
*
|
||||||
|
* @author ics
|
||||||
|
* @date 2024-02-22
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/meeting/roomContent")
|
||||||
|
public class RoomContentController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRoomContentService roomContentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询房间主体内容
|
||||||
|
*/
|
||||||
|
@GetMapping("get/{id}")
|
||||||
|
public RoomContent get(@PathVariable("id") Long id) {
|
||||||
|
return roomContentService.selectRoomContentById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询房间主体内容列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("meeting:roomContent:list")
|
||||||
|
@GetMapping("list")
|
||||||
|
public R list(RoomContent roomContent) {
|
||||||
|
startPage();
|
||||||
|
return result(roomContentService.selectRoomContentList(roomContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存房间主体内容
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("meeting:roomContent:add")
|
||||||
|
@PostMapping("save")
|
||||||
|
public R addSave(@RequestBody RoomContent roomContent) {
|
||||||
|
return toAjax(roomContentService.insertRoomContent(roomContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存房间主体内容
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("meeting:roomContent:edit")
|
||||||
|
@PostMapping("update")
|
||||||
|
public R editSave(@RequestBody RoomContent roomContent) {
|
||||||
|
return toAjax(roomContentService.updateRoomContent(roomContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除房间主体内容
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("meeting:roomContent:remove")
|
||||||
|
@PostMapping("remove")
|
||||||
|
public R remove(String ids) {
|
||||||
|
return toAjax(roomContentService.deleteRoomContentByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.ics.admin.domain.meeting;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.ics.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间主体内容对象 tb_room_content
|
||||||
|
*
|
||||||
|
* @author ics
|
||||||
|
* @date 2024-02-22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("tb_room_content")
|
||||||
|
public class RoomContent extends BaseEntity<RoomContent> {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 类型(会议室、办公室、茶室、路演厅、) */
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/** 名称 */
|
||||||
|
private String meetingName;
|
||||||
|
|
||||||
|
/** 容纳人数 */
|
||||||
|
private Integer capacityNum;
|
||||||
|
|
||||||
|
/** 扩充人数 */
|
||||||
|
private Integer expandNum;
|
||||||
|
|
||||||
|
/** 室内图片url */
|
||||||
|
private String indoorPicUrl;
|
||||||
|
|
||||||
|
/** 开始时间 */
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
|
/** 价格单位:1小时、2天、3半天 */
|
||||||
|
private String priceUnit;
|
||||||
|
|
||||||
|
/** 金额 */
|
||||||
|
private String money;
|
||||||
|
|
||||||
|
/** 是否展示 */
|
||||||
|
private Integer isShow;
|
||||||
|
|
||||||
|
/** 房间id */
|
||||||
|
private Long roomId;
|
||||||
|
|
||||||
|
/** 形状(U型,O型) */
|
||||||
|
private String shape;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.ics.admin.mapper.meeting;
|
||||||
|
|
||||||
|
import com.ics.admin.domain.meeting.RoomContent;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间主体内容Mapper接口
|
||||||
|
*
|
||||||
|
* @author ics
|
||||||
|
* @date 2024-02-22
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RoomContentMapper extends BaseMapper<RoomContent> {
|
||||||
|
/**
|
||||||
|
* 查询房间主体内容
|
||||||
|
*
|
||||||
|
* @param id 房间主体内容ID
|
||||||
|
* @return 房间主体内容
|
||||||
|
*/
|
||||||
|
RoomContent selectRoomContentById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询房间主体内容列表
|
||||||
|
*
|
||||||
|
* @param roomContent 房间主体内容
|
||||||
|
* @return 房间主体内容集合
|
||||||
|
*/
|
||||||
|
List<RoomContent> selectRoomContentList(RoomContent roomContent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增房间主体内容
|
||||||
|
*
|
||||||
|
* @param roomContent 房间主体内容
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertRoomContent(RoomContent roomContent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改房间主体内容
|
||||||
|
*
|
||||||
|
* @param roomContent 房间主体内容
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateRoomContent(RoomContent roomContent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除房间主体内容
|
||||||
|
*
|
||||||
|
* @param id 房间主体内容ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteRoomContentById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除房间主体内容
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteRoomContentByIds(String[] ids);
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package com.ics.admin.service.impl.meeting;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ics.admin.domain.meeting.RoomContent;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ics.admin.mapper.meeting.RoomContentMapper;
|
||||||
|
import com.ics.admin.domain.meeting.RoomContent;
|
||||||
|
import com.ics.admin.service.meeting.IRoomContentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间主体内容Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ics
|
||||||
|
* @date 2024-02-22
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomContent> implements IRoomContentService {
|
||||||
|
@Autowired
|
||||||
|
private RoomContentMapper roomContentMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询房间主体内容
|
||||||
|
*
|
||||||
|
* @param id 房间主体内容ID
|
||||||
|
* @return 房间主体内容
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public RoomContent selectRoomContentById(Long id) {
|
||||||
|
return roomContentMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询房间主体内容列表
|
||||||
|
*
|
||||||
|
* @param roomContent 房间主体内容
|
||||||
|
* @return 房间主体内容
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<RoomContent> selectRoomContentList(RoomContent roomContent) {
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
return roomContentMapper.selectList(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增房间主体内容
|
||||||
|
*
|
||||||
|
* @param roomContent 房间主体内容
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertRoomContent(RoomContent roomContent) {
|
||||||
|
return roomContentMapper.insert(roomContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改房间主体内容
|
||||||
|
*
|
||||||
|
* @param roomContent 房间主体内容
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateRoomContent(RoomContent roomContent) {
|
||||||
|
return roomContentMapper.updateById(roomContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除房间主体内容对象
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteRoomContentByIds(String ids) {
|
||||||
|
String[] idsArray = StrUtil.split(ids,",");
|
||||||
|
return roomContentMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除房间主体内容信息
|
||||||
|
*
|
||||||
|
* @param id 房间主体内容ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteRoomContentById(Long id) {
|
||||||
|
return roomContentMapper.deleteRoomContentById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ics.admin.service.meeting;
|
||||||
|
|
||||||
|
import com.ics.admin.domain.meeting.RoomContent;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间主体内容Service接口
|
||||||
|
*
|
||||||
|
* @author ics
|
||||||
|
* @date 2024-02-22
|
||||||
|
*/
|
||||||
|
public interface IRoomContentService extends IService<RoomContent> {
|
||||||
|
/**
|
||||||
|
* 查询房间主体内容
|
||||||
|
*
|
||||||
|
* @param id 房间主体内容ID
|
||||||
|
* @return 房间主体内容
|
||||||
|
*/
|
||||||
|
RoomContent selectRoomContentById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询房间主体内容列表
|
||||||
|
*
|
||||||
|
* @param roomContent 房间主体内容
|
||||||
|
* @return 房间主体内容集合
|
||||||
|
*/
|
||||||
|
List<RoomContent> selectRoomContentList(RoomContent roomContent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增房间主体内容
|
||||||
|
*
|
||||||
|
* @param roomContent 房间主体内容
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertRoomContent(RoomContent roomContent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改房间主体内容
|
||||||
|
*
|
||||||
|
* @param roomContent 房间主体内容
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateRoomContent(RoomContent roomContent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除房间主体内容
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteRoomContentByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除房间主体内容信息
|
||||||
|
*
|
||||||
|
* @param id 房间主体内容ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteRoomContentById(Long id);
|
||||||
|
}
|
@ -0,0 +1,127 @@
|
|||||||
|
<?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.ics.admin.mapper.meeting.RoomContentMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ics.admin.domain.meeting.RoomContent" id="RoomContentResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="type" column="type" />
|
||||||
|
<result property="meetingName" column="meeting_name" />
|
||||||
|
<result property="capacityNum" column="capacity_num" />
|
||||||
|
<result property="expandNum" column="expand_num" />
|
||||||
|
<result property="indoorPicUrl" column="indoor_pic_url" />
|
||||||
|
<result property="startTime" column="start_time" />
|
||||||
|
<result property="endDate" column="end_date" />
|
||||||
|
<result property="priceUnit" column="price_unit" />
|
||||||
|
<result property="money" column="money" />
|
||||||
|
<result property="isShow" column="is_show" />
|
||||||
|
<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="version" column="version" />
|
||||||
|
<result property="deleteFlag" column="delete_flag" />
|
||||||
|
<result property="roomId" column="room_id" />
|
||||||
|
<result property="shape" column="shape" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectRoomContentVo">
|
||||||
|
SELECT id, type, meeting_name, capacity_num, expand_num, indoor_pic_url, start_time, end_date, price_unit, money, is_show, create_by, create_time, update_by, update_time, version, delete_flag, room_id, shape FROM tb_room_content
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectRoomContentList" parameterType="RoomContent" resultMap="RoomContentResult">
|
||||||
|
<include refid="selectRoomContentVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="meetingName != null and meetingName != ''"> AND meeting_name LIKE CONCAT('%', #{meetingName}, '%')</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRoomContentById" parameterType="Long" resultMap="RoomContentResult">
|
||||||
|
<include refid="selectRoomContentVo"/>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertRoomContent" parameterType="RoomContent">
|
||||||
|
INSERT INTO tb_room_content
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null ">id,</if>
|
||||||
|
<if test="type != null ">type,</if>
|
||||||
|
<if test="meetingName != null and meetingName != ''">meeting_name,</if>
|
||||||
|
<if test="capacityNum != null ">capacity_num,</if>
|
||||||
|
<if test="expandNum != null ">expand_num,</if>
|
||||||
|
<if test="indoorPicUrl != null and indoorPicUrl != ''">indoor_pic_url,</if>
|
||||||
|
<if test="startTime != null ">start_time,</if>
|
||||||
|
<if test="endDate != null ">end_date,</if>
|
||||||
|
<if test="priceUnit != null and priceUnit != ''">price_unit,</if>
|
||||||
|
<if test="money != null and money != ''">money,</if>
|
||||||
|
<if test="isShow != null ">is_show,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="createTime != null ">create_time,</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||||
|
<if test="updateTime != null ">update_time,</if>
|
||||||
|
<if test="version != null ">version,</if>
|
||||||
|
<if test="deleteFlag != null ">delete_flag,</if>
|
||||||
|
<if test="roomId != null ">room_id,</if>
|
||||||
|
<if test="shape != null and shape != ''">shape,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null ">#{id},</if>
|
||||||
|
<if test="type != null ">#{type},</if>
|
||||||
|
<if test="meetingName != null and meetingName != ''">#{meetingName},</if>
|
||||||
|
<if test="capacityNum != null ">#{capacityNum},</if>
|
||||||
|
<if test="expandNum != null ">#{expandNum},</if>
|
||||||
|
<if test="indoorPicUrl != null and indoorPicUrl != ''">#{indoorPicUrl},</if>
|
||||||
|
<if test="startTime != null ">#{startTime},</if>
|
||||||
|
<if test="endDate != null ">#{endDate},</if>
|
||||||
|
<if test="priceUnit != null and priceUnit != ''">#{priceUnit},</if>
|
||||||
|
<if test="money != null and money != ''">#{money},</if>
|
||||||
|
<if test="isShow != null ">#{isShow},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="createTime != null ">#{createTime},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null ">#{updateTime},</if>
|
||||||
|
<if test="version != null ">#{version},</if>
|
||||||
|
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
||||||
|
<if test="roomId != null ">#{roomId},</if>
|
||||||
|
<if test="shape != null and shape != ''">#{shape},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateRoomContent" parameterType="RoomContent">
|
||||||
|
UPDATE tb_room_content
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="type != null ">type = #{type},</if>
|
||||||
|
<if test="meetingName != null and meetingName != ''">meeting_name = #{meetingName},</if>
|
||||||
|
<if test="capacityNum != null ">capacity_num = #{capacityNum},</if>
|
||||||
|
<if test="expandNum != null ">expand_num = #{expandNum},</if>
|
||||||
|
<if test="indoorPicUrl != null and indoorPicUrl != ''">indoor_pic_url = #{indoorPicUrl},</if>
|
||||||
|
<if test="startTime != null ">start_time = #{startTime},</if>
|
||||||
|
<if test="endDate != null ">end_date = #{endDate},</if>
|
||||||
|
<if test="priceUnit != null and priceUnit != ''">price_unit = #{priceUnit},</if>
|
||||||
|
<if test="money != null and money != ''">money = #{money},</if>
|
||||||
|
<if test="isShow != null ">is_show = #{isShow},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||||
|
<if test="version != null ">version = #{version},</if>
|
||||||
|
<if test="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
|
||||||
|
<if test="roomId != null ">room_id = #{roomId},</if>
|
||||||
|
<if test="shape != null and shape != ''">shape = #{shape},</if>
|
||||||
|
</trim>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteRoomContentById" parameterType="Long">
|
||||||
|
DELETE FROM tb_room_content WHERE id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteRoomContentByIds" parameterType="String">
|
||||||
|
DELETE FROM tb_room_content where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user