lyhzzz 2 miesięcy temu
rodzic
commit
1d75028df2

+ 4 - 1
doc/fd_fusion-local.sql

@@ -1029,4 +1029,7 @@ ALTER TABLE `laser`.`t_case`
     ADD COLUMN `offline_path` varchar(255) NULL COMMENT '离线包路径' AFTER `offline_status`;
 
 ALTER TABLE `laser`.`t_case`
-    ADD COLUMN `offline_time` varchar(255) NULL COMMENT '离线包打包时间' AFTER `offline_path`;
+    ADD COLUMN `offline_start_time` varchar(255) NULL COMMENT '离线包打包时间' AFTER `offline_path`;
+
+ALTER TABLE `laser`.`t_case`
+    ADD COLUMN `offline_end_time` varchar(255) NULL COMMENT '离线包打包时间' AFTER `offline_start_time`;

+ 4 - 4
src/main/java/com/fdkankan/fusion/down/CaseDownService.java

@@ -139,11 +139,7 @@ public class CaseDownService {
     public void downOffline(Integer caseId,String zipPath){
         String caseOffPath = null;
         try {
-            String timeKey = DateUtils.dateStr();
-            caseOffPath = zipPath+"offline_"+caseId+"_"+timeKey ;
-            caseService.updateOfflineStatus(caseId,1,zipPath);
             String redisKey = String.format(downProcessKey, caseId);
-
             if( redisUtil.hasKey(redisKey)){
                 String res = redisUtil.get(redisKey);
                 DownloadProcessVo downloadProcessVo = JSONObject.parseObject(res, DownloadProcessVo.class);
@@ -152,6 +148,10 @@ public class CaseDownService {
                 }
             }
 
+            String timeKey = DateUtils.dateStr();
+            caseOffPath = zipPath+"offline_"+caseId+"_"+timeKey ;
+            caseService.updateOfflineStatus(caseId,1,zipPath);
+
             setRedisProcess(caseId,0);
             //复制前端资源
             cpIndexHtml(caseId,caseOffPath);

+ 5 - 2
src/main/java/com/fdkankan/fusion/entity/CaseEntity.java

@@ -144,6 +144,9 @@ public class CaseEntity implements Serializable {
     @TableField("offline_path")
     private String offlinePath;
 
-    @TableField("offline_time")
-    private String offlineTime;
+    @TableField("offline_start_time")
+    private String offlineStartTime;
+
+    @TableField("offline_end_time")
+    private String offlineEndTime;
 }

+ 6 - 0
src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java

@@ -337,6 +337,12 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
         wrapper.eq(CaseEntity::getCaseId,caseId);
         wrapper.set(CaseEntity::getOfflineStatus,status);
         wrapper.set(CaseEntity::getOfflinePath,zipPath);
+        if (status == 2) {
+            wrapper.set(CaseEntity::getOfflineEndTime,new Date());
+        }
+        if (status == 1) {
+            wrapper.set(CaseEntity::getOfflineStartTime,new Date());
+        }
         this.update(wrapper);
     }
 }