...
|
...
|
@@ -32,7 +32,7 @@ public class ProductStandardRelationMqListener extends AbstractMqListener implem |
|
|
try {
|
|
|
final String key = UUID.randomUUID().toString();
|
|
|
String messageStr = new String(message.getBody(), "UTF-8");
|
|
|
logger.info("[model=ProductStandardRelationMqListener][key={}][message={}]", key, messageStr);
|
|
|
logger.info("[key={}][message={}]", key, messageStr);
|
|
|
// 如果在重建索引等待
|
|
|
this.waitingRebuildingIndex();
|
|
|
JSONObject json = JSONObject.parseObject(messageStr);
|
...
|
...
|
@@ -52,7 +52,6 @@ public class ProductStandardRelationMqListener extends AbstractMqListener implem |
|
|
}
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
|
|
public void updateData(final Map data, final String key) {
|
|
|
long begin = System.currentTimeMillis();
|
|
|
ProductStandardRelation productStandardRelation = new ProductStandardRelation();
|
...
|
...
|
@@ -62,11 +61,10 @@ public class ProductStandardRelationMqListener extends AbstractMqListener implem |
|
|
return;
|
|
|
}
|
|
|
productStandardRelationService.saveOrUpdate(productStandardRelation);
|
|
|
logger.info("[func=updateData][step=saveToBb][key={}][cost={}ms]", key, System.currentTimeMillis() - begin);
|
|
|
logger.info("[func=updateData][key={}][cost={}ms]", key, System.currentTimeMillis() - begin);
|
|
|
this.updateProductIndex(productId, System.currentTimeMillis(), key);
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
|
|
public void deleteData(final Map data, final String key) {
|
|
|
long begin = System.currentTimeMillis();
|
|
|
ProductStandardRelation psr = new ProductStandardRelation();
|
...
|
...
|
@@ -77,11 +75,10 @@ public class ProductStandardRelationMqListener extends AbstractMqListener implem |
|
|
int productId = psr.getProductId();
|
|
|
Integer standardId = psr.getStandardId();
|
|
|
productStandardRelationService.delete(productId, standardId);
|
|
|
logger.info("[func=deleteData][step=deleteFromBb][key={}][cost={}ms]", key, System.currentTimeMillis() - begin);
|
|
|
logger.info("[func=deleteData][key={}][cost={}ms]", key, System.currentTimeMillis() - begin);
|
|
|
this.updateProductIndex(productId, System.currentTimeMillis(), key);
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
|
private void updateProductIndex(Integer productId, long begin, final String key) {
|
|
|
List<Map> productStandards = productStandardRelationService.getStandardListByProductId(productId);
|
|
|
Set<String> standardIdSet = new HashSet<String>();
|
...
|
...
|
|