update 会议新增参会人

This commit is contained in:
lijiarao
2021-09-09 15:23:22 +08:00
parent 33f292f6c8
commit 194698127b
17 changed files with 690 additions and 43 deletions
@@ -8,13 +8,51 @@ public class MeetingSubitemCommon {
/**
* 嘉宾
*/
public final static String JIA_BIN = "1";
public final static Integer JIA_BIN = 1;
/**
* 参会人
*/
public final static String CAN_HUI_REN = "2";
public final static Integer CAN_HUI_REN = 2;
/**
* 内部企业
*/
public final static String NEI_BU_QI_YE = "3";
public final static Integer NEI_BU_QI_YE = 3;
/**
* 缴费方式:打包
*/
public final static Integer PAY_MODE_PACK = 3;
/**
* vip嘉宾
*/
public final static Integer VIP = 1;
/**
* 演讲嘉宾
*/
public final static Integer SPEAKER = 2;
/**
* 特邀嘉宾
*/
public final static Integer GUEST = 3;
/**
* 合作伙伴嘉宾
*/
public final static Integer COOPERATIVE = 4;
/**
* 用餐
*/
public final static Integer HAVE_MEALS = 1;
/**
* 接站
*/
public static final Integer PICK_UP = 1;
/**
* 送站
*/
public static final Integer DELIVERY_STATION = 1;
/**
* 入住酒店
*/
public static final Integer CHECK_IN_HOTEL = 1;
}
@@ -148,16 +148,19 @@ public class PayMeetingSituation implements Serializable {
/**是否用餐*/
@Excel(name = "是否用餐", width = 15)
@ApiModelProperty(value = "是否用餐")
@Dict(dicCode = "yn")
private Integer haveMeals;
/**是否回民*/
@Excel(name = "是否回民", width = 15)
@ApiModelProperty(value = "是否回民")
@Dict(dicCode = "yn")
private Integer huiPeople;
/**是否入住协议酒店*/
@Excel(name = "是否入住协议酒店", width = 15)
@ApiModelProperty(value = "是否入住协议酒店")
@Dict(dicCode = "yn")
private Integer checkInHotel;
/**入住酒店时间*/
@@ -179,6 +182,12 @@ public class PayMeetingSituation implements Serializable {
@ApiModelProperty(value = "房型")
private String roomLayout;
/**是否需要接站*/
@Excel(name = "是否需要接站", width = 15)
@ApiModelProperty(value = "是否需要接站")
@Dict(dicCode = "yn")
private Integer pickUp;
/**抵达时间*/
@Excel(name = "抵达时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@@ -199,6 +208,7 @@ public class PayMeetingSituation implements Serializable {
/**是否需要送站*/
@Excel(name = "是否需要送站", width = 15)
@ApiModelProperty(value = "是否需要送站")
@Dict(dicCode = "yn")
private Integer deliveryStation;
/**离开时间*/
@@ -231,13 +241,9 @@ public class PayMeetingSituation implements Serializable {
/**是否签到*/
@Excel(name = "是否签到", width = 15)
@ApiModelProperty(value = "是否签到")
@Dict(dicCode = "yn")
private Integer checkIn;
/**是否需要接站*/
@Excel(name = "是否需要接站", width = 15)
@ApiModelProperty(value = "是否需要接站")
private Integer pickUp;
/**邮寄联系人*/
@Excel(name = "邮寄联系人", width = 15)
@ApiModelProperty(value = "邮寄联系人")
@@ -266,6 +272,7 @@ public class PayMeetingSituation implements Serializable {
@NotNull(message = "缴费方式不能为空",groups = CommonPeople.class)
@Min(1)
@Max(3)
@Dict(dicCode = "meeting_pay_type")
private Integer payMode;
/**需要发票*/
@@ -273,6 +280,7 @@ public class PayMeetingSituation implements Serializable {
@ApiModelProperty(value = "需要发票")
@Min(0)
@Max(2)
@Dict(dicCode = "invoice_type")
private Integer needInvoice;
/**付款凭证*/
@@ -335,4 +343,6 @@ public class PayMeetingSituation implements Serializable {
@Excel(name = "对接人姓名", width = 15)
@ApiModelProperty(value = "对接人姓名")
private String dockName;
}
@@ -1,22 +1,31 @@
package com.jero.meeting.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.exception.JeroBootException;
import com.jero.common.util.ValidUtil;
import com.jero.company.entity.PayContactsManagement;
import com.jero.company.service.IPayContactsManagementService;
import com.jero.meeting.common.MeetingCommon;
import com.jero.meeting.common.MeetingSubitemCommon;
import com.jero.meeting.entity.PayMeeting;
import com.jero.meeting.entity.PayMeetingSituation;
import com.jero.meeting.mapper.PayMeetingSituationMapper;
import com.jero.meeting.service.IPayMeetingService;
import com.jero.meeting.service.IPayMeetingSituationService;
import com.jero.meeting.vo.CommonPeopleVO;
import com.jero.meeting.vo.MeetingEntity;
import com.jero.meeting.valid.group.*;
import com.jero.meeting.vo.*;
import com.jero.project.common.PayProjectCommon;
import com.jero.standards.memberinfo.entity.MemberInfo;
import com.jero.standards.memberinfo.service.IMemberInfoService;
import com.jero.temporary.entity.PayCompanyManagementTemporary;
import com.jero.temporary.entity.PayContactsManagementTemporary;
import com.jero.temporary.service.IPayCompanyManagementTemporaryService;
import com.jero.temporary.service.IPayContactsManagementTemporaryService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -32,22 +41,31 @@ import javax.annotation.Resource;
public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituationMapper, PayMeetingSituation> implements IPayMeetingSituationService {
@Resource
private IPayContactsManagementService contactsManagementService;
@Resource
private IPayCompanyManagementTemporaryService companyManagementTemporaryService;
@Resource
private IPayContactsManagementTemporaryService contactsManagementTemporaryService;
@Resource
private IPayMeetingService meetingService;
@Resource
private IMemberInfoService memberInfoService;
/**
* 保存
*/
@Override
public void add(PayMeetingSituation payMeetingSituation) {
String meetingId = payMeetingSituation.getMeetingId();
PayMeeting payMeeting = meetingService.getById(meetingId);
//会议类型
Integer meetingType = payMeeting.getMeetingType();
//要保存的对象
PayMeetingSituation payMeetingSituation1 = new PayMeetingSituation();
//会议校验基础类
MeetingEntity meetingEntity = new MeetingEntity();
BeanUtils.copyProperties(payMeetingSituation,meetingEntity);
BeanUtils.copyProperties(payMeetingSituation, meetingEntity);
//校验公共属性
ValidUtil.validate(meetingEntity);
BeanUtils.copyProperties(meetingEntity, payMeetingSituation1);
//校验企业
String companyId = meetingEntity.getCompanyId();
PayCompanyManagementTemporary companyManagementTemporary = companyManagementTemporaryService.insertCompanyManagementTemporary(companyId);
@@ -59,44 +77,116 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
PayContactsManagement contactsManagement = contactsManagementService.getById(companyContactId);
//校验是否是选择的企业的联系人
String companyId1 = contactsManagement.getCompanyId();
if (companyId1.equals(companyId)){
if (companyId1.equals(companyId)) {
PayContactsManagementTemporary contactsManagementTemporary = contactsManagementTemporaryService.insertContactsManagementTemporary(companyContactId);
payMeetingSituation.setCompanyContactTemporaryId(contactsManagementTemporary.getId());
payMeetingSituation.setCompanyContactName(contactsManagementTemporary.getName());
}else {
} else {
throw new JeroBootException("企业联系人不是所选企业的企业联系人");
}
//判断身份
Integer identity = payMeetingSituation.getIdentity();
if (identity.equals(Integer.parseInt(MeetingSubitemCommon.CAN_HUI_REN))){
CommonPeopleVO commonPeopleVO = new CommonPeopleVO();
BeanUtils.copyProperties(payMeetingSituation,commonPeopleVO);
ValidUtil.validate(commonPeopleVO);
//校验邮寄联系人
String postContactId = commonPeopleVO.getPostContactId();
PayContactsManagement postContact = contactsManagementService.getById(postContactId);
//校验是否是选择的企业的联系人
String companyId2 = postContact.getCompanyId();
if (companyId2.equals(companyId)){
PayContactsManagementTemporary contactsManagementTemporary1 = contactsManagementTemporaryService.insertContactsManagementTemporary(postContactId);
commonPeopleVO.setPostContactTemporaryId(contactsManagementTemporary1.getId());
commonPeopleVO.setPostContactName(contactsManagementTemporary1.getName());
}else {
throw new JeroBootException("邮寄联系人不是所选企业的企业联系人");
//国际研讨会会议的嘉宾和其他类型不同
if (meetingType.equals(Integer.parseInt(MeetingCommon.INTERNATIONAL_MEETING)) &&
identity.equals(MeetingSubitemCommon.JIA_BIN)) {
//获取嘉宾类型
Integer guestType = payMeetingSituation.getGuestType();
if (ObjectUtil.isNull(guestType)){
throw new JeroBootException("嘉宾类型不能为空");
}
BeanUtils.copyProperties(commonPeopleVO,payMeetingSituation1);
InternationalGuestVO internationalGuestVO = new InternationalGuestVO();
BeanUtils.copyProperties(payMeetingSituation, internationalGuestVO);
//合作伙伴嘉宾只有最基础的参数所以不需要校验,只需要校验VIP,演讲嘉宾,特邀嘉宾
if (!guestType.equals(MeetingSubitemCommon.COOPERATIVE)){
//先校验VIP,演讲嘉宾,特邀嘉宾的公共字段
ValidUtil.validate(internationalGuestVO);
//用餐
Integer haveMeals = internationalGuestVO.getHaveMeals();
if (haveMeals.equals(MeetingSubitemCommon.HAVE_MEALS)){
ValidUtil.validate(internationalGuestVO, HaveMeals.class);
}
//接站
Integer pickUp = internationalGuestVO.getPickUp();
if (pickUp.equals(MeetingSubitemCommon.PICK_UP)){
ValidUtil.validate(internationalGuestVO, PickUp.class);
}
//送站
Integer deliveryStation = internationalGuestVO.getDeliveryStation();
if (deliveryStation.equals(MeetingSubitemCommon.DELIVERY_STATION)){
ValidUtil.validate(internationalGuestVO, DeliveryStation.class);
}
//校验VIP,演讲嘉宾的公共字段
if (!guestType.equals(MeetingSubitemCommon.GUEST)){
ValidUtil.validate(internationalGuestVO, Guest.class);
//校验VIP
if (guestType.equals(MeetingSubitemCommon.VIP)){
ValidUtil.validate(internationalGuestVO, VIP.class);
Integer checkInHotel = internationalGuestVO.getCheckInHotel();
if (checkInHotel.equals(MeetingSubitemCommon.CHECK_IN_HOTEL)){
ValidUtil.validate(internationalGuestVO, CheckInHotel.class);
}
}
}
}
//参会人
} else if (identity.equals(MeetingSubitemCommon.CAN_HUI_REN)) {
CommonPeopleVO commonPeopleVO = new CommonPeopleVO();
BeanUtils.copyProperties(payMeetingSituation, commonPeopleVO);
Integer payMode = commonPeopleVO.getPayMode();
//缴费方式为打包时,不处理邮寄联系人和地址
if (payMode.equals(MeetingSubitemCommon.PAY_MODE_PACK)) {
ValidUtil.validate(commonPeopleVO, NotPack.class);
//存入打包字段
payMeetingSituation1.setPack(PayProjectCommon.PACKAGING1);
payMeetingSituation1.setAmountReceivable(new BigDecimal(0));
} else {
//存入打包字段
payMeetingSituation1.setPack(PayProjectCommon.PACKAGING0);
//如果是标协会议判断会员类型
if (meetingType.equals(Integer.parseInt(MeetingCommon.STANDARD_MEETING))){
//根据企业名称和会员类型不为null判断是否为标协会员
LambdaQueryWrapper<MemberInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(MemberInfo::getCompanyName,payMeetingSituation.getCompanyName());
wrapper.isNotNull(MemberInfo::getMemberType);
int count = memberInfoService.count(wrapper);
//如果是标协会员就存入会议费用(标协会员)
if (count>0){
payMeetingSituation1.setAmountReceivable(payMeeting.getMeetingCostsVip());
}else {
payMeetingSituation1.setAmountReceivable(payMeeting.getMeetingCosts());
}
}else {
payMeetingSituation1.setAmountReceivable(payMeeting.getMeetingCosts());
}
ValidUtil.validate(commonPeopleVO);
//校验邮寄联系人
String postContactId = commonPeopleVO.getPostContactId();
PayContactsManagement postContact = contactsManagementService.getById(postContactId);
//校验是否是选择的企业的联系人
String companyId2 = postContact.getCompanyId();
if (companyId2.equals(companyId)) {
PayContactsManagementTemporary contactsManagementTemporary1 = contactsManagementTemporaryService.insertContactsManagementTemporary(postContactId);
payMeetingSituation1.setPostContactTemporaryId(contactsManagementTemporary1.getId());
payMeetingSituation1.setPostContactName(contactsManagementTemporary1.getName());
} else {
throw new JeroBootException("邮寄联系人不是所选企业的企业联系人");
}
}
//其他会议的嘉宾和内部企业
}else {
CommonGuestVO commonGuestVO = new CommonGuestVO();
BeanUtils.copyProperties(payMeetingSituation, commonGuestVO);
ValidUtil.validate(commonGuestVO);
BeanUtils.copyProperties(commonGuestVO, payMeetingSituation1);
}
//到账
payMeetingSituation1.setInAccount(PayProjectCommon.IN_ACCOUNT0);
//打包
payMeetingSituation1.setPack(PayProjectCommon.PACKAGING0);
//开票
payMeetingSituation1.setMakeInvoice(PayProjectCommon.MAKE_INVOICE0);
//邮寄
payMeetingSituation1.setMail(PayProjectCommon.MAIL0);
save(payMeetingSituation1);
}
}
/**
* 更新
@@ -0,0 +1,9 @@
package com.jero.meeting.valid.group;
/**
* 入住酒店校验
* @author liJiaRao
* @date 2021-09-09 11:42
*/
public @interface CheckInHotel {
}
@@ -0,0 +1,9 @@
package com.jero.meeting.valid.group;
/**
* 送站校验
* @author liJiaRao
* @date 2021-09-09 14:10
*/
public @interface DeliveryStation {
}
@@ -0,0 +1,9 @@
package com.jero.meeting.valid.group;
/**
* 用餐校验
* @author liJiaRao
* @date 2021-09-09 11:49
*/
public @interface HaveMeals {
}
@@ -0,0 +1,9 @@
package com.jero.meeting.valid.group;
/**
* 不需要打包
* @author liJiaRao
* @date 2021-09-09 9:57
*/
public @interface NotPack {
}
@@ -0,0 +1,9 @@
package com.jero.meeting.valid.group;
/**
* 接站校验
* @author liJiaRao
* @date 2021-09-09 13:50
*/
public @interface PickUp {
}
@@ -0,0 +1,9 @@
package com.jero.meeting.valid.group;
/**
* VIP校验
* @author liJiaRao
* @date 2021-09-09 14:28
*/
public @interface VIP {
}
@@ -1,20 +1,27 @@
package com.jero.meeting.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.meeting.valid.group.CheckInHotel;
import com.jero.meeting.valid.group.Guest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.*;
/**
* @author liJiaRao
* @date 2021-09-08 18:09
*/
@Data
public class CommonGuestVO extends MeetingEntity{
public class CommonGuestVO{
/**是否入住协议酒店*/
@Excel(name = "是否入住协议酒店", width = 15)
@ApiModelProperty(value = "是否入住协议酒店")
@Min(0)
@Max(1)
private Integer checkInHotel;
/**抵达时间*/
@@ -1,25 +1,23 @@
package com.jero.meeting.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.meeting.valid.group.CommonPeople;
import com.jero.meeting.valid.group.NotPack;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.*;
import java.math.BigDecimal;
/**
* @author liJiaRao
* @date 2021-09-08 17:59
*/
@Data
public class CommonPeopleVO extends CommonGuestVO{
public class CommonPeopleVO{
/**邮寄联系人*/
@Excel(name = "邮寄联系人", width = 15)
@ApiModelProperty(value = "邮寄联系人")
@NotBlank(message = "邮寄联系人不能为空",groups = NotPack.class)
private String postContactId;
/**
@@ -35,14 +33,15 @@ public class CommonPeopleVO extends CommonGuestVO{
private String postContactName;
/**邮寄联系人地址*/
@Excel(name = "邮寄联系人地址", width = 15)
@Excel(name = "地址", width = 15)
@ApiModelProperty(value = "邮寄联系人地址")
@NotBlank(message = "地址不能为空",groups = NotPack.class)
private String postContactAddress;
/**缴费方式*/
@Excel(name = "缴费方式", width = 15)
@ApiModelProperty(value = "缴费方式")
@NotNull(message = "缴费方式不能为空",groups = CommonPeople.class)
@NotNull(message = "缴费方式不能为空")
@Min(1)
@Max(3)
private Integer payMode;
@@ -0,0 +1,163 @@
package com.jero.meeting.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.meeting.valid.group.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.*;
/**
* @author liJiaRao
* @date 2021-09-09 11:47
*/
@Data
public class InternationalGuestVO {
/**嘉宾类型*/
@ApiModelProperty(value = "嘉宾类型")
@NotNull(message = "请选择嘉宾类型")
@Min(value = 1)
@Max(value = 4)
private Integer guestType;
/**演讲题目*/
@Excel(name = "演讲题目", width = 15)
@ApiModelProperty(value = "演讲题目")
@NotBlank(message = "演讲题目不能为空",groups = Guest.class)
@Size(max = 50, message = "演讲题目最大为50字符",groups = Guest.class)
private String speechTopic;
/**演讲ppt*/
@Excel(name = "演讲ppt", width = 15)
@ApiModelProperty(value = "演讲ppt")
@NotBlank(message = "演讲ppt不能为空",groups = Guest.class)
private String speechPpt;
/**照片*/
@Excel(name = "照片", width = 15)
@ApiModelProperty(value = "照片")
private String photo;
/**个人简介*/
@Excel(name = "个人简介", width = 15)
@ApiModelProperty(value = "个人简介")
@Size(max = 50, message = "个人简介最大为50字符")
private String profile;
/**是否用餐*/
@Excel(name = "是否用餐", width = 15)
@ApiModelProperty(value = "是否用餐")
@NotNull(message = "是否用餐不能为空")
@Min(0)
@Max(1)
private Integer haveMeals;
/**是否回民*/
@Excel(name = "是否回民", width = 15)
@ApiModelProperty(value = "是否回民")
@NotBlank(message = "是否回民不能为空",groups = HaveMeals.class)
@Min(value = 0,groups = HaveMeals.class)
@Max(value = 1,groups = HaveMeals.class)
private Integer huiPeople;
/**是否入住协议酒店*/
@Excel(name = "是否入住协议酒店", width = 15)
@ApiModelProperty(value = "是否入住协议酒店")
@NotBlank(message = "是否入住协议酒店不能为空",groups = VIP.class)
@Min(0)
@Max(1)
private Integer checkInHotel;
/**入住酒店时间*/
@Excel(name = "入住酒店时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "入住酒店时间")
@NotNull(message = "入住酒店时间不能为空",groups = CheckInHotel.class)
private java.util.Date inHotelTime;
/**离开酒店时间*/
@Excel(name = "离开酒店时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "离开酒店时间")
@NotNull(message = "离开酒店时间不能为空",groups = CheckInHotel.class)
private java.util.Date outHotelTime;
/**房型*/
@Excel(name = "房型", width = 15)
@ApiModelProperty(value = "房型")
@NotNull(message = "房型不能为空",groups = CheckInHotel.class)
private String roomLayout;
/**是否需要接站*/
@Excel(name = "是否需要接站", width = 15)
@ApiModelProperty(value = "是否需要接站")
@NotNull(message = "是否需要接站不能为空")
@Min(0)
@Max(1)
private Integer pickUp;
/**抵达时间*/
@Excel(name = "抵达时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "抵达时间")
@NotNull(message = "抵达时间不能为空",groups = PickUp.class)
//@FutureOrPresent(message = "抵达时间错误",groups = PickUp.class)
private java.util.Date arrivalTime;
/**到达站*/
@Excel(name = "到达站", width = 15)
@ApiModelProperty(value = "到达站")
@NotNull(message = "到达站不能为空",groups = PickUp.class)
private String destination;
/**到达班次*/
@Excel(name = "到达班次", width = 15)
@ApiModelProperty(value = "到达班次")
@NotNull(message = "到达班次不能为空",groups = PickUp.class)
private String arrivalShift;
/**是否需要送站*/
@Excel(name = "是否需要送站", width = 15)
@ApiModelProperty(value = "是否需要送站")
@NotNull(message = "是否需要送站不能为空")
@Min(0)
@Max(1)
private Integer deliveryStation;
/**离开时间*/
@Excel(name = "离开时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "离开时间")
@NotNull(message = "离开时间不能为空",groups = DeliveryStation.class)
private java.util.Date departureTime;
/**离开站*/
@Excel(name = "离开站", width = 15)
@ApiModelProperty(value = "离开站")
@Size(max = 50,message = "离开站最大为50字符",groups = DeliveryStation.class)
private String departureStation;
/**离开班次*/
@Excel(name = "离开班次", width = 15)
@ApiModelProperty(value = "离开班次")
@Size(max = 50,message = "离开班次最大为50字符",groups = DeliveryStation.class)
private String departureShift;
/**同行人*/
@Excel(name = "同行人", width = 15)
@ApiModelProperty(value = "同行人")
@Size(max = 50,message = "同行人最大为50字符")
private String peer;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
@Size(max = 50,message = "备注人最大为200字符")
private String remark;
}