|
|
@@ -85,7 +85,6 @@ public class MeetingOrderTemplate implements BaseTemplate { |
|
|
|
|
|
|
|
private static final List<MeetingParamVo> MEETING_PARAMS = new ArrayList<>(); |
|
|
|
|
|
|
|
private static JSONObject MEETING_DURATION = new JSONObject(); |
|
|
|
|
|
|
|
private static List<String> MEETING_TOPIC = new ArrayList<>(); |
|
|
|
|
|
|
@@ -146,7 +145,6 @@ public class MeetingOrderTemplate implements BaseTemplate { |
|
|
|
log.error("解析会议参数失败", e); |
|
|
|
} |
|
|
|
} |
|
|
|
MEETING_DURATION = JSONObject.parseObject(nacosConfigManager.getConfigService().getConfig("meeting_duration_hour", "DEFAULT_GROUP", 5000)); |
|
|
|
String topics = nacosConfigManager.getConfigService().getConfig("meeting_topic", "DEFAULT_GROUP", 5000); |
|
|
|
MEETING_TOPIC.addAll(List.of(topics.split(","))); |
|
|
|
MEETING_CONFIRM = JSONObject.parseObject(nacosConfigManager.getConfigService().getConfig("meeting_confirm_cancel", "DEFAULT_GROUP", 5000)); |
|
|
@@ -188,7 +186,7 @@ public class MeetingOrderTemplate implements BaseTemplate { |
|
|
|
// 更新session中的locationId与location |
|
|
|
session.getFormat().put("location",roomsDto.getName()); |
|
|
|
session.getFormat().put("locationId",roomsDto.getId()); |
|
|
|
content = content.replace(roomsDto.getName(), "啊啊啊"); |
|
|
|
content = content.replace(roomsDto.getName(), "@@@"); |
|
|
|
break; |
|
|
|
} |
|
|
|
for(int i = 0;i<10;i++){ |
|
|
@@ -200,7 +198,7 @@ public class MeetingOrderTemplate implements BaseTemplate { |
|
|
|
// 更新session中的locationId与location |
|
|
|
session.getFormat().put("location",roomsDto.getName()); |
|
|
|
session.getFormat().put("locationId",roomsDto.getId()); |
|
|
|
content = content.replace(roomsDto.getName(), "啊啊啊"); |
|
|
|
content = content.replace(roomsDto.getName(), "@@@"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@@ -211,14 +209,28 @@ public class MeetingOrderTemplate implements BaseTemplate { |
|
|
|
session = dateSession; |
|
|
|
} |
|
|
|
//判断是否击中持续时间的正则 |
|
|
|
for(String key:MEETING_DURATION.keySet()){ |
|
|
|
if(content.contains(key)){ |
|
|
|
session.getFormat().put("duration", MEETING_DURATION.getIntValue(key)); |
|
|
|
content = content.replace(key, "啊啊啊"); |
|
|
|
break; |
|
|
|
String[] chinesenumber2 = {"一","两","三","四","五","六","七","八","九","十"}; |
|
|
|
for(int i=0;i<10;i++){ |
|
|
|
content = content.replaceAll(chinesenumber2[i],number[i]); |
|
|
|
} |
|
|
|
Pattern pattern = Pattern.compile("(\\d)+(\\.)?(\\d)*(个)?(半)?小时"); |
|
|
|
Matcher matcher = pattern.matcher(content); |
|
|
|
if(matcher.find()){ |
|
|
|
content = content.replace(matcher.group(), "@@@"); |
|
|
|
String matchedNumber =matcher.group().replace("个", "").replace("小时", "").replace("半", ".5"); |
|
|
|
Double tempNumber = Double.parseDouble(matchedNumber) * 60; |
|
|
|
if(String.valueOf(tempNumber).endsWith(".0")){ |
|
|
|
session.getFormat().put("duration", Integer.parseInt(String.valueOf(Double.parseDouble(matchedNumber) * 60).replace(".0", ""))); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(content.contains("半小时") || content.contains("半个小时")){ |
|
|
|
session.getFormat().put("duration", 30); |
|
|
|
content = content.replace("半小时", "@@@").replace("半个小时", "@@@"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//判断是否集中会议主题正则 |
|
|
|
for(String topic: MEETING_TOPIC){ |
|
|
|
if(content.contains(topic)){ |
|
|
|
session.getFormat().put("meetingIntent", topic); |
|
|
@@ -227,14 +239,22 @@ public class MeetingOrderTemplate implements BaseTemplate { |
|
|
|
} |
|
|
|
//判断会议室是否冲突,如果冲突则回传有冲突 |
|
|
|
JSONObject checkObject = session.getFormat(); |
|
|
|
if(checkObject.containsKey("date")){ |
|
|
|
LocalDateTime date = LocalDateTime.parse(session.getFormat().getString("date") + " 00:00:00",DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
|
|
|
LocalDateTime now = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0).withNano(0); |
|
|
|
if(now.isAfter(date)){ |
|
|
|
session.getFormat().put("conflict", 1); |
|
|
|
} else{ |
|
|
|
session.getFormat().remove("conflict"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (checkObject.containsKey("date") && checkObject.containsKey("start_time") && checkObject.containsKey("location") && checkObject.containsKey("duration")) { |
|
|
|
JSONObject ret= remoteMeetingService.queryExistOrder(checkObject.getLong("locationId"), checkObject.getString("date"), checkObject.getString("start_time"),checkObject.getInteger("duration"),tenantId,source.getMaster(), SecurityConstants.INNER); |
|
|
|
if (StringUtils.isNotEmpty(ret.getString("err"))) { |
|
|
|
// 会议室冲突,删除时间 |
|
|
|
session.getFormat().put("conflict",1); |
|
|
|
} |
|
|
|
else{ |
|
|
|
session.getFormat().put("conflict",0); |
|
|
|
// 会议室冲突,返回冲突类型 |
|
|
|
session.getFormat().put("conflict", 2); |
|
|
|
}else{ |
|
|
|
session.getFormat().put("conflict", 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|