|
@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -51,6 +52,7 @@ public class UploadPatentBatchService {
|
|
|
private final PatentAffairService patentAffairService;
|
|
|
private final ImportErrorLogMapper importErrorLogMapper;
|
|
|
private final AssoProductPatentService assoProductPatentService;
|
|
|
+ private final PatentInstructionService patentInstructionService;
|
|
|
private static int FLAG = 0;
|
|
|
|
|
|
@Async("singleThreadAsyncTaskExecutor")
|
|
@@ -660,23 +662,29 @@ public class UploadPatentBatchService {
|
|
|
* @description 将装配完毕的VO类向数据库中不同的表进行添加或修改操作(dataToDB兄弟类)
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String dataToDBCell(PatentCell patentCell) {
|
|
|
+ public String dataToDBCell(PatentCell patentCell) throws ParseException {
|
|
|
UploadParamsVO uploadParamsVO = new UploadParamsVO();
|
|
|
Patent patent =new Patent();
|
|
|
//设置专利号
|
|
|
patent.setPatentNo(patentCell.getPatentNo());
|
|
|
//设置摘要
|
|
|
- patent.setAbstractStr(patentCell.getAbstrc());
|
|
|
+ patent.setAbstractStr(patentCell.getAbstrText());
|
|
|
//设置标题
|
|
|
patent.setName(patentCell.getTitle());
|
|
|
- uploadParamsVO.setPatent(patent);
|
|
|
+ //设置公开日
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd");
|
|
|
+ Date date = simpleDateFormat.parse(patentCell.getPubilcDate());
|
|
|
+ Integer ts = (int)date.getTime();
|
|
|
+ patent.setPublicDate(ts);
|
|
|
+ //设置摘要附图
|
|
|
+ patent.setAbstractPath(patentCell.getPicUrl());
|
|
|
+ //设置pdf文档
|
|
|
+ patentInstructionService.edit( patentCell.getPatentNo(),patentCell.getPdf());
|
|
|
//设置公开号
|
|
|
-// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd");
|
|
|
-// Date date = simpleDateFormat.parse(patentCell.getPubilcDate());
|
|
|
-// long ts = date.getTime();
|
|
|
-// patent.setPublicDate();
|
|
|
- getOneOrInsertOne(uploadParamsVO);
|
|
|
+ patent.setPublicNo(patentCell.getPublicAccreditNo());
|
|
|
uploadParamsVO.setSimpleStatus(patentCell.getStatue());
|
|
|
+ uploadParamsVO.setPatent(patent);
|
|
|
+ getOneOrInsertOne(uploadParamsVO);
|
|
|
try {
|
|
|
//专利信息 OS_PATENT
|
|
|
if (uploadParamsVO.getPatent() != null) {
|
|
@@ -711,6 +719,10 @@ public class UploadPatentBatchService {
|
|
|
patentTypeNoBusiness(uploadParamsVO);
|
|
|
//事务信息 OS_PATENT_AFFAIR
|
|
|
patentAffairBusiness(uploadParamsVO);
|
|
|
+ //当专题库id不为null时添加专利到专题库
|
|
|
+ if(patentCell.getProjectId()!=null){
|
|
|
+ projectPatentLinkService.updateProjectPatent(patentCell.getProjectId(),uploadParamsVO.getPatent().getId());
|
|
|
+ }
|
|
|
return Response.success();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|