huangzhiguo 1 рік тому
батько
коміт
8f125a1a8b

+ 8 - 2
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -197,6 +197,10 @@ public class CmPayShopController extends BaseController {
 
     @RequestMapping("saveChangePayShopAmount")
     public String saveChangePayShopAmount(NewShopOrder newShopOrder) {
+        /**
+         * couponAmount 优惠券优惠金额
+         * promotionFullReduction   促销满减优惠(不考虑凑单促销)
+         */
         String shopOrderID = newShopOrder.getId();
         Double freight = newShopOrder.getShopPostFee();
         Double thirdPartyFee = newShopOrder.getShopOtherFee() == null ? 0d : newShopOrder.getShopOtherFee();
@@ -388,8 +392,10 @@ public class CmPayShopController extends BaseController {
                 cmChangePayShopProduct.setSingleShouldPayTotalTax(product.getSingleShouldPayTotalTax());
                 cmChangePayShopProductService.save(cmChangePayShopProduct);
             }
-            shopOrder.setShopTaxFee(totalTaxesFee); //总税费
-            shopOrder.setShopProductAmount(totalCostFee); //商品费
+            //总税费
+            shopOrder.setShopTaxFee(totalTaxesFee);
+            //商品费 - 优惠券 - 促销满减优惠
+            shopOrder.setShopProductAmount(MathUtil.sub(totalCostFee , MathUtil.add(shopOrder.getCouponAmount(), shopOrder.getPromotionFullReduction())).doubleValue());
         //}
         // 比例成本
         /*if ("2".equals(costType)) {

+ 2 - 2
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -4,7 +4,7 @@
 
     <sql id="shopOrderColumns">
         co.rebateFee as rebateFee,
-        co.couponAmount as couponAmount,
+        ifnull(co.couponAmount, 0) as couponAmount,
 			co.userBeans as userBeans,
 			a.shopOrderID AS shopOrderID,
 			a.shopStatus AS status,
@@ -82,7 +82,7 @@
     		a.differenceType AS differenceType,
     		a.differencePrice AS differencePrice,
     		a.proportional AS proportional,
-    		a.promotionFullReduction As promotionFullReduction,
+    		ifnull(a.promotionFullReduction, 0) As promotionFullReduction,
     		a.zeroCostFlag AS zeroCostFlag
     </sql>
 

+ 5 - 1
src/main/resources/mappings/modules/product/ProductNewMapper.xml

@@ -148,7 +148,7 @@
         LEFT JOIN cm_svip_product csp on a.productID = csp.productId
         left join (select * from cm_organize_product_info ) copi on copi.productId = a.productID
         <where>
-              copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=a.productID)
+
             <if test="id !=null and id !=''">
                 AND a.productID=#{id}
             </if>
@@ -166,6 +166,10 @@
             </if>
             <if test="groundMall != null and groundMall != ''">
                 AND a.groundMall like concat('%',#{groundMall},'%')
+                and copi.organizeId = #{groundMall}
+            </if>
+            <if test="groundMall == null">
+                copi.organizeId = 0
             </if>
             <if test="productCategory != null and productCategory != ''">
                 AND a.productCategory = #{productCategory}

+ 1 - 0
src/main/resources/mappings/modules/user/CmPortraitMapper.xml

@@ -47,6 +47,7 @@
 
     <select id="selOrderList" resultType="com.caimei.modules.order.entity.NewOrder">
         SELECT
+        DISTINCT cso.shopOrderId as shopOrderID,
         (SELECT COUNT(shopOrderId) FROM cm_shop_order WHERE clubID = #{clubID} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotal,
         (SELECT IFNULL(SUM(totalAmount), 0) FROM cm_shop_order WHERE clubID = #{clubID} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotalAmount,
         cso.clubID,

+ 3 - 0
src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp

@@ -876,6 +876,9 @@
 
             </span>
         <span>待收金额:<fmt:formatNumber value="${shopOrder.restAmount}" type="currency"/></span>
+        <c:if test="${not empty shopOrder.couponAmount and shopOrder.couponAmount > 0}"> <span>优惠券:${shopOrder.couponAmount}</span> </c:if>
+        <c:if test="${not empty shopOrder.promotionFullReduction and shopOrder.promotionFullReduction > 0}"> <span>促销满减:${shopOrder.promotionFullReduction}</span> </c:if>
+        <c:if test="${not empty shopOrder.presentNum and shopOrder.presentNum > 0}"> <span>赠品数:${shopOrder.presentNum}</span> </c:if>
         <br/>
         <span>子订单状态:
  <c:if test="${shopOrder.status eq 11 || shopOrder.status eq 12 || shopOrder.status eq 13 ||shopOrder.status eq 21 ||shopOrder.status eq 22 ||