wangliang 4 лет назад
Родитель
Сommit
3a960834fd

+ 1 - 28
themis-business/src/main/java/com/qmth/themis/business/templete/TaskExportCommon.java

@@ -160,33 +160,6 @@ public class TaskExportCommon {
         }
         }
     }
     }
 
 
-    /**
-     * 换算进度
-     *
-     * @param max
-     * @param min
-     * @param size
-     * @param txtList
-     * @return
-     */
-    public List<String> progress(int max, int min, int size, List<String> txtList) {
-        BigDecimal bigDecimal = new BigDecimal(100);
-        BigDecimal progress = new BigDecimal(Double.valueOf(new BigDecimal(max).divide(new BigDecimal(size), 2, BigDecimal.ROUND_HALF_UP).multiply(bigDecimal).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue())).setScale(0, BigDecimal.ROUND_HALF_UP);
-        if (progress.intValue() == 100) {
-            this.tbTaskHistory.setStatus(TaskStatusEnum.FINISH);
-            this.tbTaskHistory.setSummary("共导出了" + size + "条数据");
-            this.tbTaskHistory.setFinishTime(new Date());
-            txtList.add(DateUtil.format(new Date(), this.timeFormat) + "->数据导出完毕," + this.tbTaskHistory.getSummary());
-        } else {
-            this.tbTaskHistory.setStatus(TaskStatusEnum.RUNNING);
-            this.tbTaskHistory.setSummary("正在导出第" + min + "条至" + max + "条数据");
-            txtList.add(DateUtil.format(new Date(), this.timeFormat) + "->数据导出中," + this.tbTaskHistory.getSummary());
-        }
-        this.tbTaskHistory.setProgress(progress.doubleValue());
-        this.tbTaskHistoryService.updateById(this.tbTaskHistory);
-        return txtList;
-    }
-
     /**
     /**
      * 异常处理
      * 异常处理
      *
      *
@@ -201,7 +174,7 @@ public class TaskExportCommon {
         String exceptionStr = "数据导出到第" + (y == 0 ? y + 1 : y) + "条时发生异常:" + e.getMessage();
         String exceptionStr = "数据导出到第" + (y == 0 ? y + 1 : y) + "条时发生异常:" + e.getMessage();
         txtList.add(DateUtil.format(new Date(), this.timeFormat) + "->" + exceptionStr);
         txtList.add(DateUtil.format(new Date(), this.timeFormat) + "->" + exceptionStr);
         this.tbTaskHistory.setSummary(exceptionStr);
         this.tbTaskHistory.setSummary(exceptionStr);
-        this.tbTaskHistoryService.updateById(this.tbTaskHistory);
+//        this.tbTaskHistoryService.updateById(this.tbTaskHistory);
         return txtList;
         return txtList;
     }
     }
 
 

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/TaskImportCommon.java

@@ -153,7 +153,7 @@ public class TaskImportCommon {
         String exceptionStr = "数据处理到第" + (y == 0 ? y + 1 : y) + "条时发生异常:" + e.getMessage();
         String exceptionStr = "数据处理到第" + (y == 0 ? y + 1 : y) + "条时发生异常:" + e.getMessage();
         txtList.add(DateUtil.format(new Date(), this.timeFormat) + "->" + exceptionStr);
         txtList.add(DateUtil.format(new Date(), this.timeFormat) + "->" + exceptionStr);
         this.tbTaskHistory.setSummary(exceptionStr);
         this.tbTaskHistory.setSummary(exceptionStr);
-        this.tbTaskHistoryService.updateById(this.tbTaskHistory);
+//        this.tbTaskHistoryService.updateById(this.tbTaskHistory);
         return txtList;
         return txtList;
     }
     }
 
 

+ 2 - 2
themis-business/src/main/java/com/qmth/themis/business/templete/service/impl/TempleteLogicServiceImpl.java

@@ -290,7 +290,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
             txtList.add(DateUtil.format(new Date(), timeFormat) + "->数据处理中," + tbTaskHistory.getSummary());
             txtList.add(DateUtil.format(new Date(), timeFormat) + "->数据处理中," + tbTaskHistory.getSummary());
         }
         }
         tbTaskHistory.setProgress(progress.doubleValue());
         tbTaskHistory.setProgress(progress.doubleValue());
-        tbTaskHistoryService.updateById(tbTaskHistory);
+//        tbTaskHistoryService.updateById(tbTaskHistory);
         return txtList;
         return txtList;
     }
     }
 
 
@@ -319,7 +319,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
             txtList.add(DateUtil.format(new Date(), timeFormat) + "->数据导出中," + tbTaskHistory.getSummary());
             txtList.add(DateUtil.format(new Date(), timeFormat) + "->数据导出中," + tbTaskHistory.getSummary());
         }
         }
         tbTaskHistory.setProgress(progress.doubleValue());
         tbTaskHistory.setProgress(progress.doubleValue());
-        tbTaskHistoryService.updateById(tbTaskHistory);
+//        tbTaskHistoryService.updateById(tbTaskHistory);
         return txtList;
         return txtList;
     }
     }
 }
 }