|
@@ -3,8 +3,10 @@ package cn.cslg.pas.service.upLoadPatent;
|
|
|
import cn.cslg.pas.common.model.vo.ProjectImportPatentVO;
|
|
|
import cn.cslg.pas.common.model.vo.UploadParamsVO;
|
|
|
import cn.cslg.pas.common.utils.DateUtils;
|
|
|
+import cn.cslg.pas.domain.PQueueData;
|
|
|
import cn.cslg.pas.domain.QueueData;
|
|
|
import cn.cslg.pas.domain.Task;
|
|
|
+import cn.cslg.pas.service.PatentInstructionService;
|
|
|
import cn.cslg.pas.service.TaskService;
|
|
|
import cn.cslg.pas.service.UploadPatentBatchService;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -33,31 +35,49 @@ public class PantentQueueService {
|
|
|
private final ExcutePatentDataExcel excutePatentDataExcel;
|
|
|
private final ExcutePatentDataEpo excutePatentDataEpo;
|
|
|
private final ExcutePatentDataStar excutePatentDataStar;
|
|
|
+ private final PatentInstructionService patentInstructionService;
|
|
|
private final List<Integer> taskQueueList = new ArrayList<>();
|
|
|
- private Boolean flag = false;
|
|
|
+ private final List<PQueueData> setPatentImageQueueList = new ArrayList<>();
|
|
|
+ private final List<PQueueData> setPatentZhuluQueueList = new ArrayList<>();
|
|
|
+ private final List<PQueueData> setPatentRightQueueList = new ArrayList<>();
|
|
|
+ private final List<PQueueData> setPatentInstructionTextQueueList = new ArrayList<>();
|
|
|
+ private final List<PQueueData> setPatentInstructionPDFQueueList = new ArrayList<>();
|
|
|
private final List<QueueData> patentImageQueueList = new ArrayList<>();
|
|
|
private final List<QueueData> patentZhuluQueueList = new ArrayList<>();
|
|
|
private final List<QueueData> patentRightQueueList = new ArrayList<>();
|
|
|
private final List<QueueData> patentInstructionTextQueueList = new ArrayList<>();
|
|
|
+ private final List<QueueData> patentInstructionPDFQueueList = new ArrayList<>();
|
|
|
private final Lock taskLock = new ReentrantLock();
|
|
|
+ private final Lock setPatentImageLock = new ReentrantLock();
|
|
|
+ private final Lock setPatentZhuluLock = new ReentrantLock();
|
|
|
+ private final Lock setPatentRightLock = new ReentrantLock();
|
|
|
+ private final Lock setPatentInstructionTextLock = new ReentrantLock();
|
|
|
+ private final Lock setPatentInstructionPDFLock = new ReentrantLock();
|
|
|
private final Lock patentImageLock = new ReentrantLock();
|
|
|
private final Lock patentZhuluLock = new ReentrantLock();
|
|
|
private final Lock patentRightLock = new ReentrantLock();
|
|
|
private final Lock patentInstructionTextLock = new ReentrantLock();
|
|
|
+ private final Lock patentInstructionPDFLock = new ReentrantLock();
|
|
|
private final Condition taskCondition = taskLock.newCondition();
|
|
|
+ private final Condition setPatentImageCondition = setPatentImageLock.newCondition();
|
|
|
+ private final Condition setPatentZhuluCondition = setPatentZhuluLock.newCondition();
|
|
|
+ private final Condition setPatentRightCondition = setPatentRightLock.newCondition();
|
|
|
+ private final Condition setPatentInstructionTextCondition = setPatentInstructionTextLock.newCondition();
|
|
|
+ private final Condition setPatentInstructionPDFCondition = setPatentInstructionPDFLock.newCondition();
|
|
|
private final Condition patentImageCondition = patentImageLock.newCondition();
|
|
|
private final Condition patentZhuluCondition = patentZhuluLock.newCondition();
|
|
|
private final Condition patentRightCondition = patentRightLock.newCondition();
|
|
|
private final Condition patentInstructionTextCondition = patentInstructionTextLock.newCondition();
|
|
|
+ private final Condition patentInstructionPDFCondition = patentInstructionPDFLock.newCondition();
|
|
|
private final HashMap<String, Integer> patentIdMap = new HashMap<>();
|
|
|
|
|
|
/**
|
|
|
* 生产者:从任务队列取出任务,再调用工厂方法根据任务类型返回对应的生产专利方法的对象将专利分配给消费者
|
|
|
*/
|
|
|
public void addPatnetToQueue() {
|
|
|
- Task task = null;
|
|
|
- try {
|
|
|
- while (true) {
|
|
|
+ while (true) {
|
|
|
+ Task task = new Task();
|
|
|
+ try {
|
|
|
//判断任务队列是否有任务,若没有则该生产者线程睡眠
|
|
|
if (taskQueueList.size() == 0) {
|
|
|
taskLock.lock();
|
|
@@ -86,16 +106,198 @@ public class PantentQueueService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ //任务表更新状态为失败
|
|
|
+ task.setStatus(2);
|
|
|
+ task.setEndTime(DateUtils.getDateTime());
|
|
|
+ taskService.updateById(task);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载线程1:著录项目
|
|
|
+ */
|
|
|
+ public void setPatentZhuLu() {
|
|
|
+ while (true) {
|
|
|
+ try {
|
|
|
+ if (setPatentZhuluQueueList.size() > 0) {
|
|
|
+ PQueueData pQueueData = setPatentZhuluQueueList.remove(0);
|
|
|
+ Task task = pQueueData.getTask();
|
|
|
+ //专利之星
|
|
|
+ //if (task.getType() == 4) {
|
|
|
+ //excutePatentDataStar.setPatentZhuLu(pQueueData.getStarPatent(), pQueueData.getUploadParamsVO());
|
|
|
+ //}
|
|
|
+ ProjectImportPatentVO projectImportPatentVO = new ProjectImportPatentVO();
|
|
|
+ projectImportPatentVO.setProjectId(task.getProjectId());
|
|
|
+ QueueData queueData = new QueueData()
|
|
|
+ .setTask(task)
|
|
|
+ .setUploadParamsVO(pQueueData.getUploadParamsVO())
|
|
|
+ .setProjectImportPatentVO(projectImportPatentVO);
|
|
|
+ //装载完成,将其丢入著录消费者队列,并唤醒著录消费者线程
|
|
|
+ patentZhuluQueueList.add(queueData);
|
|
|
+ patentZhuluLock.lock();
|
|
|
+ patentZhuluCondition.signalAll();
|
|
|
+ patentZhuluLock.unlock();
|
|
|
+
|
|
|
+ } else {
|
|
|
+ setPatentZhuluLock.lock();
|
|
|
+ setPatentZhuluCondition.await();
|
|
|
+ setPatentZhuluLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载线程2:摘要附图
|
|
|
+ */
|
|
|
+ public void setPatentImage() {
|
|
|
+ while (true) {
|
|
|
+ try {
|
|
|
+ if (setPatentImageQueueList.size() > 0) {
|
|
|
+ PQueueData pQueueData = setPatentImageQueueList.remove(0);
|
|
|
+ Task task = pQueueData.getTask();
|
|
|
+ //专利之星
|
|
|
+ if (task.getType() == 4) {
|
|
|
+ excutePatentDataStar.setPatentPicture(pQueueData.getStarPatent(), pQueueData.getUploadParamsVO());
|
|
|
+ }
|
|
|
+ QueueData queueData = new QueueData()
|
|
|
+ .setTask(task)
|
|
|
+ .setUploadParamsVO(pQueueData.getUploadParamsVO());
|
|
|
+ //装载完成,将其丢入摘要附图消费者队列,并唤醒摘要附图消费者线程
|
|
|
+ patentImageQueueList.add(queueData);
|
|
|
+ patentImageLock.lock();
|
|
|
+ patentImageCondition.signalAll();
|
|
|
+ patentImageLock.unlock();
|
|
|
+
|
|
|
+ } else {
|
|
|
+ setPatentImageLock.lock();
|
|
|
+ setPatentImageCondition.await();
|
|
|
+ setPatentImageLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载线程3:权要
|
|
|
+ */
|
|
|
+ public void setPatentRight() {
|
|
|
+ while (true) {
|
|
|
+ try {
|
|
|
+ if (setPatentRightQueueList.size() > 0) {
|
|
|
+ PQueueData pQueueData = setPatentRightQueueList.remove(0);
|
|
|
+ Task task = pQueueData.getTask();
|
|
|
+ //专利之星
|
|
|
+ if (task.getType() == 4) {
|
|
|
+ excutePatentDataStar.setPatentClaim(pQueueData.getStarPatent(), pQueueData.getUploadParamsVO());
|
|
|
+ }
|
|
|
+ QueueData queueData = new QueueData()
|
|
|
+ .setTask(task)
|
|
|
+ .setUploadParamsVO(pQueueData.getUploadParamsVO());
|
|
|
+ //装载完成,将其丢入权要消费者队列,并唤醒权要消费者线程
|
|
|
+ patentRightQueueList.add(queueData);
|
|
|
+ patentRightLock.lock();
|
|
|
+ patentRightCondition.signalAll();
|
|
|
+ patentRightLock.unlock();
|
|
|
+
|
|
|
+ } else {
|
|
|
+ setPatentRightLock.lock();
|
|
|
+ setPatentRightCondition.await();
|
|
|
+ setPatentRightLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载线程4:说明书文本
|
|
|
+ */
|
|
|
+ public void setPatentInstructionText() {
|
|
|
+ while (true) {
|
|
|
+ try {
|
|
|
+ if (setPatentInstructionTextQueueList.size() > 0) {
|
|
|
+ PQueueData pQueueData = setPatentInstructionTextQueueList.remove(0);
|
|
|
+ Task task = pQueueData.getTask();
|
|
|
+ //专利之星
|
|
|
+ if (task.getType() == 4) {
|
|
|
+ excutePatentDataStar.setPatentInstructionText(pQueueData.getStarPatent(), pQueueData.getUploadParamsVO());
|
|
|
+ }
|
|
|
+ QueueData queueData = new QueueData()
|
|
|
+ .setTask(task)
|
|
|
+ .setUploadParamsVO(pQueueData.getUploadParamsVO());
|
|
|
+ //装载完成,将其丢入说明书文本消费者队列,并唤醒说明书文本消费者线程
|
|
|
+ patentInstructionTextQueueList.add(queueData);
|
|
|
+ patentInstructionTextLock.lock();
|
|
|
+ patentInstructionTextCondition.signalAll();
|
|
|
+ patentInstructionTextLock.unlock();
|
|
|
+
|
|
|
+ } else {
|
|
|
+ setPatentInstructionTextLock.lock();
|
|
|
+ setPatentInstructionTextCondition.await();
|
|
|
+ setPatentInstructionTextLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载线程5:说明书pdf
|
|
|
+ */
|
|
|
+ public void setPatentInstructionPDF() {
|
|
|
+ while (true) {
|
|
|
+ try {
|
|
|
+ if (setPatentInstructionPDFQueueList.size() > 0) {
|
|
|
+ PQueueData pQueueData = setPatentInstructionPDFQueueList.remove(0);
|
|
|
+ Task task = pQueueData.getTask();
|
|
|
+ //专利之星
|
|
|
+ if (task.getType() == 4) {
|
|
|
+ excutePatentDataStar.setPatentInstructionPDF(pQueueData.getStarPatent(), pQueueData.getUploadParamsVO());
|
|
|
+ }
|
|
|
+ QueueData queueData = new QueueData()
|
|
|
+ .setTask(task)
|
|
|
+ .setUploadParamsVO(pQueueData.getUploadParamsVO());
|
|
|
+ //装载完成,将其丢入说明书pdf消费者队列,并唤醒说明书pdf消费者线程
|
|
|
+ patentInstructionPDFQueueList.add(queueData);
|
|
|
+ patentInstructionPDFLock.lock();
|
|
|
+ patentInstructionPDFCondition.signalAll();
|
|
|
+ patentInstructionPDFLock.unlock();
|
|
|
+
|
|
|
+ } else {
|
|
|
+ setPatentInstructionPDFLock.lock();
|
|
|
+ setPatentInstructionPDFCondition.await();
|
|
|
+ setPatentInstructionPDFLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- //任务表更新状态为失败
|
|
|
- task.setStatus(3);
|
|
|
- task.setEndTime(DateUtils.getDateTime());
|
|
|
- taskService.updateById(task);
|
|
|
}
|
|
|
- flag = true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -103,26 +305,28 @@ public class PantentQueueService {
|
|
|
*/
|
|
|
public void pushPatentImageToDB() throws InterruptedException, IOException {
|
|
|
while (true) {
|
|
|
+ QueueData queueData = new QueueData();
|
|
|
try {
|
|
|
- if (patentImageQueueList.isEmpty()) {
|
|
|
- if (flag) {
|
|
|
- System.out.println("摘要附图全部完成,退出循环");
|
|
|
- return;
|
|
|
+ if (patentImageQueueList.size() > 0) {
|
|
|
+ queueData = patentImageQueueList.remove(0);
|
|
|
+ UploadParamsVO uploadParamsVO = queueData.getUploadParamsVO();
|
|
|
+ //摘要附图入库(两种方式:1.Excel摘要附图方式 2.网站导入摘要附图方式)
|
|
|
+ if (queueData.getTask().getType().equals(1)) {
|
|
|
+ uploadPatentToDBService.uploadPatentImage(uploadParamsVO);
|
|
|
} else {
|
|
|
- patentImageLock.lock();
|
|
|
- patentImageCondition.await();
|
|
|
- patentImageLock.unlock();
|
|
|
+ uploadPatentToDBService.uploadPatentImage2(uploadParamsVO);
|
|
|
}
|
|
|
- } else {
|
|
|
- QueueData queueData = patentImageQueueList.remove(0);
|
|
|
- //摘要附图入库
|
|
|
- uploadPatentToDBService.uploadPatentImage(queueData.getUploadParamsVO());
|
|
|
//Websocket发送message:通过WebSocket 在每一次循环结束后 向前端发送完成进度
|
|
|
sendMessage(queueData);
|
|
|
+ } else {
|
|
|
+ patentImageLock.lock();
|
|
|
+ patentImageCondition.await();
|
|
|
+ patentImageLock.unlock();
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ sendMessage(queueData);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -134,18 +338,10 @@ public class PantentQueueService {
|
|
|
*/
|
|
|
public void pushPatentZhuLuToDB() throws InterruptedException, IOException {
|
|
|
while (true) {
|
|
|
+ QueueData queueData = new QueueData();
|
|
|
try {
|
|
|
- if (patentZhuluQueueList.isEmpty()) {
|
|
|
- if (flag) {
|
|
|
- System.out.println("著录项目全部完成,退出循环");
|
|
|
- return;
|
|
|
- } else {
|
|
|
- patentZhuluLock.lock();
|
|
|
- patentZhuluCondition.await();
|
|
|
- patentZhuluLock.unlock();
|
|
|
- }
|
|
|
- } else {
|
|
|
- QueueData queueData = patentZhuluQueueList.remove(0);
|
|
|
+ if (patentZhuluQueueList.size() > 0) {
|
|
|
+ queueData = patentZhuluQueueList.remove(0);
|
|
|
//著录项目入库
|
|
|
uploadPatentToDBService.uploadPatentZhulu(queueData.getUploadParamsVO());
|
|
|
//专题库与专利关联入库
|
|
@@ -156,10 +352,15 @@ public class PantentQueueService {
|
|
|
uploadPatentToDBService.uploadAssoPorPat(queueData.getUploadParamsVO(), queueData.getProjectImportPatentVO());
|
|
|
//Websocket发送message:通过WebSocket 在每一次循环结束后 向前端发送完成进度
|
|
|
sendMessage(queueData);
|
|
|
+ } else {
|
|
|
+ patentZhuluLock.lock();
|
|
|
+ patentZhuluCondition.await();
|
|
|
+ patentZhuluLock.unlock();
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ sendMessage(queueData);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -170,26 +371,23 @@ public class PantentQueueService {
|
|
|
*/
|
|
|
public void pushPatentRightToDB() throws InterruptedException, IOException {
|
|
|
while (true) {
|
|
|
+ QueueData queueData = new QueueData();
|
|
|
try {
|
|
|
- if (patentRightQueueList.isEmpty()) {
|
|
|
- if (flag) {
|
|
|
- System.out.println("权利要求全部完成,退出循环");
|
|
|
- return;
|
|
|
- } else {
|
|
|
- patentRightLock.lock();
|
|
|
- patentRightCondition.await();
|
|
|
- patentRightLock.unlock();
|
|
|
- }
|
|
|
- } else {
|
|
|
- QueueData queueData = patentRightQueueList.remove(0);
|
|
|
+ if (patentRightQueueList.size() > 0) {
|
|
|
+ queueData = patentRightQueueList.remove(0);
|
|
|
//权要文本入库
|
|
|
uploadPatentToDBService.uploadPatentRight(queueData.getUploadParamsVO());
|
|
|
//Websocket发送message:通过WebSocket 在每一次循环结束后 向前端发送完成进度
|
|
|
sendMessage(queueData);
|
|
|
+ } else {
|
|
|
+ patentRightLock.lock();
|
|
|
+ patentRightCondition.await();
|
|
|
+ patentRightLock.unlock();
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ sendMessage(queueData);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -200,33 +398,62 @@ public class PantentQueueService {
|
|
|
*/
|
|
|
public void pushPatentInstructionTextToDB() throws InterruptedException, IOException {
|
|
|
while (true) {
|
|
|
+ QueueData queueData = new QueueData();
|
|
|
try {
|
|
|
- if (patentInstructionTextQueueList.isEmpty()) {
|
|
|
- if (flag) {
|
|
|
- System.out.println("说明书文本全部完成,退出循环");
|
|
|
- return;
|
|
|
- } else {
|
|
|
- patentInstructionTextLock.lock();
|
|
|
- patentInstructionTextCondition.await();
|
|
|
- patentInstructionTextLock.unlock();
|
|
|
- }
|
|
|
- } else {
|
|
|
- QueueData queueData = patentInstructionTextQueueList.remove(0);
|
|
|
+ if (patentInstructionTextQueueList.size() > 0) {
|
|
|
+ queueData = patentInstructionTextQueueList.remove(0);
|
|
|
//说明书文本入库
|
|
|
uploadPatentToDBService.uploadPatentInstructionText(queueData.getUploadParamsVO());
|
|
|
//Websocket发送message:通过WebSocket 在每一次循环结束后 向前端发送完成进度
|
|
|
sendMessage(queueData);
|
|
|
+ } else {
|
|
|
+ patentInstructionTextLock.lock();
|
|
|
+ patentInstructionTextCondition.await();
|
|
|
+ patentInstructionTextLock.unlock();
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ sendMessage(queueData);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 消费者5:将专利从队列取出,说明书pdf地址入库
|
|
|
+ */
|
|
|
+ public void pushPatentInstructionPDFToDB() throws InterruptedException, IOException {
|
|
|
+ while (true) {
|
|
|
+ QueueData queueData = new QueueData();
|
|
|
+ try {
|
|
|
+ if (patentInstructionPDFQueueList.size() > 0) {
|
|
|
+ queueData = patentInstructionPDFQueueList.remove(0);
|
|
|
+ //说明书pdf入库
|
|
|
+ patentInstructionService.edit(queueData.getUploadParamsVO().getPatent().getPatentNo(), queueData.getUploadParamsVO().getFileDTO());
|
|
|
+ //Websocket发送message:通过WebSocket 在每一次循环结束后 向前端发送完成进度
|
|
|
+ sendMessage(queueData);
|
|
|
+ } else {
|
|
|
+ patentInstructionPDFLock.lock();
|
|
|
+ patentInstructionPDFCondition.await();
|
|
|
+ patentInstructionPDFLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ sendMessage(queueData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 当一个消费者消费完其负责的专利部分,修改成功条数,计算发送进度
|
|
|
+ *
|
|
|
+ * @param queueData 任务专利队列对象
|
|
|
+ */
|
|
|
public void sendMessage(QueueData queueData) {
|
|
|
- //每完成一个专利,通过计算,发送进度
|
|
|
+ //每完成一个专利(根据计算该任务该专利的所有消费者都完成时),发送进度
|
|
|
synchronized ("此为同步锁") {
|
|
|
//当前进行的任务
|
|
|
Task task = queueData.getTask();
|
|
@@ -238,7 +465,7 @@ public class PantentQueueService {
|
|
|
Integer num = patentIdMap.get(currentPatent);
|
|
|
if (num == null) {
|
|
|
patentIdMap.put(currentPatent, 1);
|
|
|
- } else if (num < 3) {
|
|
|
+ } else if (num < 4) {
|
|
|
patentIdMap.put(currentPatent, ++num);
|
|
|
} else {
|
|
|
/*
|
|
@@ -263,7 +490,7 @@ public class PantentQueueService {
|
|
|
taskService.updateById(updateTask);
|
|
|
|
|
|
//当全部完成时
|
|
|
- if (task.getSuccessNum().equals(total)) {
|
|
|
+ if (task.getSuccessNum() + task.getExceptionNum() == total) {
|
|
|
percentage = 100L;
|
|
|
//设置任务状态为成功
|
|
|
task.setStatus(2);
|
|
@@ -278,6 +505,73 @@ public class PantentQueueService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 数据丢入摘要附图生产队列并唤醒装载摘要附图线程
|
|
|
+ *
|
|
|
+ * @param pQueueData 装载生产队列实体类
|
|
|
+ */
|
|
|
+ public void imageToPQueue(PQueueData pQueueData) {
|
|
|
+ setPatentImageQueueList.add(pQueueData);
|
|
|
+ setPatentImageLock.lock();
|
|
|
+ setPatentImageCondition.signalAll();
|
|
|
+ setPatentImageLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 数据丢入著录项目生产队列并唤醒装载著录项目线程
|
|
|
+ *
|
|
|
+ * @param pQueueData 装载生产队列实体类
|
|
|
+ */
|
|
|
+ public void zhuluToPQueue(PQueueData pQueueData) {
|
|
|
+ setPatentZhuluQueueList.add(pQueueData);
|
|
|
+ setPatentZhuluLock.lock();
|
|
|
+ setPatentZhuluCondition.signalAll();
|
|
|
+ setPatentZhuluLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 数据丢入权要生产队列并唤醒装载权要线程
|
|
|
+ *
|
|
|
+ * @param pQueueData 装载生产队列实体类
|
|
|
+ */
|
|
|
+ public void rightToPQueue(PQueueData pQueueData) {
|
|
|
+ setPatentRightQueueList.add(pQueueData);
|
|
|
+ setPatentRightLock.lock();
|
|
|
+ setPatentRightCondition.signalAll();
|
|
|
+ setPatentRightLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 数据丢入说明书文本生产队列并唤醒装载说明书文本线程
|
|
|
+ *
|
|
|
+ * @param pQueueData 装载生产队列实体类
|
|
|
+ */
|
|
|
+ public void instructionTextToPQueue(PQueueData pQueueData) {
|
|
|
+ setPatentInstructionTextQueueList.add(pQueueData);
|
|
|
+ setPatentInstructionTextLock.lock();
|
|
|
+ setPatentInstructionTextCondition.signalAll();
|
|
|
+ setPatentInstructionTextLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 数据丢入说明书pdf生产队列并唤醒装载说明书pdf线程
|
|
|
+ *
|
|
|
+ * @param pQueueData 装载生产队列实体类
|
|
|
+ */
|
|
|
+ public void instructionPDFToPQueue(PQueueData pQueueData) {
|
|
|
+ setPatentInstructionPDFQueueList.add(pQueueData);
|
|
|
+ setPatentInstructionPDFLock.lock();
|
|
|
+ setPatentInstructionPDFCondition.signalAll();
|
|
|
+ setPatentInstructionPDFLock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 专利丢入5个消费者队列,并唤醒5个消费者线程
|
|
|
+ *
|
|
|
+ * @param task 任务对象
|
|
|
+ * @param uploadParamsVO 专利实体类对象
|
|
|
+ * @param projectImportPatentVO 专利与专题库关联数据对象
|
|
|
+ */
|
|
|
public void patentToQueue(Task task, UploadParamsVO uploadParamsVO, ProjectImportPatentVO projectImportPatentVO) {
|
|
|
//保存专利基础数据(专利表"os_patent")
|
|
|
uploadPatentBatchService.getOneOrInsertOne(uploadParamsVO);
|
|
@@ -293,8 +587,9 @@ public class PantentQueueService {
|
|
|
patentZhuluQueueList.add(queueData);
|
|
|
patentRightQueueList.add(queueData);
|
|
|
patentInstructionTextQueueList.add(queueData);
|
|
|
+ patentInstructionPDFQueueList.add(queueData);
|
|
|
|
|
|
- //通知消费者线程(5个消费者:摘要附图、著录项目、权利要求文本、说明书文本、与专利关联数据)
|
|
|
+ //通知消费者线程(5个消费者:摘要附图、著录项目、权利要求文本、说明书文本、说明书pdf)
|
|
|
//1.摘要附图
|
|
|
patentImageLock.lock();
|
|
|
patentImageCondition.signalAll();
|
|
@@ -311,6 +606,11 @@ public class PantentQueueService {
|
|
|
patentInstructionTextLock.lock();
|
|
|
patentInstructionTextCondition.signalAll();
|
|
|
patentInstructionTextLock.unlock();
|
|
|
+ //5.说明书pdf
|
|
|
+ patentInstructionPDFLock.lock();
|
|
|
+ patentInstructionPDFCondition.signalAll();
|
|
|
+ patentInstructionPDFLock.unlock();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -346,7 +646,7 @@ public class PantentQueueService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 唤醒生产者线程执
|
|
|
+ * 唤醒生产者线程
|
|
|
*/
|
|
|
public void awakeTasktch() {
|
|
|
taskLock.lock();
|
|
@@ -356,7 +656,7 @@ public class PantentQueueService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 工厂方法,根据任务类型创建对应的获取专利数据的对象
|
|
|
+ * 工厂方法,根据任务类型返回对应的生产专利数据的对象
|
|
|
*
|
|
|
* @param task 任务
|
|
|
* @return 返回获取专利数据的对象
|