add 会议管理导出
This commit is contained in:
+6
-9
@@ -85,17 +85,14 @@ public class JeroController<T, S extends IService<T>> {
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
protected ModelAndView exportListXls(List<T> object, Class<T> clazz, String title) {
|
||||
protected ModelAndView exportListXls(List<?> object, Class<?> clazz, String title) {
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
|
||||
//此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, title);
|
||||
mv.addObject(NormalExcelConstants.CLASS, clazz);
|
||||
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
||||
ExportParams exportParams=new ExportParams(title, title);
|
||||
exportParams.setImageBasePath(upLoadPath);
|
||||
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
||||
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, null);
|
||||
mv.addObject(NormalExcelConstants.PARAMS,new ExportParams(title, title));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, object);
|
||||
return mv;
|
||||
}
|
||||
|
||||
@@ -167,7 +164,7 @@ public class JeroController<T, S extends IService<T>> {
|
||||
/**
|
||||
* 导出Excel模板
|
||||
*/
|
||||
public ModelAndView exportTemplate(Class<T> exportClass, String title) {
|
||||
public ModelAndView exportTemplate(Class<?> exportClass, String title) {
|
||||
// AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
//此处设置的filename无效 ,前端会重更新设置一下
|
||||
|
||||
+207
-127
@@ -1,7 +1,10 @@
|
||||
package com.jero.meeting.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -14,6 +17,7 @@ import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.util.ValidUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.meeting.common.MeetingCommon;
|
||||
import com.jero.meeting.entity.PayMeeting;
|
||||
import com.jero.meeting.entity.PayMeetingHotelContacts;
|
||||
@@ -24,8 +28,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.meeting.vo.PayMeetingVO;
|
||||
import com.jero.modules.system.volid.group.UpdateGroup;
|
||||
import com.jero.project.entity.PayWorkingGroup;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
@@ -34,160 +45,229 @@ import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @description: 会议管理
|
||||
* @author: jero-boot
|
||||
* @date: 2021-09-02
|
||||
* @date: 2021-09-02
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Api(tags="会议管理")
|
||||
@Api(tags = "会议管理")
|
||||
@RestController
|
||||
@RequestMapping("/meeting/payMeeting")
|
||||
@Slf4j
|
||||
public class PayMeetingController extends JeroController<PayMeeting, IPayMeetingService> {
|
||||
@Resource
|
||||
private IPayMeetingService payMeetingService;
|
||||
@Resource
|
||||
private ISysBaseAPI sysBaseApi;
|
||||
@Resource
|
||||
private IPayMeetingHotelContactsService meetingHotelContactsService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*/
|
||||
@AutoLog(value = "会议管理-分页列表查询")
|
||||
@ApiOperation(value="会议管理-分页列表查询", notes="会议管理-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(PayMeeting payMeeting,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<PayMeeting> queryWrapper = QueryGenerator.initQueryWrapper(payMeeting, req.getParameterMap());
|
||||
Page<PayMeeting> page = new Page<>(pageNo, pageSize);
|
||||
IPage<PayMeeting> pageList = payMeetingService.page(page, queryWrapper);
|
||||
for (PayMeeting meeting : pageList.getRecords()) {
|
||||
//查询会议负责人
|
||||
LoginUser user = sysBaseApi.getUserById(meeting.getDirectorId());
|
||||
meeting.setDirectorName(user.getUsername());
|
||||
meeting.setDirectorPhone(PasswordUtil.decrypt(user.getPhone()));
|
||||
PayMeetingVO payMeetingVO = new PayMeetingVO();
|
||||
BeanUtils.copyProperties(payMeetingVO,payMeeting);
|
||||
//查询酒店联系人列表
|
||||
if (meeting.getMeetingType().equals(Integer.parseInt(MeetingCommon.STANDARD_MEETING))) {
|
||||
LambdaQueryWrapper<PayMeetingHotelContacts> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PayMeetingHotelContacts::getMeetingId,meeting.getId());
|
||||
List<PayMeetingHotelContacts> payMeetingHotelContactsList = meetingHotelContactsService.list(wrapper);
|
||||
meeting.setHotelContactsList(payMeetingHotelContactsList);
|
||||
}
|
||||
}
|
||||
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
@Resource
|
||||
private IPayMeetingService payMeetingService;
|
||||
@Resource
|
||||
private ISysBaseAPI sysBaseApi;
|
||||
@Resource
|
||||
private IPayMeetingHotelContactsService meetingHotelContactsService;
|
||||
@Resource
|
||||
private IPayWorkingGroupService payWorkingGroupService;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@AutoLog(value = "会议管理-列表查询")
|
||||
@ApiOperation(value="会议管理-列表查询", notes="会议管理-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<PayMeeting>> queryList() {
|
||||
* 分页列表查询
|
||||
*/
|
||||
@AutoLog(value = "会议管理-分页列表查询")
|
||||
@ApiOperation(value = "会议管理-分页列表查询", notes = "会议管理-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(PayMeeting payMeeting,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<PayMeeting> queryWrapper = QueryGenerator.initQueryWrapper(payMeeting, req.getParameterMap());
|
||||
Page<PayMeeting> page = new Page<>(pageNo, pageSize);
|
||||
IPage<PayMeeting> pageList = payMeetingService.page(page, queryWrapper);
|
||||
for (PayMeeting meeting : pageList.getRecords()) {
|
||||
//查询会议负责人
|
||||
LoginUser user = sysBaseApi.getUserById(meeting.getDirectorId());
|
||||
meeting.setDirectorName(user.getUsername());
|
||||
meeting.setDirectorPhone(PasswordUtil.decrypt(user.getPhone()));
|
||||
PayMeetingVO payMeetingVO = new PayMeetingVO();
|
||||
BeanUtils.copyProperties(payMeetingVO, payMeeting);
|
||||
//查询酒店联系人列表
|
||||
if (meeting.getMeetingType().equals(Integer.parseInt(MeetingCommon.STANDARD_MEETING))) {
|
||||
LambdaQueryWrapper<PayMeetingHotelContacts> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PayMeetingHotelContacts::getMeetingId, meeting.getId());
|
||||
List<PayMeetingHotelContacts> payMeetingHotelContactsList = meetingHotelContactsService.list(wrapper);
|
||||
meeting.setHotelContactsList(payMeetingHotelContactsList);
|
||||
}
|
||||
}
|
||||
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@AutoLog(value = "会议管理-列表查询")
|
||||
@ApiOperation(value = "会议管理-列表查询", notes = "会议管理-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<PayMeeting>> queryList() {
|
||||
List<PayMeeting> list = payMeetingService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@AutoLog(value = "会议管理-添加")
|
||||
@ApiOperation(value="会议管理-添加", notes="会议管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PayMeetingVO payMeetingVO) {
|
||||
ValidUtil.validate(payMeetingVO);
|
||||
payMeetingService.add(payMeetingVO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
@AutoLog(value = "会议管理-编辑")
|
||||
@ApiOperation(value="会议管理-编辑", notes="会议管理-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody PayMeetingVO payMeetingVO) {
|
||||
ValidUtil.validate(payMeetingVO, UpdateGroup.class);
|
||||
payMeetingService.editById(payMeetingVO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@AutoLog(value = "会议管理-通过id删除")
|
||||
@ApiOperation(value="会议管理-通过id删除", notes="会议管理-通过id删除")
|
||||
@GetMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id") String id) {
|
||||
payMeetingService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@AutoLog(value = "会议管理-批量删除")
|
||||
@ApiOperation(value="会议管理-批量删除", notes="会议管理-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids") String ids) {
|
||||
this.payMeetingService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*/
|
||||
@AutoLog(value = "会议管理-通过id查询")
|
||||
@ApiOperation(value="会议管理-通过id查询", notes="会议管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id") String id) {
|
||||
PayMeeting payMeeting = payMeetingService.queryById(id);
|
||||
if(payMeeting==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
//查询会议负责人
|
||||
LoginUser user = sysBaseApi.getUserById(payMeeting.getDirectorId());
|
||||
payMeeting.setDirectorName(user.getUsername());
|
||||
payMeeting.setDirectorPhone(PasswordUtil.decrypt(user.getPhone()));
|
||||
PayMeetingVO payMeetingVO = new PayMeetingVO();
|
||||
BeanUtils.copyProperties(payMeetingVO,payMeeting);
|
||||
//查询酒店联系人列表
|
||||
LambdaQueryWrapper<PayMeetingHotelContacts> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PayMeetingHotelContacts::getMeetingId,payMeeting.getId());
|
||||
List<PayMeetingHotelContacts> payMeetingHotelContactsList = meetingHotelContactsService.list(wrapper);
|
||||
payMeeting.setHotelContactsList(payMeetingHotelContactsList);
|
||||
return Result.OK(payMeeting);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*/
|
||||
* 添加
|
||||
*/
|
||||
@AutoLog(value = "会议管理-添加")
|
||||
@ApiOperation(value = "会议管理-添加", notes = "会议管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PayMeetingVO payMeetingVO) {
|
||||
ValidUtil.validate(payMeetingVO);
|
||||
payMeetingService.add(payMeetingVO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
@AutoLog(value = "会议管理-编辑")
|
||||
@ApiOperation(value = "会议管理-编辑", notes = "会议管理-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody PayMeetingVO payMeetingVO) {
|
||||
ValidUtil.validate(payMeetingVO, UpdateGroup.class);
|
||||
payMeetingService.editById(payMeetingVO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@AutoLog(value = "会议管理-通过id删除")
|
||||
@ApiOperation(value = "会议管理-通过id删除", notes = "会议管理-通过id删除")
|
||||
@GetMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name = "id") String id) {
|
||||
payMeetingService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@AutoLog(value = "会议管理-批量删除")
|
||||
@ApiOperation(value = "会议管理-批量删除", notes = "会议管理-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
this.payMeetingService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*/
|
||||
@AutoLog(value = "会议管理-通过id查询")
|
||||
@ApiOperation(value = "会议管理-通过id查询", notes = "会议管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name = "id") String id) {
|
||||
PayMeeting meeting = payMeetingService.queryById(id);
|
||||
if (meeting == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
//查询会议负责人
|
||||
LoginUser user = sysBaseApi.getUserById(meeting.getDirectorId());
|
||||
meeting.setDirectorName(user.getUsername());
|
||||
meeting.setDirectorPhone(PasswordUtil.decrypt(user.getPhone()));
|
||||
PayMeetingVO payMeetingVO = new PayMeetingVO();
|
||||
BeanUtils.copyProperties(meeting, payMeetingVO);
|
||||
String meetingType = meeting.getMeetingType().toString();
|
||||
//String meetingType1 = sysBaseApi.translateDict("meeting_type", meetingType);
|
||||
payMeetingVO.setMeetingType(meetingType);
|
||||
payMeetingVO.setTbMeetingType(meeting.getMeetingType().toString());
|
||||
//payMeetingVO.setHotelContactsList(new ArrayList<>());
|
||||
//标协会议查询酒店联系人列表
|
||||
if (meetingType.equals(MeetingCommon.STANDARD_MEETING)) {
|
||||
LambdaQueryWrapper<PayMeetingHotelContacts> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PayMeetingHotelContacts::getMeetingId, meeting.getId());
|
||||
List<PayMeetingHotelContacts> payMeetingHotelContactsList = meetingHotelContactsService.list(wrapper);
|
||||
payMeetingVO.setHotelContactsList(payMeetingHotelContactsList);
|
||||
//标协会议类型
|
||||
//String tbMeetingType = meeting.getTbMeetingType().toString();
|
||||
//String type = sysBaseApi.translateDict("standard_meeting_type", tbMeetingType);
|
||||
//payMeetingVO.setTbMeetingType(type);
|
||||
// 工作组项目查询工作组项目名
|
||||
} else if (meetingType.equals(MeetingCommon.WORKING_GROUP_MEETING)) {
|
||||
String workingGroupId = meeting.getWorkingGroupId();
|
||||
PayWorkingGroup workingGroup = payWorkingGroupService.getById(workingGroupId);
|
||||
payMeetingVO.setWorkingGroupName(workingGroup.getWorkingGroupProject());
|
||||
}
|
||||
return Result.OK(payMeetingVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*/
|
||||
@GetMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, PayMeeting payMeeting) {
|
||||
return super.exportXls(request, payMeeting, PayMeeting.class, "会议管理");
|
||||
QueryWrapper<PayMeeting> queryWrapper = QueryGenerator.initQueryWrapper(payMeeting, request.getParameterMap());
|
||||
List<PayMeeting> pageList = payMeetingService.list(queryWrapper);
|
||||
List<PayMeetingVO> exportList = new ArrayList<>();
|
||||
// 过滤选中数据
|
||||
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());
|
||||
}
|
||||
for (PayMeeting meeting : pageList) {
|
||||
//查询会议负责人
|
||||
LoginUser user = sysBaseApi.getUserById(meeting.getDirectorId());
|
||||
meeting.setDirectorName(user.getUsername());
|
||||
meeting.setDirectorPhone(PasswordUtil.decrypt(user.getPhone()));
|
||||
PayMeetingVO payMeetingVO = new PayMeetingVO();
|
||||
BeanUtils.copyProperties(meeting, payMeetingVO);
|
||||
String meetingType = meeting.getMeetingType().toString();
|
||||
String meetingType1 = sysBaseApi.translateDict("meeting_type", meetingType);
|
||||
payMeetingVO.setMeetingType(meetingType1);
|
||||
payMeetingVO.setHotelContactsList(new ArrayList<>());
|
||||
//标协会议查询酒店联系人列表
|
||||
if (meetingType.equals(MeetingCommon.STANDARD_MEETING)) {
|
||||
LambdaQueryWrapper<PayMeetingHotelContacts> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PayMeetingHotelContacts::getMeetingId, meeting.getId());
|
||||
List<PayMeetingHotelContacts> payMeetingHotelContactsList = meetingHotelContactsService.list(wrapper);
|
||||
payMeetingVO.setHotelContactsList(payMeetingHotelContactsList);
|
||||
//标协会议类型
|
||||
String tbMeetingType = meeting.getTbMeetingType().toString();
|
||||
String type = sysBaseApi.translateDict("standard_meeting_type", tbMeetingType);
|
||||
payMeetingVO.setTbMeetingType(type);
|
||||
// 工作组项目查询工作组项目名
|
||||
} else if (meetingType.equals(MeetingCommon.WORKING_GROUP_MEETING)) {
|
||||
String workingGroupId = meeting.getWorkingGroupId();
|
||||
PayWorkingGroup workingGroup = payWorkingGroupService.getById(workingGroupId);
|
||||
payMeetingVO.setWorkingGroupName(workingGroup.getWorkingGroupProject());
|
||||
}
|
||||
exportList.add(payMeetingVO);
|
||||
}
|
||||
return super.exportListXls(exportList, PayMeetingVO.class, "会议管理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel模板
|
||||
*/
|
||||
* 导出excel模板
|
||||
*/
|
||||
@GetMapping(value = "/exportTemplate")
|
||||
public ModelAndView exportTemplate() {
|
||||
return super.exportTemplate(PayMeeting.class, "会议管理");
|
||||
return super.exportTemplate(PayMeetingVO.class, "会议管理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*/
|
||||
* 通过excel导入数据
|
||||
*/
|
||||
@PostMapping(value = "/importExcel")
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, PayMeeting.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对象ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getId(PayMeeting item) {
|
||||
try {
|
||||
return PropertyUtils.getProperty(item, "id").toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -35,7 +35,6 @@ public class PayMeetingHotelContacts implements Serializable {
|
||||
private String id;
|
||||
|
||||
/**会议id*/
|
||||
@Excel(name = "会议id", width = 15)
|
||||
@ApiModelProperty(value = "会议id")
|
||||
private String meetingId;
|
||||
|
||||
|
||||
+54
-34
@@ -16,6 +16,8 @@ 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 com.jero.project.entity.PayWorkingGroup;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
import org.apache.shiro.util.CollectionUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -23,6 +25,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
@@ -42,7 +45,8 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
|
||||
private ISysBaseAPI sysBaseApi;
|
||||
@Resource
|
||||
private IPayMeetingHotelContactsService meetingHotelContactsService;
|
||||
|
||||
@Resource
|
||||
private IPayWorkingGroupService payWorkingGroupService;
|
||||
/**
|
||||
* 新增会议
|
||||
*/
|
||||
@@ -118,39 +122,55 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
|
||||
}
|
||||
|
||||
//根据会议类型进行校验
|
||||
if (meetingType.equals(MeetingCommon.WORKING_GROUP_MEETING)){
|
||||
ValidUtil.validate(payMeetingVO, WorkingGroupMeeting.class);
|
||||
}else if (meetingType.equals(MeetingCommon.STANDARD_MEETING)){
|
||||
ValidUtil.validate(payMeetingVO, StandardMeeting.class);
|
||||
hotelContactsList = payMeetingVO.getHotelContactsList();
|
||||
for (PayMeetingHotelContacts hotelContacts : hotelContactsList) {
|
||||
ValidUtil.validate(hotelContacts, StandardMeeting.class);
|
||||
}
|
||||
}else if (meetingType.equals(MeetingCommon.INTERNATIONAL_MEETING)){
|
||||
ValidUtil.validate(payMeetingVO, InternationalMeeting.class);
|
||||
//邀请码不能有重复的
|
||||
List<String> codeList = new ArrayList<>();
|
||||
//VIP邀请码
|
||||
String vipInvitationCode = payMeetingVO.getVipInvitationCode();
|
||||
codeList.add(vipInvitationCode);
|
||||
//演讲嘉宾邀请码
|
||||
String speakerInvitationCode = payMeetingVO.getSpeakerInvitationCode();
|
||||
if (codeList.contains(speakerInvitationCode)) {
|
||||
throw new JeroBootException("邀请码不能重复");
|
||||
}
|
||||
codeList.add(speakerInvitationCode);
|
||||
//特邀嘉宾邀请码
|
||||
String guestInvitationCode = payMeetingVO.getGuestInvitationCode();
|
||||
if (codeList.contains(guestInvitationCode)) {
|
||||
throw new JeroBootException("邀请码不能重复");
|
||||
}
|
||||
codeList.add(guestInvitationCode);
|
||||
//合作伙伴邀请码
|
||||
String cooperativeInvitationCode = payMeetingVO.getCooperativeInvitationCode();
|
||||
if (codeList.contains(cooperativeInvitationCode)) {
|
||||
throw new JeroBootException("邀请码不能重复");
|
||||
}
|
||||
codeList.add(cooperativeInvitationCode);
|
||||
switch (meetingType) {
|
||||
case MeetingCommon.WORKING_GROUP_MEETING:
|
||||
ValidUtil.validate(payMeetingVO, WorkingGroupMeeting.class);
|
||||
String workingGroupId = payMeetingVO.getWorkingGroupId();
|
||||
PayWorkingGroup workingGroup = payWorkingGroupService.getById(workingGroupId);
|
||||
if (workingGroup == null){
|
||||
throw new JeroBootException("工作组项目不存在");
|
||||
}
|
||||
break;
|
||||
case MeetingCommon.STANDARD_MEETING:
|
||||
ValidUtil.validate(payMeetingVO, StandardMeeting.class);
|
||||
//标协会议类型
|
||||
Map<String, String> standardMeetingType = sysBaseApi.queryDictItemsMapByCode("standard_meeting_type");
|
||||
String tbMeetingType = payMeetingVO.getTbMeetingType();
|
||||
if (!standardMeetingType.containsKey(tbMeetingType)){
|
||||
throw new JeroBootException("标协会议类型不存在");
|
||||
}
|
||||
hotelContactsList = payMeetingVO.getHotelContactsList();
|
||||
for (PayMeetingHotelContacts hotelContacts : hotelContactsList) {
|
||||
ValidUtil.validate(hotelContacts, StandardMeeting.class);
|
||||
}
|
||||
break;
|
||||
case MeetingCommon.INTERNATIONAL_MEETING:
|
||||
ValidUtil.validate(payMeetingVO, InternationalMeeting.class);
|
||||
//邀请码不能有重复的
|
||||
List<String> codeList = new ArrayList<>();
|
||||
//VIP邀请码
|
||||
String vipInvitationCode = payMeetingVO.getVipInvitationCode();
|
||||
codeList.add(vipInvitationCode);
|
||||
//演讲嘉宾邀请码
|
||||
String speakerInvitationCode = payMeetingVO.getSpeakerInvitationCode();
|
||||
if (codeList.contains(speakerInvitationCode)) {
|
||||
throw new JeroBootException("邀请码不能重复");
|
||||
}
|
||||
codeList.add(speakerInvitationCode);
|
||||
//特邀嘉宾邀请码
|
||||
String guestInvitationCode = payMeetingVO.getGuestInvitationCode();
|
||||
if (codeList.contains(guestInvitationCode)) {
|
||||
throw new JeroBootException("邀请码不能重复");
|
||||
}
|
||||
codeList.add(guestInvitationCode);
|
||||
//合作伙伴邀请码
|
||||
String cooperativeInvitationCode = payMeetingVO.getCooperativeInvitationCode();
|
||||
if (codeList.contains(cooperativeInvitationCode)) {
|
||||
throw new JeroBootException("邀请码不能重复");
|
||||
}
|
||||
codeList.add(cooperativeInvitationCode);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jero.meeting.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.meeting.entity.PayMeetingHotelContacts;
|
||||
import com.jero.meeting.valid.group.InternationalMeeting;
|
||||
import com.jero.meeting.valid.group.StandardMeeting;
|
||||
@@ -10,6 +11,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
@@ -43,24 +45,24 @@ public class PayMeetingVO implements Serializable {
|
||||
private String meetingName;
|
||||
|
||||
/**会议类型*/
|
||||
@Excel(name = "会议类型", width = 15,dicCode = "meeting_type")
|
||||
@Excel(name = "会议类型", width = 15)
|
||||
@ApiModelProperty(value = "会议类型")
|
||||
@NotBlank(message = "会议类型不能为空")
|
||||
private String meetingType;
|
||||
|
||||
/**标协会议类型*/
|
||||
@Excel(name = "标协会议类型", width = 15,dicCode = "standard_meeting_type")
|
||||
@Excel(name = "标协会议类型", width = 15)
|
||||
@ApiModelProperty(value = "标协会议类型")
|
||||
@NotBlank(message = "标协会议类型不能为空", groups = StandardMeeting.class)
|
||||
private String tbMeetingType;
|
||||
|
||||
/**工作组项目id*/
|
||||
@Excel(name = "工作组项目名称", width = 15, dictTable = "pay_working_group",dicText = "working_group_project",dicCode = "id")
|
||||
@ApiModelProperty(value = "工作组项目id")
|
||||
@NotBlank(message = "工作组项目名称不能为空", groups = WorkingGroupMeeting.class)
|
||||
private String workingGroupId;
|
||||
|
||||
/**工作组项目名称*/
|
||||
@Excel(name = "工作组项目名称", width = 15)
|
||||
@ApiModelProperty(value = "工作组项目名称")
|
||||
private String workingGroupName;
|
||||
|
||||
@@ -185,17 +187,17 @@ public class PayMeetingVO implements Serializable {
|
||||
private Integer meetingCostsVip;
|
||||
|
||||
/**会议负责人id*/
|
||||
@Excel(name = "会议负责人", width = 15,dictTable = "sys_user",dicText = "username",dicCode = "id")
|
||||
@ApiModelProperty(value = "会议负责人id")
|
||||
@NotBlank(message = "会议负责人不能为空")
|
||||
private String directorId;
|
||||
|
||||
/**会议负责人*/
|
||||
@Excel(name = "会议负责人", width = 15)
|
||||
@ApiModelProperty(value = "会议负责人")
|
||||
private String directorName;
|
||||
|
||||
/**会议负责人手机号*/
|
||||
@Excel(name = "会议负责人手机号", width = 15,exportConvert = true)
|
||||
@Excel(name = "会议负责人手机号", width = 15)
|
||||
@ApiModelProperty(value = "会议负责人手机号")
|
||||
private String directorPhone;
|
||||
|
||||
@@ -216,6 +218,7 @@ public class PayMeetingVO implements Serializable {
|
||||
/**
|
||||
* 会议关联酒店联系人列表
|
||||
*/
|
||||
@ExcelCollection(name = "酒店联系人列表")
|
||||
@NotNull(message = "酒店联系人不能为空",groups = StandardMeeting.class)
|
||||
@Size(max = 5, message = "酒店联系人最多为5个",groups = StandardMeeting.class)
|
||||
private List<PayMeetingHotelContacts> hotelContactsList;
|
||||
|
||||
Reference in New Issue
Block a user