提交 bc3b3633 作者: 洪东保

debug

父级 e75633ba
......@@ -74,6 +74,7 @@ public class MeetingInfoController {
/**
* 重新生成
*
* @param vo
* @return
*/
......@@ -99,7 +100,7 @@ public class MeetingInfoController {
String recordXml = vo.getRecordXml();
String recordContent = vo.getRecordContent();
try {
if(StringUtils.isNotEmpty(recordXml)){
if (StringUtils.isNotEmpty(recordXml)) {
//xml转json,用于前端的表单回显
String xml = minioUtils.getFileText(recordXml);
String json = convertXmlToJSON(xml);
......@@ -109,8 +110,8 @@ public class MeetingInfoController {
e.printStackTrace();
}
try {
if(StringUtils.isNotEmpty(recordContent)){
vo.setRecordContent(minioUtils.getFileText(recordContent.replaceAll(fileDownloadPath,"")));
if (StringUtils.isNotEmpty(recordContent)) {
vo.setRecordContent(minioUtils.getFileText(recordContent.replaceAll(fileDownloadPath, "")));
}
} catch (Exception e) {
e.printStackTrace();
......@@ -122,7 +123,7 @@ public class MeetingInfoController {
* 导出转写原文
*/
@PostMapping("/exportMeetingRecord")
public void exportMeetingRecord(@RequestBody MeetingInfoVO vo, HttpServletResponse response){
public void exportMeetingRecord(@RequestBody MeetingInfoVO vo, HttpServletResponse response) {
try {
MeetingInfo meetingInfo = meetingInfoService.getById(vo.getId());
String content = minioUtils.getFileText(meetingInfo.getRecordContent());
......@@ -157,19 +158,19 @@ public class MeetingInfoController {
* 导出会议纪要(本地下载)
*/
@PostMapping("/downloadMeetingMinutes")
public void downloadMeetingMinutes(@RequestBody MeetingInfoVO vo, HttpServletResponse response){
public void downloadMeetingMinutes(@RequestBody MeetingInfoVO vo, HttpServletResponse response) {
try {
MeetingInfo meetingInfo = meetingInfoService.getById(vo.getId());
String xml = minioUtils.getFileText(meetingInfo.getRecordXml());
Map<String, Object> dataModel = convertXmlToMap(xml);
//追加参会人员信息
Map<String,Object> participantsMap = new ConcurrentHashMap<>();
Map<String, Object> participantsMap = new ConcurrentHashMap<>();
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String meetingDate = meetingInfo.getStartTime().toLocalDate().format(df);
participantsMap.put("meeting_date",meetingDate);
participantsMap.put("meeting_location","线上腾讯会议");
participantsMap.put("meeting_date", meetingDate);
participantsMap.put("meeting_location", "线上腾讯会议");
participantsMap.put("meeting_participants", meetingInfo.getParticipantUsers());
participantsMap.put("meeting_host",meetingInfo.getHost());
participantsMap.put("meeting_host", meetingInfo.getHost());
dataModel.putAll(participantsMap);
MeetingRecordTemplate meetingRecordTemplate = meetingRecordTemplateMapper.selectById(meetingInfo.getTemplateId());
......@@ -180,7 +181,7 @@ public class MeetingInfoController {
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "utf8"));
XWPFTemplate template;
try (InputStream is = minioUtils.getFile(meetingRecordTemplate.getTemplate());OutputStream os = response.getOutputStream()) {
try (InputStream is = minioUtils.getFile(meetingRecordTemplate.getTemplate()); OutputStream os = response.getOutputStream()) {
template = XWPFTemplate.compile(is).render(dataModel);
template.write(os);
} catch (IOException e) {
......@@ -198,25 +199,25 @@ public class MeetingInfoController {
* 导出会议纪要(推送邮件)
*/
@PostMapping("/pushMeetingMinutes")
public R exportMeetingMinutes(@RequestBody MeetingInfoVO vo, HttpServletResponse response){
public R exportMeetingMinutes(@RequestBody MeetingInfoVO vo, HttpServletResponse response) {
try {
MeetingInfo meetingInfo = meetingInfoService.getById(vo.getId());
String xml = minioUtils.getFileText(meetingInfo.getRecordXml());
Map<String, Object> dataModel = convertXmlToMap(xml);
//追加参会人员信息
Map<String,Object> participantsMap = new ConcurrentHashMap<>();
Map<String, Object> participantsMap = new ConcurrentHashMap<>();
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String meetingDate = meetingInfo.getStartTime().toLocalDate().format(df);
participantsMap.put("meeting_date",meetingDate);
participantsMap.put("meeting_location","线上腾讯会议");
participantsMap.put("meeting_date", meetingDate);
participantsMap.put("meeting_location", "线上腾讯会议");
participantsMap.put("meeting_participants", meetingInfo.getParticipantUsers());
participantsMap.put("meeting_host",meetingInfo.getHost());
participantsMap.put("meeting_host", meetingInfo.getHost());
dataModel.putAll(participantsMap);
MeetingRecordTemplate meetingRecordTemplate = meetingRecordTemplateMapper.selectById(meetingInfo.getTemplateId());
XWPFTemplate template;
byte[] meetingMinutesBytes;
try (InputStream is = minioUtils.getFile(meetingRecordTemplate.getTemplate());ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
try (InputStream is = minioUtils.getFile(meetingRecordTemplate.getTemplate()); ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
template = XWPFTemplate.compile(is).render(dataModel);
template.write(baos);
meetingMinutesBytes = baos.toByteArray();
......@@ -226,7 +227,7 @@ public class MeetingInfoController {
List<EmailPush.Attachment> attachments = new ArrayList<>();
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMMdd");
EmailPush.Attachment attachment = EmailPush.Attachment.builder().name(meetingInfo.getSubject()+"会议纪要_" + fmt.format(meetingInfo.getStartTime())).bytes(meetingMinutesBytes).build();
EmailPush.Attachment attachment = EmailPush.Attachment.builder().name(meetingInfo.getSubject() + "会议纪要_" + fmt.format(meetingInfo.getStartTime())).bytes(meetingMinutesBytes).build();
attachments.add(attachment);
String hostUid = meetingInfo.getHostUid();
String userCode = userIdMapper.getWidByTid(hostUid);
......@@ -261,10 +262,10 @@ public class MeetingInfoController {
Map<?, ?> xmlMap = xmlMapper.readValue(xml, Map.class);
// 转换为更标准的 Map<String, Object>
Map<String,Object> map = objectMapper.convertValue(xmlMap, Map.class);
Map<String, Object> map = objectMapper.convertValue(xmlMap, Map.class);
//特殊处理map格式
for (Map.Entry<String, Object> entry : map.entrySet()) {
Map<String,Object> value = (Map<String, Object>) entry.getValue();
Map<String, Object> value = (Map<String, Object>) entry.getValue();
Object realValue = value.get("");
entry.setValue(realValue);
}
......@@ -280,15 +281,15 @@ public class MeetingInfoController {
// 正确获取节点和属性的方式
List<Map> list = new ArrayList<>();
Iterator<String> iterator = rootNode.fieldNames();
while (iterator.hasNext()){
while (iterator.hasNext()) {
String tagName = iterator.next();
JsonNode subNode = rootNode.path(tagName);
String displayName = subNode.path("label").asText();
String content = subNode.path("").asText();
list.add(new HashMap(){{
put("key",tagName);
put("keyName",displayName);
put("value",content);
list.add(new HashMap() {{
put("key", tagName);
put("keyName", displayName);
put("value", content);
}});
}
// 构建JSON对象
......
......@@ -243,12 +243,14 @@ public class EmailSender {
processLogService.log(meetingId,subMeetingId,"【邮件推送异常】:收件人工号不能为空");
continue;
}
// TODO
String email_content_template = String.valueOf(redisUtils.get("EMAIL_CONTENT_TEMPLATE"));
long expireTimestamp = ZonedDateTime.now().plusDays(2).toInstant().toEpochMilli();
body.content = MessageFormat.format(email_content_template,meetingInstanceId,toUserCode,String.valueOf(expireTimestamp));
}else{
isSent = false;
processLogService.log(meetingId,subMeetingId,"【邮件推送异常】:邮件模板未设置");
retryCount.getAndIncrement();
continue;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论