Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/developerD' into developerD

zhijiezhao 1 gadu atpakaļ
vecāks
revīzija
7503d6bd0d

+ 9 - 9
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -287,10 +287,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                     p.setCostPrice(MathUtil.div(p.getCostPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100),100)).doubleValue());
                     p.setNewCostPrice(newCostPrice);*/
 
-                    p.setOldDiscountPrice(p.getDiscountPrice());
+                   /* p.setOldDiscountPrice(p.getDiscountPrice());
                     if ("0".equals(p.getIncludedTax()) && null != p.getTaxRate() && p.getTaxRate() > 0d) {
                         p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
-                    }
+                    }*/
                     // 付采美总金额
                     allServeAmount = MathUtil.add(allServeAmount, MathUtil.mul(p.getNum(), p.getCmCostPrice())).doubleValue();
                     // 子订单利润
@@ -443,10 +443,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                     newCostPrice = p.getCostPrice();
                     p.setCostPrice(MathUtil.div(p.getCostPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100),100)).doubleValue());
                     p.setNewCostPrice(newCostPrice);*/
-                    p.setOldDiscountPrice(p.getDiscountPrice());
+                    /*p.setOldDiscountPrice(p.getDiscountPrice());
                     if ("0".equals(p.getIncludedTax()) && null != p.getTaxRate() && p.getTaxRate() > 0d) {
                         p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
-                    }
+                    }*/
                     // 付采美总金额
                     allServeAmount = MathUtil.add(allServeAmount, MathUtil.mul(p.getNum(), p.getCmCostPrice())).doubleValue();
                     brokerage = MathUtil.add(brokerage, MathUtil.mul(p.getBrokerage(),p.getNum())).doubleValue();
@@ -733,10 +733,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
                 Double wipePayment = cmPayShopRecordDao.sumWipePaymentNoStatus(Integer.valueOf(record.getShopOrderID()));
                 wipePayment = wipePayment != null ? wipePayment : 0d;
-                // 本次付款金额 + 抹平金额 + 原来已经付过的金额
-                BigDecimal payedFee = MathUtil.add(MathUtil.add(record.getPayAmount(), wipePayment), shopOrder.getPayedShopAmount());
+                // 本次付款金额 + 抹平金额 + 原来已经付过的金额 - 付第三方
+                BigDecimal payedFee = MathUtil.add(MathUtil.sub(MathUtil.add(record.getPayAmount(), wipePayment), shopOrder.getShopOtherFee()), shopOrder.getPayedShopAmount());
                 // 总共要付的金额
-                BigDecimal shouldPayFee = BigDecimal.valueOf(shopOrder.getShouldPayShopAmount());
+                BigDecimal shouldPayFee = MathUtil.sub(shopOrder.getShouldPayShopAmount(), shopOrder.getShopOtherFee());
                 //判断是否有差价金额
                 if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 1) {
                     shouldPayFee = MathUtil.add(shouldPayFee, shopOrder.getDifferencePrice());
@@ -756,7 +756,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                     logger.info("check ----> 付款金额异常, 付款金额大于待付款金额");
                     throw new Exception("付款金额异常, 付款金额大于待付款金额");
                 }
-                shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() == null ? 0D : shopOrder.getPayedShopAmount() + record.getPayAmount());
+                shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() == null ? 0D : MathUtil.add(shopOrder.getPayedShopAmount(), MathUtil.sub(record.getPayAmount(), shopOrder.getShopOtherFee())).doubleValue());
                 shopOrder.setPaying("0"); //退出付款进行状态
                 newShopOrderDao.update(shopOrder);
                 record.setStatus("1");
@@ -881,7 +881,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             //修改每一条子订单的已付款金额
             for (CmPayShopRecord record : records) {
                 NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
-                shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() - record.getPayAmount());
+                shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() - record.getPayAmount() + shopOrder.getShopOtherFee());
                 if (shopOrder.getPayedShopAmount() == 0D) {
                     // 本次付款金额 + 原来已经付过的金额  < 总共要付的金额
                     shopOrder.setPayStatus("1");

+ 2 - 2
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -365,10 +365,10 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
                 newCostPrice = p.getCostPrice();
                 p.setCostPrice(MathUtil.div(p.getCostPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100),100)).doubleValue());
                 p.setNewCostPrice(newCostPrice);*/
-                p.setOldDiscountPrice(p.getDiscountPrice());
+                /*p.setOldDiscountPrice(p.getDiscountPrice());
                 if ("0".equals(p.getIncludedTax()) && null != p.getTaxRate() && p.getTaxRate() > 0d) {
                     p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
-                }
+                }*/
             }
             if (so.getShopPostFee() == null) so.setShopPostFee(0D);
             if (so.getShopTaxFee() == null) so.setShopTaxFee(0D);

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

@@ -464,13 +464,13 @@
                     <td colspan="3" class="supplier-fee">
                         <div><span class="nowrap">
                             <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                                应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
+                                应付:<fmt:formatNumber value="${s.shouldPayShopAmount-s.shopOtherFee}" type="number" pattern="#,##0.00"/>
                             </c:if>
 							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount+s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
+                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount+s.differencePrice-s.shopOtherFee}"/></font><font color="red">(原应付:${s.shouldPayShopAmount-s.shopOtherFee},已补差价:${s.differencePrice})</font>
                             </c:if>
 							<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount-s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
+                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount-s.differencePrice-s.shopOtherFee}"/></font><font color="red">(原应付:${s.shouldPayShopAmount-s.shopOtherFee},已退差价:${s.differencePrice})</font>
                             </c:if>
 							,</span>
                             <span class="nowrap">已付:${s.payedShopAmount},</span></div>