Browse Source

增加剩余时间的判断

tags/v2.4.1
xiaoying 1 year ago
parent
commit
686538fdc4
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java

+ 4
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java View File

@@ -337,11 +337,15 @@ public class TenantServiceImpl implements TenantService {
Long day = null;
//超过有效期则为flase
boolean flag = tenantItem.getBeginTime().after(DateUtil.date());
boolean flag2 = tenantItem.getEndTime().after(DateUtil.date());
if (!flag) {
day = DateUtil.between(DateUtil.date(), tenantItem.getEndTime(), DateUnit.DAY);
} else {
day = DateUtil.between(tenantItem.getBeginTime(), tenantItem.getEndTime(), DateUnit.DAY);
}
if (!flag2) {
day = 0L;
}
//获取剩余天数
vo.setRemainDays(day);
}

Loading…
Cancel
Save