|
@@ -15,6 +15,7 @@ import com.hotent.baseInfo.model.AuditedUnit;
|
|
|
import com.hotent.baseInfo.model.CostDocumentTemplate;
|
|
import com.hotent.baseInfo.model.CostDocumentTemplate;
|
|
|
import com.hotent.baseInfo.model.CostDocumentTemplateFile;
|
|
import com.hotent.baseInfo.model.CostDocumentTemplateFile;
|
|
|
import com.hotent.baseInfo.model.CostDocumentWh;
|
|
import com.hotent.baseInfo.model.CostDocumentWh;
|
|
|
|
|
+import com.hotent.common.MyAsyncExecutor;
|
|
|
import com.hotent.config.EipConfig;
|
|
import com.hotent.config.EipConfig;
|
|
|
import com.hotent.constant.BaseConstant;
|
|
import com.hotent.constant.BaseConstant;
|
|
|
import com.hotent.project.manager.*;
|
|
import com.hotent.project.manager.*;
|
|
@@ -38,7 +39,6 @@ import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
|
import org.apache.tools.ant.util.DateUtils;
|
|
import org.apache.tools.ant.util.DateUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.scheduling.annotation.Async;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
@@ -64,7 +64,8 @@ import static org.apache.tools.ant.util.DateUtils.ISO8601_DATE_PATTERN;
|
|
|
@Service
|
|
@Service
|
|
|
public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectDocumentDao, CostProjectDocument> implements CostProjectDocumentManager {
|
|
public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectDocumentDao, CostProjectDocument> implements CostProjectDocumentManager {
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private MyAsyncExecutor asyncExecutor;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CostProjectDocumentFileManager costProjectDocumentFileManager;
|
|
private CostProjectDocumentFileManager costProjectDocumentFileManager;
|
|
@@ -389,7 +390,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
});
|
|
});
|
|
|
//asyncService.executeAsync(projectDocument.getId());
|
|
//asyncService.executeAsync(projectDocument.getId());
|
|
|
// 异步执行耗时任务
|
|
// 异步执行耗时任务
|
|
|
- /*asyncExecutor.execute(() -> {
|
|
|
|
|
|
|
+ asyncExecutor.execute(() -> {
|
|
|
// 这里是你的业务逻辑
|
|
// 这里是你的业务逻辑
|
|
|
try {
|
|
try {
|
|
|
System.out.println("开始处理数据...");
|
|
System.out.println("开始处理数据...");
|
|
@@ -399,7 +400,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
|
Thread.currentThread().interrupt();
|
|
Thread.currentThread().interrupt();
|
|
|
}
|
|
}
|
|
|
- });*/
|
|
|
|
|
|
|
+ });
|
|
|
costProjectDocumentFileManager.saveBatch(arrayList);
|
|
costProjectDocumentFileManager.saveBatch(arrayList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -408,7 +409,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
//asyncService.executeAsync(costProjectDocument.getId());
|
|
//asyncService.executeAsync(costProjectDocument.getId());
|
|
|
|
|
|
|
|
// 异步执行耗时任务
|
|
// 异步执行耗时任务
|
|
|
- /*asyncExecutor.execute(() -> {
|
|
|
|
|
|
|
+ asyncExecutor.execute(() -> {
|
|
|
// 这里是你的业务逻辑
|
|
// 这里是你的业务逻辑
|
|
|
try {
|
|
try {
|
|
|
System.out.println("开始处理数据...");
|
|
System.out.println("开始处理数据...");
|
|
@@ -418,7 +419,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
|
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
|
Thread.currentThread().interrupt();
|
|
Thread.currentThread().interrupt();
|
|
|
}
|
|
}
|
|
|
- });*/
|
|
|
|
|
|
|
+ });
|
|
|
return costProjectDocument.getId();
|
|
return costProjectDocument.getId();
|
|
|
}
|
|
}
|
|
|
|
|
|