mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 12:29:36 +08:00
增加接口
This commit is contained in:
parent
adb17043b5
commit
8b8f9a33c6
@ -62,6 +62,13 @@ public class MeetingReservationController extends BaseController {
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
* 参数
|
||||
* {
|
||||
* "loginName": "zs12",
|
||||
* "password": "123321Ydbg"
|
||||
* }
|
||||
* 返回:部门id和部门名称
|
||||
*
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("login")
|
||||
@ -74,8 +81,62 @@ public class MeetingReservationController extends BaseController {
|
||||
return R.ok().put("data", jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有会议室
|
||||
* 参数:
|
||||
* startTime:预约开始时间,格式:2024-09-23 14:00:00
|
||||
* endTime:预约结束时间,格式:2024-09-23 16:00:00
|
||||
* mrdate:预约日期,格式:2024-09-23
|
||||
* timeFormat:预约时间格式:0 任意时间(管理员),1上午,2下午,3晚上 4 全天。
|
||||
* 值为0时,读取startTime和endTime为预约会议时间范围;其他值读取mrdate,再拼接时间为预约会议时间范围。
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("getAllRoom")
|
||||
public R getAllRoom(@RequestBody MeetingRoomVo meetingRoomVo) {
|
||||
if (meetingRoomVo.getTimeFormat() > 0) {//非任意时间
|
||||
Date start = convert(meetingRoomVo.getMrdate(), meetingRoomVo.getTimeFormat(), true);
|
||||
Date end = convert(meetingRoomVo.getMrdate(), meetingRoomVo.getTimeFormat(), false);
|
||||
if (start == null || end == null) return R.error("预约时间解析错误");
|
||||
meetingRoomVo.setStartTime(start);
|
||||
meetingRoomVo.setEndTime(end);
|
||||
}
|
||||
return R.ok().put("data", meetingReservationService.getAllRoom(meetingRoomVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个会议室详情
|
||||
*
|
||||
* 参数:roomId,会议室id
|
||||
* 返回会议室数据,及会议室未结束的会议预约列表
|
||||
* */
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("roomMrs")
|
||||
public R roomMrs(@RequestBody Map<String, Long> param) {
|
||||
Long roomId = param.get("roomId");
|
||||
List<MeetingReservation> list = meetingReservationService.roomMr(roomId);
|
||||
MeetingRoomVo room = meetingRoomService.selectMeetingRoomById(roomId);
|
||||
return R.ok().put("room", room).put("mr", list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有单位
|
||||
* 无参,返回所有部门id及名称,已去重。
|
||||
* */
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("getOrg")
|
||||
public R getOrg() {
|
||||
return R.ok().put("data", meetingUtoService.getOrg());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典数据
|
||||
* 返回
|
||||
* types 会议室类型
|
||||
* floors 楼层
|
||||
* devices 设备
|
||||
* services 提供的服务
|
||||
* personNum 会议室容纳人数,已去重。
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("getConstData")
|
||||
@ -86,6 +147,9 @@ public class MeetingReservationController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新增会议室预约记录
|
||||
* 参数:
|
||||
* mr,预约数据。start、end、mrdate、timeFormat 四个参数的关系与(获取所有会议室)接口相同
|
||||
* serve,预约选择的服务
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("booking")
|
||||
@ -125,7 +189,7 @@ public class MeetingReservationController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作会议室预约记录
|
||||
* 处理会议室预约记录
|
||||
* <p>
|
||||
* id:预约记录id
|
||||
* operate:操作,CANCEL 取消 REJECTED 驳回 PASS 审核通过
|
||||
@ -146,6 +210,8 @@ public class MeetingReservationController extends BaseController {
|
||||
|
||||
/**
|
||||
* 变更预约记录
|
||||
* 参数 同 会议室预约,mr部分参数需要带上id
|
||||
* serve,预约选择的服务,会删除之前的数据,插入新的数据。如果不更选择的服务,可以不传这个参数。
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("update")
|
||||
@ -176,6 +242,16 @@ public class MeetingReservationController extends BaseController {
|
||||
|
||||
/**
|
||||
* 占用
|
||||
* 参数示例,start、end、mrdate、timeFormat 四个参数的关系与(会议室预约)接口相同
|
||||
* {
|
||||
* "mr": {
|
||||
* "roomId": "63", 会议室id
|
||||
* "start": "2024-09-26 18:00:01",
|
||||
* "end": "2024-09-26 18:39:00",
|
||||
* "mrdate": "2024-09-27",
|
||||
* "timeFormat": "0"
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("beforehand")
|
||||
@ -204,6 +280,9 @@ public class MeetingReservationController extends BaseController {
|
||||
|
||||
/**
|
||||
* 获取服务员
|
||||
* 返回值
|
||||
* voiceWaiter:音控组
|
||||
* serveWaiter:会务服务组
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("getWaiter")
|
||||
@ -233,6 +312,11 @@ public class MeetingReservationController extends BaseController {
|
||||
|
||||
/**
|
||||
* 分配服务员
|
||||
*
|
||||
* 参数
|
||||
* id:预约记录id
|
||||
* voiceWaiter:音控组人员id;多个id用“,”隔开
|
||||
* serveWaiter:会务服务组人员id;多个id用“,”隔开
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("addWaiter")
|
||||
@ -246,6 +330,7 @@ public class MeetingReservationController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除会议室预约记录
|
||||
* 参数:id,预约记录id。物理删除(包括所有关联数据),不可恢复
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@RequestMapping("delete")
|
||||
@ -256,6 +341,13 @@ public class MeetingReservationController extends BaseController {
|
||||
|
||||
/**
|
||||
* 会议室预约详情
|
||||
* 参数:
|
||||
* id:预约记录id
|
||||
* 返回值:
|
||||
* mr,预约记录
|
||||
* room,会议室信息
|
||||
* serve,选择的服务
|
||||
* waiters,分配的会务人员
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@RequestMapping("getInfo")
|
||||
@ -270,6 +362,18 @@ public class MeetingReservationController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询会议室预约记录列表
|
||||
*
|
||||
* role:按不同角色去查询预约记录。1.普通用户, 3.会议服务人员 ,5.会议管理员
|
||||
* title,会议标题,模糊查询
|
||||
* userOrg,部门名称,模糊查询
|
||||
* floor,楼层名称,精确查询
|
||||
* name,会议室名称,模糊查询
|
||||
* typeName,会议室类型名称,精确查询
|
||||
* device,设备,模糊查询
|
||||
* capacityNum,容纳人数,精确查询
|
||||
* status,预约状态,精确查询
|
||||
* filterDate,预约日期查询,以预约开始时间为准;查询指定日期的所有预约。
|
||||
*
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("list")
|
||||
|
@ -107,7 +107,7 @@ public class MeetingRoomController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存会议室
|
||||
* 新增会议室
|
||||
* @param files 附件id
|
||||
*/
|
||||
@RequiresPermissions("admin:room:add")
|
||||
@ -121,7 +121,7 @@ public class MeetingRoomController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存会议室
|
||||
* 修改会议室
|
||||
* @param files 附件id
|
||||
*/
|
||||
@RequiresPermissions("admin:room:edit")
|
||||
|
@ -36,6 +36,9 @@ public class MeetingUtoController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询用户与机构关联列表
|
||||
* orgName:部门名称,模糊查询
|
||||
* userName:姓名,模糊查询
|
||||
* loginName:登录名,模糊查询
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@RequestMapping("list")
|
||||
@ -45,7 +48,10 @@ public class MeetingUtoController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存用户与机构关联
|
||||
* 新增 用户与机构信息
|
||||
* 机构id相同,不允许名称不同
|
||||
* 登录名称不允许相同
|
||||
*
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@PostMapping("save")
|
||||
@ -63,7 +69,9 @@ public class MeetingUtoController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存用户与机构关联
|
||||
* 修改 新增 用户与机构信息
|
||||
* 机构id相同,不允许名称不同
|
||||
* 登录名称不允许相同
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@PostMapping("update")
|
||||
@ -81,6 +89,7 @@ public class MeetingUtoController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除用户与机构关联
|
||||
* 参数 ids,多个di用“,”隔开
|
||||
*/
|
||||
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||
@PostMapping("remove")
|
||||
|
@ -2,6 +2,7 @@ package com.ics.admin.mapper;
|
||||
|
||||
import com.ics.admin.domain.MeetingReservation;
|
||||
import com.ics.admin.vo.MeetingRecordVo;
|
||||
import com.ics.admin.vo.MeetingRoomVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -17,6 +18,15 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface MeetingReservationMapper {
|
||||
|
||||
/** 获取所有会议室的预约状态 */
|
||||
List<MeetingRoomVo> getAllRoom(MeetingRoomVo meetingRoomVo);
|
||||
|
||||
/**
|
||||
* 获取会议室的预约记录,没结束的预约记录
|
||||
* @param roomId
|
||||
*/
|
||||
List<MeetingReservation> roomInfo(Long roomId);
|
||||
|
||||
/**
|
||||
* 查询会议室预约记录
|
||||
*
|
||||
|
@ -29,6 +29,8 @@ public interface MeetingUtoMapper {
|
||||
*/
|
||||
List<MeetingUto> selectMeetingUtoList(MeetingUto meetingUto);
|
||||
|
||||
List<MeetingUto> getOrg();
|
||||
|
||||
List<MeetingUto> checkLoginName(MeetingUto meetingUto);
|
||||
|
||||
List<MeetingUto> checkOrgId(MeetingUto meetingUto);
|
||||
|
@ -7,6 +7,7 @@ import com.ics.admin.domain.MeetingServe;
|
||||
import com.ics.admin.mapper.MeetingServeMapper;
|
||||
import com.ics.admin.utils.MrOperate;
|
||||
import com.ics.admin.vo.MeetingRecordVo;
|
||||
import com.ics.admin.vo.MeetingRoomVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -24,6 +25,19 @@ public interface IMeetingReservationService {
|
||||
*/
|
||||
JSONObject getConstData();
|
||||
|
||||
/**
|
||||
* 获取可预约的会议室
|
||||
* @param meetingRoomVo
|
||||
* @return
|
||||
*/
|
||||
List<MeetingRoomVo> getAllRoom(MeetingRoomVo meetingRoomVo);
|
||||
|
||||
/**
|
||||
* 获取会议室的预约记录,没结束的预约记录
|
||||
* @param roomId
|
||||
*/
|
||||
List<MeetingReservation> roomMr(Long roomId);
|
||||
|
||||
/**
|
||||
* 新增会议室预约记录
|
||||
*
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ics.admin.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.ics.admin.domain.MeetingUto;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
@ -28,6 +29,10 @@ public interface IMeetingUtoService {
|
||||
*/
|
||||
List<MeetingUto> selectMeetingUtoList(MeetingUto meetingUto);
|
||||
|
||||
/**
|
||||
* 获取所有单位,供管理员选择
|
||||
*/
|
||||
JSONArray getOrg();
|
||||
/**
|
||||
* 用户登录
|
||||
* @param meetingUto
|
||||
|
@ -117,6 +117,16 @@ public class MeetingReservationServiceImpl implements IMeetingReservationService
|
||||
return datas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MeetingRoomVo> getAllRoom(MeetingRoomVo meetingRoomVo) {
|
||||
return meetingReservationMapper.getAllRoom(meetingRoomVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MeetingReservation> roomMr(Long roomId) {
|
||||
return meetingReservationMapper.roomInfo(roomId);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE)
|
||||
@Override
|
||||
public String insertMeetingReservation(Long currentUserId, MeetingReservation meetingReservation, MeetingServe[] meetingServes) {
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ics.admin.domain.MeetingUto;
|
||||
import com.ics.admin.mapper.MeetingUtoMapper;
|
||||
import com.ics.admin.service.IMeetingUtoService;
|
||||
@ -42,6 +44,19 @@ public class MeetingUtoServiceImpl implements IMeetingUtoService {
|
||||
return meetingUtoMapper.selectMeetingUtoList(meetingUto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getOrg() {
|
||||
List<MeetingUto> list = meetingUtoMapper.getOrg();
|
||||
JSONArray array = new JSONArray();
|
||||
for (MeetingUto uto : list) {
|
||||
JSONObject one = new JSONObject();
|
||||
one.put("orgId", uto.getOrgId());
|
||||
one.put("orgName", uto.getOrgName());
|
||||
array.add(one);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MeetingUto login(MeetingUto meetingUto) {
|
||||
List<MeetingUto> list = meetingUtoMapper.login(meetingUto);
|
||||
|
@ -1,9 +1,13 @@
|
||||
package com.ics.admin.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会议室对象
|
||||
@ -13,7 +17,23 @@ import java.io.Serializable;
|
||||
*/
|
||||
@Data
|
||||
public class MeetingRoomVo implements Serializable {
|
||||
private static final long serialVersionUID = 202409201024L;
|
||||
private static final long serialVersionUID = -202409201024L;
|
||||
|
||||
/** 预约-开始时间 */
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
/** 预约日期 */
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private String mrdate;
|
||||
|
||||
/** 预约时间格式:0 任意时间,1上午,2下午,3晚上 4 全天*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Integer timeFormat;
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
@ -94,6 +114,8 @@ public class MeetingRoomVo implements Serializable {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 会议室照片
|
||||
*/
|
||||
private JSONArray imgs;
|
||||
}
|
@ -37,6 +37,36 @@
|
||||
SELECT id, sn, room_id, start, `end`, time_format, title, person_num, leader, booking_user_name, booking_user_phone, user_org_id, user_org, status, operate, remark, ext1, ext2, ext3, delete_flag, create_by, create_time, update_by, update_time, tenant_id, park_id FROM ics_meeting_reservation
|
||||
</sql>
|
||||
|
||||
<!-- 获取指定时间内是否可以预约的会议室 -->
|
||||
<select id="getAllRoom" parameterType="com.ics.admin.vo.MeetingRoomVo" resultType="com.ics.admin.vo.MeetingRoomVo">
|
||||
<![CDATA[
|
||||
select room.*,case when mr.room_id is null then 0 else 1 end as status from ics_meeting_room room left join
|
||||
(
|
||||
select room_id from ics_meeting_reservation where delete_flag = 0 and status > 3
|
||||
and ((start between #{startTime} and #{endTime}) or (`end` between #{startTime} and #{endTime}) or (start < #{startTime} and `end` > #{endTime}))
|
||||
group by room_id
|
||||
) mr on mr.room_id=room.id
|
||||
|
||||
where
|
||||
room.delete_flag=0
|
||||
]]>
|
||||
<if test="floor != null and floor != ''"> AND room.floor = #{floor}</if>
|
||||
<if test="name != null and name != ''"> AND room.name LIKE CONCAT('%', #{name}, '%')</if>
|
||||
<if test="typeName != null and typeName != ''"> AND room.type_name = #{typeName}</if>
|
||||
<if test="device != null and device != ''"> AND room.device LIKE CONCAT('%', #{device}, '%')</if>
|
||||
<if test="capacityNum != null"> AND room.capacity_num = #{capacityNum}</if>
|
||||
order by room_num
|
||||
</select>
|
||||
|
||||
<!-- 根据会议室获取预约记录 -->
|
||||
<select id="roomInfo" parameterType="Long" resultMap="MeetingReservationResult">
|
||||
<include refid="selectMeetingReservationVo"/>
|
||||
<![CDATA[
|
||||
WHERE room_id=#{roomId} and delete_flag = 0 and status > 3 and status < 11 order by start
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<!-- 分页列表 -->
|
||||
<select id="selectMeetingReservationList" parameterType="com.ics.admin.vo.MeetingRecordVo" resultType="com.ics.admin.vo.MeetingRecordVo">
|
||||
SELECT mr.id, sn, room_id, start, `end`, time_format, title, person_num, leader, booking_user_name, booking_user_phone, user_org_id, user_org, status, operate, mr.remark, mr.ext1, mr.ext2, mr.ext3,
|
||||
floor_id, floor, name, type_id, type_name, device, room_num, area, capacity_num, content, enable, room.ext1 roomExt1, room.ext2 roomExt2, room.ext3 roomExt3, room.remark roomRemark
|
||||
|
@ -36,6 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="loginName != null and loginName != ''"> AND login_name LIKE CONCAT('%', #{loginName}, '%')</if>
|
||||
</select>
|
||||
|
||||
<select id="getOrg" parameterType="MeetingUto" resultMap="MeetingUtoResult">
|
||||
SELECT org_id, org_name FROM ics_meeting_uto where delete_flag = 0 group by org_id, org_name order by org_id
|
||||
</select>
|
||||
|
||||
<select id="checkLoginName" parameterType="MeetingUto" resultMap="MeetingUtoResult">
|
||||
<include refid="selectMeetingUtoVo"/>
|
||||
where delete_flag=0 and login_name=#{loginName}
|
||||
|
Loading…
x
Reference in New Issue
Block a user