|
|
|
|
@@ -1,9 +1,16 @@
|
|
|
|
|
package com.vetti.hotake.service.impl;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import com.vetti.common.core.domain.entity.SysUser;
|
|
|
|
|
import com.vetti.common.core.service.BaseServiceImpl;
|
|
|
|
|
import com.vetti.common.enums.FillTypeEnum;
|
|
|
|
|
import com.vetti.hotake.domain.HotakeMeetingCalendarDetail;
|
|
|
|
|
import com.vetti.hotake.service.IHotakeMeetingCalendarDetailService;
|
|
|
|
|
import com.vetti.system.service.ISysUserService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -14,107 +21,165 @@ import com.vetti.hotake.service.IHotakeMeetingCalendarInfoService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 会议日历记录主Service业务层处理
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @author wangxiangshun
|
|
|
|
|
* @date 2025-11-09
|
|
|
|
|
*/
|
|
|
|
|
@SuppressWarnings("all")
|
|
|
|
|
@Service
|
|
|
|
|
public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implements IHotakeMeetingCalendarInfoService
|
|
|
|
|
{
|
|
|
|
|
public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implements IHotakeMeetingCalendarInfoService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private HotakeMeetingCalendarInfoMapper hotakeMeetingCalendarInfoMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IHotakeMeetingCalendarDetailService calendarDetailService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysUserService userService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询会议日历记录主
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param id 会议日历记录主主键
|
|
|
|
|
* @return 会议日历记录主
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
@Override
|
|
|
|
|
public HotakeMeetingCalendarInfo selectHotakeMeetingCalendarInfoById(Long id)
|
|
|
|
|
{
|
|
|
|
|
return hotakeMeetingCalendarInfoMapper.selectHotakeMeetingCalendarInfoById(id);
|
|
|
|
|
public HotakeMeetingCalendarInfo selectHotakeMeetingCalendarInfoById(Long id) {
|
|
|
|
|
HotakeMeetingCalendarInfo calendarInfo = hotakeMeetingCalendarInfoMapper.selectHotakeMeetingCalendarInfoById(id);
|
|
|
|
|
//获取对应的参会人员数据
|
|
|
|
|
HotakeMeetingCalendarDetail queryDetail = new HotakeMeetingCalendarDetail();
|
|
|
|
|
List<HotakeMeetingCalendarDetail> detailList = calendarDetailService.selectHotakeMeetingCalendarDetailList(queryDetail);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(detailList)) {
|
|
|
|
|
Map<Long, List<HotakeMeetingCalendarDetail>> mapDetailList = detailList.stream().collect(Collectors.groupingBy(HotakeMeetingCalendarDetail::getMeetingId));
|
|
|
|
|
SysUser queryUser = new SysUser();
|
|
|
|
|
List<SysUser> userList = userService.selectUserList(queryUser);
|
|
|
|
|
List<HotakeMeetingCalendarDetail> calendarDetails = mapDetailList.get(calendarInfo.getId());
|
|
|
|
|
for (HotakeMeetingCalendarDetail detail : calendarDetails) {
|
|
|
|
|
List<SysUser> users = userList.stream().filter(e -> e.getUserId() == detail.getUserId()).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtil.isNotEmpty(users)) {
|
|
|
|
|
detail.setUser(users.get(0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
calendarInfo.setCalendarDetails(calendarDetails);
|
|
|
|
|
}
|
|
|
|
|
return calendarInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询会议日历记录主列表
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param hotakeMeetingCalendarInfo 会议日历记录主
|
|
|
|
|
* @return 会议日历记录主
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
@Override
|
|
|
|
|
public List<HotakeMeetingCalendarInfo> selectHotakeMeetingCalendarInfoList(HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo)
|
|
|
|
|
{
|
|
|
|
|
return hotakeMeetingCalendarInfoMapper.selectHotakeMeetingCalendarInfoList(hotakeMeetingCalendarInfo);
|
|
|
|
|
public List<HotakeMeetingCalendarInfo> selectHotakeMeetingCalendarInfoList(HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo) {
|
|
|
|
|
List<HotakeMeetingCalendarInfo> calendarInfos = hotakeMeetingCalendarInfoMapper.selectHotakeMeetingCalendarInfoList(hotakeMeetingCalendarInfo);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(calendarInfos)) {
|
|
|
|
|
//获取对应的参会人员数据
|
|
|
|
|
HotakeMeetingCalendarDetail queryDetail = new HotakeMeetingCalendarDetail();
|
|
|
|
|
List<HotakeMeetingCalendarDetail> detailList = calendarDetailService.selectHotakeMeetingCalendarDetailList(queryDetail);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(detailList)) {
|
|
|
|
|
Map<Long, List<HotakeMeetingCalendarDetail>> mapDetailList = detailList.stream().collect(Collectors.groupingBy(HotakeMeetingCalendarDetail::getMeetingId));
|
|
|
|
|
SysUser queryUser = new SysUser();
|
|
|
|
|
List<SysUser> userList = userService.selectUserList(queryUser);
|
|
|
|
|
for (HotakeMeetingCalendarInfo calendarInfo : calendarInfos) {
|
|
|
|
|
List<HotakeMeetingCalendarDetail> calendarDetails = mapDetailList.get(calendarInfo.getId());
|
|
|
|
|
for (HotakeMeetingCalendarDetail detail : calendarDetails) {
|
|
|
|
|
List<SysUser> users = userList.stream().filter(e -> e.getUserId() == detail.getUserId()).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtil.isNotEmpty(users)) {
|
|
|
|
|
detail.setUser(users.get(0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
calendarInfo.setCalendarDetails(calendarDetails);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return calendarInfos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增会议日历记录主
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param hotakeMeetingCalendarInfo 会议日历记录主
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(rollbackFor=Exception.class)
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@Override
|
|
|
|
|
public HotakeMeetingCalendarInfo insertHotakeMeetingCalendarInfo(HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo)
|
|
|
|
|
{
|
|
|
|
|
public HotakeMeetingCalendarInfo insertHotakeMeetingCalendarInfo(HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo) {
|
|
|
|
|
fill(FillTypeEnum.INSERT.getCode(), hotakeMeetingCalendarInfo);
|
|
|
|
|
hotakeMeetingCalendarInfoMapper.insertHotakeMeetingCalendarInfo(hotakeMeetingCalendarInfo);
|
|
|
|
|
|
|
|
|
|
//保存参会人员
|
|
|
|
|
//1.1 先删除对应的参会人员
|
|
|
|
|
calendarDetailService.deleteHotakeMeetingCalendarDetailByInfoId(hotakeMeetingCalendarInfo.getId());
|
|
|
|
|
//1.2 保存参会人员数据
|
|
|
|
|
for (HotakeMeetingCalendarDetail detail : hotakeMeetingCalendarInfo.getCalendarDetails()) {
|
|
|
|
|
detail.setMeetingId(hotakeMeetingCalendarInfo.getId());
|
|
|
|
|
fill(FillTypeEnum.INSERT.getCode(), detail);
|
|
|
|
|
}
|
|
|
|
|
calendarDetailService.batchInsertHotakeMeetingCalendarDetail(hotakeMeetingCalendarInfo.getCalendarDetails());
|
|
|
|
|
|
|
|
|
|
return hotakeMeetingCalendarInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改会议日历记录主
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param hotakeMeetingCalendarInfo 会议日历记录主
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(rollbackFor=Exception.class)
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@Override
|
|
|
|
|
public HotakeMeetingCalendarInfo updateHotakeMeetingCalendarInfo(HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo)
|
|
|
|
|
{
|
|
|
|
|
public HotakeMeetingCalendarInfo updateHotakeMeetingCalendarInfo(HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo) {
|
|
|
|
|
fill(FillTypeEnum.UPDATE.getCode(), hotakeMeetingCalendarInfo);
|
|
|
|
|
hotakeMeetingCalendarInfoMapper.updateHotakeMeetingCalendarInfo(hotakeMeetingCalendarInfo);
|
|
|
|
|
//保存参会人员
|
|
|
|
|
//1.1 先删除对应的参会人员
|
|
|
|
|
calendarDetailService.deleteHotakeMeetingCalendarDetailByInfoId(hotakeMeetingCalendarInfo.getId());
|
|
|
|
|
//1.2 保存参会人员数据
|
|
|
|
|
for (HotakeMeetingCalendarDetail detail : hotakeMeetingCalendarInfo.getCalendarDetails()) {
|
|
|
|
|
detail.setMeetingId(hotakeMeetingCalendarInfo.getId());
|
|
|
|
|
fill(FillTypeEnum.INSERT.getCode(), detail);
|
|
|
|
|
}
|
|
|
|
|
calendarDetailService.batchInsertHotakeMeetingCalendarDetail(hotakeMeetingCalendarInfo.getCalendarDetails());
|
|
|
|
|
return hotakeMeetingCalendarInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量删除会议日历记录主
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param ids 需要删除的会议日历记录主主键
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(rollbackFor=Exception.class)
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteHotakeMeetingCalendarInfoByIds(Long[] ids)
|
|
|
|
|
{
|
|
|
|
|
public int deleteHotakeMeetingCalendarInfoByIds(Long[] ids) {
|
|
|
|
|
return hotakeMeetingCalendarInfoMapper.deleteHotakeMeetingCalendarInfoByIds(ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除会议日历记录主信息
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param id 会议日历记录主主键
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(rollbackFor=Exception.class)
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteHotakeMeetingCalendarInfoById(Long id)
|
|
|
|
|
{
|
|
|
|
|
public int deleteHotakeMeetingCalendarInfoById(Long id) {
|
|
|
|
|
return hotakeMeetingCalendarInfoMapper.deleteHotakeMeetingCalendarInfoById(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量新增会议日历记录主
|
|
|
|
|
*
|
|
|
|
|
* @param hotakeMeetingCalendarInfoList 会议日历记录主列表
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(rollbackFor=Exception.class)
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@Override
|
|
|
|
|
public int batchInsertHotakeMeetingCalendarInfo(List<HotakeMeetingCalendarInfo> hotakeMeetingCalendarInfoList){
|
|
|
|
|
public int batchInsertHotakeMeetingCalendarInfo(List<HotakeMeetingCalendarInfo> hotakeMeetingCalendarInfoList) {
|
|
|
|
|
return hotakeMeetingCalendarInfoMapper.batchInsertHotakeMeetingCalendarInfo(hotakeMeetingCalendarInfoList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|