Browse Source

八爪鱼增加剩余有效天数一列

yurk 2 years ago
parent
commit
4cae53fc36

+ 2 - 0
fhKeeper/formulahousekeeper/octopus/src/views/customer/list.vue

@@ -34,6 +34,8 @@
             
             
             <el-table-column prop="expirationDate" label="有效期"  min-width="160" align="center">
             <el-table-column prop="expirationDate" label="有效期"  min-width="160" align="center">
             </el-table-column>
             </el-table-column>
+            <el-table-column prop="remainingValidDays" label="剩余有效天数"  min-width="160" align="center">
+            </el-table-column>
             <el-table-column prop="wxCorpid" label="企业微信"  min-width="160" align="center">
             <el-table-column prop="wxCorpid" label="企业微信"  min-width="160" align="center">
             </el-table-column>
             </el-table-column>
             <el-table-column prop="dingdingCorpid" label="钉钉"  min-width="160" align="center">
             <el-table-column prop="dingdingCorpid" label="钉钉"  min-width="160" align="center">

+ 3 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/controller/CompanyController.java

@@ -98,6 +98,9 @@ public class CompanyController {
                     re.setCanDelete(1);
                     re.setCanDelete(1);
                 }
                 }
             }
             }
+            LocalDateTime expirationDate = re.getExpirationDate();
+            Duration duration=Duration.between(now,expirationDate);
+            re.setRemainingValidDays(duration.toDays()>=0?duration.toDays():0);
         });
         });
         List<Integer> collect = records.stream().map(Company::getId).collect(Collectors.toList());
         List<Integer> collect = records.stream().map(Company::getId).collect(Collectors.toList());
         if (collect.size() > 0) {
         if (collect.size() > 0) {

+ 3 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/entity/Company.java

@@ -153,6 +153,9 @@ public class Company extends Model<Company> {
     @TableField(exist = false)
     @TableField(exist = false)
     private Integer canDelete;
     private Integer canDelete;
 
 
+    @TableField(exist = false)
+    private long remainingValidDays;
+
     @Override
     @Override
     protected Serializable pkVal() {
     protected Serializable pkVal() {
         return this.id;
         return this.id;