瀏覽代碼

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

zhijiezhao 1 年之前
父節點
當前提交
a914c3d5c5

+ 19 - 19
src/main/java/com/caimei/modules/order/service/CmReturnedPurchaseService.java

@@ -665,25 +665,25 @@ public class CmReturnedPurchaseService extends CrudService<CmReturnedPurchaseDao
                     userBeans = userBeans - num;
                     cmUserDao.updateUserBeans(newOrder.getUserID(), userBeans);
                 }
-                //订单低于1000扣500豆子退回
-                if (newOrder.getPayTotalFee() != null && newOrder.getPayTotalFee() < 1000) {
-                    //查本单是否扣豆子,有就返回
-                    UserBeansHistory bean = newCmClubDao.findLowOrder(newOrder.getOrderID());
-                    if (bean != null) {
-                        //有扣豆子记录
-                        UserBeansHistory beanHistory = new UserBeansHistory();
-                        beanHistory.setUserId(newOrder.getUserID());
-                        beanHistory.setOrderId(newOrder.getOrderID());
-                        beanHistory.setBeansType(16);
-                        beanHistory.setType(1);
-                        beanHistory.setNum(500);
-                        beanHistory.setPushStatus(0);
-                        beanHistory.setAddTime(new Date());
-                        newCmClubDao.insertBeansHistory(beanHistory);
-                        int beans = cmUserDao.findUserBeans(newOrder.getUserID()) + 500;
-                        cmUserDao.updateUserBeans(newOrder.getUserID(), beans);
-                    }
-                }
+//                //订单低于1000扣500豆子退回
+//                if (newOrder.getPayTotalFee() != null && newOrder.getPayTotalFee() < 1000) {
+//                    //查本单是否扣豆子,有就返回
+//                    UserBeansHistory bean = newCmClubDao.findLowOrder(newOrder.getOrderID());
+//                    if (bean != null) {
+//                        //有扣豆子记录
+//                        UserBeansHistory beanHistory = new UserBeansHistory();
+//                        beanHistory.setUserId(newOrder.getUserID());
+//                        beanHistory.setOrderId(newOrder.getOrderID());
+//                        beanHistory.setBeansType(16);
+//                        beanHistory.setType(1);
+//                        beanHistory.setNum(500);
+//                        beanHistory.setPushStatus(0);
+//                        beanHistory.setAddTime(new Date());
+//                        newCmClubDao.insertBeansHistory(beanHistory);
+//                        int beans = cmUserDao.findUserBeans(newOrder.getUserID()) + 500;
+//                        cmUserDao.updateUserBeans(newOrder.getUserID(), beans);
+//                    }
+//                }
             }
             //优惠券退回
             CmCouponOrderRecord couponOrderRecord = newOrder.getCouponOrderRecord();

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

@@ -1773,24 +1773,24 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             cmUserDao.updateUserBeans(order.getUserID(), userBeans);
         }
 
-        if (order.getPayTotalFee() != null && order.getPayTotalFee() < 1000) {
-            //查本单是否扣豆子,有就返回
-            UserBeansHistory bean = newCmClubDao.findLowOrder(order.getOrderID());
-            if (bean != null) {
-                //有扣豆子记录
-                UserBeansHistory beansHistory = new UserBeansHistory();
-                beansHistory.setUserId(order.getUserID());
-                beansHistory.setOrderId(order.getOrderID());
-                beansHistory.setBeansType(16);
-                beansHistory.setType(1);
-                beansHistory.setNum(500);
-                beansHistory.setPushStatus(0);
-                beansHistory.setAddTime(new Date());
-                newCmClubDao.insertBeansHistory(beansHistory);
-                int beans = cmUserDao.findUserBeans(order.getUserID()) + 500;
-                cmUserDao.updateUserBeans(order.getUserID(), beans);
-            }
-        }
+//        if (order.getPayTotalFee() != null && order.getPayTotalFee() < 1000) {
+//            //查本单是否扣豆子,有就返回
+//            UserBeansHistory bean = newCmClubDao.findLowOrder(order.getOrderID());
+//            if (bean != null) {
+//                //有扣豆子记录
+//                UserBeansHistory beansHistory = new UserBeansHistory();
+//                beansHistory.setUserId(order.getUserID());
+//                beansHistory.setOrderId(order.getOrderID());
+//                beansHistory.setBeansType(16);
+//                beansHistory.setType(1);
+//                beansHistory.setNum(500);
+//                beansHistory.setPushStatus(0);
+//                beansHistory.setAddTime(new Date());
+//                newCmClubDao.insertBeansHistory(beansHistory);
+//                int beans = cmUserDao.findUserBeans(order.getUserID()) + 500;
+//                cmUserDao.updateUserBeans(order.getUserID(), beans);
+//            }
+//        }
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String current = dateFormat.format(new Date());
         MessageCenter messageCenter = new MessageCenter();

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

@@ -309,7 +309,7 @@ public class CmPayShopController extends BaseController {
                 }
                 // product.setSingleShouldPayTotalTax(MathUtil.div(MathUtil.mul(MathUtil.div(product.getCostPrice(), MathUtil.div(MathUtil.add(product.getTaxRate(), 100),100)), product.getSupplierTaxRate()), 100).doubleValue());
                 Double singleShouldPayTotalTax = product.getSingleShouldPayTotalTax() == null ? 0d : product.getSingleShouldPayTotalTax();
-                Double supplierTaxRate = product.getSupplierTaxRate() == null ? 0d : product.getSupplierTaxRate();
+                Double supplierTaxRate = product.getTaxRate() == null ? 0d : product.getTaxRate();
                 // 获取已被退款的商品数量
                 Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(Integer.parseInt(shopOrderID), orderProductID);
                 returnNum = returnNum == null ? 0 : returnNum;
@@ -329,7 +329,8 @@ public class CmPayShopController extends BaseController {
                     cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId));
                     cmChangePayShopProduct.setOrderProductId(orderProductID);
                     cmChangePayShopProduct.setOrderProductName(product.getName());
-                    cmChangePayShopProduct.setSupplierTaxRate(orderProduct.getSupplierTaxRate());
+                    // 同步使用机构税率 作为供应商税率
+                    cmChangePayShopProduct.setSupplierTaxRate(product.getTaxRate());
                     cmChangePayShopProduct.setCostPrice(orderProduct.getNewCostPrice());
                     cmChangePayShopProduct.setSingleShouldPayTotalTax(orderProduct.getSingleShouldPayTotalTax());
                     cmChangePayShopProductService.save(cmChangePayShopProduct);
@@ -338,7 +339,9 @@ public class CmPayShopController extends BaseController {
                 orderProduct.setCostPrice(costPrice);
                 orderProduct.setOrganizeCostPrice(organizeCostPrice);
                 orderProduct.setCmCostPrice(cmCostPrice);
+                // 同步使用机构税率 作为供应商税率
                 orderProduct.setSupplierTaxRate(supplierTaxRate);
+                orderProduct.setTaxRate(product.getTaxRate());
                 orderProduct.setSingleShouldPayTotalTax(singleShouldPayTotalTax);
                 orderProducts.add(orderProduct);
                 int num = orderProduct.getNum() == null ? 0 : orderProduct.getNum();

+ 1 - 0
src/main/resources/mappings/modules/order/OrderProductMapper.xml

@@ -483,6 +483,7 @@
             organizePercent         = #{organizePercent},
             cmPercent               = #{cmPercent},
             supplierTaxRate         = #{supplierTaxRate},
+            taxRate                 = #{taxRate},
             shouldPayTotalTax       = #{shouldPayTotalTax},
             singleShouldPayTotalTax = #{singleShouldPayTotalTax}
         WHERE orderProductID = #{orderProductID}

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

@@ -718,6 +718,7 @@
         LEFT JOIN club c ON c.userID = a.userID
         <where>
             (s.shopId = 1161 OR s.AccountOwnership = 0 OR a.splitCode = 'E1807059160' or a.ordertype = 2)
+            and a.shopStatus not in (4, 5)
             <if test="startTime != null and startTime != ''">
                 AND (a.orderTime &gt; #{startTime} OR a.orderTime = #{startTime})
             </if>

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

@@ -411,28 +411,28 @@
     <tr>
         <td>订单类型: <c:if test="${order.orderType == 1}">自主订单</c:if><c:if test="${order.orderType == 0}">协销订单</c:if></td>
         <td>订单来源: ${fns:getDictLabel(order.orderSource,"bp_orderSource","" )}</td>
-        <td>订单状态:
-            <c:if test="${order.status eq 11 || order.status eq 12 || order.status eq 13 ||order.status eq 21 ||order.status eq 22 ||
-				order.status eq 23 || order.status eq 31 ||order.status eq 32 ||order.status eq 33}">
-                交易中
-            </c:if>
-            <c:if test="${order.status eq 0 || order.status eq 4 || order.status eq 5 || order.status eq 6 || order.status eq 7}">
-                ${fns:getDictLabel(order.status,"order_status","" )}
-                <c:if test="${order.status eq 0}">
-                    <span id="time" style="color: red"></span>
-                </c:if>
-                <c:if test="${order.status eq 6}">
-                    <font color="red">(
-                            <c:if test="${order.closeTime ne null}">
-                                ${order.closeTime}
-                            </c:if>
-                            <c:if test="${order.closeReason ne null}">
-                                , ${order.closeReason}
-                            </c:if>
-                    )</font>
-                </c:if>
-            </c:if>
-        </td>
+<%--        <td>订单状态:--%>
+<%--            <c:if test="${order.status eq 11 || order.status eq 12 || order.status eq 13 ||order.status eq 21 ||order.status eq 22 ||--%>
+<%--				order.status eq 23 || order.status eq 31 ||order.status eq 32 ||order.status eq 33}">--%>
+<%--                交易中--%>
+<%--            </c:if>--%>
+<%--            <c:if test="${order.status eq 0 || order.status eq 4 || order.status eq 5 || order.status eq 6 || order.status eq 7}">--%>
+<%--                ${fns:getDictLabel(order.status,"order_status","" )}--%>
+<%--                <c:if test="${order.status eq 0}">--%>
+<%--                    <span id="time" style="color: red"></span>--%>
+<%--                </c:if>--%>
+<%--                <c:if test="${order.status eq 6}">--%>
+<%--                    <font color="red">(--%>
+<%--                            <c:if test="${order.closeTime ne null}">--%>
+<%--                                ${order.closeTime}--%>
+<%--                            </c:if>--%>
+<%--                            <c:if test="${order.closeReason ne null}">--%>
+<%--                                , ${order.closeReason}--%>
+<%--                            </c:if>--%>
+<%--                    )</font>--%>
+<%--                </c:if>--%>
+<%--            </c:if>--%>
+<%--        </td>--%>
     </tr>
     <tr>
         <c:if test="${order.status ne 0}">