mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 17:09:36 +08:00
增加会议室检索条件
This commit is contained in:
parent
773c32e0f5
commit
89e7a7ad6a
@ -92,6 +92,7 @@ public class MeetingReservationController extends BaseController {
|
|||||||
* 返回值读取:为0时;任然读取status 0可预约 1不可预约
|
* 返回值读取:为0时;任然读取status 0可预约 1不可预约
|
||||||
* 为1时;读取 am,上午 0可预约 1不可预约 pm,下午 0可预约 1不可预约 night,晚上 0可预约 1不可预约
|
* 为1时;读取 am,上午 0可预约 1不可预约 pm,下午 0可预约 1不可预约 night,晚上 0可预约 1不可预约
|
||||||
*
|
*
|
||||||
|
* type 会议室筛选条件:already 已预约 without 未预约 going 开会中 free 空闲
|
||||||
* * floor 所属楼层名称,精确查询
|
* * floor 所属楼层名称,精确查询
|
||||||
* * name 会议室名称,模糊查询
|
* * name 会议室名称,模糊查询
|
||||||
* * typeName 会议室形式,精确查询
|
* * typeName 会议室形式,精确查询
|
||||||
@ -106,6 +107,12 @@ public class MeetingReservationController extends BaseController {
|
|||||||
Date start = convert(meetingRoomVo.getMrdate(), 1, true);
|
Date start = convert(meetingRoomVo.getMrdate(), 1, true);
|
||||||
Date end = convert(meetingRoomVo.getMrdate(), 1, false);
|
Date end = convert(meetingRoomVo.getMrdate(), 1, false);
|
||||||
if (start == null || end == null) return R.error("预约时间解析错误");
|
if (start == null || end == null) return R.error("预约时间解析错误");
|
||||||
|
|
||||||
|
List<MeetingRoomVo> roomTypes = null;
|
||||||
|
if (StringUtils.isNotBlank(meetingRoomVo.getType())) {
|
||||||
|
roomTypes = meetingReservationService.getAllRoomByType(meetingRoomVo);//按类型获取会议室
|
||||||
|
}
|
||||||
|
|
||||||
meetingRoomVo.setStartTime(start);
|
meetingRoomVo.setStartTime(start);
|
||||||
meetingRoomVo.setEndTime(end);
|
meetingRoomVo.setEndTime(end);
|
||||||
List<MeetingRoomVo> am = meetingReservationService.getAllRoom(meetingRoomVo);//上午
|
List<MeetingRoomVo> am = meetingReservationService.getAllRoom(meetingRoomVo);//上午
|
||||||
@ -119,6 +126,19 @@ public class MeetingReservationController extends BaseController {
|
|||||||
meetingRoomVo.setStartTime(start);
|
meetingRoomVo.setStartTime(start);
|
||||||
meetingRoomVo.setEndTime(end);
|
meetingRoomVo.setEndTime(end);
|
||||||
List<MeetingRoomVo> night = meetingReservationService.getAllRoom(meetingRoomVo);//晚上
|
List<MeetingRoomVo> night = meetingReservationService.getAllRoom(meetingRoomVo);//晚上
|
||||||
|
|
||||||
|
if (roomTypes != null) {
|
||||||
|
for (MeetingRoomVo mro : roomTypes) {
|
||||||
|
for (MeetingRoomVo amro : am) {
|
||||||
|
if (mro.getId() == amro.getId()) {
|
||||||
|
mro.setStatus(amro.getStatus());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
am = roomTypes;//换位
|
||||||
|
}
|
||||||
|
|
||||||
for (MeetingRoomVo mro : am) {
|
for (MeetingRoomVo mro : am) {
|
||||||
mro.setAm(mro.getStatus());//设置上午状态
|
mro.setAm(mro.getStatus());//设置上午状态
|
||||||
mro.setStatus(-1);
|
mro.setStatus(-1);
|
||||||
|
@ -18,6 +18,9 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface MeetingReservationMapper {
|
public interface MeetingReservationMapper {
|
||||||
|
|
||||||
|
/** 根据进类型回去指定日期是否可以预约的会议室 */
|
||||||
|
List<MeetingRoomVo> getAllRoomByType(MeetingRoomVo meetingRoomVo);
|
||||||
|
|
||||||
/** 获取所有会议室的预约状态 */
|
/** 获取所有会议室的预约状态 */
|
||||||
List<MeetingRoomVo> getAllRoom(MeetingRoomVo meetingRoomVo);
|
List<MeetingRoomVo> getAllRoom(MeetingRoomVo meetingRoomVo);
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@ public interface IMeetingReservationService {
|
|||||||
*/
|
*/
|
||||||
JSONObject getConstData();
|
JSONObject getConstData();
|
||||||
|
|
||||||
|
/** 根据进类型回去指定日期是否可以预约的会议室 */
|
||||||
|
List<MeetingRoomVo> getAllRoomByType(MeetingRoomVo meetingRoomVo);
|
||||||
/**
|
/**
|
||||||
* 获取可预约的会议室
|
* 获取可预约的会议室
|
||||||
* @param meetingRoomVo
|
* @param meetingRoomVo
|
||||||
|
@ -117,6 +117,11 @@ public class MeetingReservationServiceImpl implements IMeetingReservationService
|
|||||||
return datas;
|
return datas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MeetingRoomVo> getAllRoomByType(MeetingRoomVo meetingRoomVo) {
|
||||||
|
return meetingReservationMapper.getAllRoomByType(meetingRoomVo);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MeetingRoomVo> getAllRoom(MeetingRoomVo meetingRoomVo) {
|
public List<MeetingRoomVo> getAllRoom(MeetingRoomVo meetingRoomVo) {
|
||||||
return meetingReservationMapper.getAllRoom(meetingRoomVo);
|
return meetingReservationMapper.getAllRoom(meetingRoomVo);
|
||||||
|
@ -36,6 +36,10 @@ public class MeetingRoomVo implements Serializable {
|
|||||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||||
private Integer timeFormat;
|
private Integer timeFormat;
|
||||||
|
|
||||||
|
/** already 已预约 without 未预约 going 开会中 free 空闲 */
|
||||||
|
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||||
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 容纳人数 下限
|
* 容纳人数 下限
|
||||||
*/
|
*/
|
||||||
|
@ -37,6 +37,30 @@
|
|||||||
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
|
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>
|
</sql>
|
||||||
|
|
||||||
|
<!-- 根据进类型回去指定日期是否可以预约的会议室 -->
|
||||||
|
<select id="getAllRoomByType" parameterType="com.ics.admin.vo.MeetingRoomVo" resultType="com.ics.admin.vo.MeetingRoomVo">
|
||||||
|
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
|
||||||
|
<if test="type != null and (type == 'going' or type == 'free')"> AND status = 9 </if>
|
||||||
|
and start LIKE CONCAT(#{mrdate}, '%') group by room_id
|
||||||
|
) mr on mr.room_id=room.id
|
||||||
|
where
|
||||||
|
room.delete_flag=0
|
||||||
|
<if test="type != null and (type == 'already' or type == 'going')"> AND mr.room_id is not null</if>
|
||||||
|
<if test="type != null and (type == 'without' or type == 'free')"> AND mr.room_id is null</if>
|
||||||
|
<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="devices != null">
|
||||||
|
<foreach item="dev" collection="devices">
|
||||||
|
AND device LIKE CONCAT('%', #{dev}, '%')
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="min != null and max !=null"> and room.capacity_num >= #{min} AND room.capacity_num <= #{max}</if>
|
||||||
|
order by room_num
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 获取指定时间内是否可以预约的会议室 -->
|
<!-- 获取指定时间内是否可以预约的会议室 -->
|
||||||
<select id="getAllRoom" parameterType="com.ics.admin.vo.MeetingRoomVo" resultType="com.ics.admin.vo.MeetingRoomVo">
|
<select id="getAllRoom" parameterType="com.ics.admin.vo.MeetingRoomVo" resultType="com.ics.admin.vo.MeetingRoomVo">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user