update 新增会议
This commit is contained in:
@@ -3,6 +3,7 @@ package com.jero.common.api;
|
||||
import com.jero.common.system.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public interface CommonAPI {
|
||||
@@ -94,4 +95,10 @@ public interface CommonAPI {
|
||||
*/
|
||||
List<DictModel> queryTableDictItemsByCode(String table, String text, String code);
|
||||
|
||||
/**
|
||||
* 14获取数据字典key-value类型
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> queryDictItemsMapByCode(String code);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.jero.meeting.common;
|
||||
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2021-09-03 11:26
|
||||
*/
|
||||
public class MeetingCommon {
|
||||
/**
|
||||
* 工作组会议
|
||||
*/
|
||||
public final static String WORKING_GROUP_MEETING = "1";
|
||||
/**
|
||||
* 标协会议
|
||||
*/
|
||||
public final static String STANDARD_MEETING = "2";
|
||||
/**
|
||||
* 国际研讨会
|
||||
*/
|
||||
public final static String INTERNATIONAL_MEETING = "3";
|
||||
|
||||
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* @Description: 会议管理
|
||||
@@ -65,11 +66,13 @@ public class PayMeeting implements Serializable {
|
||||
/**会议类型*/
|
||||
@Excel(name = "会议类型", width = 15,dicCode = "meeting_type")
|
||||
@ApiModelProperty(value = "会议类型")
|
||||
@Dict(dicCode = "meeting_type")
|
||||
private Integer meetingType;
|
||||
|
||||
/**标协会议类型*/
|
||||
@Excel(name = "标协会议类型", width = 15,dicCode = "standard_meeting_type")
|
||||
@ApiModelProperty(value = "标协会议类型")
|
||||
@Dict(dicCode = "standard_meeting_type")
|
||||
private Integer tbMeetingType;
|
||||
|
||||
/**工作组id*/
|
||||
@@ -205,4 +208,7 @@ public class PayMeeting implements Serializable {
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**会议文件*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String meetingFiles;
|
||||
}
|
||||
|
||||
+6
-4
@@ -6,6 +6,7 @@ import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jero.meeting.valid.group.StandardMeeting;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -16,6 +17,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@@ -46,15 +48,15 @@ public class PayMeetingHotelContacts implements Serializable {
|
||||
/**酒店联系人*/
|
||||
@Excel(name = "酒店联系人", width = 15)
|
||||
@ApiModelProperty(value = "酒店联系人")
|
||||
@NotNull(message = "酒店联系人不能为空")
|
||||
@Size(max = 50, message = "酒店联系人最多为50个字符")
|
||||
@NotBlank(message = "酒店联系人不能为空",groups = StandardMeeting.class)
|
||||
@Size(max = 50, message = "酒店联系人最多为50个字符",groups = StandardMeeting.class)
|
||||
private String hotelContacts;
|
||||
|
||||
/**酒店联系人电话*/
|
||||
@Excel(name = "酒店联系人电话", width = 15)
|
||||
@ApiModelProperty(value = "酒店联系人电话")
|
||||
@NotNull(message = "酒店联系人电话")
|
||||
@Size(max = 50, message = "酒店联系人电话最多为50个字符")
|
||||
@NotBlank(message = "酒店联系人电话不能为空",groups = StandardMeeting.class)
|
||||
@Size(max = 50, message = "酒店联系人电话最多为50个字符",groups = StandardMeeting.class)
|
||||
private String hotelContactsPhone;
|
||||
|
||||
}
|
||||
|
||||
+46
-5
@@ -2,18 +2,30 @@ package com.jero.meeting.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.ValidUtil;
|
||||
import com.jero.meeting.common.MeetingCommon;
|
||||
import com.jero.meeting.entity.PayMeeting;
|
||||
import com.jero.meeting.mapper.PayMeetingMapper;
|
||||
import com.jero.meeting.service.IPayMeetingService;
|
||||
import com.jero.meeting.valid.group.InternationalMeeting;
|
||||
import com.jero.meeting.valid.group.StandardMeeting;
|
||||
import com.jero.meeting.valid.group.WorkingGroupMeeting;
|
||||
import com.jero.meeting.vo.PayMeetingVO;
|
||||
import org.apache.commons.beanutils.BeanUtilsBean;
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description: 会议管理
|
||||
* @Author: jero-boot
|
||||
@@ -22,7 +34,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
*/
|
||||
@Service
|
||||
public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeeting> implements IPayMeetingService {
|
||||
|
||||
@Resource
|
||||
private ISysBaseAPI sysBaseApi;
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@@ -35,16 +48,44 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
|
||||
@Override
|
||||
public void add(PayMeetingVO payMeetingVO) {
|
||||
List<String> errorMsgList = new ArrayList<>();
|
||||
PayMeeting payMeeting = new PayMeeting();
|
||||
//判断会议名称
|
||||
String meetingName = payMeetingVO.getMeetingName();
|
||||
LambdaQueryWrapper<PayMeeting> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PayMeeting::getMeetingName,meetingName);
|
||||
if (count(wrapper)>0){
|
||||
errorMsgList.add("会议名称不能重复");
|
||||
};
|
||||
throw new JeroBootException("会议名称不能重复");
|
||||
}
|
||||
//判断会议类型
|
||||
String meetingType = payMeetingVO.getMeetingType();
|
||||
Map<String, String> meetingTypeMap = sysBaseApi.queryDictItemsMapByCode("meeting_type");
|
||||
if (!meetingTypeMap.containsKey(meetingType)) {
|
||||
throw new JeroBootException("会议类型不存在");
|
||||
}else {
|
||||
payMeeting.setMeetingType(Integer.valueOf(meetingTypeMap.get(meetingType)));
|
||||
}
|
||||
//判断会议联系人
|
||||
String directorId = payMeetingVO.getDirectorId();
|
||||
LoginUser loginUser = sysBaseApi.getUserById(directorId);
|
||||
if (loginUser == null) {
|
||||
throw new JeroBootException("会议联系人不存在");
|
||||
}
|
||||
|
||||
//根据会议类型进行校验
|
||||
if (meetingType.equals(MeetingCommon.WORKING_GROUP_MEETING)){
|
||||
ValidUtil.validate(payMeetingVO, WorkingGroupMeeting.class);
|
||||
}else if (meetingType.equals(MeetingCommon.STANDARD_MEETING)){
|
||||
ValidUtil.validate(payMeetingVO, StandardMeeting.class);
|
||||
}else if (meetingType.equals(MeetingCommon.INTERNATIONAL_MEETING)){
|
||||
ValidUtil.validate(payMeetingVO, InternationalMeeting.class);
|
||||
}else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!errorMsgList.isEmpty()){
|
||||
throw new JeroBootException(errorMsgList.toString());
|
||||
}
|
||||
PayMeeting payMeeting = new PayMeeting();
|
||||
BeanUtils.copyProperties(payMeetingVO,payMeeting);
|
||||
save(payMeeting);
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.jero.meeting.valid.group;
|
||||
|
||||
/**
|
||||
* 国际研讨会
|
||||
* @author liJiaRao
|
||||
* @date 2021-09-03 11:22
|
||||
*/
|
||||
public @interface InternationalMeeting {
|
||||
}
|
||||
+1
-1
@@ -5,5 +5,5 @@ package com.jero.meeting.valid.group;
|
||||
* @author liJiaRao
|
||||
* @date 2021-09-02 16:38
|
||||
*/
|
||||
public @interface WorkingGroupProject {
|
||||
public @interface WorkingGroupMeeting {
|
||||
}
|
||||
@@ -1,27 +1,23 @@
|
||||
package com.jero.meeting.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.meeting.entity.PayMeetingHotelContacts;
|
||||
import com.jero.meeting.valid.group.InternationalMeeting;
|
||||
import com.jero.meeting.valid.group.StandardMeeting;
|
||||
import com.jero.meeting.valid.group.WorkingGroupProject;
|
||||
import com.jero.meeting.valid.group.WorkingGroupMeeting;
|
||||
import com.jero.valid.ValidList;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 会议管理VO
|
||||
@@ -56,7 +52,7 @@ public class PayMeetingVO implements Serializable {
|
||||
/**工作组项目id*/
|
||||
@Excel(name = "工作组项目名称", width = 15, dictTable = "pay_working_group",dicText = "working_group_project",dicCode = "id")
|
||||
@ApiModelProperty(value = "工作组项目id")
|
||||
@NotBlank(message = "工作组项目名称不能为空", groups = WorkingGroupProject.class)
|
||||
@NotBlank(message = "工作组项目名称不能为空", groups = WorkingGroupMeeting.class)
|
||||
private String workingGroupId;
|
||||
|
||||
/**工作组项目名称*/
|
||||
@@ -90,7 +86,7 @@ public class PayMeetingVO implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "开始注册签到时间")
|
||||
@NotNull(message = "开始注册签到时间不能为空")
|
||||
@NotNull(message = "开始注册签到时间不能为空",groups = StandardMeeting.class)
|
||||
private java.util.Date startSignInTime;
|
||||
|
||||
/**结束注册签到时间*/
|
||||
@@ -98,7 +94,7 @@ public class PayMeetingVO implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "结束注册签到时间")
|
||||
@NotNull(message = "结束注册签到时间不能为空")
|
||||
@NotNull(message = "结束注册签到时间不能为空",groups = StandardMeeting.class)
|
||||
private java.util.Date endSignInTime;
|
||||
|
||||
/**召开地点*/
|
||||
@@ -144,41 +140,43 @@ public class PayMeetingVO implements Serializable {
|
||||
/**VIP邀请码*/
|
||||
@Excel(name = "VIP邀请码", width = 15)
|
||||
@ApiModelProperty(value = "VIP邀请码")
|
||||
@NotNull(message = "VIP邀请码不能为空")
|
||||
@Size(max = 50, message = "VIP邀请码最多为50个字符")
|
||||
@NotBlank(message = "VIP邀请码不能为空",groups = InternationalMeeting.class)
|
||||
@Size(max = 50, message = "VIP邀请码最多为50个字符",groups = InternationalMeeting.class)
|
||||
private java.lang.String vipInvitationCode;
|
||||
|
||||
/**演讲嘉宾邀请码*/
|
||||
@Excel(name = "演讲嘉宾邀请码", width = 15)
|
||||
@ApiModelProperty(value = "演讲嘉宾邀请码")
|
||||
@NotNull(message = "演讲嘉宾邀请码不能为空")
|
||||
@Size(max = 50, message = "演讲嘉宾邀请码最多为50个字符")
|
||||
@NotBlank(message = "演讲嘉宾邀请码不能为空",groups = InternationalMeeting.class)
|
||||
@Size(max = 50, message = "演讲嘉宾邀请码最多为50个字符",groups = InternationalMeeting.class)
|
||||
private java.lang.String speakerInvitationCode;
|
||||
|
||||
/**特邀嘉宾邀请码*/
|
||||
@Excel(name = "特邀嘉宾邀请码", width = 15)
|
||||
@ApiModelProperty(value = "特邀嘉宾邀请码")
|
||||
@NotNull(message = "特邀嘉宾邀请码不能为空")
|
||||
@Size(max = 50, message = "特邀嘉宾邀请码最多为50个字符")
|
||||
@NotBlank(message = "特邀嘉宾邀请码不能为空",groups = InternationalMeeting.class)
|
||||
@Size(max = 50, message = "特邀嘉宾邀请码最多为50个字符",groups = InternationalMeeting.class)
|
||||
private java.lang.String guestInvitationCode;
|
||||
|
||||
/**合作伙伴邀请码*/
|
||||
@Excel(name = "合作伙伴邀请码", width = 15)
|
||||
@ApiModelProperty(value = "合作伙伴邀请码")
|
||||
@NotNull(message = "合作伙伴邀请码不能为空")
|
||||
@Size(max = 50, message = "合作伙伴邀请码最多为50个字符")
|
||||
@NotBlank(message = "合作伙伴邀请码不能为空",groups = InternationalMeeting.class)
|
||||
@Size(max = 50, message = "合作伙伴邀请码最多为50个字符",groups = InternationalMeeting.class)
|
||||
private java.lang.String cooperativeInvitationCode;
|
||||
|
||||
/**会议费用*/
|
||||
@Excel(name = "会议费用", width = 15)
|
||||
@ApiModelProperty(value = "会议费用")
|
||||
@NotNull(message = "会议费用不能为空")
|
||||
@Max(value = 999999999,message = "会议费用格式错误")
|
||||
private Integer meetingCosts;
|
||||
|
||||
/**会议费用(标协会员)*/
|
||||
@Excel(name = "会议费用(标协会员)", width = 15)
|
||||
@ApiModelProperty(value = "会议费用(标协会员)")
|
||||
@NotNull(message = "会议费用(标协会员)不能为空")
|
||||
@Max(value = 999999999,message = "会议费用(标协会员)格式错误")
|
||||
private Integer meetingCostsVip;
|
||||
|
||||
/**会议负责人id*/
|
||||
@@ -194,29 +192,28 @@ public class PayMeetingVO implements Serializable {
|
||||
/**会议负责人手机号*/
|
||||
@Excel(name = "会议负责人手机号", width = 15,exportConvert = true)
|
||||
@ApiModelProperty(value = "会议负责人手机号")
|
||||
@NotBlank(message = "会议负责人手机号不能为空")
|
||||
private String directorPhone;
|
||||
|
||||
/**酒店名称*/
|
||||
@Excel(name = "酒店名称", width = 15)
|
||||
@ApiModelProperty(value = "酒店名称")
|
||||
@NotBlank(message = "酒店名称不能为空")
|
||||
@Size(max = 100, message = "酒店名称最大为100字符")
|
||||
@NotBlank(message = "酒店名称不能为空",groups = StandardMeeting.class)
|
||||
@Size(max = 100, message = "酒店名称最大为100字符",groups = StandardMeeting.class)
|
||||
private String hotelName;
|
||||
|
||||
/**酒店地址*/
|
||||
@Excel(name = "酒店地址", width = 15)
|
||||
@ApiModelProperty(value = "酒店地址")
|
||||
@NotBlank(message = "酒店地址不能为空")
|
||||
@Size(max = 100, message = "酒店地址最大为100字符")
|
||||
@NotBlank(message = "酒店地址不能为空",groups = StandardMeeting.class)
|
||||
@Size(max = 100, message = "酒店地址最大为100字符",groups = StandardMeeting.class)
|
||||
private String hotelAddress;
|
||||
|
||||
/**
|
||||
* 会议关联酒店联系人列表
|
||||
*/
|
||||
@Valid
|
||||
@NotNull(message = "酒店联系人不能为空")
|
||||
@Size(max = 5, message = "酒店联系人最多为5个")
|
||||
@NotNull(message = "酒店联系人不能为空",groups = StandardMeeting.class)
|
||||
@Size(max = 5, message = "酒店联系人最多为5个",groups = StandardMeeting.class)
|
||||
private ValidList<PayMeetingHotelContacts> payMeetingHotelContactsList;
|
||||
|
||||
/**备注*/
|
||||
@@ -225,4 +222,9 @@ public class PayMeetingVO implements Serializable {
|
||||
@Size(max = 200, message = "备注最大为200字符")
|
||||
private String remark;
|
||||
|
||||
/**会议文件*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Size(max = 1000, message = "会议文件数量超出最大限制")
|
||||
private String meetingFiles;
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -47,6 +47,7 @@ import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 底层共通业务API,提供其他独立模块调用
|
||||
@@ -280,6 +281,13 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
return sysDictService.queryTableDictItemsByCode(table, text, code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> queryDictItemsMapByCode(String code) {
|
||||
return sysDictService.queryDictItemsByCode(code)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(DictModel::getText, DictModel::getValue));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryAllDepartBackDictModel() {
|
||||
return sysDictService.queryAllDepartBackDictModel();
|
||||
|
||||
Reference in New Issue
Block a user