|
|
@@ -49,6 +49,9 @@ import com.hz.pm.api.projectlib.model.entity.Project; |
|
|
|
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; |
|
|
|
import com.hz.pm.api.projectlib.service.IProjectService; |
|
|
|
import com.hz.pm.api.sys.model.dto.RegionDTO; |
|
|
|
import com.hz.pm.api.sys.model.entity.MsgCallRecord; |
|
|
|
import com.hz.pm.api.sys.model.enumeration.SubmitTypeEnum; |
|
|
|
import com.hz.pm.api.sys.service.IMsgCallRecordService; |
|
|
|
import com.hz.pm.api.user.helper.MhUnitCache; |
|
|
|
import com.hz.pm.api.user.model.entity.UserInfo; |
|
|
|
import com.hz.pm.api.user.model.enumeration.RoleEnum; |
|
|
@@ -112,6 +115,7 @@ public class MeetingManage { |
|
|
|
private final EnvironmentUtil environmentUtil; |
|
|
|
private final MhUnitCache mhUnitCache; |
|
|
|
private final ProjectStateMachineUtil projectStateMachineUtil; |
|
|
|
private final IMsgCallRecordService msgCallRecordService; |
|
|
|
|
|
|
|
private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; |
|
|
|
|
|
|
@@ -494,6 +498,7 @@ public class MeetingManage { |
|
|
|
.meetingName(meeting.getName()) |
|
|
|
.meetingType(meeting.getType()) |
|
|
|
.meetingAddress(meeting.getMeetingAddress()) |
|
|
|
.meetingAddressDetail(meeting.getMeetingAddressDetail()) |
|
|
|
.typeName(getDictName(meeting.getType())) |
|
|
|
.startTime(meeting.getStartTime()) |
|
|
|
.endTime(meeting.getEndTime()) |
|
|
@@ -543,12 +548,31 @@ public class MeetingManage { |
|
|
|
if (experts.isEmpty()) { |
|
|
|
return result; |
|
|
|
} |
|
|
|
List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId); |
|
|
|
List<String> confirmedRosterSubmitKeys = new ArrayList<>(); |
|
|
|
List<Long> expertIds = CollUtils.fieldList(experts, w -> { |
|
|
|
if (StrUtil.isNotBlank(w.getConfirmedRosterMsgSubmitKey())) { |
|
|
|
confirmedRosterSubmitKeys.add(w.getConfirmedRosterMsgSubmitKey()); |
|
|
|
} |
|
|
|
return w.getExpertId(); |
|
|
|
}); |
|
|
|
Map<String, String> confirmedRosterReplyMap = new HashMap<>(); |
|
|
|
if (!confirmedRosterSubmitKeys.isEmpty()) { |
|
|
|
Wrapper<MsgCallRecord> query = Wrappers.lambdaQuery(MsgCallRecord.class) |
|
|
|
.select(MsgCallRecord::getSubmitKey, MsgCallRecord::getReplyContent) |
|
|
|
.eq(MsgCallRecord::getSubmitType, SubmitTypeEnum.SMS) |
|
|
|
.in(MsgCallRecord::getSubmitKey, confirmedRosterSubmitKeys); |
|
|
|
List<MsgCallRecord> msgCallRecords = msgCallRecordService.list(query); |
|
|
|
for (MsgCallRecord msgCallRecord : msgCallRecords) { |
|
|
|
confirmedRosterReplyMap.put(msgCallRecord.getSubmitKey(), msgCallRecord.getReplyContent()); |
|
|
|
} |
|
|
|
} |
|
|
|
Map<Long, ExpertBasicInfoVO> expertMap = meetingManageHelper.getExpertBasicInfo(expertIds); |
|
|
|
BiFunction<MeetingExpert, Map<Long, ExpertInviteRule>, InviteExpertListItemVO> mapping = (me, ruleMap) -> { |
|
|
|
ExpertBasicInfoVO expert = expertMap.get(me.getExpertId()); |
|
|
|
InviteExpertListItemVO item = BeanUtil.copyProperties(expert, InviteExpertListItemVO.class); |
|
|
|
item.setExpertMeetingId(me.getId()); |
|
|
|
item.setConfirmedRoster(me.getConfirmedRoster()); |
|
|
|
item.setConfirmedRosterReplyContent(confirmedRosterReplyMap.get(me.getConfirmedRosterMsgSubmitKey())); |
|
|
|
item.setMeetingId(me.getMeetingId()); |
|
|
|
item.setStatus(me.getStatus()); |
|
|
|
item.setStatusName(ExpertAttendStatusEnum.getValByCode(me.getStatus())); |
|
|
@@ -910,13 +934,21 @@ public class MeetingManage { |
|
|
|
return; |
|
|
|
} |
|
|
|
List<Long> currConfirmedMeIds = CollUtils.fieldList(expertNoticing, MeetingExpert::getId); |
|
|
|
Wrapper<MeetingExpert> meUpdate = Wrappers.lambdaUpdate(MeetingExpert.class) |
|
|
|
.in(MeetingExpert::getId, currConfirmedMeIds) |
|
|
|
LambdaUpdateWrapper<MeetingExpert> meUpdate = Wrappers.lambdaUpdate(MeetingExpert.class) |
|
|
|
.set(MeetingExpert::getConfirmedRoster, Boolean.TRUE); |
|
|
|
meetingExpertService.update(meUpdate); |
|
|
|
if (environmentUtil.isProdEnv()) { |
|
|
|
meetingNotifyHelper.sendConfirmedRosterMsg(expertNoticing, meeting); |
|
|
|
for (MeetingExpert expert : expertNoticing) { |
|
|
|
if (StrUtil.isBlank(expert.getConfirmedRosterMsgSubmitKey())) { |
|
|
|
currConfirmedMeIds.remove(expert.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (currConfirmedMeIds.isEmpty()) { |
|
|
|
throw ReturnException.wrap("参会通知短信发送失败,请重试!"); |
|
|
|
} |
|
|
|
} |
|
|
|
meUpdate.in(MeetingExpert::getId, currConfirmedMeIds); |
|
|
|
meetingExpertService.update(meUpdate); |
|
|
|
} finally { |
|
|
|
distributedLock.releaseLock(key); |
|
|
|
} |
|
|
@@ -930,6 +962,7 @@ public class MeetingManage { |
|
|
|
data.setEndTime(meeting.getEndTime()); |
|
|
|
data.setMeetingName(meeting.getName()); |
|
|
|
data.setMeetingAddress(meeting.getMeetingAddress()); |
|
|
|
data.setMeetingAddressDetail(meeting.getMeetingAddressDetail()); |
|
|
|
data.setConnecter(meeting.getConnecter()); |
|
|
|
data.setContact(meeting.getContact()); |
|
|
|
data.setLongitude(meeting.getAddressLongitude()); |
|
|
@@ -1113,10 +1146,6 @@ public class MeetingManage { |
|
|
|
if (meeting == null || MeetingStatusEnum.CANCEL.eq(meeting.getStatus())) { |
|
|
|
throw ReturnException.wrap("会议不存在或已取消"); |
|
|
|
} |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
if (meeting.getEndTime().isAfter(now)) { |
|
|
|
throw ReturnException.wrap("会议未结束"); |
|
|
|
} |
|
|
|
if (!Boolean.TRUE.equals(meeting.getIsInnerProject())) { |
|
|
|
throw ReturnException.wrap("此会议未关联项目"); |
|
|
|
} |
|
|
|