|
@@ -57,22 +57,43 @@ public class GetPatentPictureFromWebThread extends Thread {
|
|
}
|
|
}
|
|
UploadPatentWebDTO uploadPatentWebDTO = uploadPatentWebDTOs.remove(0);
|
|
UploadPatentWebDTO uploadPatentWebDTO = uploadPatentWebDTOs.remove(0);
|
|
try {
|
|
try {
|
|
|
|
+ String usedNo = uploadPatentWebDTO.getStarPatentVO().getPublicNo();
|
|
|
|
+ if (usedNo == null) {
|
|
|
|
+ usedNo = uploadPatentWebDTO.getStarPatentVO().getPublicAccreditNo();
|
|
|
|
+ }
|
|
|
|
+ if (usedNo.contains("CN")) {
|
|
|
|
+ PatentStarApiService patentStarApiService = applicationContext.getBean(PatentStarApiService.class);
|
|
|
|
|
|
- PatentStarApiService patentStarApiService = applicationContext.getBean(PatentStarApiService.class);
|
|
|
|
- String pictureUrl = patentStarApiService.getPictureApi(uploadPatentWebDTO.getStarPatentVO().getRowApplicationNo());
|
|
|
|
|
|
+ String pictureUrl = patentStarApiService.getPictureApi(uploadPatentWebDTO.getStarPatentVO().getRowApplicationNo());
|
|
|
|
+
|
|
|
|
+ if (pictureUrl != null && !pictureUrl.contains("408")) {
|
|
|
|
+ File file = FileUtils.getPictureFileByUrl(pictureUrl);
|
|
|
|
+ FileManagerService fileManagerService = applicationContext.getBean(FileManagerService.class);
|
|
|
|
+ String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
|
|
|
|
+ fileManagerService.uploadFileWithGuid(file, guid);
|
|
|
|
+ } else {
|
|
|
|
+ recordQuestionPatent(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ ImportSinglePatentService importSinglePatentService = applicationContext.getBean(ImportSinglePatentService.class);
|
|
|
|
+ byte[] bytes = importSinglePatentService.getImages(usedNo);
|
|
|
|
+ if (bytes != null) {
|
|
|
|
+ File file = FileUtils.getFileByBytes(bytes, usedNo, "jpg");
|
|
|
|
+ FileManagerService fileManagerService = applicationContext.getBean(FileManagerService.class);
|
|
|
|
+ String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
|
|
|
|
+ fileManagerService.uploadFileWithGuid(file, guid);
|
|
|
|
+ file.delete();
|
|
|
|
+ } else {
|
|
|
|
+ recordQuestionPatent(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
- if (pictureUrl != null && !pictureUrl.contains("408")) {
|
|
|
|
- File file = FileUtils.getPictureFileByUrl(pictureUrl);
|
|
|
|
- FileManagerService fileManagerService = applicationContext.getBean(FileManagerService.class);
|
|
|
|
- String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
|
|
|
|
- fileManagerService.uploadFileWithGuid(file, guid);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- recordQuestionPatent(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
|
|
|
|
}
|
|
}
|
|
taskThread.updateProcess(false, 2, "");
|
|
taskThread.updateProcess(false, 2, "");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
taskThread.updateProcess(true, 2, "");
|
|
taskThread.updateProcess(true, 2, "");
|
|
|
|
+ recordQuestionPatent(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
|
|
|
|
+
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -108,7 +129,7 @@ public class GetPatentPictureFromWebThread extends Thread {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void recordQuestionPatent(String appNo){
|
|
|
|
|
|
+ public void recordQuestionPatent(String appNo) {
|
|
PatentImportErrorLog patentImportErrorLog = new PatentImportErrorLog();
|
|
PatentImportErrorLog patentImportErrorLog = new PatentImportErrorLog();
|
|
patentImportErrorLog.setPatentNo(appNo);
|
|
patentImportErrorLog.setPatentNo(appNo);
|
|
patentImportErrorLog.setErrorType(3);
|
|
patentImportErrorLog.setErrorType(3);
|