|
|
@@ -342,6 +342,18 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
projectDocument.setDocumentType(costProjectDocument.getDocumentType()+"-"+templateManagerById.getDocumentType());
|
|
|
projectDocument.setDocumentTypeName(templateManagerById.getDocumentTypeName());
|
|
|
projectDocument.setDocumentAlias(templateManagerById.getAlias());
|
|
|
+ // 异步执行耗时任务
|
|
|
+ asyncExecutor.execute(() -> {
|
|
|
+ // 这里是你的业务逻辑
|
|
|
+ try {
|
|
|
+ System.out.println("开始处理数据...");
|
|
|
+ this.createDocument(projectDocument.getId());
|
|
|
+ Thread.sleep(5000); // 模拟耗时操作
|
|
|
+ System.out.println("数据处理完成");
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ Thread.currentThread().interrupt();
|
|
|
+ }
|
|
|
+ });
|
|
|
//super.create(projectDocument);
|
|
|
this.save(projectDocument);
|
|
|
|
|
|
@@ -389,18 +401,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
arrayList.add(costProjectDocumentFile);
|
|
|
});
|
|
|
//asyncService.executeAsync(projectDocument.getId());
|
|
|
- // 异步执行耗时任务
|
|
|
- asyncExecutor.execute(() -> {
|
|
|
- // 这里是你的业务逻辑
|
|
|
- try {
|
|
|
- System.out.println("开始处理数据...");
|
|
|
- this.createDocument(projectDocument.getId());
|
|
|
- Thread.sleep(5000); // 模拟耗时操作
|
|
|
- System.out.println("数据处理完成");
|
|
|
- } catch (InterruptedException e) {
|
|
|
- Thread.currentThread().interrupt();
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
costProjectDocumentFileManager.saveBatch(arrayList);
|
|
|
}
|
|
|
|