|
@@ -112,20 +112,33 @@ public class ProductInfoHandler {
|
|
|
if (null == typeId) {
|
|
|
typeId = productTypeList.get(0).getTypeId();
|
|
|
}
|
|
|
- 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<String, Object> map = new HashMap<String, Object>();
|
|
|
- map.put("productList", productList);
|
|
|
- map.put("productTypeList", productTypeList);
|
|
|
- map.put("total", count);
|
|
|
- remsg.setMessage(ResultInfo.SUCCESSINFO);
|
|
|
- remsg.setResultCode(ResultInfo.SUCCESSCODE);
|
|
|
+ //获取配件类型
|
|
|
+ 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);
|
|
|
+ }
|
|
|
remsg.setStatus(true);
|
|
|
remsg.setData(map);
|
|
|
return remsg;
|