修改了会议预约bug
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8m37s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8m37s
This commit is contained in:
parent
c49bb4cdb3
commit
f69326343e
@ -26,6 +26,7 @@ public class EnumFetcherController {
|
||||
* @param name
|
||||
* @return 获取枚举全部值 参数以字段大驼峰格式 如:OmsOrderStatus
|
||||
*/
|
||||
|
||||
@GetMapping("/enum-values/{name}")
|
||||
public R<Map<Object, Object>> getEnumValues(@PathVariable("name") String name) {
|
||||
Map<Object, Object> map = enumFetcherService.getEnumValues(name);
|
||||
|
@ -38,31 +38,26 @@ public class MeetAttachController extends BaseController {
|
||||
private final IMeetAttachService meetAttachService;
|
||||
|
||||
/**
|
||||
* 查询会议室增值服务列表
|
||||
* 查询分页会议室增值服务列表
|
||||
*/
|
||||
@SaCheckPermission("property:attach:list")
|
||||
// @SaCheckPermission("property:attach:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<MeetAttachVo> list(MeetAttachBo bo, PageQuery pageQuery) {
|
||||
public TableDataInfo<MeetAttachVo> pageList(MeetAttachBo bo, PageQuery pageQuery) {
|
||||
return meetAttachService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
///**
|
||||
// * 导出会议室增值服务列表
|
||||
// */
|
||||
//@SaCheckPermission("property:attach:export")
|
||||
//@Log(title = "会议室增值服务", businessType = BusinessType.EXPORT)
|
||||
//@PostMapping("/export")
|
||||
//public void export(MeetAttachBo bo, HttpServletResponse response) {
|
||||
// List<MeetAttachVo> list = meetAttachService.queryList(bo);
|
||||
// ExcelUtil.exportExcel(list, "会议室增值服务", MeetAttachVo.class, response);
|
||||
//}
|
||||
|
||||
/**
|
||||
* 查询会议室增值服务列表
|
||||
*/
|
||||
@GetMapping("/attachList")
|
||||
public R<List<MeetAttachVo>> list() {
|
||||
return R.ok(meetAttachService.queryList(new MeetAttachBo()));
|
||||
}
|
||||
/**
|
||||
* 获取会议室增值服务详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("property:attach:query")
|
||||
//@SaCheckPermission("property:attach:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<MeetAttachVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
@ -83,7 +78,7 @@ public class MeetAttachController extends BaseController {
|
||||
/**
|
||||
* 修改会议室增值服务
|
||||
*/
|
||||
@SaCheckPermission("property:attach:edit")
|
||||
// @SaCheckPermission("property:attach:edit")
|
||||
@Log(title = "会议室增值服务", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
@ -96,7 +91,7 @@ public class MeetAttachController extends BaseController {
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("property:attach:remove")
|
||||
// @SaCheckPermission("property:attach:remove")
|
||||
@Log(title = "会议室增值服务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.property.controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -7,6 +8,8 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.property.domain.vo.MeetBookingAppointmentVo;
|
||||
import org.dromara.property.domain.vo.MeetBookingWeekVo;
|
||||
import org.redisson.api.RList;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@ -41,25 +44,31 @@ public class MeetBookingController extends BaseController {
|
||||
/**
|
||||
* 查询会议预约记录列表
|
||||
*/
|
||||
@SaCheckPermission("property:meetbooking:list")
|
||||
//@SaCheckPermission("property:meetbooking:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<MeetBookingVo> list(MeetBookingBo bo, PageQuery pageQuery) {
|
||||
return meetBookingService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
/**
|
||||
* 查询已预约会议预约记录列表
|
||||
* 按照日期查询已预约会议预约记录列表
|
||||
*/
|
||||
@GetMapping("/appointment-list")
|
||||
public List<MeetBookingAppointmentVo> appointmentList(String appointmentDate) {
|
||||
return meetBookingService.appointmentList(appointmentDate);
|
||||
public R<List<MeetBookingAppointmentVo>> appointmentList(String appointmentDate) {
|
||||
return R.ok(meetBookingService.appointmentList(appointmentDate));
|
||||
}
|
||||
/**
|
||||
* 按照会议室Id查询已预约会议预约记录列表
|
||||
*/
|
||||
@GetMapping("/meet-appointment-list")
|
||||
public R<List<MeetBookingWeekVo>> appointmentIdList(String meetId) {
|
||||
return R.ok(meetBookingService.appointmentIdList(meetId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会议预约详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("property:meetbooking:query")
|
||||
//@SaCheckPermission("property:meetbooking:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<MeetBookingVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
@ -69,7 +78,7 @@ public class MeetBookingController extends BaseController {
|
||||
/**
|
||||
* 新增会议预约
|
||||
*/
|
||||
@SaCheckPermission("property:meetbooking:add")
|
||||
//@SaCheckPermission("property:meetbooking:add")
|
||||
@Log(title = "会议预约", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
@ -80,7 +89,7 @@ public class MeetBookingController extends BaseController {
|
||||
/**
|
||||
* 修改会议预约
|
||||
*/
|
||||
@SaCheckPermission("property:meetbooking:edit")
|
||||
// @SaCheckPermission("property:meetbooking:edit")
|
||||
@Log(title = "会议预约", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
|
@ -6,6 +6,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会议室增值服务对象 meet_attach
|
||||
@ -40,7 +41,7 @@ public class MeetAttach extends TenantEntity {
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private Long price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
@ -55,7 +56,7 @@ public class MeetAttach extends TenantEntity {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Long state;
|
||||
private int state;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
|
@ -4,6 +4,8 @@ import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -81,22 +83,27 @@ public class MeetBooking extends TenantEntity {
|
||||
/**
|
||||
* 费用
|
||||
*/
|
||||
private Long price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 是否包含增值服务
|
||||
*/
|
||||
private Long attach;
|
||||
private int attach;
|
||||
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
private Long payState;
|
||||
private int payState;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Long state;
|
||||
private int state;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String descs;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
|
@ -9,6 +9,8 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会议室增值服务业务对象 meet_attach
|
||||
*
|
||||
@ -40,7 +42,7 @@ public class MeetAttachBo extends BaseEntity {
|
||||
* 单价
|
||||
*/
|
||||
@NotNull(message = "单价不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
@ -58,7 +60,7 @@ public class MeetAttachBo extends BaseEntity {
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long state;
|
||||
private int state;
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -80,31 +82,35 @@ public class MeetBookingBo extends BaseEntity {
|
||||
* 参会人数
|
||||
*/
|
||||
@NotNull(message = "参会人数不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long personSum;
|
||||
private int personSum;
|
||||
|
||||
/**
|
||||
* 费用
|
||||
*/
|
||||
@NotNull(message = "费用不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 是否包含增值服务
|
||||
*/
|
||||
@NotNull(message = "是否包含增值服务不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long attach;
|
||||
private int attach;
|
||||
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
@NotNull(message = "支付状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long payState;
|
||||
private int payState;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long state;
|
||||
private int state;
|
||||
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String descs;
|
||||
}
|
||||
|
@ -1,13 +1,27 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.property.domain.MeetBooking;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:yuyongle
|
||||
* @Date:2025/7/7 17:07
|
||||
* @Description:
|
||||
**/
|
||||
public class MeetBookingAppointmentVo {
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = MeetBooking.class)
|
||||
public class MeetBookingAppointmentVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ -39,4 +53,18 @@ public class MeetBookingAppointmentVo {
|
||||
* 会议室主题
|
||||
*/
|
||||
private String meetTheme;
|
||||
|
||||
/**
|
||||
* 预定开始时间
|
||||
*/
|
||||
private Date scheduledStarttime;
|
||||
|
||||
/**
|
||||
* 预定结束时间
|
||||
*/
|
||||
private Date scheduledEndtime;
|
||||
/**
|
||||
* 会议时段
|
||||
*/
|
||||
private String slots;
|
||||
}
|
||||
|
@ -118,6 +118,13 @@ public class MeetBookingVo implements Serializable {
|
||||
@ExcelProperty(value = "状态")
|
||||
private Long state;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
|
||||
@ExcelProperty(value = "描述")
|
||||
private String descs;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
@ -0,0 +1,78 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.property.domain.MeetBooking;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:yuyongle
|
||||
* @Date:2025/7/7 17:07
|
||||
* @Description:查询本周实体类
|
||||
**/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = MeetBooking.class)
|
||||
public class MeetBookingWeekVo implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 会议室名称
|
||||
*/
|
||||
@ExcelProperty(value = "会议室名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 会议室id
|
||||
*/
|
||||
@ExcelProperty(value = "会议室id")
|
||||
private Long meetId;
|
||||
/**
|
||||
* 所属单位
|
||||
*/
|
||||
@ExcelProperty(value = "所属单位")
|
||||
private String unit;
|
||||
/**
|
||||
* 预定人
|
||||
*/
|
||||
@ExcelProperty(value = "预定人")
|
||||
private String person;
|
||||
/**
|
||||
* 会议室主题
|
||||
*/
|
||||
private String meetTheme;
|
||||
|
||||
/**
|
||||
* 预定开始时间
|
||||
*/
|
||||
private Date scheduledStarttime;
|
||||
|
||||
/**
|
||||
* 预定结束时间
|
||||
*/
|
||||
private Date scheduledEndtime;
|
||||
/**
|
||||
* 会议时段
|
||||
*/
|
||||
private String slots;
|
||||
/**
|
||||
* 星期几
|
||||
*/
|
||||
private String week;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private String dates;
|
||||
}
|
@ -4,6 +4,9 @@ import org.dromara.property.domain.TbRoom;
|
||||
import org.dromara.property.domain.vo.TbRoomVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 房间信息Mapper接口
|
||||
*
|
||||
@ -14,4 +17,5 @@ public interface TbRoomMapper extends BaseMapperPlus<TbRoom, TbRoomVo> {
|
||||
|
||||
//查询房间名称
|
||||
String queryRoomName(Long roomId);
|
||||
Map<Long,String> queryRoomNameList(List<Long> ids);
|
||||
}
|
||||
|
@ -6,8 +6,10 @@ import org.dromara.property.domain.vo.MeetBookingVo;
|
||||
import org.dromara.property.domain.bo.MeetBookingBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.property.domain.vo.MeetBookingWeekVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -47,7 +49,10 @@ public interface IMeetBookingService {
|
||||
* @return 会议预约列表
|
||||
*/
|
||||
List<MeetBookingVo> queryList(MeetBookingBo bo);
|
||||
|
||||
/**
|
||||
* 按照会议室Id查询已预约会议预约记录列表
|
||||
*/
|
||||
List<MeetBookingWeekVo> appointmentIdList(String meetId);
|
||||
/**
|
||||
* 新增会议预约
|
||||
*
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -68,12 +69,12 @@ public class MeetAttachServiceImpl implements IMeetAttachService {
|
||||
*/
|
||||
@Override
|
||||
public List<MeetAttachVo> queryList(MeetAttachBo bo) {
|
||||
bo.setState(0);
|
||||
LambdaQueryWrapper<MeetAttach> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<MeetAttach> buildQueryWrapper(MeetAttachBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<MeetAttach> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(MeetAttach::getId);
|
||||
lqw.eq(bo.getMeetId() != null, MeetAttach::getMeetId, bo.getMeetId());
|
||||
@ -81,7 +82,7 @@ public class MeetAttachServiceImpl implements IMeetAttachService {
|
||||
lqw.eq(bo.getPrice() != null, MeetAttach::getPrice, bo.getPrice());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), MeetAttach::getUnit, bo.getUnit());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getType()), MeetAttach::getType, bo.getType());
|
||||
lqw.eq(bo.getState() != null, MeetAttach::getState, bo.getState());
|
||||
lqw.eq(MeetAttach::getState, bo.getState());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -13,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.Meet;
|
||||
import org.dromara.property.domain.MeetAttach;
|
||||
import org.dromara.property.domain.vo.MeetBookingAppointmentVo;
|
||||
import org.dromara.property.domain.vo.MeetBookingWeekVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.MeetBookingBo;
|
||||
import org.dromara.property.domain.vo.MeetBookingVo;
|
||||
@ -21,9 +23,8 @@ import org.dromara.property.mapper.MeetBookingMapper;
|
||||
import org.dromara.property.service.IMeetBookingService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -78,6 +79,30 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
||||
}
|
||||
List<MeetBooking> meetBookings = baseMapper.selectList(meetBookingLambdaQueryWrapper);
|
||||
List<MeetBookingAppointmentVo> meetBookingAppointmentVoList = BeanUtil.copyToList(meetBookings, MeetBookingAppointmentVo.class);
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH");
|
||||
|
||||
meetBookingAppointmentVoList.stream().forEach(
|
||||
s->{
|
||||
String str = df.format(s.getScheduledStarttime());
|
||||
int a = Integer.parseInt(str);
|
||||
if (a >= 0 && a <= 6) {
|
||||
s.setSlots("凌晨");
|
||||
}
|
||||
if (a > 6 && a <= 12) {
|
||||
s.setSlots("上午");
|
||||
}
|
||||
if (a > 12 && a <= 13) {
|
||||
s.setSlots("中午");
|
||||
}
|
||||
if (a > 13 && a <= 18) {
|
||||
s.setSlots("下午");
|
||||
}
|
||||
if (a > 18 && a <= 24) {
|
||||
s.setSlots("晚上");
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
return meetBookingAppointmentVoList;
|
||||
}
|
||||
|
||||
@ -93,8 +118,38 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MeetBookingWeekVo> appointmentIdList(String meetId) {
|
||||
// 计算当前周的起止时间
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
// 设置为周一
|
||||
calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
|
||||
Date startOfWeek = calendar.getTime();
|
||||
// 加6天变为周日
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 6);
|
||||
Date endOfWeek = calendar.getTime();
|
||||
// 构建查询条件
|
||||
LambdaQueryWrapper<MeetBooking> bookingLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
bookingLambdaQueryWrapper.eq(MeetBooking::getMeetId, meetId)
|
||||
.ge(MeetBooking::getScheduledStarttime, startOfWeek)
|
||||
.le(MeetBooking::getScheduledEndtime, endOfWeek);
|
||||
List<MeetBookingVo> meetBookingVoList = baseMapper.selectVoList(bookingLambdaQueryWrapper);
|
||||
List<MeetBookingWeekVo> meetBookingWeekVoList = BeanUtil.copyToList(meetBookingVoList, MeetBookingWeekVo.class);
|
||||
String[] weekStr={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
|
||||
List<MeetBookingWeekVo> meetBookingWeekList= new ArrayList<>();
|
||||
meetBookingWeekVoList.stream().forEach(s->{
|
||||
//设置指定的Date对象不设置默认返回当天的星期
|
||||
calendar.setTime(s.getScheduledStarttime());
|
||||
//获取当前时间的星期
|
||||
int firstDayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
|
||||
s.setWeek(weekStr[firstDayOfWeek - 1]);
|
||||
meetBookingWeekList.add(s);
|
||||
});
|
||||
return meetBookingWeekList;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<MeetBooking> buildQueryWrapper(MeetBookingBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<MeetBooking> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(MeetBooking::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), MeetBooking::getName, bo.getName());
|
||||
@ -105,11 +160,11 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPhone()), MeetBooking::getPhone, bo.getPhone());
|
||||
lqw.eq(bo.getScheduledStarttime() != null, MeetBooking::getScheduledStarttime, bo.getScheduledStarttime());
|
||||
lqw.eq(bo.getScheduledEndtime() != null, MeetBooking::getScheduledEndtime, bo.getScheduledEndtime());
|
||||
lqw.eq(bo.getPersonSum() != null, MeetBooking::getPersonSum, bo.getPersonSum());
|
||||
lqw.eq(bo.getPrice() != null, MeetBooking::getPrice, bo.getPrice());
|
||||
lqw.eq(bo.getAttach() != null, MeetBooking::getAttach, bo.getAttach());
|
||||
lqw.eq(bo.getPayState() != null, MeetBooking::getPayState, bo.getPayState());
|
||||
lqw.eq(bo.getState() != null, MeetBooking::getState, bo.getState());
|
||||
lqw.eq(ObjectUtil.isNotEmpty(bo.getPersonSum()), MeetBooking::getPersonSum, bo.getPersonSum());
|
||||
lqw.eq(ObjectUtil.isNotEmpty(bo.getPrice()), MeetBooking::getPrice, bo.getPrice());
|
||||
lqw.eq(ObjectUtil.isNotEmpty(bo.getAttach()), MeetBooking::getAttach, bo.getAttach());
|
||||
lqw.eq(ObjectUtil.isNotEmpty(bo.getPayState()), MeetBooking::getPayState, bo.getPayState());
|
||||
lqw.eq(ObjectUtil.isNotEmpty(bo.getState()), MeetBooking::getState, bo.getState());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -9,7 +10,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.MeetBooking;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.mapper.MeetBookingMapper;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
import org.dromara.property.mapper.TbRoomMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -21,10 +24,11 @@ import org.dromara.property.mapper.MeetMapper;
|
||||
import org.dromara.property.service.IMeetService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -41,6 +45,7 @@ public class MeetServiceImpl implements IMeetService {
|
||||
private final MeetMapper baseMapper;
|
||||
private final ResidentPersonMapper residentPersonMapper;
|
||||
private final TbRoomMapper roomMapper;
|
||||
private final MeetBookingMapper meetbookMapper;
|
||||
|
||||
/**
|
||||
* 查询会议室管理
|
||||
@ -91,10 +96,54 @@ public class MeetServiceImpl implements IMeetService {
|
||||
*/
|
||||
@Override
|
||||
public List<MeetVo> queryList(MeetBo bo) {
|
||||
LambdaQueryWrapper<Meet> lqw = buildQueryWrapper(bo);
|
||||
//查询当前日期和当前时间段会议记录表的会议id
|
||||
LambdaQueryWrapper<MeetBooking> bookLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
String[] times = bo.getOpenHours().split("-");
|
||||
String openStartTimeStr = times[0];
|
||||
String openEndTimeStr = times[1];
|
||||
LocalDate appointmentTime = LocalDate.parse(bo.getAppointmentTime());
|
||||
LocalTime startTime = LocalTime.parse(openStartTimeStr, DateTimeFormatter.ofPattern("HH:mm"));
|
||||
LocalTime EndTime = LocalTime.parse(openEndTimeStr, DateTimeFormatter.ofPattern("HH:mm"));
|
||||
LocalDateTime startDateTime = LocalDateTime.of(appointmentTime, startTime );
|
||||
LocalDateTime endDateTime = LocalDateTime.of(appointmentTime, EndTime);
|
||||
bookLambdaQueryWrapper.ge(MeetBooking::getScheduledStarttime, startDateTime)
|
||||
.le(MeetBooking::getScheduledEndtime, endDateTime);
|
||||
List<MeetBooking> meetBookings = meetbookMapper.selectList(bookLambdaQueryWrapper);
|
||||
List<Long> meetIdList = meetBookings.stream().map(MeetBooking::getMeetId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<Meet> lqw = buildQueryListWrapper(bo,meetIdList);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
private LambdaQueryWrapper<Meet> buildQueryListWrapper(MeetBo bo,List<Long> meetIdList) {
|
||||
LambdaQueryWrapper<Meet> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(Meet::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), Meet::getName, bo.getName());
|
||||
lqw.notIn(ObjectUtil.isNotEmpty(meetIdList),Meet::getId,meetIdList);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLocation()), Meet::getLocation, bo.getLocation());
|
||||
lqw.le(bo.getPersonNumber() != null, Meet::getPersonNumber, bo.getPersonNumber());
|
||||
lqw.eq(bo.getBaseService() != null, Meet::getBaseService, bo.getBaseService());
|
||||
if (StringUtils.isNotBlank(bo.getOpenHours())) {
|
||||
String[] times = bo.getOpenHours().split("-");
|
||||
if (times.length == 2) {
|
||||
String openStartTimeStr = times[0];
|
||||
String openEndTimeStr = times[1];
|
||||
|
||||
String nowTime = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm"));
|
||||
if (nowTime.compareTo(openStartTimeStr) >= 0 && nowTime.compareTo(openEndTimeStr) <= 0) {
|
||||
lqw.ge(Meet::getOpenHours, openStartTimeStr)
|
||||
.le(Meet::getOpenHours, openEndTimeStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
lqw.eq(bo.getBasePrice() != null, Meet::getBasePrice, bo.getBasePrice());
|
||||
lqw.eq(bo.getAttach() != null, Meet::getAttach, bo.getAttach());
|
||||
return lqw;
|
||||
}
|
||||
private LambdaQueryWrapper<Meet> buildQueryWrapper(MeetBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<Meet> lqw = Wrappers.lambdaQuery();
|
||||
@ -108,6 +157,8 @@ public class MeetServiceImpl implements IMeetService {
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增会议室管理
|
||||
*
|
||||
@ -169,15 +220,15 @@ public class MeetServiceImpl implements IMeetService {
|
||||
*/
|
||||
@Override
|
||||
public Map<Object, Object> getMeetSelectDate(String type){
|
||||
|
||||
switch (type) {
|
||||
case "getMeetName":
|
||||
return getList().stream()
|
||||
.collect(Collectors.toMap(
|
||||
Meet::getId,
|
||||
Meet::getName,
|
||||
(oldValue, newValue) -> oldValue
|
||||
));
|
||||
Map<Object, Object> meetMap = new HashMap<>();
|
||||
for (Meet meet : getList()) {
|
||||
// 如果键不存在,则直接放入;如果存在,则保留第一个遇到的值
|
||||
meetMap.putIfAbsent("value", meet.getId());
|
||||
meetMap.putIfAbsent("name", meet.getName());
|
||||
}
|
||||
return meetMap;
|
||||
case "getMeetPrincipals":
|
||||
return getList().stream()
|
||||
.collect(Collectors.toMap(
|
||||
|
@ -14,4 +14,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
inner join tb_community c on r.community_id=c.id
|
||||
where r.id=#{roomId}
|
||||
</select>
|
||||
|
||||
<select id="queryRoomNameList" resultType="java.util.Map">
|
||||
select
|
||||
r.id,
|
||||
concat(c.community_name,b.building_name,u.unit_name,f.floor_name,r.room_number)
|
||||
from tb_room r
|
||||
inner join tb_floor f on r.floor_id=f.id
|
||||
inner join tb_unit u on r.unit_id=u.id
|
||||
inner join tb_building b on r.building_id=b.id
|
||||
inner join tb_community c on r.community_id=c.id
|
||||
where r.id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user