diff --git a/xhpc-modules/xhpc-tenant/src/main/java/com/xhpc/tenant/task/XhpcTenantTask.java b/xhpc-modules/xhpc-tenant/src/main/java/com/xhpc/tenant/task/XhpcTenantTask.java index 8fb70c98..47f66ce5 100644 --- a/xhpc-modules/xhpc-tenant/src/main/java/com/xhpc/tenant/task/XhpcTenantTask.java +++ b/xhpc-modules/xhpc-tenant/src/main/java/com/xhpc/tenant/task/XhpcTenantTask.java @@ -38,15 +38,15 @@ public class XhpcTenantTask { /** - * 每天一点自动清理过期租户 + * 提前15天通知即将到期的租户 */ @Scheduled(cron = "0 0 14 * * ? ") private void ExpiringTenantSmsTask(){ - String expireTime = DateUtil.formatDateTime(com.xhpc.common.util.DateUtil.addDay(new Date(), -15)); + String expireTime = DateUtil.formatDate(com.xhpc.common.util.DateUtil.addDay(new Date(), 15)); List expireDomainList = tenantMapper.selectExpiringList(expireTime); for(XhpcTenantDomain domain: expireDomainList){ - // todo 发短信提醒 + if (StringUtils.isEmpty(domain.getContactNumber())){ continue; } diff --git a/xhpc-modules/xhpc-tenant/src/main/resources/mapper/XhpcTenantMapper.xml b/xhpc-modules/xhpc-tenant/src/main/resources/mapper/XhpcTenantMapper.xml index de7f7fd9..674e82f5 100644 --- a/xhpc-modules/xhpc-tenant/src/main/resources/mapper/XhpcTenantMapper.xml +++ b/xhpc-modules/xhpc-tenant/src/main/resources/mapper/XhpcTenantMapper.xml @@ -273,7 +273,7 @@ select from xhpc_tenant - where is_deleted = 0 and status = 1 and expire_time is not null and expire_time #{expireTime} + where is_deleted = 0 and status = 1 and expire_time is not null and DATE_FORMAT(expire_time,'%Y-%m-%d') #{expireTime} \ No newline at end of file