|
@@ -58,12 +58,6 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
|
|
|
private TenantInfoService tenantInfoService;
|
|
|
|
|
|
@Autowired
|
|
|
- private TenantAlbumMusicService tenantAlbumMusicService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private MusicSheetService musicSheetService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private StudentService studentService;
|
|
|
|
|
|
@Autowired
|
|
@@ -76,9 +70,6 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
|
|
|
private StudentDao studentDao;
|
|
|
|
|
|
@Autowired
|
|
|
- private TenantAlbumPurchaseMapper tenantAlbumPurchaseMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private UserTenantAlbumRecordService userTenantAlbumRecordService;
|
|
|
|
|
|
|
|
@@ -95,9 +86,6 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
|
|
|
private SysUserMapper sysUserMapper;
|
|
|
|
|
|
@Autowired
|
|
|
- private TenantInfoMapper tenantInfoMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private TenantGroupAlbumService tenantGroupAlbumService;
|
|
|
|
|
|
|
|
@@ -673,6 +661,19 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
|
|
|
List<Long> ids = userTenantAlbumRecords.stream().map(UserTenantAlbumRecordWrapper.UserTenantAlbumRecord::getId).collect(Collectors.toList());
|
|
|
baseMapper.updateMsgStatus(ids,1);
|
|
|
}
|
|
|
+ //即将到期的专辑
|
|
|
+ List<UserTenantAlbumRecordWrapper.UserTenantAlbumRecord> userTenantAlbumRecords1 = baseMapper.selectTemporaryRecord1();
|
|
|
+ if (CollectionUtils.isNotEmpty(userTenantAlbumRecords1)) {
|
|
|
+ //获取专辑名称
|
|
|
+ List<Long> tenantAlbumIds = userTenantAlbumRecords1.stream().map(UserTenantAlbumRecordWrapper.UserTenantAlbumRecord::getTenantAlbumId).collect(Collectors.toList());
|
|
|
+ Map<Long, String> albumIdMap = tenantAlbumService.lambdaQuery()
|
|
|
+ .in(TenantAlbum::getId, tenantAlbumIds)
|
|
|
+ .list().stream().collect(Collectors.toMap(TenantAlbum::getId, TenantAlbum::getName));
|
|
|
+ //发送消息
|
|
|
+ userTenantAlbumRecords1.forEach(record -> temporarySend(record.getUserId(),record.getPhone(), albumIdMap.get(record.getTenantAlbumId())));
|
|
|
+ List<Long> ids = userTenantAlbumRecords1.stream().map(UserTenantAlbumRecordWrapper.UserTenantAlbumRecord::getId).collect(Collectors.toList());
|
|
|
+ baseMapper.updateMsgStatus(ids,2);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -746,4 +747,16 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
|
|
|
log.error("机构学生训练教材过期", e);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private void temporarySend(Long userId,String phone, String tenantAlbumName) {
|
|
|
+ Map<Long, String> receivers = new HashMap<>();
|
|
|
+ receivers.put(userId, phone);
|
|
|
+ try {
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.TENANT_ALBUM_EXPIRE,
|
|
|
+ receivers, null, 0, null, ClientEnum.TENANT_STUDENT.getCode(),tenantAlbumName);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("机构学生训练教材过期", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|