ccj 1 vuosi sitten
vanhempi
commit
68636db24c

+ 5 - 1
shop.sql

@@ -2045,4 +2045,8 @@ SET FOREIGN_KEY_CHECKS = 1;
 ALTER TABLE `shop`.`shop_order` 
 ADD COLUMN `all_amount` varchar(255) NULL COMMENT '夫子价格' AFTER `shipping_fee`;
 ALTER TABLE `shop`.`shop_order` 
-ADD COLUMN `real_paid_amount` varchar(255) NULL COMMENT '当当实际付款金额' AFTER `all_amount`;
+ADD COLUMN `real_paid_amount` varchar(255) NULL COMMENT '当当实际付款金额' AFTER `all_amount`;
+ALTER TABLE `shop`.`shop_order` 
+ADD COLUMN `item_id` varchar(255) NULL COMMENT '商品编码' AFTER `real_paid_amount`,
+ADD COLUMN `outer_item_id` varchar(255) NULL COMMENT '外部商品编码' AFTER `item_id`,
+ADD COLUMN `item_name` varchar(255) NULL COMMENT '商品名称' AFTER `outer_item_id`;

+ 13 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/AdminCheckQuartz.java

@@ -452,8 +452,20 @@ public class AdminCheckQuartz {
                 else{
                     if(resultt.getBuyerInfo() != null){
                         shopOrder.setRealPaidAmount(resultt.getBuyerInfo().getRealPaidAmount());
-                        shopOrderMapper.updateById(shopOrder);
                     }
+                    if(resultt.getItemsList()!=null ){
+                        if (resultt.getItemsList().size() == 1){
+                            shopOrder.setItemId(resultt.getItemsList().get(0).getItemID());
+                            shopOrder.setOuterItemId(resultt.getItemsList().get(0).getOuterItemID());
+                            shopOrder.setItemName(resultt.getItemsList().get(0).getItemName());
+                        }
+                        else if(resultt.getItemsList().size() > 1){
+                            shopOrder.setItemId("多本订单");
+                            shopOrder.setOuterItemId("多本订单");
+                            shopOrder.setItemName("多本订单");
+                        }
+                    }
+                    shopOrderMapper.updateById(shopOrder);
                 }
             } catch (ApiException e) {
                 throw e;

+ 9 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/shop/ShopOrder.java

@@ -164,6 +164,15 @@ public class ShopOrder extends BaseDO{
     @Excel(name = "当当实际付款金额")
     @TableField("real_paid_amount")
     private String realPaidAmount;
+    @Excel(name = "商品编码")
+    @TableField("item_id")
+    private String itemId;
+    @Excel(name = "外部商品编码")
+    @TableField("outer_item_id")
+    private String outerItemId;
+    @Excel(name = "商品名称")
+    @TableField("item_name")
+    private String itemName;
 
     @TableField(exist = false)
     private ShopAccount shopAccount;