瀏覽代碼

更新剩余天数判断

tags/v2.4.1
xiaoying 1 年之前
父節點
當前提交
2f1830d922
共有 1 個檔案被更改,包括 8 行新增1 行删除
  1. +8
    -1
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java

+ 8
- 1
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java 查看文件

@@ -334,8 +334,15 @@ public class TenantServiceImpl implements TenantService {
if (ObjectUtil.isNotNull(tenantItem)) {
//获取有效期等
vo.setEffectiveDate(DateUtil.formatDate(tenantItem.getBeginTime()) + CommonConstant.TILDE + DateUtil.formatDate(tenantItem.getEndTime()));
Long day = null;
//超过有效期则为flase
boolean flag = tenantItem.getBeginTime().after(DateUtil.date());
if (!flag) {
day = DateUtil.between(DateUtil.date(), tenantItem.getEndTime(), DateUnit.DAY);
} else {
day = DateUtil.between(tenantItem.getBeginTime(), tenantItem.getEndTime(), DateUnit.DAY);
}
//获取剩余天数
long day = DateUtil.between(DateUtil.date(), tenantItem.getEndTime(), DateUnit.DAY);
vo.setRemainDays(day);
}
//此处userId = tenantId 效果一致

Loading…
取消
儲存