wangxiaoming 7 anni fa
parent
commit
fb1add70e1

+ 14 - 25
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/cart/ProductInfoHandler.java

@@ -114,31 +114,20 @@ public class ProductInfoHandler {
 		}
 
 		Map<String, Object> map = new HashMap<String, Object>();
-		//获取配件类型
-		ShopSystemRule shopSystemRule = systemService.selectOneShopRuleById(255);
-		if(shopSystemRule.getRuleType() == typeId){	//等于则标识为配件
-			ProductFittings fittings = new ProductFittings();
-			fittings.setProductType(typeId);
-			List<ProductFittings> productFittingsList = productInfoService.selectPageProductFittings(pageSize, pageNO,typeId);
-			map.put("productFittingsList", productFittingsList);
-			map.put("productTypeList", productTypeList);
-			remsg.setMessage(ResultInfo.SUCCESSINFO);
-			remsg.setResultCode(ResultInfo.SUCCESSCODE);
-		}else{
-			ProductType productType = new ProductType();
-			productType.setTypeId(typeId);
-			Product product = new Product();
-			product.setProductName(productName);
-			product.setProductType(productType);
-			List<Product> productList = productInfoService.selectPageProduct(pageSize, pageNO,productName,typeId);
-			int num = this.productInfoService.selectProductCount(product);
-			int count = num % pageSize == 0? num/pageSize:(num/pageSize)+1;
-			map.put("productList", productList);
-			map.put("productTypeList", productTypeList);
-			map.put("total", count);
-			remsg.setMessage(ResultInfo.SUCCESSINFO);
-			remsg.setResultCode(ResultInfo.SUCCESSCODE);
-		}
+
+		ProductType productType = new ProductType();
+		productType.setTypeId(typeId);
+		Product product = new Product();
+		product.setProductName(productName);
+		product.setProductType(productType);
+		List<Product> productList = productInfoService.selectPageProduct(pageSize, pageNO,productName,typeId);
+		int num = this.productInfoService.selectProductCount(product);
+		int count = num % pageSize == 0? num/pageSize:(num/pageSize)+1;
+		map.put("productList", productList);
+		map.put("productTypeList", productTypeList);
+		map.put("total", count);
+		remsg.setMessage(ResultInfo.SUCCESSINFO);
+		remsg.setResultCode(ResultInfo.SUCCESSCODE);
 		remsg.setStatus(true);
 		remsg.setData(map);
 		return remsg;