|
@@ -311,6 +311,19 @@ public class VppDrInvitationServiceImpl implements VppDrInvitationService {
|
|
|
if (params.get("drEventId") != null) {
|
|
if (params.get("drEventId") != null) {
|
|
|
wrapper.eq(VppDrInvitation::getDrEventId, Long.parseLong(params.get("drEventId").toString()));
|
|
wrapper.eq(VppDrInvitation::getDrEventId, Long.parseLong(params.get("drEventId").toString()));
|
|
|
}
|
|
}
|
|
|
|
|
+ if (params.get("eventId") != null && StringUtils.hasText(params.get("eventId").toString())) {
|
|
|
|
|
+ List<Long> eventPks = eventMapper.selectList(new LambdaQueryWrapper<VppDrEvent>()
|
|
|
|
|
+ .eq(VppDrEvent::getDeleteFlag, VppAuditHelper.NOT_DELETED)
|
|
|
|
|
+ .like(VppDrEvent::getEventId, params.get("eventId").toString().trim()))
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .map(VppDrEvent::getId)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ if (eventPks.isEmpty()) {
|
|
|
|
|
+ wrapper.eq(VppDrInvitation::getDrEventId, -1L);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ wrapper.in(VppDrInvitation::getDrEventId, eventPks);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
if (params.get("responseType") != null) {
|
|
if (params.get("responseType") != null) {
|
|
|
wrapper.eq(VppDrInvitation::getResponseType, Integer.parseInt(params.get("responseType").toString()));
|
|
wrapper.eq(VppDrInvitation::getResponseType, Integer.parseInt(params.get("responseType").toString()));
|
|
|
}
|
|
}
|
|
@@ -489,13 +502,27 @@ public class VppDrInvitationServiceImpl implements VppDrInvitationService {
|
|
|
if (CollectionUtils.isEmpty(invitations)) {
|
|
if (CollectionUtils.isEmpty(invitations)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
- Set<Long> customerIds = invitations.stream().map(VppDrInvitation::getCustomerId).collect(Collectors.toSet());
|
|
|
|
|
-
|
|
|
|
|
- Map<Long, VppCustomer> customerMap = customerMapper.selectBatchIds(customerIds).stream()
|
|
|
|
|
|
|
+ Set<Long> customerIds = invitations.stream()
|
|
|
|
|
+ .map(VppDrInvitation::getCustomerId)
|
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
|
|
+ Map<Long, VppCustomer> customerMap = customerIds.isEmpty()
|
|
|
|
|
+ ? Collections.emptyMap()
|
|
|
|
|
+ : customerMapper.selectBatchIds(customerIds).stream()
|
|
|
.collect(Collectors.toMap(VppCustomer::getId, c -> c, (a, b) -> a));
|
|
.collect(Collectors.toMap(VppCustomer::getId, c -> c, (a, b) -> a));
|
|
|
|
|
|
|
|
|
|
+ Set<Long> eventPks = invitations.stream()
|
|
|
|
|
+ .map(VppDrInvitation::getDrEventId)
|
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
|
|
+ Map<Long, VppDrEvent> eventMap = eventPks.isEmpty()
|
|
|
|
|
+ ? Collections.emptyMap()
|
|
|
|
|
+ : eventMapper.selectBatchIds(eventPks).stream()
|
|
|
|
|
+ .filter(e -> !VppAuditHelper.isDeleted(e.getDeleteFlag()))
|
|
|
|
|
+ .collect(Collectors.toMap(VppDrEvent::getId, e -> e, (a, b) -> a));
|
|
|
|
|
+
|
|
|
return invitations.stream()
|
|
return invitations.stream()
|
|
|
- .map(inv -> toVo(inv, customerMap.get(inv.getCustomerId()), null))
|
|
|
|
|
|
|
+ .map(inv -> toVo(inv, customerMap.get(inv.getCustomerId()), null, eventMap.get(inv.getDrEventId())))
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -504,10 +531,17 @@ public class VppDrInvitationServiceImpl implements VppDrInvitationService {
|
|
|
VppCustomerContact contact = invitation.getSmsContactId() != null
|
|
VppCustomerContact contact = invitation.getSmsContactId() != null
|
|
|
? contactMapper.selectById(invitation.getSmsContactId())
|
|
? contactMapper.selectById(invitation.getSmsContactId())
|
|
|
: null;
|
|
: null;
|
|
|
- return toVo(invitation, customer, contact);
|
|
|
|
|
|
|
+ VppDrEvent event = invitation.getDrEventId() != null
|
|
|
|
|
+ ? eventMapper.selectById(invitation.getDrEventId())
|
|
|
|
|
+ : null;
|
|
|
|
|
+ if (event != null && VppAuditHelper.isDeleted(event.getDeleteFlag())) {
|
|
|
|
|
+ event = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ return toVo(invitation, customer, contact, event);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private DrInvitationVO toVo(VppDrInvitation invitation, VppCustomer customer, VppCustomerContact contact) {
|
|
|
|
|
|
|
+ private DrInvitationVO toVo(VppDrInvitation invitation, VppCustomer customer, VppCustomerContact contact,
|
|
|
|
|
+ VppDrEvent event) {
|
|
|
DrInvitationVO vo = new DrInvitationVO();
|
|
DrInvitationVO vo = new DrInvitationVO();
|
|
|
BeanUtils.copyProperties(invitation, vo);
|
|
BeanUtils.copyProperties(invitation, vo);
|
|
|
if (customer != null) {
|
|
if (customer != null) {
|
|
@@ -517,6 +551,9 @@ public class VppDrInvitationServiceImpl implements VppDrInvitationService {
|
|
|
vo.setSmsContactName(contact.getContactName());
|
|
vo.setSmsContactName(contact.getContactName());
|
|
|
vo.setSmsContactPhone(contact.getContactPhone());
|
|
vo.setSmsContactPhone(contact.getContactPhone());
|
|
|
}
|
|
}
|
|
|
|
|
+ if (event != null) {
|
|
|
|
|
+ vo.setEventId(event.getEventId());
|
|
|
|
|
+ }
|
|
|
return vo;
|
|
return vo;
|
|
|
}
|
|
}
|
|
|
|
|
|