提交 3f9283a4 作者: 洪东保

根据部门导出会议记录-debug

父级 524d87bb
......@@ -604,7 +604,7 @@ public class FileProcessTask {
.set(MeetingInfo::getRecordContent,recordContentPath)
.set(MeetingInfo::getRecordXml,recordXmlPath)
.set(MeetingInfo::getParticipantUsers,meetingInfo.getParticipantUsers())
.set(MeetingInfo::getIsGenerated,Boolean.TRUE)
.set(MeetingInfo::getIsGenerated, success)
.set(MeetingInfo::getTemplateId,meetingRecordTemplate.getId())
.set(MeetingInfo::getTransDocId,meetingInfo.getTransDocId())
.set(MeetingInfo::getSubject,meetingInfo.getSubject())
......
......@@ -3,7 +3,21 @@ package com.cmeeting.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cmeeting.ad.entity.SysUserSync;
import java.util.List;
public interface SysUserSyncService extends IService<SysUserSync> {
/**
* 根据工号查询部门 limit 1
* @param userId
* @return
*/
String getDeptPathByUserId(String userId);
/**
* 根据工号查询部门集合(部分人在两个部门下)
* @param userId
* @return
*/
List<String> getDeptPathByUserIdAndInSet(String userId);
}
......@@ -561,31 +561,32 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti
public void statisticsEmail(Date startTime, Date endTime, HttpServletResponse response) {
List<MeetingInfo> meetingInfoList = meetingInfoMapper.selectList(new LambdaQueryWrapper<MeetingInfo>()
.between(MeetingInfo::getStartTime, startTime, endTime));
log.info("会议总量: {}", meetingInfoList.size());
// 查询工号以及部门
List<String> uids = meetingInfoList.stream().map(MeetingInfo::getHostUid).distinct().collect(Collectors.toList());
List<UserId> userIds = userIdMapper.selectList(new LambdaQueryWrapper<UserId>().in(UserId::getTid, uids));
Map<String, String> idMap = userIds.stream().collect(Collectors.toMap(UserId::getTid, UserId::getWid));
Map<String, String> deptMap = new HashMap<>();
Map<String, List<String>> deptMap = new HashMap<>();
for (UserId userId : userIds) {
String deptPathByUserId = sysUserSyncService.getDeptPathByUserId(userId.getWid());
log.info("userId: {} ---- path: {}", userId.getWid(), deptPathByUserId);
deptMap.put(userId.getWid(), deptPathByUserId);
List<String> deptPathByUserIdAndInSet = sysUserSyncService.getDeptPathByUserIdAndInSet(userId.getWid());
deptMap.put(userId.getWid(), deptPathByUserIdAndInSet);
}
Map<String, List<MeetingInfo>> hostUidMeetingInfoMap = new HashMap<>();
for (MeetingInfo meetingInfo : meetingInfoList) {
String path = deptMap.get(idMap.get(meetingInfo.getHostUid()));
for (String deptId : DEPT_MAP.keySet()) {
if (path.contains(deptId)) {
List<MeetingInfo> meetingInfos = hostUidMeetingInfoMap.get(DEPT_MAP.get(deptId));
if (CollUtil.isEmpty(meetingInfos)) {
meetingInfos = new ArrayList<>();
for (String path : deptMap.get(idMap.get(meetingInfo.getHostUid()))) {
for (String deptId : DEPT_MAP.keySet()) {
if (path.contains(deptId)) {
List<MeetingInfo> meetingInfos = hostUidMeetingInfoMap.get(DEPT_MAP.get(deptId));
if (CollUtil.isEmpty(meetingInfos)) {
meetingInfos = new ArrayList<>();
}
meetingInfos.add(meetingInfo);
hostUidMeetingInfoMap.put(DEPT_MAP.get(deptId), meetingInfos);
break;
}
meetingInfos.add(meetingInfo);
hostUidMeetingInfoMap.put(DEPT_MAP.get(deptId), meetingInfos);
break;
}
}
}
......@@ -613,9 +614,7 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti
Integer emptyNum=0, emailPushAccessNum=0, newNum=0, generatErrorNum=0, noteGeneratedNum=0, pushSuccessNum=0, pushErrorNum=0;
for (MeetingInfo meetingInfo : meetingList) {
if (meetingInfo.getStatus() == MeetingState.NEW.getCode()) {
newNum++;
} else if (meetingInfo.getStatus() == MeetingState.GENERATE_ERROR.getCode()) {
if (meetingInfo.getStatus() == MeetingState.GENERATE_ERROR.getCode()) {
generatErrorNum++;
} else if (meetingInfo.getStatus() == MeetingState.PUSH_SUCCESS.getCode()) {
pushSuccessNum++;
......@@ -623,6 +622,8 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti
pushErrorNum++;
} else if (meetingInfo.getStatus() == MeetingState.EMPTY.getCode()) {
emptyNum++;
} else if (meetingInfo.getStatus() == MeetingState.NEW.getCode() && meetingInfo.getEmailPushAccess()) {
newNum++;
}
if (meetingInfo.getIsGenerated() || meetingInfo.getStatus() == MeetingState.NOTE_GENERATED.getCode()) {
noteGeneratedNum++;
......
......@@ -12,7 +12,10 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@Slf4j
......@@ -21,12 +24,42 @@ public class SysUserSyncServiceImpl extends ServiceImpl<SysUserSysMapper, SysUse
@Value(value = "${permission.tenantId}")
private String perTenantId;
private static Map<String, String> DEPT_MAP = new HashMap<>(12);
static {
DEPT_MAP.put("10340", "集团总部");
DEPT_MAP.put("11683", "中集车辆(集团)股份有限公司");
DEPT_MAP.put("11080", "中集安瑞科投资控股(深圳)有限公司");
DEPT_MAP.put("635364", "中集管理培训(深圳)有限公司");
DEPT_MAP.put("612702", "中集世联达集装箱物流(深圳)有限公司");
DEPT_MAP.put("661082", "柏坚货柜机械维修(深圳)有限公司");
DEPT_MAP.put("745168", "中集世联达国际物流有限公司");
DEPT_MAP.put("766268", "中铁集物流装备有限公司");
DEPT_MAP.put("698027", "深圳中集同创供应链有限公司");
DEPT_MAP.put("674199", "中集模块化建筑投资有限公司");
DEPT_MAP.put("698022", "深圳中集共享后勤服务有限公司");
DEPT_MAP.put("707436", "深圳市集家美寓公寓管理有限公司");
}
@Override
public String getDeptPathByUserId(String userId) {
SysUserSync sysUserSync = baseMapper.selectOne(new LambdaQueryWrapper<SysUserSync>().eq(SysUserSync::getTenantId, perTenantId).eq(SysUserSync::getUserId, userId));
SysUserSync sysUserSync = baseMapper.selectOne(new LambdaQueryWrapper<SysUserSync>()
.eq(SysUserSync::getTenantId, perTenantId).eq(SysUserSync::getUserId, userId)
.select(SysUserSync::getDeptId).last("limit 1"));
String deptId = sysUserSync.getDeptId();
String deptPath = getDeptPath("/" + deptId, deptId);
return deptPath;
return getDeptPath("/" + deptId, deptId);
}
@Override
public List<String> getDeptPathByUserIdAndInSet(String userId) {
List<SysUserSync> sysUserSyncs = baseMapper.selectList(new LambdaQueryWrapper<SysUserSync>()
.eq(SysUserSync::getTenantId, perTenantId).eq(SysUserSync::getUserId, userId)
.select(SysUserSync::getDeptId));
List<String> collect = sysUserSyncs.stream().map(SysUserSync::getDeptId).collect(Collectors.toList());
List<String> ret = new ArrayList<>();
for (String s : collect) {
ret.add(getDeptPath("/" + s, s));
}
return ret;
}
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论