新增会议室设置和会议室增值服务
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m43s

This commit is contained in:
yuyongle 2025-07-04 14:57:15 +08:00
parent 9a8ccb1f57
commit 79d55e458f
17 changed files with 410 additions and 29 deletions

View File

@ -0,0 +1,34 @@
package org.dromara.property.controller;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.property.service.EnumFetcherService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @author yuqi
*/
@RestController
@RequestMapping("/enum-fetcher")
@RequiredArgsConstructor
public class EnumFetcherController {
private final EnumFetcherService enumFetcherService;
/**
*
* @param name
* @return 获取枚举全部值 参数以字段大驼峰格式 :OmsOrderStatus
*/
@GetMapping("/enum-values/{name}")
public R<Map<String, String>> getEnumValues(@PathVariable("name") String name) {
Map<String, String> map = enumFetcherService.getEnumValues(name);
return R.ok(map);
}
}

View File

@ -46,16 +46,16 @@ public class MeetAttachController extends BaseController {
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);
}
///**
// * 导出会议室增值服务列表
// */
//@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);
//}
/**
* 获取会议室增值服务详细信息

View File

@ -2,6 +2,8 @@ package org.dromara.property.controller;
import java.util.List;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
@ -32,6 +34,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
@Validated
@RequiredArgsConstructor
@RestController
@Tag(name = " 会议室设置")
@RequestMapping("/meet")
public class MeetController extends BaseController {
@ -40,7 +43,8 @@ public class MeetController extends BaseController {
/**
* 查询会议室管理列表
*/
@SaCheckPermission("property:meet:list")
// @SaCheckPermission("property:meet:list")
@Operation
@GetMapping("/list")
public TableDataInfo<MeetVo> list(MeetBo bo, PageQuery pageQuery) {
return meetService.queryPageList(bo, pageQuery);
@ -62,10 +66,9 @@ public class MeetController extends BaseController {
*
* @param id 主键
*/
@SaCheckPermission("property:meet:query")
//@SaCheckPermission("property:meet:query")
@GetMapping("/{id}")
public R<MeetVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable("id") Long id) {
public R<MeetVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) {
return R.ok(meetService.queryById(id));
}

View File

@ -58,19 +58,42 @@ public class Meet extends TenantEntity {
private Long attach;
/**
* 创建人id
* 负责人
*/
private Long createById;
private String principals;
/**
* 更新人id
* 描述
*/
private Long updateById;
private String desc;
/**
* 搜索值
* 联系电话
*/
private String searchValue;
private String phoneNo;
/**
* (0不审核,1审核)
*/
private Integer isCheck;
/**
* 预约时间
*/
private String appointmentTime;
/**
* 开放时段
*/
private String openHours;
/**
* 状态(0启用,1禁用)
*/
private Integer status;
/**
* (1免费2.付费,3面议)
*/
private Integer expenseType;
}

View File

@ -56,6 +56,10 @@ public class MeetAttach extends TenantEntity {
* 状态
*/
private Long state;
/**
* 图片
*/
private String picture;
/**
* 创建人id

View File

@ -1,5 +1,6 @@
package org.dromara.property.domain.bo;
import com.baomidou.mybatisplus.annotation.TableId;
import org.dromara.property.domain.Meet;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
@ -9,6 +10,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.util.List;
/**
* 会议室管理业务对象 meet
*
@ -23,22 +26,25 @@ public class MeetBo extends BaseEntity {
/**
* 主键
*/
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
@TableId(value = "id")
private Long id;
/**
* 会议室名称
*/
@NotBlank(message = "会议室名称不能为空")
private String name;
/**
* 位置
*/
@NotBlank(message = "位置不能为空")
private String location;
/**
* 容纳人数
*/
@NotBlank(message = "容纳人数不能为空")
private Long personNumber;
/**
@ -56,5 +62,48 @@ public class MeetBo extends BaseEntity {
*/
private Long attach;
/**
* 负责人
*/
private String principals;
/**
* 描述
*/
private String desc;
/**
* 联系电话
*/
private String phoneNo;
/**
* (0不审核,1审核)
*/
private Integer isCheck;
/**
* 预约时间
*/
private String appointmentTime;
/**
* 开放时段
*/
private String openHours;
/**
* 状态(0启用,1禁用)
*/
private Integer status;
/**
* (1免费2.付费,3面议)
*/
private Integer expenseType;
/**
* 新增图片
*/
private String picture;
}

View File

@ -0,0 +1,34 @@
package org.dromara.property.domain.enums;
/**
* @Author:yuyongle
* @Date:2025/7/4 10:35
* @Description:
**/
public enum MeetAttachStatusEnum {
/**
* 待确认
*/
ENAABLE("上架", "0"),
/**
* 待提货
*/
DEACTIVATE("下架", "1");
private final String name;
private final String value;
MeetAttachStatusEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
}

View File

@ -0,0 +1,34 @@
package org.dromara.property.domain.enums;
/**
* @Author:yuyongle
* @Date:2025/7/4 10:35
* @Description:
**/
public enum MeetStatusEnum {
/**
* 待确认
*/
ENAABLE("启用", "0"),
/**
* 待提货
*/
DEACTIVATE("停用", "1");
private final String name;
private final String value;
MeetStatusEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
}

View File

@ -0,0 +1,36 @@
package org.dromara.property.domain.vo;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import com.baomidou.mybatisplus.annotation.TableId;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.property.domain.Meet;
import java.io.Serial;
import java.io.Serializable;
/**
* @Author:yuyongle
* @Date:2025/7/3 17:35
* @Description:
**/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = Meet.class)
public class MeePictureVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id")
private Long id;
/**
* 会议id
*/
private Long meetId;
/**
* 图片路径
*/
private String pictureUrl;
}

View File

@ -41,7 +41,7 @@ public class MeetVo implements Serializable {
private String name;
/**
* 位置
* 会议室位置
*/
@ExcelProperty(value = "位置")
private String location;
@ -51,7 +51,10 @@ public class MeetVo implements Serializable {
*/
@ExcelProperty(value = "容纳人数")
private Long personNumber;
/**
* 状态(0启用,1禁用)
*/
private Integer status;
/**
* 基础服务
*/
@ -61,9 +64,8 @@ public class MeetVo implements Serializable {
/**
* 基础价格
*/
@ExcelProperty(value = "基础价格")
@ExcelProperty(value = "费用")
private Long basePrice;
/**
* 增值服务是否启用
*/
@ -71,10 +73,14 @@ public class MeetVo implements Serializable {
private Long attach;
/**
* 创建时间
* 负责人
*/
@ExcelProperty(value = "创建时间")
private Date createTime;
@ExcelProperty(value = "负责人")
private String principals;
/**
* 联系电话
*/
@ExcelProperty(value = "联系电话")
private String phoneNo;
}

View File

@ -0,0 +1,17 @@
package org.dromara.property.service;
import java.util.Map;
/**
* @Author:yuyongle
* @Date:2025/7/4 09:41
* @Description:
**/
public interface EnumFetcherService {
/**
* 获取枚举值
* @param type 大驼峰格式
* @return
*/
Map<String, String> getEnumValues(String type);
}

View File

@ -8,6 +8,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* 会议室增值服务Service接口
@ -66,4 +67,10 @@ public interface IMeetAttachService {
* @return 是否删除成功
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 获取下拉接口数据
* @param type
*/
Map<String,String> getMeetAttachSelectDate(String type);
}

View File

@ -8,6 +8,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* 会议室管理Service接口
@ -66,4 +67,10 @@ public interface IMeetService {
* @return 是否删除成功
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 获取下拉接口数据
* @param type
*/
public Map<String,String> getMeetSelectDate(String type);
}

View File

@ -0,0 +1,56 @@
package org.dromara.property.service.impl;
import lombok.RequiredArgsConstructor;
import org.dromara.property.domain.enums.MeetAttachStatusEnum;
import org.dromara.property.domain.enums.MeetStatusEnum;
import org.dromara.property.service.EnumFetcherService;
import org.dromara.property.service.IMeetAttachService;
import org.dromara.property.service.IMeetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author:yuyongle
* @Date:2025/7/4 09:41
* @Description:
**/
@Service
@RequiredArgsConstructor
public class EnumFetcherServiceImpl implements EnumFetcherService {
@Autowired
private IMeetService meetService;
@Autowired
private IMeetAttachService meetAttachService;
@Override
public Map<String, String> getEnumValues(String type) {
switch (type) {
case "getMeetName":
return meetService.getMeetSelectDate(type);
case "getMeetPrincipals":
return meetService.getMeetSelectDate(type);
case "getMeetStatus":
return getMeetStatus();
case "getMeetAttachName":
return meetAttachService.getMeetAttachSelectDate(type);
case "getMeetAttachType":
return meetAttachService.getMeetAttachSelectDate(type);
case "getMeetAttachStatus()":
return getMeetAttachStatus();
default:
throw new IllegalArgumentException("Unknown type: " + type);
}
}
Map<String, String> getMeetStatus() {
return java.util.Arrays.stream(MeetStatusEnum.values())
.collect(Collectors.toMap(MeetStatusEnum::getValue, MeetStatusEnum::getName));
}
Map<String, String> getMeetAttachStatus() {
return java.util.Arrays.stream(MeetAttachStatusEnum.values())
.collect(Collectors.toMap(MeetAttachStatusEnum::getValue, MeetAttachStatusEnum::getName));
}
}

View File

@ -9,6 +9,7 @@ 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.Meet;
import org.springframework.stereotype.Service;
import org.dromara.property.domain.bo.MeetAttachBo;
import org.dromara.property.domain.vo.MeetAttachVo;
@ -19,6 +20,7 @@ import org.dromara.property.service.IMeetAttachService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.stream.Collectors;
/**
* 会议室增值服务Service业务层处理
@ -134,4 +136,34 @@ public class MeetAttachServiceImpl implements IMeetAttachService {
}
return baseMapper.deleteByIds(ids) > 0;
}
/**
* 下拉接口数据
*/
@Override
public Map<String, String> getMeetAttachSelectDate(String type){
switch (type) {
case "getMeetAttachName":
return getList().stream()
.collect(Collectors.toMap(
MeetAttach::getProjectName,
MeetAttach::getProjectName,
(oldValue, newValue) -> oldValue
));
case "getMeetAttachType":
return getList().stream()
.collect(Collectors.toMap(
MeetAttach::getType,
MeetAttach::getType,
(oldValue, newValue) -> oldValue
));
default:
throw new IllegalArgumentException("Unknown type: " + type);
}
}
public List<MeetAttach> getList(){
LambdaQueryWrapper<MeetAttach> meetQueryWrapper = new LambdaQueryWrapper<>();
return baseMapper.selectList(meetQueryWrapper);
}
}

View File

@ -19,6 +19,7 @@ import org.dromara.property.service.IMeetService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.stream.Collectors;
/**
* 会议室管理Service业务层处理
@ -110,6 +111,7 @@ public class MeetServiceImpl implements IMeetService {
public Boolean updateByBo(MeetBo bo) {
Meet update = MapstructUtils.convert(bo, Meet.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
@ -134,4 +136,34 @@ public class MeetServiceImpl implements IMeetService {
}
return baseMapper.deleteByIds(ids) > 0;
}
/**
* 下拉接口数据
*/
@Override
public Map<String, String> getMeetSelectDate(String type){
switch (type) {
case "getMeetName":
return getList().stream()
.collect(Collectors.toMap(
Meet::getName,
Meet::getName,
(oldValue, newValue) -> oldValue
));
case "getMeetPrincipals":
return getList().stream()
.collect(Collectors.toMap(
Meet::getPrincipals,
Meet::getPrincipals,
(oldValue, newValue) -> oldValue
));
default:
throw new IllegalArgumentException("Unknown type: " + type);
}
}
public List<Meet> getList(){
LambdaQueryWrapper<Meet> meetQueryWrapper = new LambdaQueryWrapper<>();
return baseMapper.selectList(meetQueryWrapper);
}
}

View File

@ -0,0 +1,7 @@
<?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="org.dromara.property.mapper.MeetPictureMapper">
</mapper>