|
@@ -98,6 +98,14 @@ public class SysTenantServiceImpl implements ISysTenantService
|
|
|
//String endDay = l.toString().replace("-", "").toString();
|
|
|
//item.setTenantExpirationTime("已到期"+endDay+"天");
|
|
|
item.setTenantExpirationTime("已到期");
|
|
|
+ }else if(l==0){
|
|
|
+ //计算两个日期相差的小时数
|
|
|
+ Long totalMinutes = LocalDateTimeUtil.between(start, end, ChronoUnit.MINUTES);
|
|
|
+ //分钟转时间
|
|
|
+ int totalMinutesInt = Integer.parseInt(totalMinutes.toString());
|
|
|
+ int hours= (totalMinutesInt/60);
|
|
|
+ int remainingMinutes =totalMinutesInt%60;
|
|
|
+ item.setTenantExpirationTime(0+"天"+hours+"小时"+remainingMinutes+"分钟");
|
|
|
}else{
|
|
|
item.setTenantExpirationTime(l.toString());
|
|
|
}
|
|
@@ -353,11 +361,24 @@ public class SysTenantServiceImpl implements ISysTenantService
|
|
|
public static void main(String[] args) {
|
|
|
//校验充值天数是否正确
|
|
|
SymmetricCrypto symmetricCrypto = new SymmetricCrypto(SymmetricAlgorithm.DES, "sgEsnN6QWq8W7j5H01020304".getBytes());
|
|
|
- String a = symmetricCrypto.decryptStr("facb3dad9a590c24584416fd0e9690e6ad8116cefdd53d5f");
|
|
|
+ String a = symmetricCrypto.decryptStr("2d034a7f7f6cc999b23b15c29e1e278c594a628aed13e40a");
|
|
|
+ System.out.println(a);
|
|
|
+ long between = LocalDateTimeUtil.between(LocalDateTime.now(), DateUtils.toLocalDateTime(a, "yyyy-MM-dd HH:mm:ss"), ChronoUnit.DAYS);
|
|
|
+ System.out.println(between);
|
|
|
+ if(between==0){
|
|
|
+ //计算两个日期相差的小时数
|
|
|
+ Long totalMinutes = LocalDateTimeUtil.between(LocalDateTime.now(), DateUtils.toLocalDateTime(a, "yyyy-MM-dd HH:mm:ss"), ChronoUnit.MINUTES);
|
|
|
+ //分钟转时间
|
|
|
+ int totalMinutesInt = Integer.parseInt(totalMinutes.toString());
|
|
|
+ int hours= (totalMinutesInt/60);
|
|
|
+ int remainingMinutes =totalMinutesInt%60;
|
|
|
+ System.out.println(hours+"小时"+remainingMinutes+"分钟后就过期了");
|
|
|
+ }
|
|
|
+
|
|
|
//判断如果用户过期了
|
|
|
- LocalDateTime activeDateTime = LocalDateTimeUtil.offset(LocalDateTime.now(), -100, ChronoUnit.DAYS);
|
|
|
- String activeDateTimeStr = DateUtils.toLocalDateTimeStr(activeDateTime);
|
|
|
- String newActiveDateTimeStr= symmetricCrypto.encryptHex(activeDateTimeStr);
|
|
|
+ //LocalDateTime activeDateTime = LocalDateTimeUtil.offset(LocalDateTime.now(), -100, ChronoUnit.DAYS);
|
|
|
+ //String activeDateTimeStr = DateUtils.toLocalDateTimeStr(activeDateTime);
|
|
|
+ //String newActiveDateTimeStr= symmetricCrypto.encryptHex(activeDateTimeStr);
|
|
|
//System.out.println(newActiveDateTimeStr);
|
|
|
}
|
|
|
|