Browse Source

bugfix-订单相关

Aslee 3 năm trước cách đây
mục cha
commit
342bf0ee4b

+ 6 - 1
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -851,7 +851,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                 newShopOrderDao.delete(freightShopOrder);
                 newOrderProductDao.delete(freightOrderProduct);
             }
-            if (newOrder.getFreePostFlag() != null && newOrder.getFreePostFlag().equals("1")) {
+            if (newOrder.getFreePostFlag() != null && "1".equals(newOrder.getFreePostFlag())) {
                 setFreightShopOrder(newOrder);
             }
             List<NewShopOrder> shopOrders = newShopOrderDao.findListByOrderID(newOrder.getOrderID());
@@ -1091,6 +1091,11 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         newShopOrder.setTotalAmount(newOrder.getFreight());
         newShopOrder.setNeedPayAmount(newOrder.getFreight());
         newShopOrder.setDiscountAmount(0D);
+        newShopOrder.setEachDiscount(0D);
+        newShopOrder.setRealPay(newOrder.getFreight());
+        newShopOrder.setReceiptAmount(0D);
+        newShopOrder.setSplitCode(product.getSplitCode());
+        newShopOrder.setReceiptStatus("1");
         if ("1".equals(pOrder.getPostageOrderFlag())) {
             newShopOrder.setPayFlag("1");
             newShopOrder.setPayStatus("3");

+ 3 - 3
src/main/java/com/caimei/modules/order/utils/OrderUtil.java

@@ -55,7 +55,7 @@ public class OrderUtil {
                 shopOrder.setTotalAmount(shopOrder.getTotalAmount() + o.getTotalFee());
                 shopOrder.setNeedPayAmount(shopOrder.getNeedPayAmount() + o.getShouldPayFee());
                 shopOrder.setTotalAddedValueTax(shopOrder.getTotalAddedValueTax() + o.getTotalAddedValueTax()); //税费
-                shopOrder.setBrokerage(shopOrder.getBrokerage() + o.getCmFee()); //佣金 =  应付采美
+                shopOrder.setBrokerage(shopOrder.getBrokerage() + o.getCmFee() + o.getTotalAddedValueTax() - o.getShouldPayTotalTax()); //佣金 =  应付采美
                 // 计算超级会员优惠
                 if (null != o.getSvipPriceFlag() && 1 == o.getSvipPriceFlag()) {
                     BigDecimal productTotalReduction = MathUtil.mul(o.getSvipReduction(), o.getNum(), 2);
@@ -83,7 +83,7 @@ public class OrderUtil {
                 shopOrder.setOrderSubmitType(4);
                 shopOrder.setFee(null);
                 // 赠品单独列出了
-                shopOrder.setPresentNum(0);
+                shopOrder.setPresentNum(o.getPresentNum());
                 shopOrder.setProductAmount(o.getTotalAmount());
                 shopOrder.setDiscountFee(o.getDiscountFee());
                 shopOrder.setTotalAmount(o.getTotalFee());
@@ -92,7 +92,7 @@ public class OrderUtil {
                 List<NewOrderProduct> newOrderProducts = new ArrayList<>(); // 实例化订单商品集合
                 newOrderProducts.add(o);
                 shopOrder.setNewOrderProducts(newOrderProducts);
-                shopOrder.setBrokerage(o.getCmFee());
+                shopOrder.setBrokerage(o.getCmFee() + o.getTotalAddedValueTax() - o.getShouldPayTotalTax());
 
                 shopOrder.setDiscountAmount((o.getPrice() - o.getDiscountPrice()) * o.getNum());
                 shopOrder.setTotalAmount(o.getTotalFee());

+ 2 - 1
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -84,7 +84,8 @@
 		a.trainingMethod as "trainingMethod",
 		a.trainingType as "trainingType",
 		a.trainingFee as "trainingFee",
-		a.commodityType as "commodityType"
+		a.commodityType as "commodityType",
+		a.splitCode
 	</sql>
 
 	<sql id="productJoins">

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/bulkpurchase/applyRefoundForm.jsp

@@ -508,7 +508,7 @@
                             <td>
                                 商品总额:¥<fmt:formatNumber type="number" value="${shopOrder.needPayAmount}" pattern="0.00" maxFractionDigits="2" />
                             </td>
-                            <td colspan="2">
+                            <td>
                                 优惠:¥<fmt:formatNumber type="number" value="${shopOrder.eachDiscount}" pattern="0.00" maxFractionDigits="2" />
                             </td>
                             <td>
@@ -517,7 +517,7 @@
                             <td>
                                 已付金额:¥<fmt:formatNumber type="number" value="${shopOrder.receiptAmount}" pattern="0.00" maxFractionDigits="2" />
                             </td>
-                            <td>
+                            <td colspan="2">
                                 待付金额:¥<fmt:formatNumber type="number" value="${shopOrder.restAmount}" pattern="0.00" maxFractionDigits="2" />
                             </td>
                         </tr>

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp

@@ -411,6 +411,7 @@
                         <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                     </td>
                     <td>${s.couponAmount} </td>
+                    <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
                 <tr/>
                 <tr>
                     <th>子订单编号(ID)</th>

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp

@@ -190,6 +190,7 @@
 							<c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
 						</td>
 						<td>${s.couponAmount} </td>
+						<td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
 					<tr/>
 					<tr>
 						<th>子订单编号(ID)</th>

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/order/cmPayShopEdit.jsp

@@ -179,6 +179,7 @@
                             <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                         </td>
                         <td>${s.couponAmount} </td>
+                        <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
                     <tr/>
                     <tr>
                         <th>子订单编号(ID)</th>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp

@@ -413,7 +413,6 @@
         </div>
         <div class="payment-form-content">
             <c:forEach items="${cmPayShop.shopOrders}" var="s">
-               <input type="hidden" value="${eachDiscount}" class="eachDiscount" ><%-- //分摊优惠--%>
                 <table class="table table-striped table-bordered table-condensed pay-table">
                     <tr>
                         <th>订单编号(ID)</th>
@@ -512,6 +511,7 @@
                             <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                         </td>
                         <td class="couponAmount">${s.couponAmount} </td>
+                        <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
                     <tr/>
                     <tr>
                         <th>子订单编号(ID)</th>
@@ -936,6 +936,7 @@
         });
 
         $('.pay-table').each(function () {
+            debugger
             var thisEle = $(this),
                 totalComissionVal = 0,
                 resVal = '';
@@ -949,7 +950,6 @@
             totalComissionEle.each(function () {
                 totalComissionVal += Number($(this).text().replace(',', ''));
             })
-            alert(promotionFullReduction.toFixed(2));
             // 子订单佣金=单个商品总佣金+机构运费-付第三方-供应商运费-子订单分摊优惠
             resVal = (totalComissionVal + clubFreight - thirdPartyVal - freightVal - eachDiscount).toFixed(2);
             comissionEle.text(resVal);

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopDetail.jsp

@@ -181,6 +181,7 @@
                         <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                     </td>
                     <td>${s.couponAmount} </td>
+                    <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
                 <tr/>
                 <tr>
                     <th>子订单编号(ID)</th>

+ 0 - 1
src/main/webapp/static/modules/bulkpurchase/orderForm.js

@@ -144,7 +144,6 @@ $(function () {
         product_index = 0;
         var productList = [];
         $('.productTable tbody tr:not(.gift)').each(function (index, element) {
-            debugger
             var data = JSON.parse($(this).attr("data-value"));
             data.shopId = data.shopID ? data.shopID : data.shopId;
             data.productId = data.productID ? data.productID : data.productId;