Authored by gemingdan

+log

@@ -92,6 +92,7 @@ public class PromotionProductMqListener extends AbstractMqListener implements Ch @@ -92,6 +92,7 @@ public class PromotionProductMqListener extends AbstractMqListener implements Ch
92 private void updateProductIndex(Integer productSkn, long currentTimeMillis,String key){ 92 private void updateProductIndex(Integer productSkn, long currentTimeMillis,String key){
93 String promotionIds=promotionProductService.getPromotionIds(productSkn); 93 String promotionIds=promotionProductService.getPromotionIds(productSkn);
94 Integer productId=productService.selectProductIdBySkn(productSkn); 94 Integer productId=productService.selectProductIdBySkn(productSkn);
  95 + logger.info("[func=updateProductIndex][step=saveToES][key={}][productId={}][promotionIds={}]", key,productId, promotionIds);
95 Map<String, Object> indexData = new HashMap<String, Object>(); 96 Map<String, Object> indexData = new HashMap<String, Object>();
96 indexData.put("productId", productId); 97 indexData.put("productId", productId);
97 indexData.put("promotionIds", promotionIds); 98 indexData.put("promotionIds", promotionIds);
@@ -21,13 +21,12 @@ public class PromotionProductService { @@ -21,13 +21,12 @@ public class PromotionProductService {
21 21
22 public String getPromotionIds(Integer skn){ 22 public String getPromotionIds(Integer skn){
23 List<PromotionProduct> list = promotionProductMapper.selectListBySkn(skn); 23 List<PromotionProduct> list = promotionProductMapper.selectListBySkn(skn);
24 - StringBuffer result=new StringBuffer(); 24 + StringBuffer result=new StringBuffer("");
25 for(PromotionProduct pp:list){ 25 for(PromotionProduct pp:list){
26 result.append(pp.getPromotionId()).append(","); 26 result.append(pp.getPromotionId()).append(",");
27 } 27 }
28 - System.out.println(result.toString());  
29 - if(result.length()<2){  
30 - return null; 28 + if(result.length()<1){
  29 + return "";
31 } 30 }
32 return result.substring(0,result.length()-1); 31 return result.substring(0,result.length()-1);
33 } 32 }