Authored by WN\wangnan

productprice修改表结构 fix

... ... @@ -59,6 +59,7 @@ public class ProductPriceMqListener extends AbstractIndexMqListener {
protected void deleteData(String id) throws Exception {
// 1、获取productId
Integer productSkn = Integer.valueOf(id);
Integer productId = productService.selectProductIdBySkn(productSkn);
// 2、删除数据库
long begin = System.currentTimeMillis();
... ... @@ -66,8 +67,7 @@ public class ProductPriceMqListener extends AbstractIndexMqListener {
logger.info("[func=deleteData][step=deleteFromBb][productId={}][cost={}ms]", id, this.getCost(begin));
// 3、清空ProductIndex索引中的价格相关参数
begin = System.currentTimeMillis();
this.updateProductIndexByClearPrice(productSkn);
this.updateProductIndexByClearPrice(productId);
}
... ... @@ -84,7 +84,8 @@ public class ProductPriceMqListener extends AbstractIndexMqListener {
// 2、更新ProductIndex
begin = System.currentTimeMillis();
this.updateProductIndex(productPrice.getProductId(), productPrice);
Integer productId = productService.selectProductIdBySkn(productPrice.getProductSkn());
this.updateProductIndex(productId, productPrice);
this.updateProductPricePlan(productPrice);
logger.info("[func=updateData][step=updateProductIndex][productSkn={}][cost={}ms]", productPrice.getProductSkn(), this.getCost(begin));
}
... ... @@ -150,9 +151,9 @@ public class ProductPriceMqListener extends AbstractIndexMqListener {
/**
* 清除商品索引里 相关的价格参数
*/
private void updateProductIndexByClearPrice(Integer productSkn) {
private void updateProductIndexByClearPrice(Integer productId) {
Map<String, Object> indexData = new HashMap<String, Object>(30);
indexData.put("productSkn", productSkn);
indexData.put("productId", productId);
indexData.put("marketPrice", null);
indexData.put("salesPrice", null);
indexData.put("vipPrice", null);
... ... @@ -172,7 +173,7 @@ public class ProductPriceMqListener extends AbstractIndexMqListener {
indexData.put("priceUpdateTime", 0);
indexData.put("isnew", "N");
// 更新商品索引
this.updateProductIndexWithDataMap(indexData, productSkn);
this.updateProductIndexWithDataMap(indexData, productId);
}
}
... ...