update 参会人导出

This commit is contained in:
lijiarao
2021-09-22 16:41:34 +08:00
parent 4e3c0551c7
commit cba874ac79
11 changed files with 575 additions and 15 deletions
@@ -20,7 +20,6 @@ import com.jero.common.util.PasswordUtil;
import com.jero.common.util.ValidUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.data.entity.PayCaseCommittee;
import com.jero.data.entity.PayCaseCommitteeSubitem;
import com.jero.data.service.IPayCaseCommitteeService;
import com.jero.meeting.common.MeetingCommon;
import com.jero.meeting.entity.PayMeeting;
@@ -286,9 +285,9 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
break;
case MeetingCommon.OTHER_MEETING:
//保存数据
BaseExcel baseExcel = new BaseExcel();
BeanUtils.copyProperties(payMeetingVO, baseExcel);
exportList.add(baseExcel);
OtherMeetingExcel otherMeetingExcel = new OtherMeetingExcel();
BeanUtils.copyProperties(payMeetingVO, otherMeetingExcel);
exportList.add(otherMeetingExcel);
break;
case MeetingCommon.COMMITTEE_MEETING:
String caseCommitteeId = meeting.getCaseCommitteeId();
@@ -313,7 +312,7 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
classToExport = InternationalMeetingExcel.class;
break;
case MeetingCommon.OTHER_MEETING:
classToExport = BaseExcel.class;
classToExport = OtherMeetingExcel.class;
break;
case MeetingCommon.COMMITTEE_MEETING:
classToExport = CommitteeMeetingExcel.class;
@@ -1,24 +1,35 @@
package com.jero.meeting.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.jero.common.api.vo.Result;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.util.AuthenticationUtils;
import com.jero.common.util.PasswordUtil;
import com.jero.common.util.ValidUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.company.entity.PayCompanyManagement;
import com.jero.company.entity.PayContactsManagement;
import com.jero.company.service.IPayCompanyManagementService;
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.service.IPayMeetingSituationService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.meeting.vo.*;
import com.jero.meeting.vo.excel.*;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
@@ -41,6 +52,10 @@ public class PayMeetingSituationController extends JeroController<PayMeetingSitu
private IPayMeetingSituationService payMeetingSituationService;
@Resource
private AuthenticationUtils authenticationUtils;
@Resource
private IPayContactsManagementService contactsManagementService;
@Resource
private IPayCompanyManagementService companyManagementService;
/**
* 分页列表查询
*/
@@ -64,9 +79,9 @@ public class PayMeetingSituationController extends JeroController<PayMeetingSitu
@ApiOperation(value = "合同查询未关联参会人列表", notes = "合同查询未关联参会人列表")
@GetMapping(value = "/contractPage")
public Result<?> contractPage(MeetingSituationContractVO meetingSituationContractVO,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Page<MeetingSituationContractVO> page = new Page<>(pageNo, pageSize);
IPage<MeetingSituationContractVO> pageList = payMeetingSituationService.contractPage(page, meetingSituationContractVO);
return Result.OK(pageList);
@@ -79,12 +94,12 @@ public class PayMeetingSituationController extends JeroController<PayMeetingSitu
@ApiOperation(value = "参会人员信息-分页列表查询", notes = "参会人员信息-分页列表查询")
@GetMapping(value = "/page2")
public Result<?> queryPageList2(PayMeetingSituation payMeetingSituation,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
String publicKey = req.getParameter("publicKey");
String token = req.getParameter("token");
authenticationUtils.check(token,publicKey);
authenticationUtils.check(token, publicKey);
QueryWrapper<PayMeetingSituation> queryWrapper = QueryGenerator.initQueryWrapper(payMeetingSituation, req.getParameterMap());
Page<PayMeetingSituation> page = new Page<>(pageNo, pageSize);
IPage<PayMeetingSituation> pageList = payMeetingSituationService.page(page, queryWrapper);
@@ -194,7 +209,84 @@ public class PayMeetingSituationController extends JeroController<PayMeetingSitu
*/
@GetMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PayMeetingSituation payMeetingSituation) {
return super.exportXls(request, payMeetingSituation, PayMeetingSituation.class, "参会人员信息");
QueryWrapper<PayMeetingSituation> queryWrapper = QueryGenerator.initQueryWrapper(payMeetingSituation, request.getParameterMap());
List<PayMeetingSituation> pageList = payMeetingSituationService.list(queryWrapper);
// 过滤选中数据
String selections = request.getParameter("selections");
if (oConvertUtils.isNotEmpty(selections)) {
List<String> selectionList = Arrays.asList(selections.split(","));
pageList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
}
if (pageList.isEmpty()) {
throw new JeroBootException("没有数据");
}
String meetingType = payMeetingSituationService.getMeetingType(payMeetingSituation);
List<Object> exportList = new ArrayList<>();
for (PayMeetingSituation meetingSituation : pageList) {
String companyContactId = meetingSituation.getCompanyContactId();
PayContactsManagement contactsManagement = contactsManagementService.getById(companyContactId);
meetingSituation.setCompanyContactName(contactsManagement.getName());
meetingSituation.setPost(contactsManagement.getPost());
meetingSituation.setPhone(PasswordUtil.decrypt(contactsManagement.getPhone()));
meetingSituation.setEmail(PasswordUtil.decrypt(contactsManagement.getEmail()));
PayCompanyManagement companyManagement = companyManagementService.getById(contactsManagement.getCompanyId());
meetingSituation.setCompanyName(companyManagement.getCompanyName());
switch (meetingType) {
case MeetingCommon.STANDARD_MEETING:
//保存数据
StandardsSituationExcel standardsSituationExcel = new StandardsSituationExcel();
BeanUtils.copyProperties(meetingSituation, standardsSituationExcel);
exportList.add(standardsSituationExcel);
// 工作组项目查询工作组项目名
break;
case MeetingCommon.WORKING_GROUP_MEETING:
//保存数据
WorkingGroupSituationExcel workingGroupSituationExcel = new WorkingGroupSituationExcel();
BeanUtils.copyProperties(meetingSituation, workingGroupSituationExcel);
exportList.add(workingGroupSituationExcel);
break;
case MeetingCommon.INTERNATIONAL_MEETING:
//保存数据
InternationalSituationExcel internationalSituationExcel = new InternationalSituationExcel();
BeanUtils.copyProperties(meetingSituation, internationalSituationExcel);
exportList.add(internationalSituationExcel);
break;
case MeetingCommon.OTHER_MEETING:
//保存数据
SituationExcel situationExcel = new SituationExcel();
BeanUtils.copyProperties(meetingSituation, situationExcel);
exportList.add(situationExcel);
break;
case MeetingCommon.COMMITTEE_MEETING:
//保存数据
CommitteeSituationExcel committeeSituationExcel = new CommitteeSituationExcel();
BeanUtils.copyProperties(meetingSituation, committeeSituationExcel);
exportList.add(committeeSituationExcel);
break;
}
}
Class<?> classToExport = null;
switch (meetingType) {
case MeetingCommon.WORKING_GROUP_MEETING:
classToExport = WorkingGroupSituationExcel.class;
break;
case MeetingCommon.STANDARD_MEETING:
classToExport = StandardsSituationExcel.class;
break;
case MeetingCommon.INTERNATIONAL_MEETING:
classToExport = InternationalSituationExcel.class;
break;
case MeetingCommon.OTHER_MEETING:
classToExport = SituationExcel.class;
break;
case MeetingCommon.COMMITTEE_MEETING:
classToExport = CommitteeSituationExcel.class;
break;
}
return super.exportListXls(exportList, classToExport, "参会人员信息");
}
@@ -264,6 +264,11 @@ public class PayMeetingSituation implements Serializable {
@ApiModelProperty(value = "邮寄联系人地址")
private String postContactAddress;
/**邮编*/
@Excel(name = "邮编", width = 15)
@ApiModelProperty(value = "邮编")
private String postCode;
/**缴费方式*/
@Excel(name = "缴费方式", width = 15,dicCode = "meeting_pay_type")
@ApiModelProperty(value = "缴费方式")
@@ -62,4 +62,5 @@ public interface IPayMeetingSituationService extends IService<PayMeetingSituatio
void signIn(SignInVO signInVO);
String getMeetingType(PayMeetingSituation payMeetingSituation);
}
@@ -353,6 +353,13 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
saveOrUpdate(meetingSituation);
}
@Override
public String getMeetingType(PayMeetingSituation payMeetingSituation) {
String meetingId = payMeetingSituation.getMeetingId();
PayMeeting payMeeting = meetingService.getById(meetingId);
return payMeeting.getMeetingType().toString();
}
/**
* 更新
*/
@@ -487,6 +494,7 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
payMeetingSituation1.setPostContactId(postContact.getId());
payMeetingSituation1.setPostContactName(postContact.getName());
payMeetingSituation1.setPostContactAddress(payMeetingSituation.getPostContactAddress());
payMeetingSituation1.setPostCode(payMeetingSituation.getPostCode());
} else {
throw new JeroBootException("邮寄联系人不是所选企业的企业联系人");
}
@@ -0,0 +1,79 @@
package com.jero.meeting.vo.excel;
import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @author liJiaRao
* @date 2021-09-22 15:39
*/
@Data
public class CommitteeSituationExcel {
/**会议id*/
@Excel(name = "会议名称", width = 15,dictTable = "pay_meeting",dicCode = "id",dicText = "meeting_name")
private String meetingId;
/**企业id*/
@Excel(name = "企业名称", width = 15)
private String companyName;
/**企业联系人id*/
@Excel(name = "企业联系人名称", width = 15)
private String companyContactName;
/**职务*/
@Excel(name = "职务", width = 15)
private String post;
/**手机号*/
@Excel(name = "手机号", width = 15)
private String phone;
/**邮箱*/
@Excel(name = "邮箱", width = 15)
private String email;
/**身份*/
@Dict(dicCode = "meet_identify_type")
@Excel(name = "身份", width = 15,dicCode = "meet_identify_type")
private Integer identity;
/**是否入住协议酒店*/
@Excel(name = "是否入住酒店", width = 15,dicCode = "yn")
private Integer checkInHotel;
/**抵达时间*/
@Excel(name = "抵达时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date arrivalTime;
/**离开时间*/
@Excel(name = "离开时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date departureTime;
/**邮寄联系人*/
@Excel(name = "邮寄联系人", width = 15, dictTable = "pay_contacts_management", dicText = "name", dicCode = "id")
private String postContactId;
/**邮寄联系人地址*/
@Excel(name = "邮寄联系人地址", width = 15)
private String postContactAddress;
/**邮编*/
@Excel(name = "邮编", width = 15)
private String postCode;
/**缴费方式*/
@Excel(name = "缴费方式", width = 15,dicCode = "meeting_pay_type")
private Integer payMode;
/**需要发票*/
@Excel(name = "需要发票", width = 15,dicCode = "invoice_type")
private Integer needInvoice;
/**订单后4位编码*/
@Excel(name = "订单后4位编码", width = 15)
private String orderCode;
}
@@ -0,0 +1,139 @@
package com.jero.meeting.vo.excel;
import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @author liJiaRao
* @date 2021-09-22 15:39
*/
@Data
public class InternationalSituationExcel {
/**会议id*/
@Excel(name = "会议名称", width = 15,dictTable = "pay_meeting",dicCode = "id",dicText = "meeting_name")
private String meetingId;
/**企业id*/
@Excel(name = "企业名称", width = 15)
private String companyName;
/**企业联系人id*/
@Excel(name = "企业联系人名称", width = 15)
private String companyContactName;
/**职务*/
@Excel(name = "职务", width = 15)
private String post;
/**手机号*/
@Excel(name = "手机号", width = 15)
private String phone;
/**邮箱*/
@Excel(name = "邮箱", width = 15)
private String email;
/**身份*/
@Dict(dicCode = "meet_identify_type")
@Excel(name = "身份", width = 15,dicCode = "meet_identify_type")
private Integer identity;
/**嘉宾类型*/
@Excel(name = "嘉宾类型", width = 15,dicCode = "guest_type")
private Integer guestType;
/**演讲题目*/
@Excel(name = "演讲题目", width = 15)
private String speechTopic;
/**个人简介*/
@Excel(name = "个人简介", width = 15)
private String profile;
/**是否用餐*/
@Excel(name = "是否用餐", width = 15,dicCode = "yn")
private Integer haveMeals;
/**是否回民*/
@Excel(name = "是否回民", width = 15,dicCode = "yn")
private Integer huiPeople;
/**是否入住协议酒店*/
@Excel(name = "是否入住协议酒店", width = 15,dicCode = "yn")
private Integer checkInHotel;
/**入住酒店时间*/
@Excel(name = "入住酒店时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date inHotelTime;
/**离开酒店时间*/
@Excel(name = "离开酒店时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date outHotelTime;
/**房型*/
@Excel(name = "房型", width = 15)
private String roomLayout;
/**是否需要接站*/
@Excel(name = "是否需要接站", width = 15,dicCode = "yn")
private Integer pickUp;
/**抵达时间*/
@Excel(name = "抵达时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date arrivalTime;
/**到达站*/
@Excel(name = "到达站", width = 15)
private String destination;
/**到达班次*/
@Excel(name = "到达班次", width = 15)
private String arrivalShift;
/**是否需要送站*/
@Excel(name = "是否需要送站", width = 15,dicCode = "yn")
private Integer deliveryStation;
/**离开时间*/
@Excel(name = "离开时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date departureTime;
/**离开站*/
@Excel(name = "离开站", width = 15)
private String departureStation;
/**离开班次*/
@Excel(name = "离开班次", width = 15)
private String departureShift;
/**同行人*/
@Excel(name = "同行人", width = 15)
private String peer;
/**备注*/
@Excel(name = "备注", width = 15)
private String remark;
/**邮寄联系人*/
@Excel(name = "邮寄联系人", width = 15, dictTable = "pay_contacts_management", dicText = "name", dicCode = "id")
private String postContactId;
/**邮寄联系人地址*/
@Excel(name = "邮寄联系人地址", width = 15)
private String postContactAddress;
/**缴费方式*/
@Excel(name = "缴费方式", width = 15,dicCode = "meeting_pay_type")
private Integer payMode;
/**需要发票*/
@Excel(name = "需要发票", width = 15,dicCode = "invoice_type")
private Integer needInvoice;
/**订单后4位编码*/
@Excel(name = "订单后4位编码", width = 15)
private String orderCode;
}
@@ -10,7 +10,7 @@ import java.math.BigDecimal;
* @date 2021-09-22 14:02
*/
@Data
public class BaseExcel {
public class OtherMeetingExcel {
/**会议名称*/
@Excel(name = "会议名称", width = 15)
private String meetingName;
@@ -0,0 +1,79 @@
package com.jero.meeting.vo.excel;
import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @author liJiaRao
* @date 2021-09-22 15:39
*/
@Data
public class SituationExcel {
/**会议id*/
@Excel(name = "会议名称", width = 15,dictTable = "pay_meeting",dicCode = "id",dicText = "meeting_name")
private String meetingId;
/**企业id*/
@Excel(name = "企业名称", width = 15)
private String companyName;
/**企业联系人id*/
@Excel(name = "企业联系人名称", width = 15)
private String companyContactName;
/**职务*/
@Excel(name = "职务", width = 15)
private String post;
/**手机号*/
@Excel(name = "手机号", width = 15)
private String phone;
/**邮箱*/
@Excel(name = "邮箱", width = 15)
private String email;
/**身份*/
@Dict(dicCode = "meet_identify_type")
@Excel(name = "身份", width = 15,dicCode = "meet_identify_type")
private Integer identity;
/**是否入住协议酒店*/
@Excel(name = "是否入住酒店", width = 15,dicCode = "yn")
private Integer checkInHotel;
/**抵达时间*/
@Excel(name = "抵达时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date arrivalTime;
/**离开时间*/
@Excel(name = "离开时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date departureTime;
/**邮寄联系人*/
@Excel(name = "邮寄联系人", width = 15, dictTable = "pay_contacts_management", dicText = "name", dicCode = "id")
private String postContactId;
/**邮寄联系人地址*/
@Excel(name = "邮寄联系人地址", width = 15)
private String postContactAddress;
/**邮编*/
@Excel(name = "邮编", width = 15)
private String postCode;
/**缴费方式*/
@Excel(name = "缴费方式", width = 15,dicCode = "meeting_pay_type")
private Integer payMode;
/**需要发票*/
@Excel(name = "需要发票", width = 15,dicCode = "invoice_type")
private Integer needInvoice;
/**订单后4位编码*/
@Excel(name = "订单后4位编码", width = 15)
private String orderCode;
}
@@ -0,0 +1,79 @@
package com.jero.meeting.vo.excel;
import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @author liJiaRao
* @date 2021-09-22 15:40
*/
@Data
public class StandardsSituationExcel {
/**会议id*/
@Excel(name = "会议名称", width = 15,dictTable = "pay_meeting",dicCode = "id",dicText = "meeting_name")
private String meetingId;
/**企业id*/
@Excel(name = "企业名称", width = 15)
private String companyName;
/**企业联系人id*/
@Excel(name = "企业联系人名称", width = 15)
private String companyContactName;
/**职务*/
@Excel(name = "职务", width = 15)
private String post;
/**手机号*/
@Excel(name = "手机号", width = 15)
private String phone;
/**邮箱*/
@Excel(name = "邮箱", width = 15)
private String email;
/**身份*/
@Dict(dicCode = "meet_identify_type")
@Excel(name = "身份", width = 15,dicCode = "meet_identify_type")
private Integer identity;
/**是否入住协议酒店*/
@Excel(name = "是否入住酒店", width = 15,dicCode = "yn")
private Integer checkInHotel;
/**抵达时间*/
@Excel(name = "抵达时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date arrivalTime;
/**离开时间*/
@Excel(name = "离开时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date departureTime;
/**邮寄联系人*/
@Excel(name = "邮寄联系人", width = 15, dictTable = "pay_contacts_management", dicText = "name", dicCode = "id")
private String postContactId;
/**邮寄联系人地址*/
@Excel(name = "邮寄联系人地址", width = 15)
private String postContactAddress;
/**邮编*/
@Excel(name = "邮编", width = 15)
private String postCode;
/**缴费方式*/
@Excel(name = "缴费方式", width = 15,dicCode = "meeting_pay_type")
private Integer payMode;
/**需要发票*/
@Excel(name = "需要发票", width = 15,dicCode = "invoice_type")
private Integer needInvoice;
/**订单后4位编码*/
@Excel(name = "订单后4位编码", width = 15)
private String orderCode;
}
@@ -0,0 +1,79 @@
package com.jero.meeting.vo.excel;
import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @author liJiaRao
* @date 2021-09-22 15:40
*/
@Data
public class WorkingGroupSituationExcel {
/**会议id*/
@Excel(name = "会议名称", width = 15,dictTable = "pay_meeting",dicCode = "id",dicText = "meeting_name")
private String meetingId;
/**企业id*/
@Excel(name = "企业名称", width = 15)
private String companyName;
/**企业联系人id*/
@Excel(name = "企业联系人名称", width = 15)
private String companyContactName;
/**职务*/
@Excel(name = "职务", width = 15)
private String post;
/**手机号*/
@Excel(name = "手机号", width = 15)
private String phone;
/**邮箱*/
@Excel(name = "邮箱", width = 15)
private String email;
/**身份*/
@Dict(dicCode = "meet_identify_type")
@Excel(name = "身份", width = 15,dicCode = "meet_identify_type")
private Integer identity;
/**是否入住协议酒店*/
@Excel(name = "是否入住酒店", width = 15,dicCode = "yn")
private Integer checkInHotel;
/**抵达时间*/
@Excel(name = "抵达时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date arrivalTime;
/**离开时间*/
@Excel(name = "离开时间", width = 20, format = "yyyy-MM-dd")
private java.util.Date departureTime;
/**邮寄联系人*/
@Excel(name = "邮寄联系人", width = 15, dictTable = "pay_contacts_management", dicText = "name", dicCode = "id")
private String postContactId;
/**邮寄联系人地址*/
@Excel(name = "邮寄联系人地址", width = 15)
private String postContactAddress;
/**邮编*/
@Excel(name = "邮编", width = 15)
private String postCode;
/**缴费方式*/
@Excel(name = "缴费方式", width = 15,dicCode = "meeting_pay_type")
private Integer payMode;
/**需要发票*/
@Excel(name = "需要发票", width = 15,dicCode = "invoice_type")
private Integer needInvoice;
/**订单后4位编码*/
@Excel(name = "订单后4位编码", width = 15)
private String orderCode;
}