‘linchangsheng’ vor 1 Monat
Ursprung
Commit
6a91a1c17c

+ 3 - 0
src/main/java/com/gree/mall/manager/bean/goods/GoodsBean.java

@@ -19,6 +19,9 @@ public class GoodsBean extends Goods {
     @ApiModelProperty("轮播图")
     private List<CommonFile> images;
 
+    @ApiModelProperty("所属商户")
+    private List<GoodsCompany> goodsCompanies;
+
 
     private String category1;
     private String category2;

+ 6 - 0
src/main/java/com/gree/mall/manager/logic/goods/GoodsLogic.java

@@ -314,6 +314,7 @@ public class GoodsLogic {
      * @return
      */
     public GoodsBean detail(String goodsId) throws RemoteServiceException {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
         Goods goods = goodsService.getById(goodsId);
         List<GoodsSpec> goodsSpecs = goodsSpecService.lambdaQuery()
                 .eq(GoodsSpec::getGoodsId, goodsId)
@@ -330,6 +331,11 @@ public class GoodsLogic {
         BeanUtils.copyProperties(goods, goodsBean);
         goodsBean.setGoodsSpecs(goodsSpecs);
         goodsBean.setImages(commonLogic.queryFileByObjId(goods.getGoodsId(), Constant.Img.GOODS_IMG));
+
+        goodsBean.setGoodsCompanies(goodsCompanyService.lambdaQuery()
+        .in(GoodsCompany::getCompanyId,adminUser.getAdminCompanyIds())
+                .eq(GoodsCompany::getGoodsId,goods.getGoodsId()).list()
+        );
         goodsBean.setStock(goodsStock);
         List<GoodsTemplate> goodsTemplates = goodsTemplateService.lambdaQuery()
                 .eq(GoodsTemplate::getGoodsId, goodsId)