|
@@ -7,6 +7,7 @@ import cn.rankin.data.api.product.dto.*;
|
|
|
import cn.rankin.data.api.product.entity.*;
|
|
|
import cn.rankin.data.api.product.entity.Package;
|
|
|
import cn.rankin.productservice.code.ProductServiceAPICode;
|
|
|
+import cn.rankin.productservice.repository.GoodsRepository;
|
|
|
import cn.rankin.productservice.service.PackageService;
|
|
|
import cn.rankin.productservice.service.ProductService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -29,6 +30,9 @@ public class ProductController {
|
|
|
@Autowired
|
|
|
private PackageService packageService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private GoodsRepository goodsRepository;
|
|
|
+
|
|
|
@RequestMapping(method = RequestMethod.GET)
|
|
|
public APIResult<Page<Product>> search(ProductSearchDTO searchDTO) {
|
|
|
Product product = new Product();
|
|
@@ -136,7 +140,15 @@ public class ProductController {
|
|
|
|
|
|
List<Product> childrens = packageService.getChildrens(pkg.getPid());
|
|
|
|
|
|
+ //goods
|
|
|
+ List<Goods> goodsList = null;
|
|
|
+
|
|
|
+ if(null != pkg.getPid()){
|
|
|
+ goodsList = goodsRepository.findByPidAndMerchantId(pkg.getPid(), merchantId);
|
|
|
+ }
|
|
|
+
|
|
|
pkg.setChildrens(childrens);
|
|
|
+ pkg.setGoods(goodsList);
|
|
|
}
|
|
|
|
|
|
if(null == pkgs){
|