|
@@ -21,7 +21,6 @@ import java.util.Arrays;
|
|
|
*/
|
|
|
@Service
|
|
|
@RequiredArgsConstructor
|
|
|
-@EnableAsync
|
|
|
public class ImportPatentQueenService extends ServiceImpl<ImportPatentQueenMapper, ImportPatentQueen> {
|
|
|
private final ImportSinglePatentService importSinglePatentService;
|
|
|
private final CompareLiteratureService compareLiteratureService;
|
|
@@ -40,22 +39,24 @@ public class ImportPatentQueenService extends ServiceImpl<ImportPatentQueenMappe
|
|
|
/**
|
|
|
*
|
|
|
*/
|
|
|
- @Async
|
|
|
public void importPatent(ImportPatentQueen importPatentQueen) {
|
|
|
// RefreshPatentDTO refreshPatentDTO = new RefreshPatentDTO();
|
|
|
// refreshPatentDTO.setPatentNo(importPatentQueen.getPatentNo());
|
|
|
// refreshPatentDTO.setRefreshContent(Arrays.asList(2,3,4,5,6));
|
|
|
- Integer projectId = importPatentQueen.getProjectId();
|
|
|
- String patentNo = importPatentQueen.getPatentNo();
|
|
|
- try {
|
|
|
- importSinglePatentService.addSinglePatent(importPatentQueen.getPatentNo());
|
|
|
- compareLiteratureService.updateByPatentNo(projectId, patentNo);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- total = total - 1;
|
|
|
- this.removeById(importPatentQueen);
|
|
|
- this.startImport();
|
|
|
+ new Thread(() -> {
|
|
|
+ Integer projectId = importPatentQueen.getProjectId();
|
|
|
+ String patentNo = importPatentQueen.getPatentNo();
|
|
|
+ try {
|
|
|
+ importSinglePatentService.addSinglePatent(importPatentQueen.getPatentNo());
|
|
|
+ compareLiteratureService.updateByPatentNo(projectId, patentNo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ total = total - 1;
|
|
|
+ this.removeById(importPatentQueen);
|
|
|
+ this.startImport();
|
|
|
+ }).start();
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|