Sfoglia il codice sorgente

fix bug:商品信息查询,推送订单新增字段buy_price(成交价,必填)

lhm 3 anni fa
parent
commit
bc3509374a

+ 12 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/haikong/HaiKongSendOrderInfoDetailRecordEntity.java

@@ -48,6 +48,10 @@ public class HaiKongSendOrderInfoDetailRecordEntity implements Serializable {
      */
     private BigDecimal price;
     /**
+     * 成交价
+     */
+    private BigDecimal buyPrice;
+    /**
      * 商品编码
      */
     private String itemcode;
@@ -233,4 +237,12 @@ public class HaiKongSendOrderInfoDetailRecordEntity implements Serializable {
     public void setTaxPrice(BigDecimal taxPrice) {
         this.taxPrice = taxPrice;
     }
+
+    public BigDecimal getBuyPrice() {
+        return buyPrice;
+    }
+
+    public void setBuyPrice(BigDecimal buyPrice) {
+        this.buyPrice = buyPrice;
+    }
 }

+ 12 - 0
kmall-admin/src/main/java/com/kmall/admin/haikong/dto/OrderInfoItemDTO.java

@@ -30,6 +30,9 @@ public class OrderInfoItemDTO implements Serializable {
 
     private BigDecimal price;
 
+    @JsonProperty("buy_price")
+    private BigDecimal buyPrice;
+
     private String itemcode;
 
     private BigDecimal amount;
@@ -138,6 +141,14 @@ public class OrderInfoItemDTO implements Serializable {
         this.taxPrice = taxPrice;
     }
 
+    public BigDecimal getBuyPrice() {
+        return buyPrice;
+    }
+
+    public void setBuyPrice(BigDecimal buyPrice) {
+        this.buyPrice = buyPrice;
+    }
+
     @Override
     public String toString() {
         return "OrderInfoItemDTO{" +
@@ -148,6 +159,7 @@ public class OrderInfoItemDTO implements Serializable {
                 ", name='" + name + '\'' +
                 ", cost=" + cost +
                 ", price=" + price +
+                ", buyPrice=" + buyPrice +
                 ", itemcode='" + itemcode + '\'' +
                 ", amount=" + amount +
                 ", nums=" + nums +

+ 1 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -2923,6 +2923,7 @@ public class OrderServiceImpl implements OrderService {
         orderInfoItemDTO.setPrice(orderGoodsVo.getRetail_price());
         orderInfoItemDTO.setItemcode(orderGoodsVo.getSku());
         orderInfoItemDTO.setAmount(orderGoodsVo.getActualPaymentAmount());
+        orderInfoItemDTO.setAmount(orderGoodsVo.getActualPaymentAmount());
         orderInfoItemDTO.setNums(orderGoodsVo.getNumber());
         orderInfoItemDTO.setTax("true");
         orderInfoItemDTO.setTaxPrice(orderGoodsVo.getTaxPrice());

+ 2 - 1
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -1184,7 +1184,8 @@
         SELECT
             a.id,a.sku,a.goods_number,a.goods_sn,a.name,a.list_pic_url,a.prod_barcode,r.market_price storeMarketPrice, r.retail_price as retailPrice,r.retail_price storeRetailPrice ,r.stock_num,s.store_name,r.product_id as productId,s.id 'storeId',a.goods_rate as goodsRate,
             a.hs_code as hsCode , a.legal_unit1_qty as legalUnit1Qty , a.legal_unit2_qty as legalUnit2Qty,a.ciq_prod_model as ciqProdModel,a.to_be_restored, r.stock_num, r.exit_region_number as exitRegionNumber,
-            a.category_id as categoryId, a.brand_id as brandId,a.net_weight as netWeight
+            a.category_id as categoryId, a.brand_id as brandId,a.net_weight as netWeight,
+            a.warehouse_sn as warehouseSn, a.warehous_sys_good_id as warehousSysGoodId, a.inventory_type as inventoryType
         FROM
             mall_goods a
         LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id

+ 9 - 0
kmall-admin/src/main/resources/mybatis/mapper/haikong/HaikongSendOrderInfoDetailRecordDao.xml

@@ -12,6 +12,7 @@
         <result property="name" column="name"/>
         <result property="cost" column="cost"/>
         <result property="price" column="price"/>
+        <result property="buyPrice" column="buy_price"/>
         <result property="itemcode" column="itemcode"/>
         <result property="amount" column="amount"/>
         <result property="nums" column="nums"/>
@@ -29,6 +30,7 @@
 			`name`,
 			`cost`,
 			`price`,
+			`buy_price`,
 			`itemcode`,
 			`amount`,
 			`nums`,
@@ -48,6 +50,7 @@
     		`name`,
     		`cost`,
     		`price`,
+    		`buy_price`,
     		`itemcode`,
     		`amount`,
     		`nums`,
@@ -84,6 +87,7 @@
 		`name`,
 		`cost`,
 		`price`,
+		`buy_price`,
 		`itemcode`,
 		`amount`,
 		`nums`,
@@ -116,6 +120,7 @@
 			`name`,
 			`cost`,
 			`price`,
+			`buy_price`,
 			`itemcode`,
 			`amount`,
 			`nums`,
@@ -129,6 +134,7 @@
 			#{name},
 			#{cost},
 			#{price},
+			#{buyPrice},
 			#{itemcode},
 			#{amount},
 			#{nums},
@@ -146,6 +152,7 @@
 			`name`,
 			`cost`,
 			`price`,
+			`buy_price`,
 			`itemcode`,
 			`amount`,
 			`nums`,
@@ -162,6 +169,7 @@
 					#{item.name},
 					#{item.cost},
 					#{item.price},
+					#{item.buyPrice},
 					#{item.itemcode},
 					#{item.amount},
 					#{item.nums},
@@ -181,6 +189,7 @@
 			<if test="name != null">`name` = #{name}, </if>
 			<if test="cost != null">`cost` = #{cost}, </if>
 			<if test="price != null">`price` = #{price}, </if>
+			<if test="buyPrice != null">`buy_price` = #{buyPrice}, </if>
 			<if test="itemcode != null">`itemcode` = #{itemcode}, </if>
 			<if test="amount != null">`amount` = #{amount}, </if>
 			<if test="nums != null">`nums` = #{nums}, </if>

+ 1 - 0
sql/init/other_table.sql

@@ -256,6 +256,7 @@ CREATE TABLE `haikong_send_order_info_detail_record`  (
   `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品名',
   `cost` decimal(10, 3) DEFAULT NULL COMMENT '明细商品的成本,填零售价',
   `price` decimal(10, 3) DEFAULT NULL COMMENT '销售价',
+  `buy_price` decimal(10, 3) DEFAULT NULL COMMENT '成交价',
   `itemcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
   `amount` decimal(10, 3) DEFAULT NULL COMMENT '明细商品总额,销售价*数量',
   `nums` int(8) DEFAULT NULL COMMENT '明细商品购买数量',