瀏覽代碼

Merge remote-tracking branch 'origin/zx_saas_goods' into zx_saas_goods

zouxuan 1 年之前
父節點
當前提交
d7874a55ca

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/GoodsWrapper.java

@@ -213,6 +213,12 @@ public class GoodsWrapper {
         @ApiModelProperty("货号")
         private String productSn;
 
+        @ApiModelProperty("品牌ID")
+        private Long brandId;
+
+        @ApiModelProperty("品牌名称")
+        private String brandName;
+
         public String jsonString() {
             return JSON.toJSONString(this);
         }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -365,6 +365,8 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 				PmsProductDto dto1 =  groupByGoodId.get(Long.valueOf(next.getMallGoodsId())).get(0);
 				next.setMallGoodsName(dto1.getName());
 				next.setProductSn(dto1.getProductSn());
+				next.setBrandId(dto1.getBrandId());
+				next.setBrandName(dto1.getBrandName());
 			}
 		});
 		return goodsSubList;

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SellOrderServiceImpl.java

@@ -18,6 +18,7 @@ import com.alibaba.fastjson.JSON;
 import com.ym.mec.biz.dal.dto.ComplementGoodsDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.mapper.GoodsSubMapper;
+import com.ym.mec.biz.dal.page.MusicGroupShippingAddressQueryInfo;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.api.CommonResult;
 import com.ym.mec.common.dto.OrderCreate;
@@ -81,6 +82,8 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
     private GoodsSubService goodsSubService;
     @Autowired
     private MallFeignService mallFeignService;
+    @Autowired
+    private MusicGroupShippingAddressService musicGroupShippingAddressService;
 
     @Override
     public BaseDAO<Integer, SellOrder> getDAO() {
@@ -619,6 +622,26 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
         mallOrder.setPlatformType("STUDENT");
         mallOrder.setSourceType(1);
 
+        // 乐团学生报名默认收货地址
+        if (studentPaymentOrder.getType() == OrderTypeEnum.APPLY && StringUtils.isNotBlank(mallOrder.getOrchestraId())) {
+
+            // 查询乐团默认收货地址
+            MusicGroupShippingAddressQueryInfo queryInfo = new MusicGroupShippingAddressQueryInfo();
+            queryInfo.setMusicGroupId(mallOrder.getOrchestraId());
+            queryInfo.setPage(1);
+            queryInfo.setRows(10);
+            List<MusicGroupShippingAddress> rows = musicGroupShippingAddressService.queryPage(queryInfo).getRows();
+            if (CollectionUtils.isNotEmpty(rows)) {
+                MusicGroupShippingAddress address = rows.get(0);
+                mallOrder.setReceiverName(address.getConsigneeName());
+                mallOrder.setReceiverPhone(address.getMobile());
+                mallOrder.setReceiverProvince(address.getRegionProvince());
+                mallOrder.setReceiverCity(address.getRegionCity());
+                mallOrder.setReceiverRegion(address.getRegionCounty());
+                mallOrder.setReceiverDetailAddress(address.getDetailAddress());
+            }
+        }
+
         CommonResult<Boolean> result = mallFeignService.productOrderCreate(mallOrder);
         if (result.getCode() != 200) {
             throw new BizException("同步商城订单失败",result.getMessage());