提交 59ea2b51 作者: duanxincheng

暂时让所有模板共用一个提示词,两个模板输出同样的结果

父级 17cea99f
......@@ -278,6 +278,7 @@ public class FileProcessTask {
processLogService.log(meetingId,subMeetingId,"用户"+hostUid+"暂未关联企微信息,无法生成纪要文件");
continue;
}
String processedResult = null;
for (MeetingRecordTemplate template : recordTemplateList) {
//判断本次纪要有模板生成权限
if(!authorizedUserMap.containsKey(template.getId())){
......@@ -294,7 +295,11 @@ public class FileProcessTask {
log.info("用户{}允许应用模板{}",hostUid,template.getName());
processLogService.log(meetingId,subMeetingId,"用户"+hostUid+"允许应用模板"+template.getName());
}
String processedResult = processWithClaude(recordTextBuffer.toString(),meetingDate,participantNames,template.getPrompt());
//暂时让所有模板共用一个提示词,两个模板输出同样的结果
if(StringUtils.isEmpty(processedResult)){
processedResult = processWithClaude(recordTextBuffer.toString(),meetingDate,participantNames,template.getPrompt());
}
String minutesPath = saveResult(processedResult, recordTextBuffer.toString().getBytes(StandardCharsets.UTF_8), meetingInfo,toUserCode, template);
try(InputStream is = new FileInputStream(minutesPath)){
byte[] meetingMinutesBytes = IOUtils.toByteArray(is);
......@@ -480,7 +485,8 @@ public class FileProcessTask {
//填充后的会议纪要word文件临时路径
String meetingMinutesPath;
try {
String fileName = String.format(meetingInfo.getSubject() + "_转写原文_%s.txt", DateUtil.today());
String subject = meetingInfo.getSubject();
String fileName = String.format(subject + "_转写原文_%s.txt", DateUtil.today());
MultipartFile multipartFile = new CustomMultipartFile(
"file", // 表单中的字段名
fileName, // 原始文件名
......@@ -514,7 +520,20 @@ public class FileProcessTask {
minioUtils.upload(recordXmlPath,xml.getBytes(StandardCharsets.UTF_8));
//将xml格式的内容转换为map,用于填充模板
Map<String, Object> dataModel = convertXmlToMap(xml);
meetingName = dataModel.get("meeting_name") != null ? String.valueOf(dataModel.get("meeting_name")) : "腾讯会议纪要";
//判断会议名称关键词,如果是用户自己定义的主题,不做修改
// 1***预定的会议
// 2***的快速会议
// 3**的周期会议
// 4**预定的网络研讨会
String[] keywords = {"预定的会议", "的快速会议", "的周期会议", "预定的网络研讨会"};
boolean hostCustomSubject = Arrays.stream(keywords).noneMatch(item->subject.contains(item));
if(hostCustomSubject){
meetingName = subject;
dataModel.put("meeting_name",subject);
}else{
meetingName = dataModel.get("meeting_name") != null ? String.valueOf(dataModel.get("meeting_name")) : subject;
meetingInfo.setSubject(meetingName);
}
meetingMinutesFileName = meetingName + "_" + meetingRecordTemplate.getName();
//追加参会人员信息
Map<String,Object> participantsMap = new ConcurrentHashMap<>();
......@@ -554,6 +573,7 @@ public class FileProcessTask {
.set(MeetingInfo::getIsGenerated,Boolean.TRUE)
.set(MeetingInfo::getTemplateId,meetingRecordTemplate.getId())
.set(MeetingInfo::getTransDocId,meetingInfo.getTransDocId())
.set(MeetingInfo::getSubject,meetingInfo.getSubject())
);
meetingInfo.setRecordContent(recordContentPath);
meetingInfo.setRecordXml(recordXmlPath);
......
......@@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cmeeting.ad.entity.RobotSecurityUser;
import com.cmeeting.ad.util.SecurityUtil;
import com.cmeeting.dto.UserDTO;
import com.cmeeting.exception.RobotBaseException;
import com.cmeeting.mapper.primary.UserIdMapper;
import com.cmeeting.mapper.primary.WeComUserMapper;
import com.cmeeting.mapper.secondary.SysUserSysMapper;
import com.cmeeting.pojo.MeetingInfo;
import com.cmeeting.pojo.UserId;
import com.cmeeting.pojo.WeComUser;
......@@ -20,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
......@@ -48,6 +51,10 @@ public class WeComServiceImpl extends ServiceImpl<WeComUserMapper, WeComUser> i
private TencentMeetingService tencentMeetingService;
@Autowired
private UserIdMapper userIdMapper;
@Resource
private SysUserSysMapper sysUserSyncMapper;
@Value(value = "${permission.tenantId}")
private String permissionTenantId;
@Override
public void batchInsert(List<WeComUser> users) {
......@@ -60,6 +67,8 @@ public class WeComServiceImpl extends ServiceImpl<WeComUserMapper, WeComUser> i
JSONArray departmentList = getDepartmentList();
Iterator<Object> iterator = departmentList.iterator();
List<WeComUser> users = new ArrayList<>();
// List<UserDTO> userEmailList = sysUserSyncMapper.getUserEmail(permissionTenantId);
// CollectionUtils.isEmpty(userEmailList) ? new HashMap<>() : userEmailList.
while (iterator.hasNext()){
JSONObject department = (JSONObject) iterator.next();
String departmentId = String.valueOf(department.get("id"));
......
......@@ -19,7 +19,7 @@
(
#{user.userName},
#{user.userId},
#{user.isRepeatName},
#{user.isrepeatName},
#{user.email}
)
</foreach>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论