|
@@ -835,24 +835,29 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
|
|
|
//查询过期并且没有停用的机构,将其停用
|
|
|
Date maturity = DateUtils.addDays(now, -1);
|
|
|
- List<TenantInfo> maturityTenant = baseMapper.queryExpiryTenant(maturity);
|
|
|
+ Map<String, Object> par = new HashMap<>();
|
|
|
+ par.put("expiryDate", maturity);
|
|
|
+ List<TenantInfoInfoPageVo> maturityTenant = baseMapper.queryPage(par);
|
|
|
maturityTenant.forEach(t -> {
|
|
|
- t.setState(2);
|
|
|
- t.setUpdatedBy(-1);
|
|
|
- t.setUpdatedTime(now);
|
|
|
- this.updateById(t);
|
|
|
+ TenantInfo tenantInfo = baseMapper.selectById(t.getId());
|
|
|
+ tenantInfo.setState(2);
|
|
|
+ tenantInfo.setUpdatedBy(-1);
|
|
|
+ tenantInfo.setUpdatedTime(now);
|
|
|
+ this.updateById(tenantInfo);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
private void checkAndSend(Date now, int i) {
|
|
|
- Date one = DateUtils.addDays(now, i);
|
|
|
- List<TenantInfo> oneTenant = baseMapper.queryExpiryTenant(one);
|
|
|
- send(oneTenant, DateUtils.formatDate(one, "yyyy年MM月dd日"));
|
|
|
+ Date expiryDate = DateUtils.addDays(now, i);
|
|
|
+ Map<String, Object> par = new HashMap<>();
|
|
|
+ par.put("expiryDate", expiryDate);
|
|
|
+ List<TenantInfoInfoPageVo> oneTenant = baseMapper.queryPage(par);
|
|
|
+ send(oneTenant, DateUtils.formatDate(expiryDate, "yyyy年MM月dd日"));
|
|
|
}
|
|
|
|
|
|
- private void send(List<TenantInfo> infoList, String dateStr) {
|
|
|
+ private void send(List<TenantInfoInfoPageVo> infoList, String dateStr) {
|
|
|
infoList.forEach(t -> {
|
|
|
- Object[] objects = {t.getName(), dateStr};
|
|
|
+ Object[] objects = {t.getName(), t.getServeName(), dateStr, t.getStudentUpLimit()};
|
|
|
tenantInfoSendMsgService.platformSendToAll(EXPIRATION, t.getUserId(), t.getEmail(), t.getPhone(), objects);
|
|
|
});
|
|
|
}
|