Quellcode durchsuchen

修改代扣税款,优惠金额逻辑

hyq vor 5 Jahren
Ursprung
Commit
9ef9dc8ee4

+ 20 - 0
src/main/java/com/emato/ccnet/wx/dao/entity/wx/WxOrderDate.java

@@ -69,6 +69,26 @@ public class WxOrderDate implements Serializable {
 
     private String exprAgreementType;
 
+    private BigDecimal couponPrice;
+
+    private BigDecimal fullCutPrice;
+
+    public BigDecimal getFullCutPrice() {
+        return fullCutPrice;
+    }
+
+    public void setFullCutPrice(BigDecimal fullCutPrice) {
+        this.fullCutPrice = fullCutPrice;
+    }
+
+    public BigDecimal getCouponPrice() {
+        return couponPrice;
+    }
+
+    public void setCouponPrice(BigDecimal couponPrice) {
+        this.couponPrice = couponPrice;
+    }
+
     public String getExprAgreementType() {
         return exprAgreementType;
     }

+ 5 - 3
src/main/java/com/emato/ccnet/wx/service/impl/CusOrderServiceImpl.java

@@ -317,9 +317,11 @@ public class CusOrderServiceImpl implements CusOrderService {
             cusOrder.setGoodsValue(goodsValue);
             BigDecimal taxTotal = new BigDecimal(0);
             BigDecimal paid = wxOrder.getActuralPaid();//订单下单总价格
-            if(paid != null){
-                taxTotal = paid.subtract(goodsValue).setScale(2, BigDecimal.ROUND_HALF_UP);
-            }
+//            logger.error("订单下单总价格:"+paid);
+//            logger.error("商品不含税总价:"+goodsValue);
+//            if(paid != null){
+//                taxTotal = paid.subtract(goodsValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+//            }
 
             cusOrder.setTaxTotal(taxTotal);//待扣税款
             cusOrder.setFreight(wxOrder.getFreight());

+ 8 - 1
src/main/java/com/emato/ccnet/wx/service/impl/WxOrderServiceImpl.java

@@ -194,7 +194,14 @@ public class WxOrderServiceImpl implements WxOrderService {
 
         BigDecimal freight = new BigDecimal(0);
         BigDecimal discount = new BigDecimal(0);
-//        discount = wxOrderDate.getCouponPrice();
+        //优惠券优惠金额
+        if(wxOrderDate.getCouponPrice() != null && wxOrderDate.getCouponPrice().compareTo(new BigDecimal(0)) != 0) {
+            discount = wxOrderDate.getCouponPrice();
+        }
+        //满减优惠金额
+        if(wxOrderDate.getFullCutPrice() != null && wxOrderDate.getFullCutPrice().compareTo(new BigDecimal(0)) != 0) {
+            discount = wxOrderDate.getFullCutPrice();
+        }
         wxOrder.setFreight(freight);
         wxOrder.setDiscount(discount);
 

+ 3 - 1
src/main/resources/mybatis/mapper/wx/WxOrderGrab.xml

@@ -32,6 +32,8 @@
     <result column="order_biz_type" property="wsFlag" jdbcType="CHAR" />
     <result column="buyer_pay_check" property="buyerPayCheck" jdbcType="CHAR" />
     <result column="expr_agreement_type" property="exprAgreementType" />
+    <result column="coupon_price" property="couponPrice" />
+    <result column="full_cut_price" property="fullCutPrice" />
   </resultMap>
 
   <resultMap id="wxOrderGoodsDate" type="com.emato.ccnet.wx.dao.entity.wx.WxOrderGoodsDate" >
@@ -55,7 +57,7 @@
   <select id="getWxOrderDate"  parameterType="hashMap" resultMap="wxOrderDate">
     SELECT mo.merch_order_sn,mo.order_sn,mo.id,ms.merch_sn,ms.merch_name, ms.store_number,ms.third_party_merch_code,ms.third_party_merch_name,mo.store_id,mo.add_time,mo.user_id,mo.add_time AS buyer_bill_time,mu.id_no,mu.username,
     mu.mobile AS buyer_tel,mo.consignee,mo.mobile,mo.province,mo.city,mo.district,mo.address,mo.pay_name,mo.pay_mobile,mo.pay_transaction_id,mo.actual_price,
-    mo.pay_time,mo.order_biz_type, mo.buyer_pay_check,ms.expr_agreement_type
+    mo.pay_time,mo.order_biz_type, mo.buyer_pay_check,ms.expr_agreement_type,mo.coupon_price,mo.full_cut_price
     FROM mall_order mo
     LEFT OUTER JOIN mall_user mu ON mo.user_id = mu.id
     LEFT OUTER JOIN mall_store ms ON mo.store_id = ms.id