zouxuan 2 lat temu
rodzic
commit
1a887c3bac

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/GoodsOrderItemVO.java

@@ -0,0 +1,30 @@
+package com.ym.mec.biz.dal.dto;
+
+import lombok.Data;
+
+@Data
+public class GoodsOrderItemVO {
+    private double couponAmount; // 优惠券金额
+    private int giftGrowth; // 赠送成长值
+    private int giftIntegration; // 赠送积分
+    private long id; // 唯一标识符
+    private double integrationAmount; // 积分抵扣金额
+    private long orderId; // 所属订单的唯一标识符
+    private String orderSn; // 订单编号
+    private double precisionAmount; // 精确金额
+    private String productAttr; // 商品属性,JSON 格式
+    private String productBrand; // 商品品牌
+    private long productCategoryId; // 商品分类的唯一标识符
+    private long productId; // 商品的唯一标识符
+    private String productSn; // 商品货号
+    private String productName; // 商品名称
+    private String productPic; // 商品图片
+    private double productPrice; // 商品价格
+    private int productQuantity; // 商品数量
+    private String productSkuCode; // 商品 SKU 编码
+    private long productSkuId; // 商品 SKU 的唯一标识符
+    private double promotionAmount; // 促销金额
+    private String promotionName; // 促销名称
+    private double realAmount; // 实际支付金额
+    private int returnStatus; // 退货状态
+}

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
@@ -1345,6 +1346,25 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             } catch (Exception e) {
                 logger.error("产品协议生成失败", e);
             }
+            //解析student_goods_sell字段goodsJson,生成订单详情和sellOrder
+            StudentGoodsSellDto studentGoodsSellDto = studentGoodsSellDao.getStudentGoodsSellDto(studentPaymentOrder.getOrderNo());
+            if(Objects.nonNull(studentGoodsSellDto)){
+                if(StringUtils.isNotEmpty(studentGoodsSellDto.getGoodsJson())){
+                    JSONObject jsonObject = JSON.parseObject(studentGoodsSellDto.getGoodsJson());
+                    String orderItemList = jsonObject.getString("orderItemList");
+                    if(StringUtils.isNotEmpty(orderItemList)){
+                        List<GoodsOrderItemVO> goodsOrderItemVOS = JSON.parseArray(orderItemList, GoodsOrderItemVO.class);
+                        long count = goodsOrderItemVOS.stream().filter(e -> StringUtils.isEmpty(e.getOrderSn())).count();
+                        //如果有空的商品货号,不处理
+                        if(count == 0l){
+                            List<String> productSns = goodsOrderItemVOS.stream().map(e -> e.getProductSn()).distinct().collect(Collectors.toList());
+                            for (GoodsOrderItemVO goodsVo : goodsOrderItemVOS) {
+
+                            }
+                        }
+                    }
+                }
+            }
             // 完全余额支付 不生成下面的记录
             if (BigDecimal.ZERO.compareTo(studentPaymentOrder.getActualAmount()) == 0) return;