|
|
@@ -217,9 +217,9 @@ public class QueueMessageParser {
|
|
|
component = localComponent;
|
|
|
}
|
|
|
}
|
|
|
- // 器件较为特殊,insert和update需分开对待
|
|
|
+ // insert和update需分开对待(update不进行下列判断,直接更新)
|
|
|
// update来源还可能来自属性值的变化,而equals是不比较属性值的
|
|
|
- // (如果比较的话,对于insert器件,即使是同一个,属性值在之后变化了的话,也会视为两个器件,会添加重复的器件索引)
|
|
|
+ // (如果比较的话,对于insert器件,即使是同一个,属性值在之后变化了的话,也会视为两个器件,索引无法删除,之后会添加重复的器件索引)
|
|
|
else if (jsonObject.getString("method").equals("insert")) {
|
|
|
if (localComponent != null && localComponent.equals(component)) {
|
|
|
component = null;
|
|
|
@@ -245,12 +245,8 @@ public class QueueMessageParser {
|
|
|
Long id = Long.parseLong(ids[i].toString());
|
|
|
OrderSimpleInfo order = orderDao.findById(id);
|
|
|
OrderSimpleInfo localOrder = innerOrderSearchService.getOrder(id);
|
|
|
- System.out.println(order);
|
|
|
- System.out.println(localOrder);
|
|
|
// 删除操作
|
|
|
if (jsonObject.getString("method").equals("delete")) {
|
|
|
- System.out.println("localOrder == null || localOrder.equals(order) " + localOrder == null
|
|
|
- || localOrder.equals(order));
|
|
|
if (order != null) {
|
|
|
// 删除之后,数据还存在,并且与本地索引数据一样,说明是进行了回退,或者重新插入了相同的数据,不对索引进行更新
|
|
|
if (localOrder == null || localOrder.equals(order)) {
|
|
|
@@ -260,10 +256,10 @@ public class QueueMessageParser {
|
|
|
order = localOrder;
|
|
|
}
|
|
|
}
|
|
|
- // 更新或者插入操作
|
|
|
- else {
|
|
|
- System.out.println("localOrder != null && localOrder.equals(order) " + localOrder != null
|
|
|
- && localOrder.equals(order));
|
|
|
+ // insert和update需分开对待(update不进行下列判断,直接更新)
|
|
|
+ // update来源还可能来自明细的变化,而equals是不比较明细的
|
|
|
+ // (如果比较的话,对于insert,即使是同一个,明细在之后变化了的话,也会视为两个单据,索引无法删除,之后会添加重复的单据索引)
|
|
|
+ else if (jsonObject.getString("method").equals("insert")) {
|
|
|
// 本地有相同的数据,不更新索引
|
|
|
if (localOrder != null && localOrder.equals(order)) {
|
|
|
order = null;
|
|
|
@@ -300,8 +296,10 @@ public class QueueMessageParser {
|
|
|
orderInvoice = localOrderInvoice;
|
|
|
}
|
|
|
}
|
|
|
- // 更新或者插入操作
|
|
|
- else {
|
|
|
+ // insert和update需分开对待(update不进行下列判断,直接更新)
|
|
|
+ // update来源还可能来自明细的变化,而equals是不比较明细的
|
|
|
+ // (如果比较的话,对于insert,即使是同一个,明细在之后变化了的话,也会视为两个单据,索引无法删除,之后会添加重复的单据索引)
|
|
|
+ else if (jsonObject.getString("method").equals("insert")) {
|
|
|
// 本地有相同的数据,不更新索引
|
|
|
if (localOrderInvoice != null && localOrderInvoice.equals(orderInvoice)) {
|
|
|
orderInvoice = null;
|
|
|
@@ -338,8 +336,10 @@ public class QueueMessageParser {
|
|
|
purchase = localPurchase;
|
|
|
}
|
|
|
}
|
|
|
- // 更新或者插入操作
|
|
|
- else {
|
|
|
+ // insert和update需分开对待(update不进行下列判断,直接更新)
|
|
|
+ // update来源还可能来自明细的变化,而equals是不比较明细的
|
|
|
+ // (如果比较的话,对于insert,即使是同一个,明细在之后变化了的话,也会视为两个单据,索引无法删除,之后会添加重复的单据索引)
|
|
|
+ else if (jsonObject.getString("method").equals("insert")) {
|
|
|
// 本地有相同的数据,不更新索引
|
|
|
if (localPurchase != null && localPurchase.equals(purchase)) {
|
|
|
purchase = null;
|
|
|
@@ -376,8 +376,10 @@ public class QueueMessageParser {
|
|
|
purchaseInvoice = localPurchaseInvoice;
|
|
|
}
|
|
|
}
|
|
|
- // 更新或者插入操作
|
|
|
- else {
|
|
|
+ // insert和update需分开对待(update不进行下列判断,直接更新)
|
|
|
+ // update来源还可能来自明细的变化,而equals是不比较明细的
|
|
|
+ // (如果比较的话,对于insert,即使是同一个,明细在之后变化了的话,也会视为两个单据,索引无法删除,之后会添加重复的单据索引)
|
|
|
+ else if (jsonObject.getString("method").equals("insert")) {
|
|
|
// 本地有相同的数据,不更新索引
|
|
|
if (localPurchaseInvoice != null && localPurchaseInvoice.equals(purchaseInvoice)) {
|
|
|
purchaseInvoice = null;
|