|
@@ -2,6 +2,7 @@ package com.zkqy.system.service.impl;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
+import java.time.Duration;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.ZoneOffset;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
@@ -83,7 +84,29 @@ public class SysTenantServiceImpl implements ISysTenantService
|
|
|
@Override
|
|
|
public List<SysTenant> selectSysTenantList(SysTenant sysTenant)
|
|
|
{
|
|
|
- return sysTenantMapper.selectSysTenantList(sysTenant);
|
|
|
+ SymmetricCrypto symmetricCrypto = new SymmetricCrypto(SymmetricAlgorithm.DES, "sgEsnN6QWq8W7j5H01020304".getBytes());
|
|
|
+ List<SysTenant> sysTenants = sysTenantMapper.selectSysTenantList(sysTenant);
|
|
|
+ sysTenants.stream().forEach(item->{
|
|
|
+ if(item.getTenantExpirationTime()!= null){
|
|
|
+ String decryptStr = symmetricCrypto.decryptStr(item.getTenantExpirationTime(), CharsetUtil.CHARSET_UTF_8);
|
|
|
+ LocalDateTime localDateTime = DateUtils.toLocalDateTime(decryptStr.toString(), "yyyy-MM-dd HH:mm:ss");
|
|
|
+ LocalDateTime start = LocalDateTimeUtil.parse(LocalDateTime.now().toString());
|
|
|
+ LocalDateTime end = LocalDateTimeUtil.parse(localDateTime.toString());
|
|
|
+ Duration between = LocalDateTimeUtil.between(start, end);
|
|
|
+ Long l = between.toDays();
|
|
|
+ if(l<0){
|
|
|
+ //String endDay = l.toString().replace("-", "").toString();
|
|
|
+ //item.setTenantExpirationTime("已到期"+endDay+"天");
|
|
|
+ item.setTenantExpirationTime("已到期");
|
|
|
+ }else{
|
|
|
+ item.setTenantExpirationTime(l.toString());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ item.setTenantExpirationTime("未激活");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //return sysTenantMapper.selectSysTenantList(sysTenant);
|
|
|
+ return sysTenants;
|
|
|
}
|
|
|
|
|
|
/**
|