Prechádzať zdrojové kódy

feat:剩余时间精确到小时、激活租户后刷新列表

侯茂昌 1 rok pred
rodič
commit
3ffa614351

+ 25 - 4
zkqy-system/src/main/java/com/zkqy/system/service/impl/SysTenantServiceImpl.java

@@ -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);
     }
 

+ 1 - 0
zkqy-ui/src/views/system/tenant/code/index.vue

@@ -205,6 +205,7 @@ export default {
         pageSize: 10,
         operator: undefined,
         ipAddress: undefined,
+        isEnablePaging:false,
       },
     };
   },

+ 7 - 1
zkqy-ui/src/views/system/tenant/index.vue

@@ -487,6 +487,7 @@ export default {
           { required: true, message: "请输入租户激活码", trigger: "blur" },
         ],
       },
+      currentPage:""
     };
   },
   computed: {
@@ -551,7 +552,10 @@ export default {
     handleOpe() {},
     /** 查询租户信息列表 */
     getList() {
+      console.log("dddddd",)
       this.loading = true;
+      this.currentPage=this.queryParams.pageNum;
+      //alert("ddddddddd")
       listTenant(this.queryParams).then((response) => {
         this.tenantList = response.rows;
         this.total = response.total;
@@ -813,6 +817,8 @@ export default {
           );
           if (response.code == 200) {
             this.$message.success("激活成功");
+            //重新刷新列表
+            this.getList();
           } else {
             this.$message.error("激活失败");
           }
@@ -831,7 +837,7 @@ export default {
         tenantId: null,
         tenantExpirationTime: null,
       };
-    },
+    }
   },
 };
 </script>