|
@@ -165,9 +165,11 @@ public class PantentQueueService {
|
|
|
queueData.setUploadParamsVO(pQueueData.getUploadParamsVO());
|
|
|
//装载完成,将其丢入著录消费者队列,并唤醒著录消费者线程
|
|
|
patentZhuluQueueList.add(queueData);
|
|
|
- patentZhuluLock.lock();
|
|
|
- patentZhuluCondition.signalAll();
|
|
|
- patentZhuluLock.unlock();
|
|
|
+ if (patentZhuluLock.tryLock()) {
|
|
|
+ //patentZhuluLock.lock();
|
|
|
+ patentZhuluCondition.signalAll();
|
|
|
+ patentZhuluLock.unlock();
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
setPatentZhuluLock.lock();
|
|
@@ -208,9 +210,11 @@ public class PantentQueueService {
|
|
|
|
|
|
//装载完成,将其丢入权要消费者队列,并唤醒权要消费者线程
|
|
|
patentRightQueueList.add(queueData);
|
|
|
- patentRightLock.lock();
|
|
|
- patentRightCondition.signalAll();
|
|
|
- patentRightLock.unlock();
|
|
|
+ if (patentRightLock.tryLock()) {
|
|
|
+ //patentRightLock.lock();
|
|
|
+ patentRightCondition.signalAll();
|
|
|
+ patentRightLock.unlock();
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
setPatentRightLock.lock();
|
|
@@ -251,9 +255,11 @@ public class PantentQueueService {
|
|
|
|
|
|
//装载完成,将其丢入说明书文本消费者队列,并唤醒说明书文本消费者线程
|
|
|
patentInstructionTextQueueList.add(queueData);
|
|
|
- patentInstructionTextLock.lock();
|
|
|
- patentInstructionTextCondition.signalAll();
|
|
|
- patentInstructionTextLock.unlock();
|
|
|
+ if (patentInstructionTextLock.tryLock()) {
|
|
|
+ //patentInstructionTextLock.lock();
|
|
|
+ patentInstructionTextCondition.signalAll();
|
|
|
+ patentInstructionTextLock.unlock();
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
setPatentInstructionTextLock.lock();
|
|
@@ -294,9 +300,11 @@ public class PantentQueueService {
|
|
|
|
|
|
//装载完成,将其丢入说明书pdf消费者队列,并唤醒说明书pdf消费者线程
|
|
|
patentInstructionPDFQueueList.add(queueData);
|
|
|
- patentInstructionPDFLock.lock();
|
|
|
- patentInstructionPDFCondition.signalAll();
|
|
|
- patentInstructionPDFLock.unlock();
|
|
|
+ if (patentInstructionPDFLock.tryLock()) {
|
|
|
+ //patentInstructionPDFLock.lock();
|
|
|
+ patentInstructionPDFCondition.signalAll();
|
|
|
+ patentInstructionPDFLock.unlock();
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
setPatentInstructionPDFLock.lock();
|
|
@@ -337,9 +345,11 @@ public class PantentQueueService {
|
|
|
|
|
|
//装载完成,将其丢入摘要附图消费者队列,并唤醒摘要附图消费者线程
|
|
|
patentImageQueueList.add(queueData);
|
|
|
- patentImageLock.lock();
|
|
|
- patentImageCondition.signalAll();
|
|
|
- patentImageLock.unlock();
|
|
|
+ if (patentImageLock.tryLock()) {
|
|
|
+ //patentImageLock.lock();
|
|
|
+ patentImageCondition.signalAll();
|
|
|
+ patentImageLock.unlock();
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
setPatentImageLock.lock();
|
|
@@ -543,9 +553,9 @@ public class PantentQueueService {
|
|
|
if (task.getType().equals(3) || task.getType().equals(4)) { //若是网站导入任务,则临界默认设为下载字段类型数量 - 1
|
|
|
needNum = task.getConfigCellsNum() - 1;
|
|
|
}
|
|
|
- if (num == null) {
|
|
|
+ if (num == null && needNum > 0) {
|
|
|
patentIdMap.put(currentPatent, 1);
|
|
|
- } else if (num < needNum) {
|
|
|
+ } else if (num != null && num < needNum) {
|
|
|
patentIdMap.put(currentPatent, ++num);
|
|
|
} else { //表示当前这个任务这个专利的消费者全都消费结束
|
|
|
|