Browse Source

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

# Conflicts:
#	src/main/java/com/caimei/modules/order/dao/NewOrderDao.java
zhijiezhao 1 năm trước cách đây
mục cha
commit
132d582a34
32 tập tin đã thay đổi với 3181 bổ sung570 xóa
  1. 2 0
      src/main/java/com/caimei/modules/bulkpurchase/web/CmRefundsProductController.java
  2. 8 1
      src/main/java/com/caimei/modules/hehe/dao/CmHeheProductDao.java
  3. 2 0
      src/main/java/com/caimei/modules/hehe/service/CmHeheProductService.java
  4. 112 108
      src/main/java/com/caimei/modules/hehe/service/HeHeNewOrderService.java
  5. 88 0
      src/main/java/com/caimei/modules/order/dao/NewOrderDao.java
  6. 87 0
      src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java
  7. 52 1
      src/main/java/com/caimei/modules/order/entity/NewOrder.java
  8. 70 6
      src/main/java/com/caimei/modules/order/entity/NewShopOrder.java
  9. 4 4
      src/main/java/com/caimei/modules/order/service/CmPayShopService.java
  10. 335 0
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  11. 27 0
      src/main/java/com/caimei/modules/user/entity/NewCmShop.java
  12. 4 0
      src/main/java/com/caimei/modules/user/web/NewCmShopController.java
  13. 2 1
      src/main/resources/mappings/modules/cmpage/CmPageCentreMapper.xml
  14. 12 1
      src/main/resources/mappings/modules/hehe/CmHeheProductMapper.xml
  15. 30 20
      src/main/resources/mappings/modules/hehe/CmHeheUserMapper.xml
  16. 762 0
      src/main/resources/mappings/modules/order/OrderMapper.xml
  17. 1004 1
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  18. 4 1
      src/main/resources/mappings/modules/product/ProductMapper.xml
  19. 21 0
      src/main/resources/mappings/modules/user/NewCmShopMapper.xml
  20. 1 1
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderConfirmReturnRecord.jsp
  21. 1 1
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/refundRecord.jsp
  22. 9 9
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheProductForm.jsp
  23. 4 4
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheProductList.jsp
  24. 253 220
      src/main/webapp/WEB-INF/views/modules/hehe/heheNewOrderDetail.jsp
  25. 44 44
      src/main/webapp/WEB-INF/views/modules/hehe/heheNewOrderList.jsp
  26. 1 1
      src/main/webapp/WEB-INF/views/modules/hehe/userActivityProductList.jsp
  27. 1 1
      src/main/webapp/WEB-INF/views/modules/order/cmOrderRemarksFormNew.jsp
  28. 11 11
      src/main/webapp/WEB-INF/views/modules/order/cmReturnedPurchaseList.jsp
  29. 23 23
      src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp
  30. 84 22
      src/main/webapp/WEB-INF/views/modules/user/newCmShopSetForm.jsp
  31. 114 87
      src/main/webapp/static/common/jeesite.js
  32. 9 2
      src/test/java/com/caimei/info/InfoTest.java

+ 2 - 0
src/main/java/com/caimei/modules/bulkpurchase/web/CmRefundsProductController.java

@@ -601,6 +601,7 @@ public class CmRefundsProductController extends BaseController {
             model.addAttribute("bpClauses", bpClauses);
             model.addAttribute("cmReturnedPurchaseList", dataList);
             model.addAttribute("order", newOrder);
+            model.addAttribute("orderType", cmReturnedPurchase.getOrderType());
             model.addAttribute("returnedPurchaseFee", returnedPurchaseFee);
             model.addAttribute("refundFee", refundFee);
         } catch (Exception e) {
@@ -753,6 +754,7 @@ public class CmRefundsProductController extends BaseController {
         model.addAttribute("refundFee", refundFee);
         model.addAttribute("from", from);
         model.addAttribute("orderID", cmReturnedPurchase.getOrderID().toString());
+        model.addAttribute("orderType", cmReturnedPurchase.getOrderType());
 
         return "modules/bulkpurchase/refundRecord";
     }

+ 8 - 1
src/main/java/com/caimei/modules/hehe/dao/CmHeheProductDao.java

@@ -41,6 +41,13 @@ public interface CmHeheProductDao extends CrudDao<CmHeheProduct> {
      */
     void deleteActivityProduct(Integer productId);
 
+    /**
+     * 删除活动商品sku
+     *
+     * @param productId
+     */
+    void deleteCmHeHeSku(Integer productId);
+
     /**
      *
      * @param product
@@ -89,4 +96,4 @@ public interface CmHeheProductDao extends CrudDao<CmHeheProduct> {
     void updateHeHeSkuPrice(@Param("skuId") Integer skuId, @Param("price") Double price);
 
     List<CmLadderPrice> findLadderList(Integer skuId);
-}
+}

+ 2 - 0
src/main/java/com/caimei/modules/hehe/service/CmHeheProductService.java

@@ -99,6 +99,8 @@ public class CmHeheProductService extends CrudService<CmHeheProductDao, CmHehePr
         super.delete(cmHeheProduct);
         //删除活动商品
         cmHeheProductDao.deleteActivityProduct(cmHeheProduct.getProductId());
+        //删除活动商品sku
+        cmHeheProductDao.deleteCmHeHeSku(cmHeheProduct.getProductId());
         //删除分销者活动商品
         activityProductDao.deleteUserActivity(cmHeheProduct.getProductId());
         //删除活动阶梯

+ 112 - 108
src/main/java/com/caimei/modules/hehe/service/HeHeNewOrderService.java

@@ -5,6 +5,8 @@ import com.caimei.modules.hehe.entity.CmHeheCouponOrderRecord;
 import com.caimei.modules.order.dao.*;
 import com.caimei.modules.order.entity.*;
 import com.caimei.modules.order.service.CmReceiptOrderRelationService;
+import com.caimei.modules.order.service.NewOrderService;
+import com.caimei.modules.order.service.NewShopOrderService;
 import com.caimei.modules.order.service.OrderUserInfoService;
 import com.caimei.modules.order.utils.NewOrderStatus;
 import com.caimei.modules.product.dao.CmPromotionDao;
@@ -52,6 +54,8 @@ public class HeHeNewOrderService extends CrudService<HeHeNewOrderDao, NewOrder>
     @Resource
     private NewShopOrderDao newShopOrderDao;
     @Resource
+    private NewOrderService newOrderService;
+    @Resource
     private CmUserDao cmUserDao;
     @Resource
     private CmDiscernReceiptDao cmDiscernReceiptDao;
@@ -68,114 +72,114 @@ public class HeHeNewOrderService extends CrudService<HeHeNewOrderDao, NewOrder>
 
     @Override
     public NewOrder get(String id) {
-        NewOrder newOrder = super.get(id);
-        CmUser user = cmUserDao.get(newOrder.getUserID().toString());
-        if (user != null) {
-            //查询用户余额,机构名
-            newOrder.setBuyer(user.getName());
-            Double ableUserMoney = user.getAbleUserMoney() == null ? 0d : user.getAbleUserMoney();
-            newOrder.setAbleUserMoney(ableUserMoney);
-        }
-        List<Integer> l = new ArrayList<>();
-        l.add(newOrder.getOrderID());
-        List<Integer> orderIds = cmDiscernReceiptDao.findRebateOrderID(l);
-        if (orderIds.contains(newOrder.getOrderID()))
-            newOrder.setRebateOrder("1");
-        else
-            newOrder.setRebateOrder("0");
-        if (null != newOrder) {
-            // 获取订单优惠券使用记录
-            if (newOrder.getCouponAmount() != null && newOrder.getCouponAmount() > 0) {
-                CmHeheCouponOrderRecord couponRecord = heHeNewOrderDao.findOrderCouponRecord(newOrder.getOrderID());
-                if (couponRecord != null) {
-                    newOrder.setReceiveCouponId(couponRecord.getReceiveCouponId());
-                    newOrder.setHeheCouponRecord(couponRecord);
-                }
-            }
-            // 获取订单分享减免记录
-            if (newOrder.getReductionAmount() != null && newOrder.getReductionAmount() > 0) {
-                Double reductionTouchPrice = heHeNewOrderDao.findReductionTouchPrice(newOrder.getOrderID());
-                newOrder.setReductionTouchPrice(reductionTouchPrice);
-            }
-            //获取订单客户
-            OrderUserInfo orderUserInfo = orderUserInfoService.findByOrderID(newOrder.getOrderID());
-            if (null != orderUserInfo) {
-                newOrder.setBpOrderUserinfo(orderUserInfo);
-            }
-            //获取订单商品
-            List<NewOrderProduct> list = new ArrayList<>();
-            List<NewShopOrder> shopOrders = newShopOrderDao.findListByOrderID(newOrder.getOrderID());
-            if (CollectionUtils.isNotEmpty(shopOrders)) {
-                for (NewShopOrder shopOrder : shopOrders) {
-                    List<NewOrderProduct> pList = newOrderProductDao.findListByShopOrderID(shopOrder.getShopOrderID());
-                    pList.forEach(orderProduct -> {
-                        if (orderProduct.getLadderPriceFlag() == 1) {
-                            // 查询订单商品阶梯价格
-                            List<OrderProductLadderPrice> ladderPriceList = newOrderProductDao.findladderPriceList(orderProduct.getOrderProductID());
-                            if (null != ladderPriceList && ladderPriceList.size() > 0) {
-                                IntStream.range(0, ladderPriceList.size()).forEach(i -> {
-                                    if (i == ladderPriceList.size() - 1) {
-                                        ladderPriceList.get(i).setBuyNumRangeShow("≥" + ladderPriceList.get(i).getBuyNum());
-                                    } else {
-                                        String buyNumRangeShow = ladderPriceList.get(i).getBuyNum() + "~" + (ladderPriceList.get(i + 1).getBuyNum() - 1);
-                                        ladderPriceList.get(i).setBuyNumRangeShow(buyNumRangeShow);
-                                    }
-                                });
-                                orderProduct.setOrderProductLadderPriceList(ladderPriceList);
-                            }
-                        }
-                        //分销者名称
-                        if (orderProduct.getHeUserId() != null && orderProduct.getHeUserId() > 0) {
-                            String name = heHeNewOrderDao.findHeUser(orderProduct.getHeUserId());
-                            orderProduct.setHeUserName(name);
-                        }
-                    });
-                    list.addAll(pList);
-                    shopOrder.setNewOrderProducts(pList);
-                    if (pList.stream().anyMatch(p -> p.getProductID() == 999))
-                        shopOrder.setPostFeeCos("1");
-                    pList.forEach(item -> {
-                        if (NewOrderStatus.hasReturn(newOrder.getStatus())) {
-                            Integer returningNum = newOrderProductDao.getReturningNum(item.getOrderProductID());
-                            Integer returnedNum = newOrderProductDao.getReturnedNum(item.getOrderProductID());
-                            item.setReturningNum(returningNum);
-                            item.setReturnedNum(returnedNum);
-                        }
-                        /**确认收货信息*/
-                        if (NewOrderStatus.hasReceived(newOrder.getStatus())) {
-                            Integer receivedNum = newOrderProductDao.getReceivedNum(item.getOrderProductID());
-                            item.setReceivedNum(receivedNum);
-                        }
-                        String domain = SysConfig.getStringConfig("crm.server.domain");
-                        item.setProductImage(AppUtils.getProductImageURL(item.getProductImage(), AppKeys.ORIGINAL_PICTURE, domain));
-                        if (item != null && item.getOrderPromotionsId() != null && item.getOrderPromotionsId() > 0) {
-                            item.setProductPromotion(cmPromotionDao.findOrderPromotions(item.getOrderPromotionsId()));
-                        }
-                    });
-                    Double payed = cmPayShopRecordDao.sumByShopOrderID(shopOrder.getShopOrderID());
-                    shopOrder.setPayed(payed);
-                }
-                newOrder.setNewShopOrders(shopOrders);
-            }
-            if (CollectionUtils.isNotEmpty(list)) {
-                newOrder.setOrderProduct(list);
-                double freight = 0D;
-                double totalAddedValueTax = 0D;
-                for (NewOrderProduct op : list) {
-                    if (op.getProductID().intValue() == 999) { //邮费商品
-                        freight += op.getPrice();
-                    }
-                    totalAddedValueTax += op.getTotalAddedValueTax();
-                }
-                if ("1".equals(newOrder.getFreePostFlag())) newOrder.setFreight(freight);
-                newOrder.setTotalAddedValueTax(totalAddedValueTax);
-            }
-            shopOrders.sort((so1, so2) -> {
-                //给子订单排序  邮费排在最后  其余的按shopOrderID  asc
-                if ("1".equals(so1.getPostFeeCos())) return 1;
-                return so1.getShopOrderID() - so2.getShopOrderID();
-            });
-        }
+        NewOrder newOrder = newOrderService.get(id);
+//        CmUser user = cmUserDao.get(newOrder.getUserID().toString());
+//        if (user != null) {
+//            //查询用户余额,机构名
+//            newOrder.setBuyer(user.getName());
+//            Double ableUserMoney = user.getAbleUserMoney() == null ? 0d : user.getAbleUserMoney();
+//            newOrder.setAbleUserMoney(ableUserMoney);
+//        }
+//        List<Integer> l = new ArrayList<>();
+//        l.add(newOrder.getOrderID());
+//        List<Integer> orderIds = cmDiscernReceiptDao.findRebateOrderID(l);
+//        if (orderIds.contains(newOrder.getOrderID()))
+//            newOrder.setRebateOrder("1");
+//        else
+//            newOrder.setRebateOrder("0");
+//        if (null != newOrder) {
+//            // 获取订单优惠券使用记录
+//            if (newOrder.getCouponAmount() != null && newOrder.getCouponAmount() > 0) {
+//                CmHeheCouponOrderRecord couponRecord = heHeNewOrderDao.findOrderCouponRecord(newOrder.getOrderID());
+//                if (couponRecord != null) {
+//                    newOrder.setReceiveCouponId(couponRecord.getReceiveCouponId());
+//                    newOrder.setHeheCouponRecord(couponRecord);
+//                }
+//            }
+//            // 获取订单分享减免记录
+//            if (newOrder.getReductionAmount() != null && newOrder.getReductionAmount() > 0) {
+//                Double reductionTouchPrice = heHeNewOrderDao.findReductionTouchPrice(newOrder.getOrderID());
+//                newOrder.setReductionTouchPrice(reductionTouchPrice);
+//            }
+//            //获取订单客户
+//            OrderUserInfo orderUserInfo = orderUserInfoService.findByOrderID(newOrder.getOrderID());
+//            if (null != orderUserInfo) {
+//                newOrder.setBpOrderUserinfo(orderUserInfo);
+//            }
+//            //获取订单商品
+//            List<NewOrderProduct> list = new ArrayList<>();
+//            List<NewShopOrder> shopOrders = newShopOrderDao.findListByOrderID(newOrder.getOrderID());
+//            if (CollectionUtils.isNotEmpty(shopOrders)) {
+//                for (NewShopOrder shopOrder : shopOrders) {
+//                    List<NewOrderProduct> pList = newOrderProductDao.findListByShopOrderID(shopOrder.getShopOrderID());
+//                    pList.forEach(orderProduct -> {
+//                        if (orderProduct.getLadderPriceFlag() == 1) {
+//                            // 查询订单商品阶梯价格
+//                            List<OrderProductLadderPrice> ladderPriceList = newOrderProductDao.findladderPriceList(orderProduct.getOrderProductID());
+//                            if (null != ladderPriceList && ladderPriceList.size() > 0) {
+//                                IntStream.range(0, ladderPriceList.size()).forEach(i -> {
+//                                    if (i == ladderPriceList.size() - 1) {
+//                                        ladderPriceList.get(i).setBuyNumRangeShow("≥" + ladderPriceList.get(i).getBuyNum());
+//                                    } else {
+//                                        String buyNumRangeShow = ladderPriceList.get(i).getBuyNum() + "~" + (ladderPriceList.get(i + 1).getBuyNum() - 1);
+//                                        ladderPriceList.get(i).setBuyNumRangeShow(buyNumRangeShow);
+//                                    }
+//                                });
+//                                orderProduct.setOrderProductLadderPriceList(ladderPriceList);
+//                            }
+//                        }
+//                        //分销者名称
+//                        if (orderProduct.getHeUserId() != null && orderProduct.getHeUserId() > 0) {
+//                            String name = heHeNewOrderDao.findHeUser(orderProduct.getHeUserId());
+//                            orderProduct.setHeUserName(name);
+//                        }
+//                    });
+//                    list.addAll(pList);
+//                    shopOrder.setNewOrderProducts(pList);
+//                    if (pList.stream().anyMatch(p -> p.getProductID() == 999))
+//                        shopOrder.setPostFeeCos("1");
+//                    pList.forEach(item -> {
+//                        if (NewOrderStatus.hasReturn(newOrder.getStatus())) {
+//                            Integer returningNum = newOrderProductDao.getReturningNum(item.getOrderProductID());
+//                            Integer returnedNum = newOrderProductDao.getReturnedNum(item.getOrderProductID());
+//                            item.setReturningNum(returningNum);
+//                            item.setReturnedNum(returnedNum);
+//                        }
+//                        /**确认收货信息*/
+//                        if (NewOrderStatus.hasReceived(newOrder.getStatus())) {
+//                            Integer receivedNum = newOrderProductDao.getReceivedNum(item.getOrderProductID());
+//                            item.setReceivedNum(receivedNum);
+//                        }
+//                        String domain = SysConfig.getStringConfig("crm.server.domain");
+//                        item.setProductImage(AppUtils.getProductImageURL(item.getProductImage(), AppKeys.ORIGINAL_PICTURE, domain));
+//                        if (item != null && item.getOrderPromotionsId() != null && item.getOrderPromotionsId() > 0) {
+//                            item.setProductPromotion(cmPromotionDao.findOrderPromotions(item.getOrderPromotionsId()));
+//                        }
+//                    });
+//                    Double payed = cmPayShopRecordDao.sumByShopOrderID(shopOrder.getShopOrderID());
+//                    shopOrder.setPayed(payed);
+//                }
+//                newOrder.setNewShopOrders(shopOrders);
+//            }
+//            if (CollectionUtils.isNotEmpty(list)) {
+//                newOrder.setOrderProduct(list);
+//                double freight = 0D;
+//                double totalAddedValueTax = 0D;
+//                for (NewOrderProduct op : list) {
+//                    if (op.getProductID().intValue() == 999) { //邮费商品
+//                        freight += op.getPrice();
+//                    }
+//                    totalAddedValueTax += op.getTotalAddedValueTax();
+//                }
+//                if ("1".equals(newOrder.getFreePostFlag())) newOrder.setFreight(freight);
+//                newOrder.setTotalAddedValueTax(totalAddedValueTax);
+//            }
+//            shopOrders.sort((so1, so2) -> {
+//                //给子订单排序  邮费排在最后  其余的按shopOrderID  asc
+//                if ("1".equals(so1.getPostFeeCos())) return 1;
+//                return so1.getShopOrderID() - so2.getShopOrderID();
+//            });
+//        }
         return newOrder;
     }
 

+ 88 - 0
src/main/java/com/caimei/modules/order/dao/NewOrderDao.java

@@ -5,6 +5,7 @@ import com.caimei.modules.coupon.entity.CmCouponOrderRecord;
 import com.caimei.modules.order.entity.*;
 import com.caimei.modules.product.entity.CmPromotion;
 import com.caimei.modules.user.entity.NewCmSp;
+import com.caimei.po.neworder.CmOrder;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import org.apache.ibatis.annotations.Param;
@@ -269,5 +270,92 @@ public interface NewOrderDao extends CrudDao<NewOrder> {
 
     Integer getSplitTime(Integer shopOrderId);
 
+    /**
+     * 查询用户模块重构-主订单
+     *
+     * @param orderID 用户模块重构-主订单主键
+     * @return 用户模块重构-主订单
+     */
+    public NewOrder getCmOrderByOrderID(String orderID);
+
+    /**
+     * 查询用户模块重构-主订单Id
+     *
+     * @param cmOrder 用户模块重构-主订单
+     * @return String
+     */
+    public String getById(NewOrder cmOrder);
+
+    /**
+     * 查询用户模块重构-主订单Ids
+     *
+     * @param cmOrder 用户模块重构-主订单
+     * @return List<String>
+     */
+    public List<String> getByIds(NewOrder cmOrder);
+
+    /**
+     * 查询用户模块重构-主订单
+     *
+     * @param cmOrder 用户模块重构-主订单
+     * @return 用户模块重构-主订单集合
+     */
+    public NewOrder getByCmOrder(NewOrder cmOrder);
+
+    /**
+     * 查询用户模块重构-主订单列表
+     *
+     * @param cmOrder 用户模块重构-主订单
+     * @return 用户模块重构-主订单集合
+     */
+    public List<NewOrder> getCmOrderList(NewOrder cmOrder);
+    /**
+     * 查询用户模块重构-主订单记录总数
+     *
+     * @param cmOrder 用户模块重构-主订单
+     * @return 用户模块重构-主订单Integer
+     */
+    public int getCmOrderCount(NewOrder cmOrder);
+
+    /**
+     * 新增用户模块重构-主订单
+     *
+     * @param cmOrder 用户模块重构-主订单
+     * @return 结果
+     */
+    public int addCmOrder(NewOrder cmOrder);
+
+    /**
+     * 修改用户模块重构-主订单
+     *
+     * @param cmOrder 用户模块重构-主订单
+     * @return 结果
+     */
+    public int updateCmOrder(NewOrder cmOrder);
+
+    /**
+     * 删除用户模块重构-主订单
+     *
+     * @param orderID 用户模块重构-主订单主键
+     * @return 结果
+     */
+    public int delCmOrderByOrderID(String orderID);
+
+    /**
+     * 批量删除用户模块重构-主订单
+     *
+     * @param orderIDs 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmOrderByOrderIDs(@Param("orderIDs") String[] orderIDs);
+
+    /**
+     * 修改批量删除用户模块重构-主订单
+     *
+     * @param orderIDs 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int updateDelCmOrderByOrderIDs(@Param("orderIDs") String[] orderIDs,@Param("delFlag") Integer delFlag);
+
     Double getPaidOrganizePrice(Integer orderProductId);
 }

+ 87 - 0
src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java

@@ -2,6 +2,7 @@ package com.caimei.modules.order.dao;
 
 import com.caimei.modules.order.entity.NewShopOrder;
 import com.caimei.modules.order.entity.SettleRecord;
+import com.caimei.po.neworder.CmShopOrder;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import org.apache.ibatis.annotations.Param;
@@ -85,4 +86,90 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
 
     //查询子订单是 线上 还是 线上
     List<Integer> payWay(Integer shopOrderID);
+    /**
+     * 查询子订单
+     *
+     * @param shopOrderID 子订单主键
+     * @return 子订单
+     */
+    public NewShopOrder getCmShopOrderByShopOrderID(String shopOrderID);
+
+    /**
+     * 查询子订单Id
+     *
+     * @param cmShopOrder 子订单
+     * @return String
+     */
+    public String getById(NewShopOrder cmShopOrder);
+
+    /**
+     * 查询子订单Ids
+     *
+     * @param cmShopOrder 子订单
+     * @return List<String>
+     */
+    public List<String> getByIds(NewShopOrder cmShopOrder);
+
+    /**
+     * 查询子订单
+     *
+     * @param cmShopOrder 子订单
+     * @return 子订单集合
+     */
+    public NewShopOrder getByCmShopOrder(NewShopOrder cmShopOrder);
+
+    /**
+     * 查询子订单列表
+     *
+     * @param cmShopOrder 子订单
+     * @return 子订单集合
+     */
+    public List<NewShopOrder> getCmShopOrderList(NewShopOrder cmShopOrder);
+    /**
+     * 查询子订单记录总数
+     *
+     * @param cmShopOrder 子订单
+     * @return 子订单Integer
+     */
+    public int getCmShopOrderCount(NewShopOrder cmShopOrder);
+
+    /**
+     * 新增子订单
+     *
+     * @param cmShopOrder 子订单
+     * @return 结果
+     */
+    public int addCmShopOrder(NewShopOrder cmShopOrder);
+
+    /**
+     * 修改子订单
+     *
+     * @param cmShopOrder 子订单
+     * @return 结果
+     */
+    public int updateCmShopOrder(NewShopOrder cmShopOrder);
+
+    /**
+     * 删除子订单
+     *
+     * @param shopOrderID 子订单主键
+     * @return 结果
+     */
+    public int delCmShopOrderByShopOrderID(String shopOrderID);
+
+    /**
+     * 批量删除子订单
+     *
+     * @param shopOrderIDs 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmShopOrderByShopOrderIDs(@Param("shopOrderIDs") String[] shopOrderIDs);
+
+    /**
+     * 修改批量删除子订单
+     *
+     * @param shopOrderIDs 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int updateDelCmShopOrderByShopOrderIDs(@Param("shopOrderIDs") String[] shopOrderIDs,@Param("delFlag") Integer delFlag);
 }

+ 52 - 1
src/main/java/com/caimei/modules/order/entity/NewOrder.java

@@ -165,12 +165,63 @@ public class NewOrder extends DataEntity<NewOrder> {
     private Integer numbers;    // 总数
     private Double totalMoney;  // 总金额
 
-
+    /** 已支付成功次数统计(适用线上多笔付款用来确认当前是哪一笔) */
+    private Integer paySuccessCounter;
+    /** 包邮券ID  保留字段 */
+    private Integer freePostageTicketID;
+    /** 第三方订单编号(绑定第三方订单关系),适用第三方发起订单 */
+    private String thirdPartyOrderNo;
+    /** 订单是否同步发货物流给第三方,0未同步,1已同步 */
+    private String synchronizeFlag;
+
+    /** 消息推送用户ID */
+    private String unionID;
     /**
      * 呵呵商城优惠券
      */
     private Integer receiveCouponId;
     private CmHeheCouponOrderRecord heheCouponRecord;   //优惠券信息
+
+    public Integer getPaySuccessCounter() {
+        return paySuccessCounter;
+    }
+
+    public void setPaySuccessCounter(Integer paySuccessCounter) {
+        this.paySuccessCounter = paySuccessCounter;
+    }
+
+    public Integer getFreePostageTicketID() {
+        return freePostageTicketID;
+    }
+
+    public void setFreePostageTicketID(Integer freePostageTicketID) {
+        this.freePostageTicketID = freePostageTicketID;
+    }
+
+    public String getThirdPartyOrderNo() {
+        return thirdPartyOrderNo;
+    }
+
+    public void setThirdPartyOrderNo(String thirdPartyOrderNo) {
+        this.thirdPartyOrderNo = thirdPartyOrderNo;
+    }
+
+    public String getSynchronizeFlag() {
+        return synchronizeFlag;
+    }
+
+    public void setSynchronizeFlag(String synchronizeFlag) {
+        this.synchronizeFlag = synchronizeFlag;
+    }
+
+    public String getUnionID() {
+        return unionID;
+    }
+
+    public void setUnionID(String unionID) {
+        this.unionID = unionID;
+    }
+
     public Integer getShopOrderID() {
         return shopOrderID;
     }

+ 70 - 6
src/main/java/com/caimei/modules/order/entity/NewShopOrder.java

@@ -83,8 +83,8 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private NewOrder order;
     private List<NewOrderProduct> newOrderProducts;
     private Double preferential; //订单商品的总优惠
-    private int orderSubmitType;
-    private int orderType;             // 订单类型
+    private Integer orderSubmitType;
+    private Integer orderType;             // 订单类型
     private String orderTime;//下单时间
     private Integer presentNum;//赠品数量
     private Integer outStoreNum;//已经发货的商品数量
@@ -152,6 +152,21 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private String shopPostFlag; //免邮标志 运费:-1到付,0包邮,1需要运费,-2仪器到付其它包邮
     private String postageInfo; //运费字符串
 
+    /**  */
+    private Integer returnGoodsStatus;
+
+    /** 二手商品订单标识  0非二手商品订单、 1二手商品订单 */
+    private String secondHandOrderFlag;
+    /** 外部商城付采美佣金 */
+    private BigDecimal payCmAmount;
+    /**  */
+    private String receiptedFlag;
+
+    /**  */
+    private String receiptedType;
+    /** 子订单已支付成功次数统计 */
+    private Integer paySuccessCounter;
+
 
 
     private List<CmOrderPaymentVoucherVo> voucherVo; //支付凭证
@@ -168,6 +183,55 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private String remarkImage9;
     private String remarkImage10;
 
+    public Integer getReturnGoodsStatus() {
+        return returnGoodsStatus;
+    }
+
+    public void setReturnGoodsStatus(Integer returnGoodsStatus) {
+        this.returnGoodsStatus = returnGoodsStatus;
+    }
+
+    public String getSecondHandOrderFlag() {
+        return secondHandOrderFlag;
+    }
+
+    public void setSecondHandOrderFlag(String secondHandOrderFlag) {
+        this.secondHandOrderFlag = secondHandOrderFlag;
+    }
+
+    public BigDecimal getPayCmAmount() {
+        return payCmAmount;
+    }
+
+    public void setPayCmAmount(BigDecimal payCmAmount) {
+        this.payCmAmount = payCmAmount;
+    }
+
+    public String getReceiptedFlag() {
+        return receiptedFlag;
+    }
+
+    public void setReceiptedFlag(String receiptedFlag) {
+        this.receiptedFlag = receiptedFlag;
+    }
+
+    public String getReceiptedType() {
+        return receiptedType;
+    }
+
+    public void setReceiptedType(String receiptedType) {
+        this.receiptedType = receiptedType;
+    }
+
+    public Integer getPaySuccessCounter() {
+        return paySuccessCounter;
+    }
+
+    public void setPaySuccessCounter(Integer paySuccessCounter) {
+        this.paySuccessCounter = paySuccessCounter;
+    }
+
+
     public String getShopPostFlag() {
         return shopPostFlag;
     }
@@ -675,11 +739,11 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
         this.orderID = orderID;
     }
 
-    public int getOrderType() {
+    public Integer getOrderType() {
         return orderType;
     }
 
-    public void setOrderType(int orderType) {
+    public void setOrderType(Integer orderType) {
         this.orderType = orderType;
     }
 
@@ -788,11 +852,11 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
         this.preferential = preferential;
     }
 
-    public int getOrderSubmitType() {
+    public Integer getOrderSubmitType() {
         return orderSubmitType;
     }
 
-    public void setOrderSubmitType(int orderSubmitType) {
+    public void setOrderSubmitType(Integer orderSubmitType) {
         this.orderSubmitType = orderSubmitType;
     }
 

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

@@ -496,10 +496,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             //保存每个子订单的付款金额记录  等待审核付款
             NewCmShop shop = newCmShopDao.get(cmPayShop.getShopID());
             shop.setAbleRebateAmount(shop.getAbleRebateAmount() == null ? 0D : shop.getAbleRebateAmount() - cmPayShop.getBalancePayFee());
-            shop.setBankAccount(cmPayShop.getBankAccount());
-            shop.setBankAccountName(cmPayShop.getBankAccountName());
-            shop.setBankName(cmPayShop.getBankName());
-            newCmShopDao.update(shop);
+//            shop.setBankAccount(cmPayShop.getBankAccount());
+//            shop.setBankAccountName(cmPayShop.getBankAccountName());
+//            shop.setBankName(cmPayShop.getBankName());
+//            newCmShopDao.update(shop);
             Integer orderID = null;//记录一下子订单的id 下面需要用它去查询运费子订单
             for (String p : payInfo) {
                 CmPayShopRecord record = new CmPayShopRecord();

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

@@ -2,18 +2,34 @@ package com.caimei.modules.order.service;
 
 
 import com.caimei.modules.bulkpurchase.entity.BpOrderUserinfo;
+import com.caimei.modules.bulkpurchase.entity.OrderInvoice;
+import com.caimei.modules.coupon.entity.CmCouponOrderRecord;
 import com.caimei.modules.hehe.dao.HeHeNewOrderDao;
+import com.caimei.modules.hehe.entity.CmHeheCouponOrderRecord;
 import com.caimei.modules.order.dao.*;
 import com.caimei.modules.order.entity.*;
+import com.caimei.modules.order.utils.NewOrderStatus;
 import com.caimei.modules.product.dao.CmPromotionDao;
+import com.caimei.modules.product.dao.CmSecondHandDetailDao;
 import com.caimei.modules.product.dao.ProductDao;
 import com.caimei.modules.product.entity.CmPromotion;
+import com.caimei.modules.product.entity.CmSecondHandDetail;
+import com.caimei.modules.product.entity.CmSku;
+import com.caimei.modules.product.entity.OrderProductLadderPrice;
+import com.caimei.modules.user.entity.CmUser;
+import com.caimei.modules.user.entity.NewCmClub;
+import com.caimei.po.neworder.CmShopOrder;
+import com.caimei.utils.AppKeys;
+import com.caimei.utils.AppUtils;
+import com.caimei.utils.MathUtil;
+import com.caimei.utils.SysConfig;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.modules.sys.entity.User;
 import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
 import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -22,6 +38,7 @@ import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
+import java.util.stream.IntStream;
 
 @Service
 @Transactional(readOnly = true)
@@ -63,6 +80,12 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
     private HeHeNewOrderDao heHeNewOrderDao;
     @Resource
     private CmPayShopDao cmPayShopDao;
+    @Autowired
+    private CmSecondHandDetailDao cmSecondHandDetailDao;
+    @Resource
+    private CmDiscernReceiptService cmDiscernReceiptService;
+    @Resource
+    private NewOrderService newOrderService;
 
     public NewShopOrder findByShopOrderID(Integer shopOrderID) {
         NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderID);
@@ -169,6 +192,7 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
         //查询这个子订单所有的发货批次记录
         List<LogisticsBatch> lbs = logisticsBatchDao.findBatch(orderID, logisticsBatchID);
         if(null!=shopOrderID){
+            //过滤子订单
             lbs=lbs.stream().filter(s -> s.getShopOrderID().equals(shopOrderID)).collect(Collectors.toList());
         }
 
@@ -684,4 +708,315 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
     public List<Integer> payWay(Integer shoprderID) {
         return newShopOrderDao.payWay(shoprderID);
     }
+
+    /**
+     * 查询子订单
+     *
+     * @param shopOrderID 子订单主键
+     * @return 子订单
+     */
+
+    public NewShopOrder getCmShopOrderByShopOrderID(String shopOrderID) {
+        NewShopOrder newShopOrder = new NewShopOrder();
+        newShopOrder.setShopOrderID(Integer.valueOf(shopOrderID));
+        NewShopOrder byCmShopOrder = newShopOrderDao.getByCmShopOrder(newShopOrder);
+        initCmShopOrder(byCmShopOrder);
+        return byCmShopOrder;
+    }
+
+    /**
+     * 查询子订单Id
+     *
+     * @param cmShopOrder 子订单
+     * @return String
+     */
+
+    public String getById(NewShopOrder cmShopOrder) {
+        return newShopOrderDao.getById(cmShopOrder);
+    }
+
+    /**
+     * 查询子订单Ids
+     *
+     * @param cmShopOrder 子订单
+     * @return List<String>
+     */
+
+    public List<String> getByIds(NewShopOrder cmShopOrder) {
+        return newShopOrderDao.getByIds(cmShopOrder);
+    }
+
+    /**
+     * 查询子订单
+     *
+     * @param cmShopOrder 子订单
+     * @return 子订单
+     */
+    public NewShopOrder getByCmShopOrder(NewShopOrder cmShopOrder) {
+        NewShopOrder byCmShopOrder = newShopOrderDao.getByCmShopOrder(cmShopOrder);
+        initCmShopOrder(byCmShopOrder);
+        return byCmShopOrder;
+    }
+
+    /**
+     * 查询子订单列表
+     *
+     * @param cmShopOrder 子订单
+     * @return 子订单
+     */
+    public List<NewShopOrder> getCmShopOrderList(NewShopOrder cmShopOrder) {
+        List<NewShopOrder> cmShopOrderList = newShopOrderDao.getCmShopOrderList(cmShopOrder);
+        initCmShopOrders(cmShopOrderList);
+        return cmShopOrderList;
+    }
+
+    /**
+     * 查询子订单记录总数
+     *
+     * @param cmShopOrder 子订单
+     * @return 子订单
+     */
+    public int getCmShopOrderCount(NewShopOrder cmShopOrder) {
+        return newShopOrderDao.getCmShopOrderCount(cmShopOrder);
+    }
+
+    /**
+     * 新增子订单
+     *
+     * @param cmShopOrder 子订单
+     * @return 结果
+     */
+    public int addCmShopOrder(NewShopOrder cmShopOrder) {
+        cmShopOrder.setCreateDate(new Date());
+        return newShopOrderDao.addCmShopOrder(cmShopOrder);
+    }
+
+    /**
+     * 修改子订单
+     *
+     * @param cmShopOrder 子订单
+     * @return 结果
+     */
+    public int updateCmShopOrder(NewShopOrder cmShopOrder) {
+        cmShopOrder.setUpdateDate(new Date());
+        return newShopOrderDao.updateCmShopOrder(cmShopOrder);
+    }
+
+    /**
+     * 批量删除子订单
+     *
+     * @param shopOrderIDs 需要删除的子订单主键
+     * @return 结果
+     */
+    public int delCmShopOrderByShopOrderIDs(String[] shopOrderIDs) {
+        return newShopOrderDao.updateDelCmShopOrderByShopOrderIDs(shopOrderIDs, 1);
+        //return newShopOrderDao.delCmShopOrderByShopOrderIDs(shopOrderIDs);
+    }
+
+    /**
+     * 删除子订单信息
+     *
+     * @param shopOrderID 子订单主键
+     * @return 结果
+     */
+    public int delCmShopOrderByShopOrderID(Integer shopOrderID) {
+        NewShopOrder newShopOrder = new NewShopOrder();
+        newShopOrder.setShopOrderID(shopOrderID);
+        newShopOrder.setDelFlag("1");
+        return newShopOrderDao.updateCmShopOrder(newShopOrder);
+        //return newShopOrderDao.delCmShopOrderByShopOrderID(shopOrderID);
+    }
+
+    /**
+     * 批量新增子订单
+     *
+     * @param cmShopOrderList 子订单列表
+     * @return 结果
+     */
+    public void batchAddCmShopOrder(List<NewShopOrder> cmShopOrderList) {
+        for (NewShopOrder cmShopOrder : cmShopOrderList) {
+            newShopOrderDao.addCmShopOrder(cmShopOrder);
+        }
+    }
+
+    /**
+     * 批量修改子订单
+     *
+     * @param cmShopOrderList 子订单列表
+     * @return 结果
+     */
+    public void batchUpdateCmShopOrder(List<NewShopOrder> cmShopOrderList) {
+        for (NewShopOrder cmShopOrder : cmShopOrderList) {
+            newShopOrderDao.updateCmShopOrder(cmShopOrder);
+        }
+    }
+
+    /**
+     * 功能描述: 初始化子订单集合
+     *
+     * @param cmShopOrderList
+     * @return [cmShopOrderList]
+     * @auther: Kaick
+     * @date: 2023/7/25 10:57
+     */
+    public void initCmShopOrders(List<NewShopOrder> cmShopOrderList) {
+        //获取订单商品
+        if (CollectionUtils.isNotEmpty(cmShopOrderList)) {
+            for (NewShopOrder shopOrder : cmShopOrderList) {
+                initCmShopOrder(shopOrder);
+            }
+        }
+        cmShopOrderList.sort((so1, so2) -> {
+            //给子订单排序  邮费排在最后  其余的按shopOrderID  asc
+            if ("1".equals(so1.getPostFeeCos())) return 1;
+            return so1.getShopOrderID() - so2.getShopOrderID();
+        });
+    }
+
+    /**
+     * 功能描述: 初始化子订单
+     *
+     * @param shopOrder
+     * @return [shopOrder]
+     * @auther: Kaick
+     * @date: 2023/7/25 10:56
+     */
+    public void initCmShopOrder(NewShopOrder shopOrder) {
+        //子订单已付金额
+        Double shoOrderIDReceipt = cmDiscernReceiptService.findShoOrderIDReceipt(shopOrder.getShopOrderID());
+        BigDecimal add = MathUtil.add(shopOrder.getReceiptAmount(), shoOrderIDReceipt != null ? shoOrderIDReceipt : 0);
+        shopOrder.setReceiptAmount(add.doubleValue());
+        //子订单待付金额
+        BigDecimal sub = MathUtil.sub((shopOrder.getRealPay() != null ? shopOrder.getRealPay() : shopOrder.getNeedPayAmount()).doubleValue()
+                , shopOrder.getReceiptAmount().doubleValue());
+        shopOrder.setRestAmount(sub.doubleValue());
+        if (1 == shopOrder.getStatus()) {
+            if ("1".equals(shopOrder.getReceiptStatus()) && "1".equals(shopOrder.getSendOutStatus())) {
+                shopOrder.setStatus(11);
+            } else if ("1".equals(shopOrder.getReceiptStatus()) && "2".equals(shopOrder.getSendOutStatus())) {
+                shopOrder.setStatus(12);
+            } else if ("1".equals(shopOrder.getReceiptStatus()) && "3".equals(shopOrder.getSendOutStatus())) {
+                shopOrder.setStatus(13);
+            } else if ("2".equals(shopOrder.getReceiptStatus()) && "1".equals(shopOrder.getSendOutStatus())) {
+                shopOrder.setStatus(21);
+            } else if ("2".equals(shopOrder.getReceiptStatus()) && "2".equals(shopOrder.getSendOutStatus())) {
+                shopOrder.setStatus(22);
+            } else if ("2".equals(shopOrder.getReceiptStatus()) && "3".equals(shopOrder.getSendOutStatus())) {
+                shopOrder.setStatus(23);
+            } else if ("3".equals(shopOrder.getReceiptStatus()) && "1".equals(shopOrder.getSendOutStatus())) {
+                shopOrder.setStatus(31);
+            } else if ("3".equals(shopOrder.getReceiptStatus()) && "2".equals(shopOrder.getSendOutStatus())) {
+                shopOrder.setStatus(32);
+            } else if ("3".equals(shopOrder.getReceiptStatus()) && "3".equals(shopOrder.getSendOutStatus())) {
+                shopOrder.setStatus(33);
+            }
+        }
+        //拼接运费
+        Double ColdChina = Double.valueOf(700);
+        String shopPostFlag = shopOrder.getShopPostFlag() != null ? shopOrder.getShopPostFlag() : "-2";
+        String PostageInfo = null;
+        if (null != shopOrder.getIsColdChina() && shopOrder.getIsColdChina() == 1) {
+            if ("2" == shopOrder.getShopPostFlag()) {
+                // 到付
+                PostageInfo = "¥" + ColdChina + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: 到付)";
+            } else if ("0" == shopOrder.getShopPostFlag()) {
+                // 包邮
+                PostageInfo = "¥" + ColdChina + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: 包邮)";
+            } else {
+                // 有运费
+                PostageInfo = "¥" + MathUtil.add(shopOrder.getShopPostFee(), ColdChina) + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: ¥" + shopOrder.getShopPostFee() + ")";
+            }
+        } else {
+            PostageInfo = shopPostFlag.equals("2") ? "到付" : shopPostFlag.equals("0") ? "包邮" : "¥" + shopOrder.getShopPostFee();
+        }
+        shopOrder.setPostageInfo(PostageInfo);
+        //支付凭证
+        List<CmOrderPaymentVoucherVo> voucherVo = newOrderService.findVoucherVoOrderID(shopOrder.getShopOrderID());
+        shopOrder.setVoucherVo(voucherVo);
+        List<String> code = newShopOrderDao.findCommercialCode(shopOrder.getOrderID());
+        for (String str : code) {
+            if ("E1807059160".equals(str)) {
+                shopOrder.setCommercialCode("E1807059160");
+            }
+        }
+        //子订单商品信息
+        List<NewOrderProduct> pList = newOrderProductDao.findListByShopOrderID(shopOrder.getShopOrderID());
+        pList.forEach(orderProduct -> {
+            initCmOrderProduct(orderProduct);
+        });
+        shopOrder.setNewOrderProducts(pList);
+        if (pList.stream().anyMatch(p -> p.getProductID().intValue() == 999)){
+            shopOrder.setPostFeeCos("1");
+        }
+        Double payed = cmPayShopRecordDao.sumByShopOrderID(shopOrder.getShopOrderID());
+        shopOrder.setPayed(payed);
+        //查询是否存在店铺促销活动
+        CmPromotion shopPromotion = null;
+        if (shopOrder.getOrderPromotionsId() != null && shopOrder.getOrderPromotionsId() > 0) {
+            shopPromotion = cmPromotionDao.findOrderPromotions(shopOrder.getOrderPromotionsId());
+            shopOrder.setShopPromotion(shopPromotion);
+        }
+        CmSecondHandDetail cmSecondHandDetail = cmSecondHandDetailDao.selectContactDockingPeople(shopOrder.getShopOrderNo());
+        if (null != cmSecondHandDetail) {
+            shopOrder.setContactName(cmSecondHandDetail.getContactName());
+            shopOrder.setDockingPeopleName(cmSecondHandDetail.getDockingPeopleName());
+        }
+    }
+
+    public void initCmOrderProduct(NewOrderProduct orderProduct) {
+//                        //是否二手订单
+//                        if ("2".equals(orderProduct.getProductCategory())) {
+//                            newOrder.setSecondHandOrderFlag("1");
+//                        }
+//                        //充值定金商品
+//                        if (6060 == orderProduct.getProductID()) {
+//                            newOrder.setRechargeGoods(1);
+//                        }
+        if (orderProduct.getLadderPriceFlag() == 1) {
+            // 查询订单商品阶梯价格
+            List<OrderProductLadderPrice> ladderPriceList = newOrderProductDao.findladderPriceList(orderProduct.getOrderProductID());
+            if (null != ladderPriceList && ladderPriceList.size() > 0) {
+                IntStream.range(0, ladderPriceList.size()).forEach(i -> {
+                    if (i == ladderPriceList.size() - 1) {
+                        ladderPriceList.get(i).setBuyNumRangeShow("≥" + ladderPriceList.get(i).getBuyNum());
+                    } else {
+                        String buyNumRangeShow = ladderPriceList.get(i).getBuyNum() + "~" + (ladderPriceList.get(i + 1).getBuyNum() - 1);
+                        ladderPriceList.get(i).setBuyNumRangeShow(buyNumRangeShow);
+                    }
+                });
+                orderProduct.setOrderProductLadderPriceList(ladderPriceList);
+            }
+        }
+        // 设置超级会员税费优惠
+        if (null != orderProduct.getSvipPriceFlag() && orderProduct.getSvipPriceFlag() == 1 && "0".equals(orderProduct.getIncludedTax()) && ("1".equals(orderProduct.getInvoiceType()) || "2".equals(orderProduct.getInvoiceType()))) {
+            orderProduct.setSvipTaxReduction(orderProduct.getSvipReduction() - (orderProduct.getPrice() - orderProduct.getDiscountPrice()));
+        } else {
+            orderProduct.setSvipTaxReduction(0d);
+        }
+        // sku信息
+        List<CmSku> skuList = productDao.findSkuList(orderProduct.getProductID());
+        orderProduct.setSkuList(skuList);
+        //商品退货信息
+        Integer returningNum = newOrderProductDao.getReturningNum(orderProduct.getOrderProductID());
+        Integer returnedNum = newOrderProductDao.getReturnedNum(orderProduct.getOrderProductID());
+        orderProduct.setReturningNum(returningNum);
+        orderProduct.setReturnedNum(returnedNum);
+        /**确认收货信息*/
+        Integer receivedNum = newOrderProductDao.getReceivedNum(orderProduct.getOrderProductID());
+        orderProduct.setReceivedNum(receivedNum);
+        String domain = SysConfig.getStringConfig("crm.server.domain");
+        orderProduct.setProductImage(AppUtils.getProductImageURL(orderProduct.getProductImage(), AppKeys.ORIGINAL_PICTURE, domain));
+        if (orderProduct != null && orderProduct.getOrderPromotionsId() != null && orderProduct.getOrderPromotionsId() > 0) {
+            orderProduct.setProductPromotion(cmPromotionDao.findOrderPromotions(orderProduct.getOrderPromotionsId()));
+            //单品优惠
+            if (orderProduct.getOrderPromotionsId() != null) {
+                CmPromotion promotions = cmPromotionDao.findOrderPromotions(orderProduct.getOrderPromotionsId());
+                if (promotions != null && "1".equals(promotions.getMode())) {
+                    //取对应sku的优惠价
+                    Double price = productDao.getTouchPriceBySku(orderProduct.getSkuId());
+                    orderProduct.setDiscountPrice(price);
+                }
+            }
+        }
+    }
 }

+ 27 - 0
src/main/java/com/caimei/modules/user/entity/NewCmShop.java

@@ -96,6 +96,33 @@ public class NewCmShop extends DataEntity<NewCmShop> {
     private String endTime;        //注册时间结束  查询条件
     private String editStatus;//1编辑,2审核
     private String source; //注册来源: 0网站 1小程序
+    private String cmBankAccount; //付采美银行账号
+    private String cmBankAccountName; //采美付款账号的户名
+    private String cmBankName; //采美付款账号的开户行
+
+    public String getCmBankAccount() {
+        return cmBankAccount;
+    }
+
+    public void setCmBankAccount(String cmBankAccount) {
+        this.cmBankAccount = cmBankAccount;
+    }
+
+    public String getCmBankAccountName() {
+        return cmBankAccountName;
+    }
+
+    public void setCmBankAccountName(String cmBankAccountName) {
+        this.cmBankAccountName = cmBankAccountName;
+    }
+
+    public String getCmBankName() {
+        return cmBankName;
+    }
+
+    public void setCmBankName(String cmBankName) {
+        this.cmBankName = cmBankName;
+    }
 
     public NewCmShop() {
         super();

+ 4 - 0
src/main/java/com/caimei/modules/user/web/NewCmShopController.java

@@ -192,6 +192,10 @@ public class NewCmShopController extends BaseController {
     public String formShop(NewCmShop newCmShop, Model model) {
         //获取供应商证书信息
         newCmShop = newCmShopService.get(newCmShop.getShopID().toString());
+        //去除银行账号空格
+        if(newCmShop!=null&&newCmShop.getBankAccount()!=null){
+            newCmShop.setBankAccount(newCmShop.getBankAccount().replaceAll(" ",""));
+        }
         model.addAttribute("newCmShop", newCmShop);
         return "modules/user/newCmShopSetForm";
     }

+ 2 - 1
src/main/resources/mappings/modules/cmpage/CmPageCentreMapper.xml

@@ -198,11 +198,12 @@
 		FROM
 		  new_page_floor_image a
 		  LEFT JOIN product p ON a.productId = p.productID
-		left join cm_organize_product_info copi on copi.productId = p.productID and copi.productId = p.productID  and copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=p.productId)
+		left join cm_organize_product_info copi on  copi.productId = p.productID
 		  LEFT JOIN shop s on p.shopID = s.shopID
 		  left join cm_hehe_product chp on a.productId = chp.productId
 		WHERE
 		  a.centreId = #{centreId}
+		and copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=p.productId)
           <if test="type != null and type == '8'">
               and chp.id is not null
           </if>

+ 12 - 1
src/main/resources/mappings/modules/hehe/CmHeheProductMapper.xml

@@ -157,9 +157,12 @@
         SELECT
         a.*,s.name AS "shopName"
         FROM product a
+        left join cm_organize_product_info copi on copi.productId = a.productID
         LEFT JOIN shop s on s.shopID = a.shopID
         <where>
-            a.splitCode is not null and a.splitCode != ''
+            a.splitCode is not null and a.splitCode != '' and  copi.validFlag=2
+            and copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=a.productId)
+            and s.shopID in(SELECT shopID FROM shop  WHERE name ='深圳市采美奥泰贸易有限公司')
             <if test="productID != null">
                 AND a.productID = #{productID}
             </if>
@@ -297,6 +300,8 @@
     <select id="findProductElement" resultType="com.caimei.modules.hehe.entity.CmHeheProduct">
         select ifnull(chs.price, 0)           as price,
                ifnull(cs.shopPercent, 0) as shopPercent,
+               ifnull(cs.organizePercent, 0) as organizePercent,
+               ifnull(cs.cmPercent, 0) as cmPercent,
                ifnull(cs.costCheckFlag, 0)    as costType,
                ifnull(cs.costPrice, 0)        as costPrice
             ,cs.organizeId
@@ -314,6 +319,12 @@
         WHERE productId = #{productId}
     </update>
 
+
+    <update id="deleteCmHeHeSku">
+        delete from  cm_hehe_sku
+        WHERE productId = #{productId}
+    </update>
+
     <update id="updateProductId">
         update cm_hehe_product
         set oldProductId = #{oldProductId},

+ 30 - 20
src/main/resources/mappings/modules/hehe/CmHeheUserMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.hehe.dao.CmHeheUserDao">
-    
+
 	<sql id="cmHeheUserColumns">
 		a.id AS "id",
 		a.userId AS "userId",
@@ -12,26 +12,26 @@
 		a.openId AS "openId",
 		a.addTime AS "addTime"
 	</sql>
-	
+
 
 	<delete id="deleteUserActivity">
 		delete from cm_hehe_user_activity where userId = #{userId} and productId = #{productId}
 	</delete>
 
 	<select id="get" resultType="CmHeheUser">
-		SELECT 
+		SELECT
 			<include refid="cmHeheUserColumns"/>
 		FROM cm_hehe_user a
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="CmHeheUser">
-		SELECT 
+		SELECT
 			<include refid="cmHeheUserColumns"/>
 		FROM cm_hehe_user a
 		<where>
 			<if test="name != null and name != ''">
-				AND a.name LIKE 
+				AND a.name LIKE
 					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
 					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
 					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
@@ -55,14 +55,14 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="CmHeheUser">
-		SELECT 
+		SELECT
 			<include refid="cmHeheUserColumns"/>
 		FROM cm_hehe_user a
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -71,7 +71,7 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<insert id="insert" parameterType="CmHeheUser"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO cm_hehe_user(
 			userId,
@@ -91,9 +91,9 @@
 			#{addTime}
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE cm_hehe_user SET 	
+		UPDATE cm_hehe_user SET
 			name = #{name},
 			mobile = #{mobile},
 			userIdentity = #{userIdentity},
@@ -147,24 +147,29 @@
 		a.activityId AS "activityId",
 		a.productId AS "productId",
 		a.sort AS "sort",
-		chp.price AS "price",
+		chs.price AS "price",
 		p.name AS "name",
 		p.mainImage AS "mainImage",
-		p.unit AS "unit",
+		cs.unit AS "unit",
 		s.name AS "shopName"
 		FROM
 		cm_hehe_user_activity a
 		LEFT JOIN cm_hehe_product chp ON chp.productId = a.productID
+		LEFT JOIN cm_hehe_sku chs ON chp.productId = chs.productID
+		LEFT JOIN cm_sku cs ON cs.skuId = chs.skuId
 		LEFT JOIN product p ON a.productId = p.productID
+		left join cm_organize_product_info copi on copi.productId = a.productID
 		LEFT JOIN shop s ON s.shopID = p.shopID
 		WHERE
 		a.userId = #{userId}
+		and copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=a.productId)
 		<if test="name != null and name != ''">
 			AND p.name LIKE CONCAT('%',#{name},'%')
 		</if>
 		<if test="shopName != null and shopName != ''">
 			AND s.name LIKE CONCAT('%',#{shopName},'%')
 		</if>
+		group by a.productID
 		ORDER BY
 		- a.sort DESC
 	</select>
@@ -172,22 +177,26 @@
 	<select id="findUserActivityProduct" resultType="integer">
 		SELECT productId FROM cm_hehe_user_activity  WHERE userId = #{userId}
 	</select>
-	
+
 	<select id="findAllActivityProduct" resultType="com.caimei.modules.hehe.entity.CmHeheProduct">
 		SELECT
 		  a.id AS "id",
 		  a.productId AS "productId",
-		  chp.price AS "price",
+		  chs.price AS "price",
 		  p.name AS "name",
 		  p.mainImage AS "mainImage",
 		  s.name AS "shopName"
 		FROM
 		  cm_hehe_activity_product a
 		  LEFT JOIN cm_hehe_product chp ON a.productId = chp.productId
+		LEFT JOIN cm_hehe_sku chs ON chp.productId = chs.productID
+		LEFT JOIN cm_sku cs ON cs.skuId = chs.skuId
 		  LEFT JOIN product p ON a.productId = p.productID
-		  LEFT JOIN shop s ON s.shopID = p.shopID
+		left join cm_organize_product_info copi on copi.productId = a.productID
+		LEFT JOIN shop s ON s.shopID = p.shopID
 		WHERE
 		  a.delFlag = 0
+		and copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=a.productId)
 		<if test="ids != null and ids.size() > 0 ">
 			AND a.productId NOT IN
 			<foreach collection="ids" open="(" close=")" item="id" separator=",">
@@ -203,6 +212,7 @@
 		<if test="shopName != null and shopName != ''">
 			AND s.name LIKE CONCAT('%',#{shopName},'%')
 		</if>
+		group by  a.productID
 		ORDER BY productId DESC
 	</select>
 
@@ -221,5 +231,5 @@
 	<update id="updateSortById">
 		UPDATE cm_hehe_user_activity SET sort = #{sort} WHERE id =#{id}
 	</update>
-	
-</mapper>
+
+</mapper>

+ 762 - 0
src/main/resources/mappings/modules/order/OrderMapper.xml

@@ -1498,4 +1498,766 @@
         WHERE shopOrderID = #{shopOrderID}
     </update>
 
+    <resultMap type="com.caimei.modules.order.entity.NewOrder" id="CmOrderResult">
+        <result property="orderID"    column="orderID"    />
+        <result property="orderNo"    column="orderNo"    />
+        <result property="organizeID"    column="organizeID"    />
+        <result property="userID"    column="userID"    />
+        <result property="buyUserID"    column="buyUserID"    />
+        <result property="organizeStoreId"    column="organizeStoreId"    />
+        <result property="shopOrderIDs"    column="shopOrderIDs"    />
+        <result property="orderSubmitType"    column="orderSubmitType"    />
+        <result property="orderType"    column="orderType"    />
+        <result property="hasActProduct"    column="hasActProduct"    />
+        <result property="status"    column="status"    />
+        <result property="receiptStatus"    column="receiptStatus"    />
+        <result property="payStatus"    column="payStatus"    />
+        <result property="sendOutStatus"    column="sendOutStatus"    />
+        <result property="refundType"    column="refundType"    />
+        <result property="paySuccessCounter"    column="paySuccessCounter"    />
+        <result property="payFlag"    column="payFlag"    />
+        <result property="onlinePayFlag"    column="onlinePayFlag"    />
+        <result property="productTotalFee"    column="productTotalFee"    />
+        <result property="orderTotalFee"    column="orderTotalFee"    />
+        <result property="payTotalFee"    column="payTotalFee"    />
+        <result property="payableAmount"    column="payableAmount"    />
+        <result property="balancePayFee"    column="balancePayFee"    />
+        <result property="preferential"    column="preferential"    />
+        <result property="discountFee"    column="discountFee"    />
+        <result property="promotionFullReduction"    column="promotionFullReduction"    />
+        <result property="spID"    column="spID"    />
+        <result property="mainSpID"    column="mainSpID"    />
+        <result property="note"    column="note"    />
+        <result property="clubID"    column="clubID"    />
+        <result property="clubScanTime"    column="clubScanTime"    />
+        <result property="orderSource"    column="orderSource"    />
+        <result property="closeTime"    column="closeTime"    />
+        <result property="confirmTime"    column="confirmTime"    />
+        <result property="payTime"    column="payTime"    />
+        <result property="orderTime"    column="orderTime"    />
+        <result property="productCount"    column="productCount"    />
+        <result property="presentCount"    column="presentCount"    />
+        <result property="promotionalGiftsCount"    column="promotionalGiftsCount"    />
+        <result property="invoiceFlag"    column="invoiceFlag"    />
+        <result property="confirmFlag"    column="confirmFlag"    />
+        <result property="clauseID"    column="clauseID"    />
+        <result property="clauseContent"    column="clauseContent"    />
+        <result property="clauseName"    column="clauseName"    />
+        <result property="updateDate"    column="updateDate"    />
+        <result property="freePostFlag"    column="freePostFlag"    />
+        <result property="freight"    column="freight"    />
+        <result property="userBeans"    column="userBeans"    />
+        <result property="delFlag"    column="delFlag"    />
+        <result property="freePostageTicketID"    column="freePostageTicketID"    />
+        <result property="splitFlag"    column="splitFlag"    />
+        <result property="closeReason"    column="closeReason"    />
+        <result property="postageOrderFlag"    column="postageOrderFlag"    />
+        <result property="thirdPartyOrderNo"    column="thirdPartyOrderNo"    />
+        <result property="synchronizeFlag"    column="synchronizeFlag"    />
+        <result property="secondHandOrderFlag"    column="secondHandOrderFlag"    />
+        <result property="affirmPaymentFlag"    column="affirmPaymentFlag"    />
+        <result property="rebateFlag"    column="rebateFlag"    />
+        <result property="rebateFee"    column="rebateFee"    />
+        <result property="zeroCostFlag"    column="zeroCostFlag"    />
+        <result property="couponAmount"    column="couponAmount"    />
+        <result property="svipFullReduction"    column="svipFullReduction"    />
+        <result property="orderSeen"    column="orderSeen"    />
+        <result property="reductionAmount"    column="reductionAmount"    />
+        <result property="unionID"    column="unionID"    />
+    </resultMap>
+
+    <sql id="selectCmOrderVo">
+        select
+            cm_order.orderID,
+            cm_order.orderNo,
+            cm_order.apiOrganizeOrderId,
+            cm_order.organizeID,
+            cm_order.userID,
+            cm_order.buyUserID,
+            cm_order.organizeStoreId,
+            cm_order.shopOrderIDs,
+            cm_order.orderSubmitType,
+            cm_order.orderType,
+            cm_order.hasActProduct,
+            cm_order.status,
+            cm_order.receiptStatus,
+            cm_order.payStatus,
+            cm_order.sendOutStatus,
+            cm_order.refundType,
+            cm_order.paySuccessCounter,
+            cm_order.payFlag,
+            cm_order.onlinePayFlag,
+            cm_order.productTotalFee,
+            cm_order.orderTotalFee,
+            cm_order.payTotalFee,
+            cm_order.payableAmount,
+            cm_order.balancePayFee,
+            cm_order.preferential,
+            cm_order.discountFee,
+            cm_order.promotionFullReduction,
+            cm_order.spID,
+            cm_order.mainSpID,
+            cm_order.note,
+            cm_order.clubID,
+            cm_order.clubScanTime,
+            cm_order.orderSource,
+            cm_order.closeTime,
+            cm_order.confirmTime,
+            cm_order.payTime,
+            cm_order.orderTime,
+            cm_order.productCount,
+            cm_order.presentCount,
+            cm_order.promotionalGiftsCount,
+            cm_order.invoiceFlag,
+            cm_order.confirmFlag,
+            cm_order.clauseID,
+            cm_order.clauseContent,
+            cm_order.clauseName,
+            cm_order.updateDate,
+            cm_order.freePostFlag,
+            cm_order.freight,
+            cm_order.userBeans,
+            cm_order.delFlag,
+            cm_order.freePostageTicketID,
+            cm_order.splitFlag,
+            cm_order.closeReason,
+            cm_order.postageOrderFlag,
+            cm_order.thirdPartyOrderNo,
+            cm_order.synchronizeFlag,
+            cm_order.secondHandOrderFlag,
+            cm_order.affirmPaymentFlag,
+            cm_order.rebateFlag,
+            cm_order.rebateFee,
+            cm_order.zeroCostFlag,
+            cm_order.couponAmount,
+            cm_order.svipFullReduction,
+            cm_order.orderSeen,
+            cm_order.reductionAmount,
+            cm_order.unionID
+    </sql>
+
+    <select id="getByCmOrder" parameterType="com.caimei.modules.order.entity.NewOrder" resultMap="CmOrderResult">
+        <include refid="selectCmOrderVo"/>
+        from cm_order AS cm_order
+        <where>  cm_order.delFlag = 0
+            <if test="orderID != null  and orderID != ''">
+                and cm_order.orderID
+                    = #{orderID}
+            </if>
+            <if test="orderNo != null  and orderNo != ''"> and cm_order.orderNo = #{orderNo}</if>
+            <if test="apiOrganizeOrderId != null  and apiOrganizeOrderId != ''"> and cm_order.apiOrganizeOrderId = #{apiOrganizeOrderId}</if>
+            <if test="organizeID != null "> and cm_order.organizeID = #{organizeID}</if>
+            <if test="userID != null "> and cm_order.userID = #{userID}</if>
+            <if test="buyUserID != null "> and cm_order.buyUserID = #{buyUserID}</if>
+            <if test="organizeStoreId != null "> and cm_order.organizeStoreId = #{organizeStoreId}</if>
+            <if test="shopOrderIDs != null  and shopOrderIDs != ''"> and cm_order.shopOrderIDs = #{shopOrderIDs}</if>
+            <if test="orderSubmitType != null "> and cm_order.orderSubmitType = #{orderSubmitType}</if>
+            <if test="orderType != null "> and cm_order.orderType = #{orderType}</if>
+            <if test="hasActProduct != null  and hasActProduct != ''"> and cm_order.hasActProduct = #{hasActProduct}</if>
+            <if test="status != null  and status != ''"> and cm_order.status = #{status}</if>
+            <if test="receiptStatus != null  and receiptStatus != ''"> and cm_order.receiptStatus = #{receiptStatus}</if>
+            <if test="payStatus != null  and payStatus != ''"> and cm_order.payStatus = #{payStatus}</if>
+            <if test="sendOutStatus != null  and sendOutStatus != ''"> and cm_order.sendOutStatus = #{sendOutStatus}</if>
+            <if test="refundType != null  and refundType != ''"> and cm_order.refundType = #{refundType}</if>
+            <if test="paySuccessCounter != null "> and cm_order.paySuccessCounter = #{paySuccessCounter}</if>
+            <if test="payFlag != null  and payFlag != ''"> and cm_order.payFlag = #{payFlag}</if>
+            <if test="onlinePayFlag != null  and onlinePayFlag != ''"> and cm_order.onlinePayFlag = #{onlinePayFlag}</if>
+            <if test="productTotalFee != null "> and cm_order.productTotalFee = #{productTotalFee}</if>
+            <if test="orderTotalFee != null "> and cm_order.orderTotalFee = #{orderTotalFee}</if>
+            <if test="payTotalFee != null "> and cm_order.payTotalFee = #{payTotalFee}</if>
+            <if test="payableAmount != null "> and cm_order.payableAmount = #{payableAmount}</if>
+            <if test="balancePayFee != null "> and cm_order.balancePayFee = #{balancePayFee}</if>
+            <if test="preferential != null "> and cm_order.preferential = #{preferential}</if>
+            <if test="discountFee != null "> and cm_order.discountFee = #{discountFee}</if>
+            <if test="promotionFullReduction != null "> and cm_order.promotionFullReduction = #{promotionFullReduction}</if>
+            <if test="spID != null "> and cm_order.spID = #{spID}</if>
+            <if test="mainSpID != null "> and cm_order.mainSpID = #{mainSpID}</if>
+            <if test="note != null  and note != ''"> and cm_order.note = #{note}</if>
+            <if test="clubID != null "> and cm_order.clubID = #{clubID}</if>
+            <if test="clubScanTime != null  and clubScanTime != ''"> and cm_order.clubScanTime = #{clubScanTime}</if>
+            <if test="orderSource != null  and orderSource != ''"> and cm_order.orderSource = #{orderSource}</if>
+            <if test="closeTime != null  and closeTime != ''"> and cm_order.closeTime = #{closeTime}</if>
+            <if test="confirmTime != null  and confirmTime != ''"> and cm_order.confirmTime = #{confirmTime}</if>
+            <if test="payTime != null  and payTime != ''"> and cm_order.payTime = #{payTime}</if>
+            <if test="orderTime != null  and orderTime != ''"> and cm_order.orderTime = #{orderTime}</if>
+            <if test="productCount != null "> and cm_order.productCount = #{productCount}</if>
+            <if test="presentCount != null "> and cm_order.presentCount = #{presentCount}</if>
+            <if test="promotionalGiftsCount != null "> and cm_order.promotionalGiftsCount = #{promotionalGiftsCount}</if>
+            <if test="invoiceFlag != null  and invoiceFlag != ''"> and cm_order.invoiceFlag = #{invoiceFlag}</if>
+            <if test="confirmFlag != null  and confirmFlag != ''"> and cm_order.confirmFlag = #{confirmFlag}</if>
+            <if test="clauseID != null "> and cm_order.clauseID = #{clauseID}</if>
+            <if test="clauseContent != null  and clauseContent != ''"> and cm_order.clauseContent = #{clauseContent}</if>
+            <if test="clauseName != null  and clauseName != ''"> and cm_order.clauseName like concat('%', #{clauseName}, '%')</if>
+            <if test="updateDate != null  and updateDate != ''"> and cm_order.updateDate = #{updateDate}</if>
+            <if test="freePostFlag != null  and freePostFlag != ''"> and cm_order.freePostFlag = #{freePostFlag}</if>
+            <if test="freight != null "> and cm_order.freight = #{freight}</if>
+            <if test="userBeans != null "> and cm_order.userBeans = #{userBeans}</if>
+            <if test="delFlag != null  and delFlag != ''"> and cm_order.delFlag = #{delFlag}</if>
+            <if test="freePostageTicketID != null "> and cm_order.freePostageTicketID = #{freePostageTicketID}</if>
+            <if test="splitFlag != null  and splitFlag != ''"> and cm_order.splitFlag = #{splitFlag}</if>
+            <if test="closeReason != null  and closeReason != ''"> and cm_order.closeReason = #{closeReason}</if>
+            <if test="postageOrderFlag != null  and postageOrderFlag != ''"> and cm_order.postageOrderFlag = #{postageOrderFlag}</if>
+            <if test="thirdPartyOrderNo != null  and thirdPartyOrderNo != ''"> and cm_order.thirdPartyOrderNo = #{thirdPartyOrderNo}</if>
+            <if test="synchronizeFlag != null  and synchronizeFlag != ''"> and cm_order.synchronizeFlag = #{synchronizeFlag}</if>
+            <if test="secondHandOrderFlag != null  and secondHandOrderFlag != ''"> and cm_order.secondHandOrderFlag = #{secondHandOrderFlag}</if>
+            <if test="affirmPaymentFlag != null  and affirmPaymentFlag != ''"> and cm_order.affirmPaymentFlag = #{affirmPaymentFlag}</if>
+            <if test="rebateFlag != null  and rebateFlag != ''"> and cm_order.rebateFlag = #{rebateFlag}</if>
+            <if test="rebateFee != null  and rebateFee != ''"> and cm_order.rebateFee = #{rebateFee}</if>
+            <if test="zeroCostFlag != null "> and cm_order.zeroCostFlag = #{zeroCostFlag}</if>
+            <if test="couponAmount != null "> and cm_order.couponAmount = #{couponAmount}</if>
+            <if test="svipFullReduction != null "> and cm_order.svipFullReduction = #{svipFullReduction}</if>
+            <if test="orderSeen != null  and orderSeen != ''"> and cm_order.orderSeen = #{orderSeen}</if>
+            <if test="reductionAmount != null "> and cm_order.reductionAmount = #{reductionAmount}</if>
+            <if test="unionID != null  and unionID != ''"> and cm_order.unionID = #{unionID}</if>
+        </where>
+        group by cm_order.orderID
+        order by cm_order.orderTime desc
+        limit 0,1
+    </select>
+
+    <select id="getCmOrderList" parameterType="com.caimei.modules.order.entity.NewOrder" resultMap="CmOrderResult">
+        <include refid="selectCmOrderVo"/>
+        from cm_order AS cm_order
+        <where>  cm_order.delFlag = 0
+            <if test="orderID != null  and orderID != ''">
+                and cm_order.orderID
+                    = #{orderID}
+            </if>
+            <if test="orderNo != null  and orderNo != ''"> and cm_order.orderNo = #{orderNo}</if>
+            <if test="apiOrganizeOrderId != null  and apiOrganizeOrderId != ''"> and cm_order.apiOrganizeOrderId = #{apiOrganizeOrderId}</if>
+            <if test="organizeID != null "> and cm_order.organizeID = #{organizeID}</if>
+            <if test="userID != null "> and cm_order.userID = #{userID}</if>
+            <if test="buyUserID != null "> and cm_order.buyUserID = #{buyUserID}</if>
+            <if test="organizeStoreId != null "> and cm_order.organizeStoreId = #{organizeStoreId}</if>
+            <if test="shopOrderIDs != null  and shopOrderIDs != ''"> and cm_order.shopOrderIDs = #{shopOrderIDs}</if>
+            <if test="orderSubmitType != null "> and cm_order.orderSubmitType = #{orderSubmitType}</if>
+            <if test="orderType != null "> and cm_order.orderType = #{orderType}</if>
+            <if test="hasActProduct != null  and hasActProduct != ''"> and cm_order.hasActProduct = #{hasActProduct}</if>
+            <if test="status != null  and status != ''"> and cm_order.status = #{status}</if>
+            <if test="receiptStatus != null  and receiptStatus != ''"> and cm_order.receiptStatus = #{receiptStatus}</if>
+            <if test="payStatus != null  and payStatus != ''"> and cm_order.payStatus = #{payStatus}</if>
+            <if test="sendOutStatus != null  and sendOutStatus != ''"> and cm_order.sendOutStatus = #{sendOutStatus}</if>
+            <if test="refundType != null  and refundType != ''"> and cm_order.refundType = #{refundType}</if>
+            <if test="paySuccessCounter != null "> and cm_order.paySuccessCounter = #{paySuccessCounter}</if>
+            <if test="payFlag != null  and payFlag != ''"> and cm_order.payFlag = #{payFlag}</if>
+            <if test="onlinePayFlag != null  and onlinePayFlag != ''"> and cm_order.onlinePayFlag = #{onlinePayFlag}</if>
+            <if test="productTotalFee != null "> and cm_order.productTotalFee = #{productTotalFee}</if>
+            <if test="orderTotalFee != null "> and cm_order.orderTotalFee = #{orderTotalFee}</if>
+            <if test="payTotalFee != null "> and cm_order.payTotalFee = #{payTotalFee}</if>
+            <if test="payableAmount != null "> and cm_order.payableAmount = #{payableAmount}</if>
+            <if test="balancePayFee != null "> and cm_order.balancePayFee = #{balancePayFee}</if>
+            <if test="preferential != null "> and cm_order.preferential = #{preferential}</if>
+            <if test="discountFee != null "> and cm_order.discountFee = #{discountFee}</if>
+            <if test="promotionFullReduction != null "> and cm_order.promotionFullReduction = #{promotionFullReduction}</if>
+            <if test="spID != null "> and cm_order.spID = #{spID}</if>
+            <if test="mainSpID != null "> and cm_order.mainSpID = #{mainSpID}</if>
+            <if test="note != null  and note != ''"> and cm_order.note = #{note}</if>
+            <if test="clubID != null "> and cm_order.clubID = #{clubID}</if>
+            <if test="clubScanTime != null  and clubScanTime != ''"> and cm_order.clubScanTime = #{clubScanTime}</if>
+            <if test="orderSource != null  and orderSource != ''"> and cm_order.orderSource = #{orderSource}</if>
+            <if test="closeTime != null  and closeTime != ''"> and cm_order.closeTime = #{closeTime}</if>
+            <if test="confirmTime != null  and confirmTime != ''"> and cm_order.confirmTime = #{confirmTime}</if>
+            <if test="payTime != null  and payTime != ''"> and cm_order.payTime = #{payTime}</if>
+            <if test="orderTime != null  and orderTime != ''"> and cm_order.orderTime = #{orderTime}</if>
+            <if test="productCount != null "> and cm_order.productCount = #{productCount}</if>
+            <if test="presentCount != null "> and cm_order.presentCount = #{presentCount}</if>
+            <if test="promotionalGiftsCount != null "> and cm_order.promotionalGiftsCount = #{promotionalGiftsCount}</if>
+            <if test="invoiceFlag != null  and invoiceFlag != ''"> and cm_order.invoiceFlag = #{invoiceFlag}</if>
+            <if test="confirmFlag != null  and confirmFlag != ''"> and cm_order.confirmFlag = #{confirmFlag}</if>
+            <if test="clauseID != null "> and cm_order.clauseID = #{clauseID}</if>
+            <if test="clauseContent != null  and clauseContent != ''"> and cm_order.clauseContent = #{clauseContent}</if>
+            <if test="clauseName != null  and clauseName != ''"> and cm_order.clauseName like concat('%', #{clauseName}, '%')</if>
+            <if test="updateDate != null  and updateDate != ''"> and cm_order.updateDate = #{updateDate}</if>
+            <if test="freePostFlag != null  and freePostFlag != ''"> and cm_order.freePostFlag = #{freePostFlag}</if>
+            <if test="freight != null "> and cm_order.freight = #{freight}</if>
+            <if test="userBeans != null "> and cm_order.userBeans = #{userBeans}</if>
+            <if test="delFlag != null  and delFlag != ''"> and cm_order.delFlag = #{delFlag}</if>
+            <if test="freePostageTicketID != null "> and cm_order.freePostageTicketID = #{freePostageTicketID}</if>
+            <if test="splitFlag != null  and splitFlag != ''"> and cm_order.splitFlag = #{splitFlag}</if>
+            <if test="closeReason != null  and closeReason != ''"> and cm_order.closeReason = #{closeReason}</if>
+            <if test="postageOrderFlag != null  and postageOrderFlag != ''"> and cm_order.postageOrderFlag = #{postageOrderFlag}</if>
+            <if test="thirdPartyOrderNo != null  and thirdPartyOrderNo != ''"> and cm_order.thirdPartyOrderNo = #{thirdPartyOrderNo}</if>
+            <if test="synchronizeFlag != null  and synchronizeFlag != ''"> and cm_order.synchronizeFlag = #{synchronizeFlag}</if>
+            <if test="secondHandOrderFlag != null  and secondHandOrderFlag != ''"> and cm_order.secondHandOrderFlag = #{secondHandOrderFlag}</if>
+            <if test="affirmPaymentFlag != null  and affirmPaymentFlag != ''"> and cm_order.affirmPaymentFlag = #{affirmPaymentFlag}</if>
+            <if test="rebateFlag != null  and rebateFlag != ''"> and cm_order.rebateFlag = #{rebateFlag}</if>
+            <if test="rebateFee != null  and rebateFee != ''"> and cm_order.rebateFee = #{rebateFee}</if>
+            <if test="zeroCostFlag != null "> and cm_order.zeroCostFlag = #{zeroCostFlag}</if>
+            <if test="couponAmount != null "> and cm_order.couponAmount = #{couponAmount}</if>
+            <if test="svipFullReduction != null "> and cm_order.svipFullReduction = #{svipFullReduction}</if>
+            <if test="orderSeen != null  and orderSeen != ''"> and cm_order.orderSeen = #{orderSeen}</if>
+            <if test="reductionAmount != null "> and cm_order.reductionAmount = #{reductionAmount}</if>
+            <if test="unionID != null  and unionID != ''"> and cm_order.unionID = #{unionID}</if>
+        </where>
+        group by cm_order.orderID
+        order by cm_order.orderTime desc
+    </select>
+    <select id="getCmOrderCount" parameterType="com.caimei.modules.order.entity.NewOrder" resultType="String">
+        select count(1)
+        from cm_order AS cm_order
+        <where>  cm_order.delFlag = 0
+            <if test="orderID != null  and  orderID != ''">
+                and cm_order.orderID
+                    = #{orderID}
+            </if>
+            <if test="orderNo != null  and orderNo != ''"> and cm_order.orderNo = #{orderNo}</if>
+            <if test="apiOrganizeOrderId != null  and apiOrganizeOrderId != ''"> and cm_order.apiOrganizeOrderId = #{apiOrganizeOrderId}</if>
+            <if test="organizeID != null "> and cm_order.organizeID = #{organizeID}</if>
+            <if test="userID != null "> and cm_order.userID = #{userID}</if>
+            <if test="buyUserID != null "> and cm_order.buyUserID = #{buyUserID}</if>
+            <if test="organizeStoreId != null "> and cm_order.organizeStoreId = #{organizeStoreId}</if>
+            <if test="shopOrderIDs != null  and shopOrderIDs != ''"> and cm_order.shopOrderIDs = #{shopOrderIDs}</if>
+            <if test="orderSubmitType != null "> and cm_order.orderSubmitType = #{orderSubmitType}</if>
+            <if test="orderType != null "> and cm_order.orderType = #{orderType}</if>
+            <if test="hasActProduct != null  and hasActProduct != ''"> and cm_order.hasActProduct = #{hasActProduct}</if>
+            <if test="status != null  and status != ''"> and cm_order.status = #{status}</if>
+            <if test="receiptStatus != null  and receiptStatus != ''"> and cm_order.receiptStatus = #{receiptStatus}</if>
+            <if test="payStatus != null  and payStatus != ''"> and cm_order.payStatus = #{payStatus}</if>
+            <if test="sendOutStatus != null  and sendOutStatus != ''"> and cm_order.sendOutStatus = #{sendOutStatus}</if>
+            <if test="refundType != null  and refundType != ''"> and cm_order.refundType = #{refundType}</if>
+            <if test="paySuccessCounter != null "> and cm_order.paySuccessCounter = #{paySuccessCounter}</if>
+            <if test="payFlag != null  and payFlag != ''"> and cm_order.payFlag = #{payFlag}</if>
+            <if test="onlinePayFlag != null  and onlinePayFlag != ''"> and cm_order.onlinePayFlag = #{onlinePayFlag}</if>
+            <if test="productTotalFee != null "> and cm_order.productTotalFee = #{productTotalFee}</if>
+            <if test="orderTotalFee != null "> and cm_order.orderTotalFee = #{orderTotalFee}</if>
+            <if test="payTotalFee != null "> and cm_order.payTotalFee = #{payTotalFee}</if>
+            <if test="payableAmount != null "> and cm_order.payableAmount = #{payableAmount}</if>
+            <if test="balancePayFee != null "> and cm_order.balancePayFee = #{balancePayFee}</if>
+            <if test="preferential != null "> and cm_order.preferential = #{preferential}</if>
+            <if test="discountFee != null "> and cm_order.discountFee = #{discountFee}</if>
+            <if test="promotionFullReduction != null "> and cm_order.promotionFullReduction = #{promotionFullReduction}</if>
+            <if test="spID != null "> and cm_order.spID = #{spID}</if>
+            <if test="mainSpID != null "> and cm_order.mainSpID = #{mainSpID}</if>
+            <if test="note != null  and note != ''"> and cm_order.note = #{note}</if>
+            <if test="clubID != null "> and cm_order.clubID = #{clubID}</if>
+            <if test="clubScanTime != null  and clubScanTime != ''"> and cm_order.clubScanTime = #{clubScanTime}</if>
+            <if test="orderSource != null  and orderSource != ''"> and cm_order.orderSource = #{orderSource}</if>
+            <if test="closeTime != null  and closeTime != ''"> and cm_order.closeTime = #{closeTime}</if>
+            <if test="confirmTime != null  and confirmTime != ''"> and cm_order.confirmTime = #{confirmTime}</if>
+            <if test="payTime != null  and payTime != ''"> and cm_order.payTime = #{payTime}</if>
+            <if test="orderTime != null  and orderTime != ''"> and cm_order.orderTime = #{orderTime}</if>
+            <if test="productCount != null "> and cm_order.productCount = #{productCount}</if>
+            <if test="presentCount != null "> and cm_order.presentCount = #{presentCount}</if>
+            <if test="promotionalGiftsCount != null "> and cm_order.promotionalGiftsCount = #{promotionalGiftsCount}</if>
+            <if test="invoiceFlag != null  and invoiceFlag != ''"> and cm_order.invoiceFlag = #{invoiceFlag}</if>
+            <if test="confirmFlag != null  and confirmFlag != ''"> and cm_order.confirmFlag = #{confirmFlag}</if>
+            <if test="clauseID != null "> and cm_order.clauseID = #{clauseID}</if>
+            <if test="clauseContent != null  and clauseContent != ''"> and cm_order.clauseContent = #{clauseContent}</if>
+            <if test="clauseName != null  and clauseName != ''"> and cm_order.clauseName like concat('%', #{clauseName}, '%')</if>
+            <if test="updateDate != null  and updateDate != ''"> and cm_order.updateDate = #{updateDate}</if>
+            <if test="freePostFlag != null  and freePostFlag != ''"> and cm_order.freePostFlag = #{freePostFlag}</if>
+            <if test="freight != null "> and cm_order.freight = #{freight}</if>
+            <if test="userBeans != null "> and cm_order.userBeans = #{userBeans}</if>
+            <if test="delFlag != null  and delFlag != ''"> and cm_order.delFlag = #{delFlag}</if>
+            <if test="freePostageTicketID != null "> and cm_order.freePostageTicketID = #{freePostageTicketID}</if>
+            <if test="splitFlag != null  and splitFlag != ''"> and cm_order.splitFlag = #{splitFlag}</if>
+            <if test="closeReason != null  and closeReason != ''"> and cm_order.closeReason = #{closeReason}</if>
+            <if test="postageOrderFlag != null  and postageOrderFlag != ''"> and cm_order.postageOrderFlag = #{postageOrderFlag}</if>
+            <if test="thirdPartyOrderNo != null  and thirdPartyOrderNo != ''"> and cm_order.thirdPartyOrderNo = #{thirdPartyOrderNo}</if>
+            <if test="synchronizeFlag != null  and synchronizeFlag != ''"> and cm_order.synchronizeFlag = #{synchronizeFlag}</if>
+            <if test="secondHandOrderFlag != null  and secondHandOrderFlag != ''"> and cm_order.secondHandOrderFlag = #{secondHandOrderFlag}</if>
+            <if test="affirmPaymentFlag != null  and affirmPaymentFlag != ''"> and cm_order.affirmPaymentFlag = #{affirmPaymentFlag}</if>
+            <if test="rebateFlag != null  and rebateFlag != ''"> and cm_order.rebateFlag = #{rebateFlag}</if>
+            <if test="rebateFee != null  and rebateFee != ''"> and cm_order.rebateFee = #{rebateFee}</if>
+            <if test="zeroCostFlag != null "> and cm_order.zeroCostFlag = #{zeroCostFlag}</if>
+            <if test="couponAmount != null "> and cm_order.couponAmount = #{couponAmount}</if>
+            <if test="svipFullReduction != null "> and cm_order.svipFullReduction = #{svipFullReduction}</if>
+            <if test="orderSeen != null  and orderSeen != ''"> and cm_order.orderSeen = #{orderSeen}</if>
+            <if test="reductionAmount != null "> and cm_order.reductionAmount = #{reductionAmount}</if>
+            <if test="unionID != null  and unionID != ''"> and cm_order.unionID = #{unionID}</if>
+        </where>
+        group by cm_order.orderID
+    </select>
+
+    <select id="getCmOrderByOrderID" parameterType="String" resultMap="CmOrderResult">
+        <include refid="selectCmOrderVo"/>
+        from cm_order AS cm_order
+        where  cm_order.delFlag = 0 and cm_order.orderID = #{orderID}
+    </select>
+
+    <select id="getByIds" parameterType="com.caimei.modules.order.entity.NewOrder" resultType="String">
+        select orderID
+        from cm_order AS cm_order
+        <where>  cm_order.delFlag = 0
+            <if test="orderID != null  and orderID != ''">
+                and cm_order.orderID
+                    = #{orderID}
+            </if>
+            <if test="orderNo != null  and orderNo != ''"> and cm_order.orderNo = #{orderNo}</if>
+            <if test="apiOrganizeOrderId != null  and apiOrganizeOrderId != ''"> and cm_order.apiOrganizeOrderId = #{apiOrganizeOrderId}</if>
+            <if test="organizeID != null "> and cm_order.organizeID = #{organizeID}</if>
+            <if test="userID != null "> and cm_order.userID = #{userID}</if>
+            <if test="buyUserID != null "> and cm_order.buyUserID = #{buyUserID}</if>
+            <if test="organizeStoreId != null "> and cm_order.organizeStoreId = #{organizeStoreId}</if>
+            <if test="shopOrderIDs != null  and shopOrderIDs != ''"> and cm_order.shopOrderIDs = #{shopOrderIDs}</if>
+            <if test="orderSubmitType != null "> and cm_order.orderSubmitType = #{orderSubmitType}</if>
+            <if test="orderType != null "> and cm_order.orderType = #{orderType}</if>
+            <if test="hasActProduct != null  and hasActProduct != ''"> and cm_order.hasActProduct = #{hasActProduct}</if>
+            <if test="status != null  and status != ''"> and cm_order.status = #{status}</if>
+            <if test="receiptStatus != null  and receiptStatus != ''"> and cm_order.receiptStatus = #{receiptStatus}</if>
+            <if test="payStatus != null  and payStatus != ''"> and cm_order.payStatus = #{payStatus}</if>
+            <if test="sendOutStatus != null  and sendOutStatus != ''"> and cm_order.sendOutStatus = #{sendOutStatus}</if>
+            <if test="refundType != null  and refundType != ''"> and cm_order.refundType = #{refundType}</if>
+            <if test="paySuccessCounter != null "> and cm_order.paySuccessCounter = #{paySuccessCounter}</if>
+            <if test="payFlag != null  and payFlag != ''"> and cm_order.payFlag = #{payFlag}</if>
+            <if test="onlinePayFlag != null  and onlinePayFlag != ''"> and cm_order.onlinePayFlag = #{onlinePayFlag}</if>
+            <if test="productTotalFee != null "> and cm_order.productTotalFee = #{productTotalFee}</if>
+            <if test="orderTotalFee != null "> and cm_order.orderTotalFee = #{orderTotalFee}</if>
+            <if test="payTotalFee != null "> and cm_order.payTotalFee = #{payTotalFee}</if>
+            <if test="payableAmount != null "> and cm_order.payableAmount = #{payableAmount}</if>
+            <if test="balancePayFee != null "> and cm_order.balancePayFee = #{balancePayFee}</if>
+            <if test="preferential != null "> and cm_order.preferential = #{preferential}</if>
+            <if test="discountFee != null "> and cm_order.discountFee = #{discountFee}</if>
+            <if test="promotionFullReduction != null "> and cm_order.promotionFullReduction = #{promotionFullReduction}</if>
+            <if test="spID != null "> and cm_order.spID = #{spID}</if>
+            <if test="mainSpID != null "> and cm_order.mainSpID = #{mainSpID}</if>
+            <if test="note != null  and note != ''"> and cm_order.note = #{note}</if>
+            <if test="clubID != null "> and cm_order.clubID = #{clubID}</if>
+            <if test="clubScanTime != null  and clubScanTime != ''"> and cm_order.clubScanTime = #{clubScanTime}</if>
+            <if test="orderSource != null  and orderSource != ''"> and cm_order.orderSource = #{orderSource}</if>
+            <if test="closeTime != null  and closeTime != ''"> and cm_order.closeTime = #{closeTime}</if>
+            <if test="confirmTime != null  and confirmTime != ''"> and cm_order.confirmTime = #{confirmTime}</if>
+            <if test="payTime != null  and payTime != ''"> and cm_order.payTime = #{payTime}</if>
+            <if test="orderTime != null  and orderTime != ''"> and cm_order.orderTime = #{orderTime}</if>
+            <if test="productCount != null "> and cm_order.productCount = #{productCount}</if>
+            <if test="presentCount != null "> and cm_order.presentCount = #{presentCount}</if>
+            <if test="promotionalGiftsCount != null "> and cm_order.promotionalGiftsCount = #{promotionalGiftsCount}</if>
+            <if test="invoiceFlag != null  and invoiceFlag != ''"> and cm_order.invoiceFlag = #{invoiceFlag}</if>
+            <if test="confirmFlag != null  and confirmFlag != ''"> and cm_order.confirmFlag = #{confirmFlag}</if>
+            <if test="clauseID != null "> and cm_order.clauseID = #{clauseID}</if>
+            <if test="clauseContent != null  and clauseContent != ''"> and cm_order.clauseContent = #{clauseContent}</if>
+            <if test="clauseName != null  and clauseName != ''"> and cm_order.clauseName like concat('%', #{clauseName}, '%')</if>
+            <if test="updateDate != null  and updateDate != ''"> and cm_order.updateDate = #{updateDate}</if>
+            <if test="freePostFlag != null  and freePostFlag != ''"> and cm_order.freePostFlag = #{freePostFlag}</if>
+            <if test="freight != null "> and cm_order.freight = #{freight}</if>
+            <if test="userBeans != null "> and cm_order.userBeans = #{userBeans}</if>
+            <if test="delFlag != null  and delFlag != ''"> and cm_order.delFlag = #{delFlag}</if>
+            <if test="freePostageTicketID != null "> and cm_order.freePostageTicketID = #{freePostageTicketID}</if>
+            <if test="splitFlag != null  and splitFlag != ''"> and cm_order.splitFlag = #{splitFlag}</if>
+            <if test="closeReason != null  and closeReason != ''"> and cm_order.closeReason = #{closeReason}</if>
+            <if test="postageOrderFlag != null  and postageOrderFlag != ''"> and cm_order.postageOrderFlag = #{postageOrderFlag}</if>
+            <if test="thirdPartyOrderNo != null  and thirdPartyOrderNo != ''"> and cm_order.thirdPartyOrderNo = #{thirdPartyOrderNo}</if>
+            <if test="synchronizeFlag != null  and synchronizeFlag != ''"> and cm_order.synchronizeFlag = #{synchronizeFlag}</if>
+            <if test="secondHandOrderFlag != null  and secondHandOrderFlag != ''"> and cm_order.secondHandOrderFlag = #{secondHandOrderFlag}</if>
+            <if test="affirmPaymentFlag != null  and affirmPaymentFlag != ''"> and cm_order.affirmPaymentFlag = #{affirmPaymentFlag}</if>
+            <if test="rebateFlag != null  and rebateFlag != ''"> and cm_order.rebateFlag = #{rebateFlag}</if>
+            <if test="rebateFee != null  and rebateFee != ''"> and cm_order.rebateFee = #{rebateFee}</if>
+            <if test="zeroCostFlag != null "> and cm_order.zeroCostFlag = #{zeroCostFlag}</if>
+            <if test="couponAmount != null "> and cm_order.couponAmount = #{couponAmount}</if>
+            <if test="svipFullReduction != null "> and cm_order.svipFullReduction = #{svipFullReduction}</if>
+            <if test="orderSeen != null  and orderSeen != ''"> and cm_order.orderSeen = #{orderSeen}</if>
+            <if test="reductionAmount != null "> and cm_order.reductionAmount = #{reductionAmount}</if>
+            <if test="unionID != null  and unionID != ''"> and cm_order.unionID = #{unionID}</if>
+        </where>
+        group by cm_order.orderID
+    </select>
+    <select id="getById" parameterType="com.caimei.modules.order.entity.NewOrder" resultType="String">
+        select orderID
+        from cm_order AS cm_order
+        <where>  cm_order.delFlag = 0
+            <if test="orderID != null  and orderID != ''">
+                and cm_order.orderID
+                    = #{orderID}
+            </if>
+            <if test="orderNo != null  and orderNo != ''"> and cm_order.orderNo = #{orderNo}</if>
+            <if test="apiOrganizeOrderId != null  and apiOrganizeOrderId != ''"> and cm_order.apiOrganizeOrderId = #{apiOrganizeOrderId}</if>
+            <if test="organizeID != null "> and cm_order.organizeID = #{organizeID}</if>
+            <if test="userID != null "> and cm_order.userID = #{userID}</if>
+            <if test="buyUserID != null "> and cm_order.buyUserID = #{buyUserID}</if>
+            <if test="organizeStoreId != null "> and cm_order.organizeStoreId = #{organizeStoreId}</if>
+            <if test="shopOrderIDs != null  and shopOrderIDs != ''"> and cm_order.shopOrderIDs = #{shopOrderIDs}</if>
+            <if test="orderSubmitType != null "> and cm_order.orderSubmitType = #{orderSubmitType}</if>
+            <if test="orderType != null "> and cm_order.orderType = #{orderType}</if>
+            <if test="hasActProduct != null  and hasActProduct != ''"> and cm_order.hasActProduct = #{hasActProduct}</if>
+            <if test="status != null  and status != ''"> and cm_order.status = #{status}</if>
+            <if test="receiptStatus != null  and receiptStatus != ''"> and cm_order.receiptStatus = #{receiptStatus}</if>
+            <if test="payStatus != null  and payStatus != ''"> and cm_order.payStatus = #{payStatus}</if>
+            <if test="sendOutStatus != null  and sendOutStatus != ''"> and cm_order.sendOutStatus = #{sendOutStatus}</if>
+            <if test="refundType != null  and refundType != ''"> and cm_order.refundType = #{refundType}</if>
+            <if test="paySuccessCounter != null "> and cm_order.paySuccessCounter = #{paySuccessCounter}</if>
+            <if test="payFlag != null  and payFlag != ''"> and cm_order.payFlag = #{payFlag}</if>
+            <if test="onlinePayFlag != null  and onlinePayFlag != ''"> and cm_order.onlinePayFlag = #{onlinePayFlag}</if>
+            <if test="productTotalFee != null "> and cm_order.productTotalFee = #{productTotalFee}</if>
+            <if test="orderTotalFee != null "> and cm_order.orderTotalFee = #{orderTotalFee}</if>
+            <if test="payTotalFee != null "> and cm_order.payTotalFee = #{payTotalFee}</if>
+            <if test="payableAmount != null "> and cm_order.payableAmount = #{payableAmount}</if>
+            <if test="balancePayFee != null "> and cm_order.balancePayFee = #{balancePayFee}</if>
+            <if test="preferential != null "> and cm_order.preferential = #{preferential}</if>
+            <if test="discountFee != null "> and cm_order.discountFee = #{discountFee}</if>
+            <if test="promotionFullReduction != null "> and cm_order.promotionFullReduction = #{promotionFullReduction}</if>
+            <if test="spID != null "> and cm_order.spID = #{spID}</if>
+            <if test="mainSpID != null "> and cm_order.mainSpID = #{mainSpID}</if>
+            <if test="note != null  and note != ''"> and cm_order.note = #{note}</if>
+            <if test="clubID != null "> and cm_order.clubID = #{clubID}</if>
+            <if test="clubScanTime != null  and clubScanTime != ''"> and cm_order.clubScanTime = #{clubScanTime}</if>
+            <if test="orderSource != null  and orderSource != ''"> and cm_order.orderSource = #{orderSource}</if>
+            <if test="closeTime != null  and closeTime != ''"> and cm_order.closeTime = #{closeTime}</if>
+            <if test="confirmTime != null  and confirmTime != ''"> and cm_order.confirmTime = #{confirmTime}</if>
+            <if test="payTime != null  and payTime != ''"> and cm_order.payTime = #{payTime}</if>
+            <if test="orderTime != null  and orderTime != ''"> and cm_order.orderTime = #{orderTime}</if>
+            <if test="productCount != null "> and cm_order.productCount = #{productCount}</if>
+            <if test="presentCount != null "> and cm_order.presentCount = #{presentCount}</if>
+            <if test="promotionalGiftsCount != null "> and cm_order.promotionalGiftsCount = #{promotionalGiftsCount}</if>
+            <if test="invoiceFlag != null  and invoiceFlag != ''"> and cm_order.invoiceFlag = #{invoiceFlag}</if>
+            <if test="confirmFlag != null  and confirmFlag != ''"> and cm_order.confirmFlag = #{confirmFlag}</if>
+            <if test="clauseID != null "> and cm_order.clauseID = #{clauseID}</if>
+            <if test="clauseContent != null  and clauseContent != ''"> and cm_order.clauseContent = #{clauseContent}</if>
+            <if test="clauseName != null  and clauseName != ''"> and cm_order.clauseName like concat('%', #{clauseName}, '%')</if>
+            <if test="updateDate != null  and updateDate != ''"> and cm_order.updateDate = #{updateDate}</if>
+            <if test="freePostFlag != null  and freePostFlag != ''"> and cm_order.freePostFlag = #{freePostFlag}</if>
+            <if test="freight != null "> and cm_order.freight = #{freight}</if>
+            <if test="userBeans != null "> and cm_order.userBeans = #{userBeans}</if>
+            <if test="delFlag != null  and delFlag != ''"> and cm_order.delFlag = #{delFlag}</if>
+            <if test="freePostageTicketID != null "> and cm_order.freePostageTicketID = #{freePostageTicketID}</if>
+            <if test="splitFlag != null  and splitFlag != ''"> and cm_order.splitFlag = #{splitFlag}</if>
+            <if test="closeReason != null  and closeReason != ''"> and cm_order.closeReason = #{closeReason}</if>
+            <if test="postageOrderFlag != null  and postageOrderFlag != ''"> and cm_order.postageOrderFlag = #{postageOrderFlag}</if>
+            <if test="thirdPartyOrderNo != null  and thirdPartyOrderNo != ''"> and cm_order.thirdPartyOrderNo = #{thirdPartyOrderNo}</if>
+            <if test="synchronizeFlag != null  and synchronizeFlag != ''"> and cm_order.synchronizeFlag = #{synchronizeFlag}</if>
+            <if test="secondHandOrderFlag != null  and secondHandOrderFlag != ''"> and cm_order.secondHandOrderFlag = #{secondHandOrderFlag}</if>
+            <if test="affirmPaymentFlag != null  and affirmPaymentFlag != ''"> and cm_order.affirmPaymentFlag = #{affirmPaymentFlag}</if>
+            <if test="rebateFlag != null  and rebateFlag != ''"> and cm_order.rebateFlag = #{rebateFlag}</if>
+            <if test="rebateFee != null  and rebateFee != ''"> and cm_order.rebateFee = #{rebateFee}</if>
+            <if test="zeroCostFlag != null "> and cm_order.zeroCostFlag = #{zeroCostFlag}</if>
+            <if test="couponAmount != null "> and cm_order.couponAmount = #{couponAmount}</if>
+            <if test="svipFullReduction != null "> and cm_order.svipFullReduction = #{svipFullReduction}</if>
+            <if test="orderSeen != null  and orderSeen != ''"> and cm_order.orderSeen = #{orderSeen}</if>
+            <if test="reductionAmount != null "> and cm_order.reductionAmount = #{reductionAmount}</if>
+            <if test="unionID != null  and unionID != ''"> and cm_order.unionID = #{unionID}</if>
+        </where>
+        group by cm_order.orderID
+        limit 0,1
+    </select>
+
+    <insert id="addCmOrder" parameterType="com.caimei.modules.order.entity.NewOrder" useGeneratedKeys="true" keyProperty="orderID">
+        insert into cm_order
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="orderID != null and orderID != ''">orderID,</if>
+            <if test="orderNo != null and orderNo != ''">orderNo,</if>
+            <if test="apiOrganizeOrderId != null and apiOrganizeOrderId != ''">apiOrganizeOrderId,</if>
+            <if test="organizeID != null">organizeID,</if>
+            <if test="userID != null">userID,</if>
+            <if test="buyUserID != null">buyUserID,</if>
+            <if test="organizeStoreId != null">organizeStoreId,</if>
+            <if test="shopOrderIDs != null and shopOrderIDs != ''">shopOrderIDs,</if>
+            <if test="orderSubmitType != null">orderSubmitType,</if>
+            <if test="orderType != null">orderType,</if>
+            <if test="hasActProduct != null and hasActProduct != ''">hasActProduct,</if>
+            <if test="status != null and status != ''">status,</if>
+            <if test="receiptStatus != null and receiptStatus != ''">receiptStatus,</if>
+            <if test="payStatus != null and payStatus != ''">payStatus,</if>
+            <if test="sendOutStatus != null and sendOutStatus != ''">sendOutStatus,</if>
+            <if test="refundType != null and refundType != ''">refundType,</if>
+            <if test="paySuccessCounter != null">paySuccessCounter,</if>
+            <if test="payFlag != null and payFlag != ''">payFlag,</if>
+            <if test="onlinePayFlag != null and onlinePayFlag != ''">onlinePayFlag,</if>
+            <if test="productTotalFee != null">productTotalFee,</if>
+            <if test="orderTotalFee != null">orderTotalFee,</if>
+            <if test="payTotalFee != null">payTotalFee,</if>
+            <if test="payableAmount != null">payableAmount,</if>
+            <if test="balancePayFee != null">balancePayFee,</if>
+            <if test="preferential != null">preferential,</if>
+            <if test="discountFee != null">discountFee,</if>
+            <if test="promotionFullReduction != null">promotionFullReduction,</if>
+            <if test="spID != null">spID,</if>
+            <if test="mainSpID != null">mainSpID,</if>
+            <if test="note != null and note != ''">note,</if>
+            <if test="clubID != null">clubID,</if>
+            <if test="clubScanTime != null and clubScanTime != ''">clubScanTime,</if>
+            <if test="orderSource != null and orderSource != ''">orderSource,</if>
+            <if test="closeTime != null and closeTime != ''">closeTime,</if>
+            <if test="confirmTime != null and confirmTime != ''">confirmTime,</if>
+            <if test="payTime != null and payTime != ''">payTime,</if>
+            <if test="orderTime != null and orderTime != ''">orderTime,</if>
+            <if test="productCount != null">productCount,</if>
+            <if test="presentCount != null">presentCount,</if>
+            <if test="promotionalGiftsCount != null">promotionalGiftsCount,</if>
+            <if test="invoiceFlag != null and invoiceFlag != ''">invoiceFlag,</if>
+            <if test="confirmFlag != null and confirmFlag != ''">confirmFlag,</if>
+            <if test="clauseID != null">clauseID,</if>
+            <if test="clauseContent != null and clauseContent != ''">clauseContent,</if>
+            <if test="clauseName != null and clauseName != ''">clauseName,</if>
+            <if test="updateDate != null and updateDate != ''">updateDate,</if>
+            <if test="freePostFlag != null and freePostFlag != ''">freePostFlag,</if>
+            <if test="freight != null">freight,</if>
+            <if test="userBeans != null">userBeans,</if>
+            <if test="delFlag != null and delFlag != ''">delFlag,</if>
+            <if test="freePostageTicketID != null">freePostageTicketID,</if>
+            <if test="splitFlag != null and splitFlag != ''">splitFlag,</if>
+            <if test="closeReason != null and closeReason != ''">closeReason,</if>
+            <if test="postageOrderFlag != null and postageOrderFlag != ''">postageOrderFlag,</if>
+            <if test="thirdPartyOrderNo != null and thirdPartyOrderNo != ''">thirdPartyOrderNo,</if>
+            <if test="synchronizeFlag != null and synchronizeFlag != ''">synchronizeFlag,</if>
+            <if test="secondHandOrderFlag != null and secondHandOrderFlag != ''">secondHandOrderFlag,</if>
+            <if test="affirmPaymentFlag != null and affirmPaymentFlag != ''">affirmPaymentFlag,</if>
+            <if test="rebateFlag != null and rebateFlag != ''">rebateFlag,</if>
+            <if test="rebateFee != null and rebateFee != ''">rebateFee,</if>
+            <if test="zeroCostFlag != null">zeroCostFlag,</if>
+            <if test="couponAmount != null">couponAmount,</if>
+            <if test="svipFullReduction != null">svipFullReduction,</if>
+            <if test="orderSeen != null and orderSeen != ''">orderSeen,</if>
+            <if test="reductionAmount != null">reductionAmount,</if>
+            <if test="unionID != null and unionID != ''">unionID,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="orderID != null and orderID != ''">#{orderID},</if>
+            <if test="orderNo != null and orderNo != ''">#{orderNo},</if>
+            <if test="apiOrganizeOrderId != null and apiOrganizeOrderId != ''">#{apiOrganizeOrderId},</if>
+            <if test="organizeID != null">#{organizeID},</if>
+            <if test="userID != null">#{userID},</if>
+            <if test="buyUserID != null">#{buyUserID},</if>
+            <if test="organizeStoreId != null">#{organizeStoreId},</if>
+            <if test="shopOrderIDs != null and shopOrderIDs != ''">#{shopOrderIDs},</if>
+            <if test="orderSubmitType != null">#{orderSubmitType},</if>
+            <if test="orderType != null">#{orderType},</if>
+            <if test="hasActProduct != null and hasActProduct != ''">#{hasActProduct},</if>
+            <if test="status != null and status != ''">#{status},</if>
+            <if test="receiptStatus != null and receiptStatus != ''">#{receiptStatus},</if>
+            <if test="payStatus != null and payStatus != ''">#{payStatus},</if>
+            <if test="sendOutStatus != null and sendOutStatus != ''">#{sendOutStatus},</if>
+            <if test="refundType != null and refundType != ''">#{refundType},</if>
+            <if test="paySuccessCounter != null">#{paySuccessCounter},</if>
+            <if test="payFlag != null and payFlag != ''">#{payFlag},</if>
+            <if test="onlinePayFlag != null and onlinePayFlag != ''">#{onlinePayFlag},</if>
+            <if test="productTotalFee != null">#{productTotalFee},</if>
+            <if test="orderTotalFee != null">#{orderTotalFee},</if>
+            <if test="payTotalFee != null">#{payTotalFee},</if>
+            <if test="payableAmount != null">#{payableAmount},</if>
+            <if test="balancePayFee != null">#{balancePayFee},</if>
+            <if test="preferential != null">#{preferential},</if>
+            <if test="discountFee != null">#{discountFee},</if>
+            <if test="promotionFullReduction != null">#{promotionFullReduction},</if>
+            <if test="spID != null">#{spID},</if>
+            <if test="mainSpID != null">#{mainSpID},</if>
+            <if test="note != null and note != ''">#{note},</if>
+            <if test="clubID != null">#{clubID},</if>
+            <if test="clubScanTime != null and clubScanTime != ''">#{clubScanTime},</if>
+            <if test="orderSource != null and orderSource != ''">#{orderSource},</if>
+            <if test="closeTime != null and closeTime != ''">#{closeTime},</if>
+            <if test="confirmTime != null and confirmTime != ''">#{confirmTime},</if>
+            <if test="payTime != null and payTime != ''">#{payTime},</if>
+            <if test="orderTime != null and orderTime != ''">#{orderTime},</if>
+            <if test="productCount != null">#{productCount},</if>
+            <if test="presentCount != null">#{presentCount},</if>
+            <if test="promotionalGiftsCount != null">#{promotionalGiftsCount},</if>
+            <if test="invoiceFlag != null and invoiceFlag != ''">#{invoiceFlag},</if>
+            <if test="confirmFlag != null and confirmFlag != ''">#{confirmFlag},</if>
+            <if test="clauseID != null">#{clauseID},</if>
+            <if test="clauseContent != null and clauseContent != ''">#{clauseContent},</if>
+            <if test="clauseName != null and clauseName != ''">#{clauseName},</if>
+            <if test="updateDate != null and updateDate != ''">#{updateDate},</if>
+            <if test="freePostFlag != null and freePostFlag != ''">#{freePostFlag},</if>
+            <if test="freight != null">#{freight},</if>
+            <if test="userBeans != null">#{userBeans},</if>
+            <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
+            <if test="freePostageTicketID != null">#{freePostageTicketID},</if>
+            <if test="splitFlag != null and splitFlag != ''">#{splitFlag},</if>
+            <if test="closeReason != null and closeReason != ''">#{closeReason},</if>
+            <if test="postageOrderFlag != null and postageOrderFlag != ''">#{postageOrderFlag},</if>
+            <if test="thirdPartyOrderNo != null and thirdPartyOrderNo != ''">#{thirdPartyOrderNo},</if>
+            <if test="synchronizeFlag != null and synchronizeFlag != ''">#{synchronizeFlag},</if>
+            <if test="secondHandOrderFlag != null and secondHandOrderFlag != ''">#{secondHandOrderFlag},</if>
+            <if test="affirmPaymentFlag != null and affirmPaymentFlag != ''">#{affirmPaymentFlag},</if>
+            <if test="rebateFlag != null and rebateFlag != ''">#{rebateFlag},</if>
+            <if test="rebateFee != null and rebateFee != ''">#{rebateFee},</if>
+            <if test="zeroCostFlag != null">#{zeroCostFlag},</if>
+            <if test="couponAmount != null">#{couponAmount},</if>
+            <if test="svipFullReduction != null">#{svipFullReduction},</if>
+            <if test="orderSeen != null and orderSeen != ''">#{orderSeen},</if>
+            <if test="reductionAmount != null">#{reductionAmount},</if>
+            <if test="unionID != null and unionID != ''">#{unionID},</if>
+        </trim>
+    </insert>
+
+    <update id="updateCmOrder" parameterType="com.caimei.modules.order.entity.NewOrder">
+        update cm_order
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="orderNo != null and orderNo != ''">orderNo = #{orderNo},</if>
+            <if test="apiOrganizeOrderId != null and apiOrganizeOrderId != ''">apiOrganizeOrderId = #{apiOrganizeOrderId},</if>
+            <if test="organizeID != null">organizeID = #{organizeID},</if>
+            <if test="userID != null">userID = #{userID},</if>
+            <if test="buyUserID != null">buyUserID = #{buyUserID},</if>
+            <if test="organizeStoreId != null">organizeStoreId = #{organizeStoreId},</if>
+            <if test="shopOrderIDs != null and shopOrderIDs != ''">shopOrderIDs = #{shopOrderIDs},</if>
+            <if test="orderSubmitType != null">orderSubmitType = #{orderSubmitType},</if>
+            <if test="orderType != null">orderType = #{orderType},</if>
+            <if test="hasActProduct != null and hasActProduct != ''">hasActProduct = #{hasActProduct},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="receiptStatus != null and receiptStatus != ''">receiptStatus = #{receiptStatus},</if>
+            <if test="payStatus != null and payStatus != ''">payStatus = #{payStatus},</if>
+            <if test="sendOutStatus != null and sendOutStatus != ''">sendOutStatus = #{sendOutStatus},</if>
+            <if test="refundType != null and refundType != ''">refundType = #{refundType},</if>
+            <if test="paySuccessCounter != null">paySuccessCounter = #{paySuccessCounter},</if>
+            <if test="payFlag != null and payFlag != ''">payFlag = #{payFlag},</if>
+            <if test="onlinePayFlag != null and onlinePayFlag != ''">onlinePayFlag = #{onlinePayFlag},</if>
+            <if test="productTotalFee != null">productTotalFee = #{productTotalFee},</if>
+            <if test="orderTotalFee != null">orderTotalFee = #{orderTotalFee},</if>
+            <if test="payTotalFee != null">payTotalFee = #{payTotalFee},</if>
+            <if test="payableAmount != null">payableAmount = #{payableAmount},</if>
+            <if test="balancePayFee != null">balancePayFee = #{balancePayFee},</if>
+            <if test="preferential != null">preferential = #{preferential},</if>
+            <if test="discountFee != null">discountFee = #{discountFee},</if>
+            <if test="promotionFullReduction != null">promotionFullReduction = #{promotionFullReduction},</if>
+            <if test="spID != null">spID = #{spID},</if>
+            <if test="mainSpID != null">mainSpID = #{mainSpID},</if>
+            <if test="note != null and note != ''">note = #{note},</if>
+            <if test="clubID != null">clubID = #{clubID},</if>
+            <if test="clubScanTime != null and clubScanTime != ''">clubScanTime = #{clubScanTime},</if>
+            <if test="orderSource != null and orderSource != ''">orderSource = #{orderSource},</if>
+            <if test="closeTime != null and closeTime != ''">closeTime = #{closeTime},</if>
+            <if test="confirmTime != null and confirmTime != ''">confirmTime = #{confirmTime},</if>
+            <if test="payTime != null and payTime != ''">payTime = #{payTime},</if>
+            <if test="orderTime != null and orderTime != ''">orderTime = #{orderTime},</if>
+            <if test="productCount != null">productCount = #{productCount},</if>
+            <if test="presentCount != null">presentCount = #{presentCount},</if>
+            <if test="promotionalGiftsCount != null">promotionalGiftsCount = #{promotionalGiftsCount},</if>
+            <if test="invoiceFlag != null and invoiceFlag != ''">invoiceFlag = #{invoiceFlag},</if>
+            <if test="confirmFlag != null and confirmFlag != ''">confirmFlag = #{confirmFlag},</if>
+            <if test="clauseID != null">clauseID = #{clauseID},</if>
+            <if test="clauseContent != null and clauseContent != ''">clauseContent = #{clauseContent},</if>
+            <if test="clauseName != null and clauseName != ''">clauseName = #{clauseName},</if>
+            <if test="updateDate != null and updateDate != ''">updateDate = #{updateDate},</if>
+            <if test="freePostFlag != null and freePostFlag != ''">freePostFlag = #{freePostFlag},</if>
+            <if test="freight != null">freight = #{freight},</if>
+            <if test="userBeans != null">userBeans = #{userBeans},</if>
+            <if test="delFlag != null and delFlag != ''">delFlag = #{delFlag},</if>
+            <if test="freePostageTicketID != null">freePostageTicketID = #{freePostageTicketID},</if>
+            <if test="splitFlag != null and splitFlag != ''">splitFlag = #{splitFlag},</if>
+            <if test="closeReason != null and closeReason != ''">closeReason = #{closeReason},</if>
+            <if test="postageOrderFlag != null and postageOrderFlag != ''">postageOrderFlag = #{postageOrderFlag},</if>
+            <if test="thirdPartyOrderNo != null and thirdPartyOrderNo != ''">thirdPartyOrderNo = #{thirdPartyOrderNo},</if>
+            <if test="synchronizeFlag != null and synchronizeFlag != ''">synchronizeFlag = #{synchronizeFlag},</if>
+            <if test="secondHandOrderFlag != null and secondHandOrderFlag != ''">secondHandOrderFlag = #{secondHandOrderFlag},</if>
+            <if test="affirmPaymentFlag != null and affirmPaymentFlag != ''">affirmPaymentFlag = #{affirmPaymentFlag},</if>
+            <if test="rebateFlag != null and rebateFlag != ''">rebateFlag = #{rebateFlag},</if>
+            <if test="rebateFee != null and rebateFee != ''">rebateFee = #{rebateFee},</if>
+            <if test="zeroCostFlag != null">zeroCostFlag = #{zeroCostFlag},</if>
+            <if test="couponAmount != null">couponAmount = #{couponAmount},</if>
+            <if test="svipFullReduction != null">svipFullReduction = #{svipFullReduction},</if>
+            <if test="orderSeen != null and orderSeen != ''">orderSeen = #{orderSeen},</if>
+            <if test="reductionAmount != null">reductionAmount = #{reductionAmount},</if>
+            <if test="unionID != null and unionID != ''">unionID = #{unionID},</if>
+        </trim>
+        where orderID = #{orderID}
+    </update>
+
+    <update id="updateDelCmOrderByOrderIDs" parameterType="String">
+        update cm_order set delFlag=#{delFlag} where orderID in
+        <foreach item="orderID" collection="orderIDs" open="(" separator="," close=")">
+            #{orderID}
+        </foreach>
+    </update>
+
+    <delete id="delCmOrderByOrderID" parameterType="String">
+        delete
+        from cm_order where orderID = #{orderID}
+    </delete>
+
+    <delete id="delCmOrderByOrderIDs" parameterType="String">
+        delete from cm_order where orderID in
+        <foreach item="orderID" collection="orderIDs" open="(" separator="," close=")">
+            #{orderID}
+        </foreach>
+    </delete>
+
 </mapper>

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

@@ -1077,7 +1077,7 @@
           AND cror.mbOrderId IS NOT NULL
           AND cror.splitStatus = 0
           AND a.receiptStatus=3
-          -- AND p.splitCode != 'E1807059160'
+          AND a.splitCode != 'E1807059160'
           AND co.orderID NOT IN (SELECT orderID FROM cm_order_product cops LEFT JOIN product ps ON cops.productID = ps.productID WHERE ps.splitCode = 'E1807059160' AND cops.orderID = cop.orderID)
           AND co.orderID NOT IN (
             SELECT orderID
@@ -1277,4 +1277,1007 @@
         WHERE a.shopOrderId = #{onlineShopOrderId}
         ORDER BY a.shopOrderNo DESC
     </select>
+
+    <resultMap type="com.caimei.modules.order.entity.NewShopOrder" id="CmShopOrderResult">
+        <result property="shopOrderID"    column="shopOrderID"    />
+        <result property="shopOrderNo"    column="shopOrderNo"    />
+        <result property="orderNo"    column="orderNo"    />
+        <result property="orderID"    column="orderID"    />
+        <result property="organizeID"    column="organizeID"    />
+        <result property="isColdChina"    column="isColdChina"    />
+        <result property="userID"    column="userID"    />
+        <result property="shopID"    column="shopID"    />
+        <result property="orderPromotionsId"    column="orderPromotionsId"  />
+        <result property="orderType"    column="orderType"    />
+        <result property="orderSubmitType"    column="orderSubmitType"    />
+        <result property="presentNum"    column="presentNum"    />
+        <result property="itemCount"    column="itemCount"    />
+        <result property="outStoreNum"    column="outStoreNum"    />
+        <result property="outStoreTimes"    column="outStoreTimes"    />
+        <result property="townID"    column="townID"    />
+        <result property="note"    column="note"    />
+        <result property="eachDiscount"    column="eachDiscount"    />
+        <result property="realPay"    column="realPay"    />
+        <result property="receiptAmount"    column="receiptAmount"    />
+        <result property="accountAmount"    column="accountAmount"    />
+        <result property="productAmount"    column="productAmount"    />
+        <result property="totalAmount"    column="totalAmount"    />
+        <result property="needPayAmount"    column="needPayAmount"    />
+        <result property="discountAmount"    column="discountAmount"    />
+        <result property="preferential"    column="preferential"    />
+        <result property="promotionFullReduction"    column="promotionFullReduction"    />
+        <result property="payFlag"    column="payFlag"    />
+        <result property="orderTime"    column="orderTime"    />
+        <result property="payTime"    column="payTime"    />
+        <result property="finishTime"    column="finishTime"    />
+        <result property="autoOverTimeMills"    column="autoOverTimeMills"    />
+        <result property="settleStatus"    column="settleStatus"    />
+        <result property="payStatus"    column="payStatus"    />
+        <result property="receiptStatus"    column="receiptStatus"    />
+        <result property="sendOutStatus"    column="sendOutStatus"    />
+        <result property="refundStatus"    column="refundStatus"    />
+        <result property="returnGoodsStatus"    column="returnGoodsStatus"    />
+        <result property="receiveGoodsTime"    column="receiveGoodsTime"    />
+        <result property="autoReceiveTimeMills"    column="autoReceiveTimeMills"    />
+        <result property="totalAddedValueTax"    column="totalAddedValueTax"    />
+        <result property="canRefundAmount"    column="canRefundAmount"    />
+        <result property="refundAmount"    column="refundAmount"    />
+        <result property="clubID"    column="clubID"    />
+        <result property="spID"    column="spID"    />
+        <result property="mainSpID"    column="mainSpID"    />
+        <result property="orderBeanAmount"    column="orderBeanAmount"    />
+        <result property="useBeanAmount"    column="useBeanAmount"    />
+        <result property="useBeanFlag"    column="useBeanFlag"    />
+        <result property="canRefundFlag"    column="canRefundFlag"    />
+        <result property="useBalanceFlag"    column="useBalanceFlag"    />
+        <result property="canRefundBeans"    column="canRefundBeans"    />
+        <result property="freePostageFee"    column="freePostageFee"    />
+        <result property="freePostageTicketID"    column="freePostageTicketID"    />
+        <result property="brokerage"    column="brokerage"    />
+        <result property="delFlag"    column="delFlag"    />
+        <result property="refundsAmount"    column="refundsAmount"    />
+        <result property="orderStatusFlag"    column="orderStatusFlag"    />
+        <result property="buyStatus"    column="buyStatus"    />
+        <result property="deliveryTimeMills"    column="deliveryTimeMills"    />
+        <result property="orderDeliveryID"    column="orderDeliveryID"    />
+        <result property="splitFlag"    column="splitFlag"    />
+        <result property="paying"    column="paying"    />
+        <result property="shopProductAmount"    column="shopProductAmount"    />
+        <result property="shopPostFee"    column="shopPostFee"    />
+        <result property="shopPostFlag"    column="shopPostFlag"    />
+        <result property="shopTaxFee"    column="shopTaxFee"    />
+        <result property="payCmAmount"    column="payCmAmount"    />
+        <result property="shouldPayShopAmount"    column="shouldPayShopAmount"    />
+        <result property="payedShopAmount"    column="payedShopAmount"    />
+        <result property="shopOtherFee"    column="shopOtherFee"    />
+        <result property="receiptedFlag"    column="receiptedFlag"    />
+        <result property="receiptedType"    column="receiptedType"    />
+        <result property="costType"    column="costType"    />
+        <result property="proportional"    column="proportional"    />
+        <result property="modifyShouldPayNote"    column="modifyShouldPayNote"    />
+        <result property="modifyShouldPayUserID"    column="modifyShouldPayUserID"    />
+        <result property="modifyShouldPayDate"    column="modifyShouldPayDate"    />
+        <result property="zeroCostFlag"    column="zeroCostFlag"    />
+        <result property="differenceType"    column="differenceType"    />
+        <result property="differencePrice"    column="differencePrice"    />
+        <result property="svipShopReduction"    column="svipShopReduction"    />
+        <result property="splitCode"    column="splitCode"    />
+        <result property="paySuccessCounter"    column="paySuccessCounter"    />
+        <result property="onlinePayWays"    column="onlinePayWays"    />
+        <result property="status"    column="shopStatus"    />
+    </resultMap>
+
+    <sql id="selectCmShopOrderVo">
+        select
+            cm_shop_order.shopOrderID,
+            cm_shop_order.shopOrderNo,
+            cm_shop_order.orderNo,
+            cm_shop_order.orderID,
+            cm_shop_order.organizeID,
+            cm_shop_order.isColdChina,
+            cm_shop_order.userID,
+            cm_shop_order.shopID,
+            cm_shop_order.orderPromotionsId,
+            cm_shop_order.orderType,
+            cm_shop_order.orderSubmitType,
+            cm_shop_order.presentNum,
+            cm_shop_order.itemCount,
+            cm_shop_order.outStoreNum,
+            cm_shop_order.outStoreTimes,
+            cm_shop_order.townID,
+            cm_shop_order.note,
+            ifnull(cm_shop_order.accountAmount,0) AS accountAmount,
+            ifnull(cm_shop_order.productAmount,0) AS productAmount,
+            ifnull(cm_shop_order.totalAmount,0) AS totalAmount,
+            ifnull(cm_shop_order.needPayAmount,0) AS needPayAmount,
+            ifnull(cm_shop_order.discountAmount,0) AS discountAmount,
+            ifnull(cm_shop_order.preferential,0) AS preferential,
+            ifnull(cm_shop_order.promotionFullReduction,0) AS promotionFullReduction,
+            cm_shop_order.payFlag,
+            cm_shop_order.orderTime,
+            cm_shop_order.payTime,
+            cm_shop_order.finishTime,
+            cm_shop_order.autoOverTimeMills,
+            cm_shop_order.settleStatus,
+            cm_shop_order.payStatus,
+            cm_shop_order.sendOutStatus,
+            cm_shop_order.refundStatus,
+            cm_shop_order.shopStatus,
+            cm_shop_order.returnGoodsStatus,
+            cm_shop_order.receiveGoodsTime,
+            cm_shop_order.autoReceiveTimeMills,
+            ifnull(cm_shop_order.totalAddedValueTax,0) AS totalAddedValueTax,
+            cm_shop_order.canRefundAmount,
+            cm_shop_order.refundAmount,
+            cm_shop_order.clubID,
+            cm_shop_order.spID,
+            cm_shop_order.mainSpID,
+            cm_shop_order.orderBeanAmount,
+            cm_shop_order.useBeanAmount,
+            cm_shop_order.useBeanFlag,
+            cm_shop_order.canRefundFlag,
+            cm_shop_order.useBalanceFlag,
+            cm_shop_order.canRefundBeans,
+            ifnull(cm_shop_order.freePostageFee,0) AS freePostageFee,
+            cm_shop_order.freePostageTicketID,
+            ifnull(cm_shop_order.brokerage,0) AS brokerage,
+            cm_shop_order.delFlag,
+            ifnull(cm_shop_order.refundsAmount,0) AS refundsAmount,
+            cm_shop_order.orderStatusFlag,
+            cm_shop_order.buyStatus,
+            cm_shop_order.deliveryTimeMills,
+            cm_shop_order.confirmTime,
+            cm_shop_order.updateTime,
+            cm_shop_order.orderDeliveryID,
+            cm_shop_order.splitFlag,
+            cm_shop_order.receiptedFlag,
+            cm_shop_order.receiptedType,
+            cm_shop_order.paying,
+            ifnull(cm_shop_order.shopProductAmount,0) AS shopProductAmount,
+            ifnull(cm_shop_order.shopPostFee,0) AS shopPostFee,
+            cm_shop_order.shopPostFlag,
+            ifnull(cm_shop_order.shopTaxFee,0) AS shopTaxFee,
+            ifnull(cm_shop_order.payCmAmount,0) AS payCmAmount,
+            ifnull(cm_shop_order.shouldPayShopAmount,0) AS shouldPayShopAmount,
+            ifnull(cm_shop_order.payedShopAmount,0) AS payedShopAmount,
+            ifnull(cm_shop_order.shopOtherFee,0) AS shopOtherFee,
+            cm_shop_order.costType,
+            ifnull(cm_shop_order.proportional,0) AS proportional,
+            cm_shop_order.modifyShouldPayNote,
+            cm_shop_order.modifyShouldPayUserID,
+            cm_shop_order.modifyShouldPayDate,
+            cm_shop_order.zeroCostFlag,
+            cm_shop_order.differenceType,
+            ifnull(cm_shop_order.differencePrice,0) AS differencePrice,
+            ifnull(cm_shop_order.svipShopReduction,0) AS svipShopReduction,
+            ifnull(cm_shop_order.shopRefundAmount,0) AS shopRefundAmount,
+            cm_shop_order.splitCode,
+            cm_shop_order.paySuccessCounter,
+            cm_shop_order.onlinePayWays,
+            cm_shop_order.receiptStatus,
+            ifnull(cm_shop_order.receiptAmount,0) AS receiptAmount,
+            ifnull(cm_shop_order.eachDiscount,0) AS eachDiscount,
+            ifnull(cm_shop_order.realPay,0) AS realPay,
+            cm_shop_order.discountFee,
+            cm_shop_order.fee
+    </sql>
+
+    <select id="getByCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultMap="CmShopOrderResult">
+        <include refid="selectCmShopOrderVo"/>
+        from cm_shop_order AS cm_shop_order
+        <where>  cm_shop_order.delFlag = 0
+            <if test="shopOrderID != null  and  shopOrderID != ''">
+                and cm_shop_order.shopOrderID
+                = #{shopOrderID}
+            </if>
+            <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
+                <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+                <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+                <foreach item="shopOrderIDIn" collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')" open="(" separator="," close=")">
+                    #{shopOrderIDIn}
+                </foreach>
+            </if>
+            <if test="shopOrderNo != null  and shopOrderNo != ''"> and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
+            <if test="orderNo != null  and orderNo != ''"> and cm_shop_order.orderNo = #{orderNo}</if>
+            <if test="orderID != null "> and cm_shop_order.orderID = #{orderID}</if>
+            <if test="organizeID != null "> and cm_shop_order.organizeID = #{organizeID}</if>
+            <if test="isColdChina != null "> and cm_shop_order.isColdChina = #{isColdChina}</if>
+            <if test="userID != null "> and cm_shop_order.userID = #{userID}</if>
+            <if test="shopID != null "> and cm_shop_order.shopID = #{shopID}</if>
+            <if test="orderPromotionsId != null "> and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
+            <if test="orderType != null "> and cm_shop_order.orderType = #{orderType}</if>
+            <if test="orderSubmitType != null "> and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
+            <if test="presentNum != null "> and cm_shop_order.presentNum = #{presentNum}</if>
+            <if test="itemCount != null "> and cm_shop_order.itemCount = #{itemCount}</if>
+            <if test="outStoreNum != null "> and cm_shop_order.outStoreNum = #{outStoreNum}</if>
+            <if test="outStoreTimes != null "> and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
+            <if test="townID != null "> and cm_shop_order.townID = #{townID}</if>
+            <if test="note != null  and note != ''"> and cm_shop_order.note = #{note}</if>
+            <if test="eachDiscount != null "> and cm_shop_order.eachDiscount = #{eachDiscount}</if>
+            <if test="realPay != null "> and cm_shop_order.realPay = #{realPay}</if>
+            <if test="receiptAmount != null "> and cm_shop_order.receiptAmount = #{receiptAmount}</if>
+            <if test="accountAmount != null "> and cm_shop_order.accountAmount = #{accountAmount}</if>
+            <if test="productAmount != null "> and cm_shop_order.productAmount = #{productAmount}</if>
+            <if test="totalAmount != null "> and cm_shop_order.totalAmount = #{totalAmount}</if>
+            <if test="needPayAmount != null "> and cm_shop_order.needPayAmount = #{needPayAmount}</if>
+            <if test="discountAmount != null "> and cm_shop_order.discountAmount = #{discountAmount}</if>
+            <if test="preferential != null "> and cm_shop_order.preferential = #{preferential}</if>
+            <if test="promotionFullReduction != null "> and cm_shop_order.promotionFullReduction = #{promotionFullReduction}</if>
+            <if test="payFlag != null  and payFlag != ''"> and cm_shop_order.payFlag = #{payFlag}</if>
+            <if test="orderTime != null  and orderTime != ''"> and cm_shop_order.orderTime = #{orderTime}</if>
+            <if test="payTime != null  and payTime != ''"> and cm_shop_order.payTime = #{payTime}</if>
+            <if test="finishTime != null  and finishTime != ''"> and cm_shop_order.finishTime = #{finishTime}</if>
+            <if test="autoOverTimeMills != null "> and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
+            <if test="settleStatus != null  and settleStatus != ''"> and cm_shop_order.settleStatus = #{settleStatus}</if>
+            <if test="payStatus != null  and payStatus != ''"> and cm_shop_order.payStatus = #{payStatus}</if>
+            <if test="receiptStatus != null  and receiptStatus != ''"> and cm_shop_order.receiptStatus = #{receiptStatus}</if>
+            <if test="sendOutStatus != null  and sendOutStatus != ''"> and cm_shop_order.sendOutStatus = #{sendOutStatus}</if>
+            <if test="refundStatus != null "> and cm_shop_order.refundStatus = #{refundStatus}</if>
+            <if test="returnGoodsStatus != null "> and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
+            <if test="receiveGoodsTime != null  and receiveGoodsTime != ''"> and cm_shop_order.receiveGoodsTime = #{receiveGoodsTime}</if>
+            <if test="autoReceiveTimeMills != null "> and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}</if>
+            <if test="totalAddedValueTax != null "> and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
+            <if test="canRefundAmount != null "> and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
+            <if test="refundAmount != null "> and cm_shop_order.refundAmount = #{refundAmount}</if>
+            <if test="clubID != null "> and cm_shop_order.clubID = #{clubID}</if>
+            <if test="spID != null "> and cm_shop_order.spID = #{spID}</if>
+            <if test="mainSpID != null "> and cm_shop_order.mainSpID = #{mainSpID}</if>
+            <if test="orderBeanAmount != null "> and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
+            <if test="useBeanAmount != null "> and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
+            <if test="useBeanFlag != null "> and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
+            <if test="canRefundFlag != null "> and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
+            <if test="useBalanceFlag != null "> and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
+            <if test="canRefundBeans != null "> and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
+            <if test="freePostageFee != null "> and cm_shop_order.freePostageFee = #{freePostageFee}</if>
+            <if test="freePostageTicketID != null "> and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
+            <if test="brokerage != null "> and cm_shop_order.brokerage = #{brokerage}</if>
+            <if test="delFlag != null  and delFlag != ''"> and cm_shop_order.delFlag = #{delFlag}</if>
+            <if test="refundsAmount != null "> and cm_shop_order.refundsAmount = #{refundsAmount}</if>
+            <if test="orderStatusFlag != null  and orderStatusFlag != ''"> and cm_shop_order.orderStatusFlag = #{orderStatusFlag}</if>
+            <if test="buyStatus != null  and buyStatus != ''"> and cm_shop_order.buyStatus = #{buyStatus}</if>
+            <if test="deliveryTimeMills != null  and deliveryTimeMills != ''"> and cm_shop_order.deliveryTimeMills = #{deliveryTimeMills}</if>
+            <if test="orderDeliveryID != null "> and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
+            <if test="splitFlag != null  and splitFlag != ''"> and cm_shop_order.splitFlag = #{splitFlag}</if>
+            <if test="paying != null  and paying != ''"> and cm_shop_order.paying = #{paying}</if>
+            <if test="shopProductAmount != null "> and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
+            <if test="shopPostFee != null "> and cm_shop_order.shopPostFee = #{shopPostFee}</if>
+            <if test="shopPostFlag != null  and shopPostFlag != ''"> and cm_shop_order.shopPostFlag = #{shopPostFlag}</if>
+            <if test="shopTaxFee != null "> and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
+            <if test="payCmAmount != null "> and cm_shop_order.payCmAmount = #{payCmAmount}</if>
+            <if test="shouldPayShopAmount != null "> and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
+            <if test="payedShopAmount != null "> and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
+            <if test="shopOtherFee != null "> and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
+            <if test="receiptedFlag != null  and receiptedFlag != ''"> and cm_shop_order.receiptedFlag = #{receiptedFlag}</if>
+            <if test="receiptedType != null  and receiptedType != ''"> and cm_shop_order.receiptedType = #{receiptedType}</if>
+            <if test="costType != null  and costType != ''"> and cm_shop_order.costType = #{costType}</if>
+            <if test="proportional != null "> and cm_shop_order.proportional = #{proportional}</if>
+            <if test="modifyShouldPayNote != null  and modifyShouldPayNote != ''"> and cm_shop_order.modifyShouldPayNote = #{modifyShouldPayNote}</if>
+            <if test="modifyShouldPayUserID != null "> and cm_shop_order.modifyShouldPayUserID = #{modifyShouldPayUserID}</if>
+            <if test="modifyShouldPayDate != null "> and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
+            <if test="zeroCostFlag != null "> and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
+            <if test="differenceType != null  and differenceType != ''"> and cm_shop_order.differenceType = #{differenceType}</if>
+            <if test="differencePrice != null "> and cm_shop_order.differencePrice = #{differencePrice}</if>
+            <if test="svipShopReduction != null "> and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
+            <if test="splitCode != null  and splitCode != ''"> and cm_shop_order.splitCode = #{splitCode}</if>
+            <if test="paySuccessCounter != null "> and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
+            <if test="onlinePayWays != null  and onlinePayWays != ''"> and cm_shop_order.onlinePayWays = #{onlinePayWays}</if>
+            <if test="status != null  and status != ''"> and cm_shop_order.shopStatus = #{status}</if>
+        </where>
+        group by cm_shop_order.shopOrderID
+        order by cm_shop_order.orderTime desc
+        limit 0,1
+    </select>
+
+    <select id="getCmShopOrderList" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultMap="CmShopOrderResult">
+        <include refid="selectCmShopOrderVo"/>
+        from cm_shop_order AS cm_shop_order
+        <where>  cm_shop_order.delFlag = 0
+            <if test="shopOrderID != null  and  shopOrderID != ''">
+                and cm_shop_order.shopOrderID
+                = #{shopOrderID}
+            </if>
+            <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
+                <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+                <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+                <foreach item="shopOrderIDIn" collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')" open="(" separator="," close=")">
+                    #{shopOrderIDIn}
+                </foreach>
+            </if>
+            <if test="shopOrderNo != null  and shopOrderNo != ''"> and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
+            <if test="orderNo != null  and orderNo != ''"> and cm_shop_order.orderNo = #{orderNo}</if>
+            <if test="orderID != null "> and cm_shop_order.orderID = #{orderID}</if>
+            <if test="organizeID != null "> and cm_shop_order.organizeID = #{organizeID}</if>
+            <if test="isColdChina != null "> and cm_shop_order.isColdChina = #{isColdChina}</if>
+            <if test="userID != null "> and cm_shop_order.userID = #{userID}</if>
+            <if test="shopID != null "> and cm_shop_order.shopID = #{shopID}</if>
+            <if test="orderPromotionsId != null "> and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
+            <if test="orderType != null "> and cm_shop_order.orderType = #{orderType}</if>
+            <if test="orderSubmitType != null "> and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
+            <if test="presentNum != null "> and cm_shop_order.presentNum = #{presentNum}</if>
+            <if test="itemCount != null "> and cm_shop_order.itemCount = #{itemCount}</if>
+            <if test="outStoreNum != null "> and cm_shop_order.outStoreNum = #{outStoreNum}</if>
+            <if test="outStoreTimes != null "> and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
+            <if test="townID != null "> and cm_shop_order.townID = #{townID}</if>
+            <if test="note != null  and note != ''"> and cm_shop_order.note = #{note}</if>
+            <if test="eachDiscount != null "> and cm_shop_order.eachDiscount = #{eachDiscount}</if>
+            <if test="realPay != null "> and cm_shop_order.realPay = #{realPay}</if>
+            <if test="receiptAmount != null "> and cm_shop_order.receiptAmount = #{receiptAmount}</if>
+            <if test="accountAmount != null "> and cm_shop_order.accountAmount = #{accountAmount}</if>
+            <if test="productAmount != null "> and cm_shop_order.productAmount = #{productAmount}</if>
+            <if test="totalAmount != null "> and cm_shop_order.totalAmount = #{totalAmount}</if>
+            <if test="needPayAmount != null "> and cm_shop_order.needPayAmount = #{needPayAmount}</if>
+            <if test="discountAmount != null "> and cm_shop_order.discountAmount = #{discountAmount}</if>
+            <if test="preferential != null "> and cm_shop_order.preferential = #{preferential}</if>
+            <if test="promotionFullReduction != null "> and cm_shop_order.promotionFullReduction = #{promotionFullReduction}</if>
+            <if test="payFlag != null  and payFlag != ''"> and cm_shop_order.payFlag = #{payFlag}</if>
+            <if test="orderTime != null  and orderTime != ''"> and cm_shop_order.orderTime = #{orderTime}</if>
+            <if test="payTime != null  and payTime != ''"> and cm_shop_order.payTime = #{payTime}</if>
+            <if test="finishTime != null  and finishTime != ''"> and cm_shop_order.finishTime = #{finishTime}</if>
+            <if test="autoOverTimeMills != null "> and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
+            <if test="settleStatus != null  and settleStatus != ''"> and cm_shop_order.settleStatus = #{settleStatus}</if>
+            <if test="payStatus != null  and payStatus != ''"> and cm_shop_order.payStatus = #{payStatus}</if>
+            <if test="receiptStatus != null  and receiptStatus != ''"> and cm_shop_order.receiptStatus = #{receiptStatus}</if>
+            <if test="sendOutStatus != null  and sendOutStatus != ''"> and cm_shop_order.sendOutStatus = #{sendOutStatus}</if>
+            <if test="refundStatus != null "> and cm_shop_order.refundStatus = #{refundStatus}</if>
+            <if test="returnGoodsStatus != null "> and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
+            <if test="receiveGoodsTime != null  and receiveGoodsTime != ''"> and cm_shop_order.receiveGoodsTime = #{receiveGoodsTime}</if>
+            <if test="autoReceiveTimeMills != null "> and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}</if>
+            <if test="totalAddedValueTax != null "> and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
+            <if test="canRefundAmount != null "> and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
+            <if test="refundAmount != null "> and cm_shop_order.refundAmount = #{refundAmount}</if>
+            <if test="clubID != null "> and cm_shop_order.clubID = #{clubID}</if>
+            <if test="spID != null "> and cm_shop_order.spID = #{spID}</if>
+            <if test="mainSpID != null "> and cm_shop_order.mainSpID = #{mainSpID}</if>
+            <if test="orderBeanAmount != null "> and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
+            <if test="useBeanAmount != null "> and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
+            <if test="useBeanFlag != null "> and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
+            <if test="canRefundFlag != null "> and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
+            <if test="useBalanceFlag != null "> and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
+            <if test="canRefundBeans != null "> and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
+            <if test="freePostageFee != null "> and cm_shop_order.freePostageFee = #{freePostageFee}</if>
+            <if test="freePostageTicketID != null "> and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
+            <if test="brokerage != null "> and cm_shop_order.brokerage = #{brokerage}</if>
+            <if test="delFlag != null  and delFlag != ''"> and cm_shop_order.delFlag = #{delFlag}</if>
+            <if test="refundsAmount != null "> and cm_shop_order.refundsAmount = #{refundsAmount}</if>
+            <if test="orderStatusFlag != null  and orderStatusFlag != ''"> and cm_shop_order.orderStatusFlag = #{orderStatusFlag}</if>
+            <if test="buyStatus != null  and buyStatus != ''"> and cm_shop_order.buyStatus = #{buyStatus}</if>
+            <if test="deliveryTimeMills != null  and deliveryTimeMills != ''"> and cm_shop_order.deliveryTimeMills = #{deliveryTimeMills}</if>
+            <if test="orderDeliveryID != null "> and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
+            <if test="splitFlag != null  and splitFlag != ''"> and cm_shop_order.splitFlag = #{splitFlag}</if>
+            <if test="paying != null  and paying != ''"> and cm_shop_order.paying = #{paying}</if>
+            <if test="shopProductAmount != null "> and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
+            <if test="shopPostFee != null "> and cm_shop_order.shopPostFee = #{shopPostFee}</if>
+            <if test="shopPostFlag != null  and shopPostFlag != ''"> and cm_shop_order.shopPostFlag = #{shopPostFlag}</if>
+            <if test="shopTaxFee != null "> and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
+            <if test="payCmAmount != null "> and cm_shop_order.payCmAmount = #{payCmAmount}</if>
+            <if test="shouldPayShopAmount != null "> and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
+            <if test="payedShopAmount != null "> and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
+            <if test="shopOtherFee != null "> and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
+            <if test="receiptedFlag != null  and receiptedFlag != ''"> and cm_shop_order.receiptedFlag = #{receiptedFlag}</if>
+            <if test="receiptedType != null  and receiptedType != ''"> and cm_shop_order.receiptedType = #{receiptedType}</if>
+            <if test="costType != null  and costType != ''"> and cm_shop_order.costType = #{costType}</if>
+            <if test="proportional != null "> and cm_shop_order.proportional = #{proportional}</if>
+            <if test="modifyShouldPayNote != null  and modifyShouldPayNote != ''"> and cm_shop_order.modifyShouldPayNote = #{modifyShouldPayNote}</if>
+            <if test="modifyShouldPayUserID != null "> and cm_shop_order.modifyShouldPayUserID = #{modifyShouldPayUserID}</if>
+            <if test="modifyShouldPayDate != null "> and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
+            <if test="zeroCostFlag != null "> and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
+            <if test="differenceType != null  and differenceType != ''"> and cm_shop_order.differenceType = #{differenceType}</if>
+            <if test="differencePrice != null "> and cm_shop_order.differencePrice = #{differencePrice}</if>
+            <if test="svipShopReduction != null "> and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
+            <if test="splitCode != null  and splitCode != ''"> and cm_shop_order.splitCode = #{splitCode}</if>
+            <if test="paySuccessCounter != null "> and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
+            <if test="onlinePayWays != null  and onlinePayWays != ''"> and cm_shop_order.onlinePayWays = #{onlinePayWays}</if>
+            <if test="status != null  and status != ''"> and cm_shop_order.shopStatus = #{status}</if>
+        </where>
+        group by cm_shop_order.shopOrderID
+        order by cm_shop_order.orderTime desc
+    </select>
+    <select id="getCmShopOrderCount" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultType="String">
+        select count(1)
+        from cm_shop_order AS cm_shop_order
+        <where>  cm_shop_order.delFlag = 0
+            <if test="shopOrderID != null  and  shopOrderID != ''">
+                and cm_shop_order.shopOrderID
+                = #{shopOrderID}
+            </if>
+            <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
+                <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+                <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+                <foreach item="shopOrderIDIn" collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')" open="(" separator="," close=")">
+                    #{shopOrderIDIn}
+                </foreach>
+            </if>
+            <if test="shopOrderNo != null  and shopOrderNo != ''"> and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
+            <if test="orderNo != null  and orderNo != ''"> and cm_shop_order.orderNo = #{orderNo}</if>
+            <if test="orderID != null "> and cm_shop_order.orderID = #{orderID}</if>
+            <if test="organizeID != null "> and cm_shop_order.organizeID = #{organizeID}</if>
+            <if test="isColdChina != null "> and cm_shop_order.isColdChina = #{isColdChina}</if>
+            <if test="userID != null "> and cm_shop_order.userID = #{userID}</if>
+            <if test="shopID != null "> and cm_shop_order.shopID = #{shopID}</if>
+            <if test="orderPromotionsId != null "> and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
+            <if test="orderType != null "> and cm_shop_order.orderType = #{orderType}</if>
+            <if test="orderSubmitType != null "> and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
+            <if test="presentNum != null "> and cm_shop_order.presentNum = #{presentNum}</if>
+            <if test="itemCount != null "> and cm_shop_order.itemCount = #{itemCount}</if>
+            <if test="outStoreNum != null "> and cm_shop_order.outStoreNum = #{outStoreNum}</if>
+            <if test="outStoreTimes != null "> and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
+            <if test="townID != null "> and cm_shop_order.townID = #{townID}</if>
+            <if test="note != null  and note != ''"> and cm_shop_order.note = #{note}</if>
+            <if test="eachDiscount != null "> and cm_shop_order.eachDiscount = #{eachDiscount}</if>
+            <if test="realPay != null "> and cm_shop_order.realPay = #{realPay}</if>
+            <if test="receiptAmount != null "> and cm_shop_order.receiptAmount = #{receiptAmount}</if>
+            <if test="accountAmount != null "> and cm_shop_order.accountAmount = #{accountAmount}</if>
+            <if test="productAmount != null "> and cm_shop_order.productAmount = #{productAmount}</if>
+            <if test="totalAmount != null "> and cm_shop_order.totalAmount = #{totalAmount}</if>
+            <if test="needPayAmount != null "> and cm_shop_order.needPayAmount = #{needPayAmount}</if>
+            <if test="discountAmount != null "> and cm_shop_order.discountAmount = #{discountAmount}</if>
+            <if test="preferential != null "> and cm_shop_order.preferential = #{preferential}</if>
+            <if test="promotionFullReduction != null "> and cm_shop_order.promotionFullReduction = #{promotionFullReduction}</if>
+            <if test="payFlag != null  and payFlag != ''"> and cm_shop_order.payFlag = #{payFlag}</if>
+            <if test="orderTime != null  and orderTime != ''"> and cm_shop_order.orderTime = #{orderTime}</if>
+            <if test="payTime != null  and payTime != ''"> and cm_shop_order.payTime = #{payTime}</if>
+            <if test="finishTime != null  and finishTime != ''"> and cm_shop_order.finishTime = #{finishTime}</if>
+            <if test="autoOverTimeMills != null "> and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
+            <if test="settleStatus != null  and settleStatus != ''"> and cm_shop_order.settleStatus = #{settleStatus}</if>
+            <if test="payStatus != null  and payStatus != ''"> and cm_shop_order.payStatus = #{payStatus}</if>
+            <if test="receiptStatus != null  and receiptStatus != ''"> and cm_shop_order.receiptStatus = #{receiptStatus}</if>
+            <if test="sendOutStatus != null  and sendOutStatus != ''"> and cm_shop_order.sendOutStatus = #{sendOutStatus}</if>
+            <if test="refundStatus != null "> and cm_shop_order.refundStatus = #{refundStatus}</if>
+            <if test="returnGoodsStatus != null "> and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
+            <if test="receiveGoodsTime != null  and receiveGoodsTime != ''"> and cm_shop_order.receiveGoodsTime = #{receiveGoodsTime}</if>
+            <if test="autoReceiveTimeMills != null "> and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}</if>
+            <if test="totalAddedValueTax != null "> and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
+            <if test="canRefundAmount != null "> and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
+            <if test="refundAmount != null "> and cm_shop_order.refundAmount = #{refundAmount}</if>
+            <if test="clubID != null "> and cm_shop_order.clubID = #{clubID}</if>
+            <if test="spID != null "> and cm_shop_order.spID = #{spID}</if>
+            <if test="mainSpID != null "> and cm_shop_order.mainSpID = #{mainSpID}</if>
+            <if test="orderBeanAmount != null "> and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
+            <if test="useBeanAmount != null "> and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
+            <if test="useBeanFlag != null "> and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
+            <if test="canRefundFlag != null "> and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
+            <if test="useBalanceFlag != null "> and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
+            <if test="canRefundBeans != null "> and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
+            <if test="freePostageFee != null "> and cm_shop_order.freePostageFee = #{freePostageFee}</if>
+            <if test="freePostageTicketID != null "> and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
+            <if test="brokerage != null "> and cm_shop_order.brokerage = #{brokerage}</if>
+            <if test="delFlag != null  and delFlag != ''"> and cm_shop_order.delFlag = #{delFlag}</if>
+            <if test="refundsAmount != null "> and cm_shop_order.refundsAmount = #{refundsAmount}</if>
+            <if test="orderStatusFlag != null  and orderStatusFlag != ''"> and cm_shop_order.orderStatusFlag = #{orderStatusFlag}</if>
+            <if test="buyStatus != null  and buyStatus != ''"> and cm_shop_order.buyStatus = #{buyStatus}</if>
+            <if test="deliveryTimeMills != null  and deliveryTimeMills != ''"> and cm_shop_order.deliveryTimeMills = #{deliveryTimeMills}</if>
+            <if test="orderDeliveryID != null "> and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
+            <if test="splitFlag != null  and splitFlag != ''"> and cm_shop_order.splitFlag = #{splitFlag}</if>
+            <if test="paying != null  and paying != ''"> and cm_shop_order.paying = #{paying}</if>
+            <if test="shopProductAmount != null "> and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
+            <if test="shopPostFee != null "> and cm_shop_order.shopPostFee = #{shopPostFee}</if>
+            <if test="shopPostFlag != null  and shopPostFlag != ''"> and cm_shop_order.shopPostFlag = #{shopPostFlag}</if>
+            <if test="shopTaxFee != null "> and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
+            <if test="payCmAmount != null "> and cm_shop_order.payCmAmount = #{payCmAmount}</if>
+            <if test="shouldPayShopAmount != null "> and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
+            <if test="payedShopAmount != null "> and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
+            <if test="shopOtherFee != null "> and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
+            <if test="receiptedFlag != null  and receiptedFlag != ''"> and cm_shop_order.receiptedFlag = #{receiptedFlag}</if>
+            <if test="receiptedType != null  and receiptedType != ''"> and cm_shop_order.receiptedType = #{receiptedType}</if>
+            <if test="costType != null  and costType != ''"> and cm_shop_order.costType = #{costType}</if>
+            <if test="proportional != null "> and cm_shop_order.proportional = #{proportional}</if>
+            <if test="modifyShouldPayNote != null  and modifyShouldPayNote != ''"> and cm_shop_order.modifyShouldPayNote = #{modifyShouldPayNote}</if>
+            <if test="modifyShouldPayUserID != null "> and cm_shop_order.modifyShouldPayUserID = #{modifyShouldPayUserID}</if>
+            <if test="modifyShouldPayDate != null "> and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
+            <if test="zeroCostFlag != null "> and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
+            <if test="differenceType != null  and differenceType != ''"> and cm_shop_order.differenceType = #{differenceType}</if>
+            <if test="differencePrice != null "> and cm_shop_order.differencePrice = #{differencePrice}</if>
+            <if test="svipShopReduction != null "> and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
+            <if test="splitCode != null  and splitCode != ''"> and cm_shop_order.splitCode = #{splitCode}</if>
+            <if test="paySuccessCounter != null "> and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
+            <if test="onlinePayWays != null  and onlinePayWays != ''"> and cm_shop_order.onlinePayWays = #{onlinePayWays}</if>
+            <if test="status != null  and status != ''"> and cm_shop_order.shopStatus = #{status}</if>
+        </where>
+        group by cm_shop_order.shopOrderID
+    </select>
+
+    <select id="getCmShopOrderByShopOrderID" parameterType="String" resultMap="CmShopOrderResult">
+        <include refid="selectCmShopOrderVo"/>
+        from cm_shop_order AS cm_shop_order
+        where  cm_shop_order.delFlag = 0 and cm_shop_order.shopOrderID = #{shopOrderID}
+    </select>
+
+    <select id="getByIds" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultType="String">
+        select shopOrderID
+        from cm_shop_order AS cm_shop_order
+        <where>  cm_shop_order.delFlag = 0
+            <if test="shopOrderID != null  and  shopOrderID != ''">
+                and cm_shop_order.shopOrderID
+                = #{shopOrderID}
+            </if>
+            <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
+                <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+                <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+                <foreach item="shopOrderIDIn" collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')" open="(" separator="," close=")">
+                    #{shopOrderIDIn}
+                </foreach>
+            </if>
+            <if test="shopOrderNo != null  and shopOrderNo != ''"> and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
+            <if test="orderNo != null  and orderNo != ''"> and cm_shop_order.orderNo = #{orderNo}</if>
+            <if test="orderID != null "> and cm_shop_order.orderID = #{orderID}</if>
+            <if test="organizeID != null "> and cm_shop_order.organizeID = #{organizeID}</if>
+            <if test="isColdChina != null "> and cm_shop_order.isColdChina = #{isColdChina}</if>
+            <if test="userID != null "> and cm_shop_order.userID = #{userID}</if>
+            <if test="shopID != null "> and cm_shop_order.shopID = #{shopID}</if>
+            <if test="orderPromotionsId != null "> and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
+            <if test="orderType != null "> and cm_shop_order.orderType = #{orderType}</if>
+            <if test="orderSubmitType != null "> and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
+            <if test="presentNum != null "> and cm_shop_order.presentNum = #{presentNum}</if>
+            <if test="itemCount != null "> and cm_shop_order.itemCount = #{itemCount}</if>
+            <if test="outStoreNum != null "> and cm_shop_order.outStoreNum = #{outStoreNum}</if>
+            <if test="outStoreTimes != null "> and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
+            <if test="townID != null "> and cm_shop_order.townID = #{townID}</if>
+            <if test="note != null  and note != ''"> and cm_shop_order.note = #{note}</if>
+            <if test="eachDiscount != null "> and cm_shop_order.eachDiscount = #{eachDiscount}</if>
+            <if test="realPay != null "> and cm_shop_order.realPay = #{realPay}</if>
+            <if test="receiptAmount != null "> and cm_shop_order.receiptAmount = #{receiptAmount}</if>
+            <if test="accountAmount != null "> and cm_shop_order.accountAmount = #{accountAmount}</if>
+            <if test="productAmount != null "> and cm_shop_order.productAmount = #{productAmount}</if>
+            <if test="totalAmount != null "> and cm_shop_order.totalAmount = #{totalAmount}</if>
+            <if test="needPayAmount != null "> and cm_shop_order.needPayAmount = #{needPayAmount}</if>
+            <if test="discountAmount != null "> and cm_shop_order.discountAmount = #{discountAmount}</if>
+            <if test="preferential != null "> and cm_shop_order.preferential = #{preferential}</if>
+            <if test="promotionFullReduction != null "> and cm_shop_order.promotionFullReduction = #{promotionFullReduction}</if>
+            <if test="payFlag != null  and payFlag != ''"> and cm_shop_order.payFlag = #{payFlag}</if>
+            <if test="orderTime != null  and orderTime != ''"> and cm_shop_order.orderTime = #{orderTime}</if>
+            <if test="payTime != null  and payTime != ''"> and cm_shop_order.payTime = #{payTime}</if>
+            <if test="finishTime != null  and finishTime != ''"> and cm_shop_order.finishTime = #{finishTime}</if>
+            <if test="autoOverTimeMills != null "> and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
+            <if test="settleStatus != null  and settleStatus != ''"> and cm_shop_order.settleStatus = #{settleStatus}</if>
+            <if test="payStatus != null  and payStatus != ''"> and cm_shop_order.payStatus = #{payStatus}</if>
+            <if test="receiptStatus != null  and receiptStatus != ''"> and cm_shop_order.receiptStatus = #{receiptStatus}</if>
+            <if test="sendOutStatus != null  and sendOutStatus != ''"> and cm_shop_order.sendOutStatus = #{sendOutStatus}</if>
+            <if test="refundStatus != null "> and cm_shop_order.refundStatus = #{refundStatus}</if>
+            <if test="returnGoodsStatus != null "> and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
+            <if test="receiveGoodsTime != null  and receiveGoodsTime != ''"> and cm_shop_order.receiveGoodsTime = #{receiveGoodsTime}</if>
+            <if test="autoReceiveTimeMills != null "> and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}</if>
+            <if test="totalAddedValueTax != null "> and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
+            <if test="canRefundAmount != null "> and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
+            <if test="refundAmount != null "> and cm_shop_order.refundAmount = #{refundAmount}</if>
+            <if test="clubID != null "> and cm_shop_order.clubID = #{clubID}</if>
+            <if test="spID != null "> and cm_shop_order.spID = #{spID}</if>
+            <if test="mainSpID != null "> and cm_shop_order.mainSpID = #{mainSpID}</if>
+            <if test="orderBeanAmount != null "> and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
+            <if test="useBeanAmount != null "> and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
+            <if test="useBeanFlag != null "> and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
+            <if test="canRefundFlag != null "> and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
+            <if test="useBalanceFlag != null "> and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
+            <if test="canRefundBeans != null "> and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
+            <if test="freePostageFee != null "> and cm_shop_order.freePostageFee = #{freePostageFee}</if>
+            <if test="freePostageTicketID != null "> and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
+            <if test="brokerage != null "> and cm_shop_order.brokerage = #{brokerage}</if>
+            <if test="delFlag != null  and delFlag != ''"> and cm_shop_order.delFlag = #{delFlag}</if>
+            <if test="refundsAmount != null "> and cm_shop_order.refundsAmount = #{refundsAmount}</if>
+            <if test="orderStatusFlag != null  and orderStatusFlag != ''"> and cm_shop_order.orderStatusFlag = #{orderStatusFlag}</if>
+            <if test="buyStatus != null  and buyStatus != ''"> and cm_shop_order.buyStatus = #{buyStatus}</if>
+            <if test="deliveryTimeMills != null  and deliveryTimeMills != ''"> and cm_shop_order.deliveryTimeMills = #{deliveryTimeMills}</if>
+            <if test="orderDeliveryID != null "> and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
+            <if test="splitFlag != null  and splitFlag != ''"> and cm_shop_order.splitFlag = #{splitFlag}</if>
+            <if test="paying != null  and paying != ''"> and cm_shop_order.paying = #{paying}</if>
+            <if test="shopProductAmount != null "> and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
+            <if test="shopPostFee != null "> and cm_shop_order.shopPostFee = #{shopPostFee}</if>
+            <if test="shopPostFlag != null  and shopPostFlag != ''"> and cm_shop_order.shopPostFlag = #{shopPostFlag}</if>
+            <if test="shopTaxFee != null "> and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
+            <if test="payCmAmount != null "> and cm_shop_order.payCmAmount = #{payCmAmount}</if>
+            <if test="shouldPayShopAmount != null "> and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
+            <if test="payedShopAmount != null "> and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
+            <if test="shopOtherFee != null "> and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
+            <if test="receiptedFlag != null  and receiptedFlag != ''"> and cm_shop_order.receiptedFlag = #{receiptedFlag}</if>
+            <if test="receiptedType != null  and receiptedType != ''"> and cm_shop_order.receiptedType = #{receiptedType}</if>
+            <if test="costType != null  and costType != ''"> and cm_shop_order.costType = #{costType}</if>
+            <if test="proportional != null "> and cm_shop_order.proportional = #{proportional}</if>
+            <if test="modifyShouldPayNote != null  and modifyShouldPayNote != ''"> and cm_shop_order.modifyShouldPayNote = #{modifyShouldPayNote}</if>
+            <if test="modifyShouldPayUserID != null "> and cm_shop_order.modifyShouldPayUserID = #{modifyShouldPayUserID}</if>
+            <if test="modifyShouldPayDate != null "> and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
+            <if test="zeroCostFlag != null "> and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
+            <if test="differenceType != null  and differenceType != ''"> and cm_shop_order.differenceType = #{differenceType}</if>
+            <if test="differencePrice != null "> and cm_shop_order.differencePrice = #{differencePrice}</if>
+            <if test="svipShopReduction != null "> and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
+            <if test="splitCode != null  and splitCode != ''"> and cm_shop_order.splitCode = #{splitCode}</if>
+            <if test="paySuccessCounter != null "> and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
+            <if test="onlinePayWays != null  and onlinePayWays != ''"> and cm_shop_order.onlinePayWays = #{onlinePayWays}</if>
+            <if test="status != null  and status != ''"> and cm_shop_order.shopStatus = #{status}</if>
+        </where>
+        group by cm_shop_order.shopOrderID
+    </select>
+    <select id="getById" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultType="String">
+        select shopOrderID
+        from cm_shop_order AS cm_shop_order
+        <where>  cm_shop_order.delFlag = 0
+            <if test="shopOrderID != null  and  shopOrderID != ''">
+                and cm_shop_order.shopOrderID
+                = #{shopOrderID}
+            </if>
+            <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
+                <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+                <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+                <foreach item="shopOrderIDIn" collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')" open="(" separator="," close=")">
+                    #{shopOrderIDIn}
+                </foreach>
+            </if>
+            <if test="shopOrderNo != null  and shopOrderNo != ''"> and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
+            <if test="orderNo != null  and orderNo != ''"> and cm_shop_order.orderNo = #{orderNo}</if>
+            <if test="orderID != null "> and cm_shop_order.orderID = #{orderID}</if>
+            <if test="organizeID != null "> and cm_shop_order.organizeID = #{organizeID}</if>
+            <if test="isColdChina != null "> and cm_shop_order.isColdChina = #{isColdChina}</if>
+            <if test="userID != null "> and cm_shop_order.userID = #{userID}</if>
+            <if test="shopID != null "> and cm_shop_order.shopID = #{shopID}</if>
+            <if test="orderPromotionsId != null "> and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
+            <if test="orderType != null "> and cm_shop_order.orderType = #{orderType}</if>
+            <if test="orderSubmitType != null "> and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
+            <if test="presentNum != null "> and cm_shop_order.presentNum = #{presentNum}</if>
+            <if test="itemCount != null "> and cm_shop_order.itemCount = #{itemCount}</if>
+            <if test="outStoreNum != null "> and cm_shop_order.outStoreNum = #{outStoreNum}</if>
+            <if test="outStoreTimes != null "> and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
+            <if test="townID != null "> and cm_shop_order.townID = #{townID}</if>
+            <if test="note != null  and note != ''"> and cm_shop_order.note = #{note}</if>
+            <if test="eachDiscount != null "> and cm_shop_order.eachDiscount = #{eachDiscount}</if>
+            <if test="realPay != null "> and cm_shop_order.realPay = #{realPay}</if>
+            <if test="receiptAmount != null "> and cm_shop_order.receiptAmount = #{receiptAmount}</if>
+            <if test="accountAmount != null "> and cm_shop_order.accountAmount = #{accountAmount}</if>
+            <if test="productAmount != null "> and cm_shop_order.productAmount = #{productAmount}</if>
+            <if test="totalAmount != null "> and cm_shop_order.totalAmount = #{totalAmount}</if>
+            <if test="needPayAmount != null "> and cm_shop_order.needPayAmount = #{needPayAmount}</if>
+            <if test="discountAmount != null "> and cm_shop_order.discountAmount = #{discountAmount}</if>
+            <if test="preferential != null "> and cm_shop_order.preferential = #{preferential}</if>
+            <if test="promotionFullReduction != null "> and cm_shop_order.promotionFullReduction = #{promotionFullReduction}</if>
+            <if test="payFlag != null  and payFlag != ''"> and cm_shop_order.payFlag = #{payFlag}</if>
+            <if test="orderTime != null  and orderTime != ''"> and cm_shop_order.orderTime = #{orderTime}</if>
+            <if test="payTime != null  and payTime != ''"> and cm_shop_order.payTime = #{payTime}</if>
+            <if test="finishTime != null  and finishTime != ''"> and cm_shop_order.finishTime = #{finishTime}</if>
+            <if test="autoOverTimeMills != null "> and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
+            <if test="settleStatus != null  and settleStatus != ''"> and cm_shop_order.settleStatus = #{settleStatus}</if>
+            <if test="payStatus != null  and payStatus != ''"> and cm_shop_order.payStatus = #{payStatus}</if>
+            <if test="receiptStatus != null  and receiptStatus != ''"> and cm_shop_order.receiptStatus = #{receiptStatus}</if>
+            <if test="sendOutStatus != null  and sendOutStatus != ''"> and cm_shop_order.sendOutStatus = #{sendOutStatus}</if>
+            <if test="refundStatus != null "> and cm_shop_order.refundStatus = #{refundStatus}</if>
+            <if test="returnGoodsStatus != null "> and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
+            <if test="receiveGoodsTime != null  and receiveGoodsTime != ''"> and cm_shop_order.receiveGoodsTime = #{receiveGoodsTime}</if>
+            <if test="autoReceiveTimeMills != null "> and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}</if>
+            <if test="totalAddedValueTax != null "> and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
+            <if test="canRefundAmount != null "> and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
+            <if test="refundAmount != null "> and cm_shop_order.refundAmount = #{refundAmount}</if>
+            <if test="clubID != null "> and cm_shop_order.clubID = #{clubID}</if>
+            <if test="spID != null "> and cm_shop_order.spID = #{spID}</if>
+            <if test="mainSpID != null "> and cm_shop_order.mainSpID = #{mainSpID}</if>
+            <if test="orderBeanAmount != null "> and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
+            <if test="useBeanAmount != null "> and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
+            <if test="useBeanFlag != null "> and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
+            <if test="canRefundFlag != null "> and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
+            <if test="useBalanceFlag != null "> and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
+            <if test="canRefundBeans != null "> and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
+            <if test="freePostageFee != null "> and cm_shop_order.freePostageFee = #{freePostageFee}</if>
+            <if test="freePostageTicketID != null "> and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
+            <if test="brokerage != null "> and cm_shop_order.brokerage = #{brokerage}</if>
+            <if test="delFlag != null  and delFlag != ''"> and cm_shop_order.delFlag = #{delFlag}</if>
+            <if test="refundsAmount != null "> and cm_shop_order.refundsAmount = #{refundsAmount}</if>
+            <if test="orderStatusFlag != null  and orderStatusFlag != ''"> and cm_shop_order.orderStatusFlag = #{orderStatusFlag}</if>
+            <if test="buyStatus != null  and buyStatus != ''"> and cm_shop_order.buyStatus = #{buyStatus}</if>
+            <if test="deliveryTimeMills != null  and deliveryTimeMills != ''"> and cm_shop_order.deliveryTimeMills = #{deliveryTimeMills}</if>
+            <if test="orderDeliveryID != null "> and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
+            <if test="splitFlag != null  and splitFlag != ''"> and cm_shop_order.splitFlag = #{splitFlag}</if>
+            <if test="paying != null  and paying != ''"> and cm_shop_order.paying = #{paying}</if>
+            <if test="shopProductAmount != null "> and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
+            <if test="shopPostFee != null "> and cm_shop_order.shopPostFee = #{shopPostFee}</if>
+            <if test="shopPostFlag != null  and shopPostFlag != ''"> and cm_shop_order.shopPostFlag = #{shopPostFlag}</if>
+            <if test="shopTaxFee != null "> and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
+            <if test="payCmAmount != null "> and cm_shop_order.payCmAmount = #{payCmAmount}</if>
+            <if test="shouldPayShopAmount != null "> and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
+            <if test="payedShopAmount != null "> and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
+            <if test="shopOtherFee != null "> and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
+            <if test="receiptedFlag != null  and receiptedFlag != ''"> and cm_shop_order.receiptedFlag = #{receiptedFlag}</if>
+            <if test="receiptedType != null  and receiptedType != ''"> and cm_shop_order.receiptedType = #{receiptedType}</if>
+            <if test="costType != null  and costType != ''"> and cm_shop_order.costType = #{costType}</if>
+            <if test="proportional != null "> and cm_shop_order.proportional = #{proportional}</if>
+            <if test="modifyShouldPayNote != null  and modifyShouldPayNote != ''"> and cm_shop_order.modifyShouldPayNote = #{modifyShouldPayNote}</if>
+            <if test="modifyShouldPayUserID != null "> and cm_shop_order.modifyShouldPayUserID = #{modifyShouldPayUserID}</if>
+            <if test="modifyShouldPayDate != null "> and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
+            <if test="zeroCostFlag != null "> and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
+            <if test="differenceType != null  and differenceType != ''"> and cm_shop_order.differenceType = #{differenceType}</if>
+            <if test="differencePrice != null "> and cm_shop_order.differencePrice = #{differencePrice}</if>
+            <if test="svipShopReduction != null "> and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
+            <if test="splitCode != null  and splitCode != ''"> and cm_shop_order.splitCode = #{splitCode}</if>
+            <if test="paySuccessCounter != null "> and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
+            <if test="onlinePayWays != null  and onlinePayWays != ''"> and cm_shop_order.onlinePayWays = #{onlinePayWays}</if>
+            <if test="status != null  and status != ''"> and cm_shop_order.shopStatus = #{status}</if>
+        </where>
+        group by cm_shop_order.shopOrderID
+        limit 0,1
+    </select>
+
+    <insert id="addCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder" useGeneratedKeys="true" keyProperty="shopOrderID">
+        insert into cm_shop_order
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="shopOrderID != null and shopOrderID != ''">shopOrderID,</if>
+            <if test="shopOrderNo != null and shopOrderNo != ''">shopOrderNo,</if>
+            <if test="orderNo != null and orderNo != ''">orderNo,</if>
+            <if test="orderID != null">orderID,</if>
+            <if test="organizeID != null">organizeID,</if>
+            <if test="isColdChina != null">isColdChina,</if>
+            <if test="userID != null">userID,</if>
+            <if test="shopID != null">shopID,</if>
+            <if test="orderPromotionsId != null">orderPromotionsId,</if>
+            <if test="orderType != null">orderType,</if>
+            <if test="orderSubmitType != null">orderSubmitType,</if>
+            <if test="presentNum != null">presentNum,</if>
+            <if test="itemCount != null">itemCount,</if>
+            <if test="outStoreNum != null">outStoreNum,</if>
+            <if test="outStoreTimes != null">outStoreTimes,</if>
+            <if test="townID != null">townID,</if>
+            <if test="note != null and note != ''">note,</if>
+            <if test="eachDiscount != null">eachDiscount,</if>
+            <if test="realPay != null">realPay,</if>
+            <if test="receiptAmount != null">receiptAmount,</if>
+            <if test="accountAmount != null">accountAmount,</if>
+            <if test="productAmount != null">productAmount,</if>
+            <if test="totalAmount != null">totalAmount,</if>
+            <if test="needPayAmount != null">needPayAmount,</if>
+            <if test="discountAmount != null">discountAmount,</if>
+            <if test="preferential != null">preferential,</if>
+            <if test="promotionFullReduction != null">promotionFullReduction,</if>
+            <if test="payFlag != null and payFlag != ''">payFlag,</if>
+            <if test="orderTime != null and orderTime != ''">orderTime,</if>
+            <if test="payTime != null and payTime != ''">payTime,</if>
+            <if test="finishTime != null and finishTime != ''">finishTime,</if>
+            <if test="autoOverTimeMills != null">autoOverTimeMills,</if>
+            <if test="settleStatus != null and settleStatus != ''">settleStatus,</if>
+            <if test="payStatus != null and payStatus != ''">payStatus,</if>
+            <if test="receiptStatus != null and receiptStatus != ''">receiptStatus,</if>
+            <if test="sendOutStatus != null and sendOutStatus != ''">sendOutStatus,</if>
+            <if test="refundStatus != null">refundStatus,</if>
+            <if test="returnGoodsStatus != null">returnGoodsStatus,</if>
+            <if test="receiveGoodsTime != null and receiveGoodsTime != ''">receiveGoodsTime,</if>
+            <if test="autoReceiveTimeMills != null">autoReceiveTimeMills,</if>
+            <if test="totalAddedValueTax != null">totalAddedValueTax,</if>
+            <if test="canRefundAmount != null">canRefundAmount,</if>
+            <if test="refundAmount != null">refundAmount,</if>
+            <if test="clubID != null">clubID,</if>
+            <if test="spID != null">spID,</if>
+            <if test="mainSpID != null">mainSpID,</if>
+            <if test="orderBeanAmount != null">orderBeanAmount,</if>
+            <if test="useBeanAmount != null">useBeanAmount,</if>
+            <if test="useBeanFlag != null">useBeanFlag,</if>
+            <if test="canRefundFlag != null">canRefundFlag,</if>
+            <if test="useBalanceFlag != null">useBalanceFlag,</if>
+            <if test="canRefundBeans != null">canRefundBeans,</if>
+            <if test="freePostageFee != null">freePostageFee,</if>
+            <if test="freePostageTicketID != null">freePostageTicketID,</if>
+            <if test="brokerage != null">brokerage,</if>
+            <if test="delFlag != null and delFlag != ''">delFlag,</if>
+            <if test="refundsAmount != null">refundsAmount,</if>
+            <if test="orderStatusFlag != null and orderStatusFlag != ''">orderStatusFlag,</if>
+            <if test="buyStatus != null and buyStatus != ''">buyStatus,</if>
+            <if test="deliveryTimeMills != null and deliveryTimeMills != ''">deliveryTimeMills,</if>
+            <if test="orderDeliveryID != null">orderDeliveryID,</if>
+            <if test="splitFlag != null and splitFlag != ''">splitFlag,</if>
+            <if test="paying != null and paying != ''">paying,</if>
+            <if test="shopProductAmount != null">shopProductAmount,</if>
+            <if test="shopPostFee != null">shopPostFee,</if>
+            <if test="shopPostFlag != null and shopPostFlag != ''">shopPostFlag,</if>
+            <if test="shopTaxFee != null">shopTaxFee,</if>
+            <if test="payCmAmount != null">payCmAmount,</if>
+            <if test="shouldPayShopAmount != null">shouldPayShopAmount,</if>
+            <if test="payedShopAmount != null">payedShopAmount,</if>
+            <if test="shopOtherFee != null">shopOtherFee,</if>
+            <if test="receiptedFlag != null and receiptedFlag != ''">receiptedFlag,</if>
+            <if test="receiptedType != null and receiptedType != ''">receiptedType,</if>
+            <if test="costType != null and costType != ''">costType,</if>
+            <if test="proportional != null">proportional,</if>
+            <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">modifyShouldPayNote,</if>
+            <if test="modifyShouldPayUserID != null">modifyShouldPayUserID,</if>
+            <if test="modifyShouldPayDate != null">modifyShouldPayDate,</if>
+            <if test="zeroCostFlag != null">zeroCostFlag,</if>
+            <if test="differenceType != null and differenceType != ''">differenceType,</if>
+            <if test="differencePrice != null">differencePrice,</if>
+            <if test="svipShopReduction != null">svipShopReduction,</if>
+            <if test="splitCode != null and splitCode != ''">splitCode,</if>
+            <if test="paySuccessCounter != null">paySuccessCounter,</if>
+            <if test="onlinePayWays != null and onlinePayWays != ''">onlinePayWays,</if>
+            <if test="status != null and status != ''">shopStatus,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="shopOrderID != null and shopOrderID != ''">#{shopOrderID},</if>
+            <if test="shopOrderNo != null and shopOrderNo != ''">#{shopOrderNo},</if>
+            <if test="orderNo != null and orderNo != ''">#{orderNo},</if>
+            <if test="orderID != null">#{orderID},</if>
+            <if test="organizeID != null">#{organizeID},</if>
+            <if test="isColdChina != null">#{isColdChina},</if>
+            <if test="userID != null">#{userID},</if>
+            <if test="shopID != null">#{shopID},</if>
+            <if test="orderPromotionsId != null">#{orderPromotionsId},</if>
+            <if test="orderType != null">#{orderType},</if>
+            <if test="orderSubmitType != null">#{orderSubmitType},</if>
+            <if test="presentNum != null">#{presentNum},</if>
+            <if test="itemCount != null">#{itemCount},</if>
+            <if test="outStoreNum != null">#{outStoreNum},</if>
+            <if test="outStoreTimes != null">#{outStoreTimes},</if>
+            <if test="townID != null">#{townID},</if>
+            <if test="note != null and note != ''">#{note},</if>
+            <if test="eachDiscount != null">#{eachDiscount},</if>
+            <if test="realPay != null">#{realPay},</if>
+            <if test="receiptAmount != null">#{receiptAmount},</if>
+            <if test="accountAmount != null">#{accountAmount},</if>
+            <if test="productAmount != null">#{productAmount},</if>
+            <if test="totalAmount != null">#{totalAmount},</if>
+            <if test="needPayAmount != null">#{needPayAmount},</if>
+            <if test="discountAmount != null">#{discountAmount},</if>
+            <if test="preferential != null">#{preferential},</if>
+            <if test="promotionFullReduction != null">#{promotionFullReduction},</if>
+            <if test="payFlag != null and payFlag != ''">#{payFlag},</if>
+            <if test="orderTime != null and orderTime != ''">#{orderTime},</if>
+            <if test="payTime != null and payTime != ''">#{payTime},</if>
+            <if test="finishTime != null and finishTime != ''">#{finishTime},</if>
+            <if test="autoOverTimeMills != null">#{autoOverTimeMills},</if>
+            <if test="settleStatus != null and settleStatus != ''">#{settleStatus},</if>
+            <if test="payStatus != null and payStatus != ''">#{payStatus},</if>
+            <if test="receiptStatus != null and receiptStatus != ''">#{receiptStatus},</if>
+            <if test="sendOutStatus != null and sendOutStatus != ''">#{sendOutStatus},</if>
+            <if test="refundStatus != null">#{refundStatus},</if>
+            <if test="returnGoodsStatus != null">#{returnGoodsStatus},</if>
+            <if test="receiveGoodsTime != null and receiveGoodsTime != ''">#{receiveGoodsTime},</if>
+            <if test="autoReceiveTimeMills != null">#{autoReceiveTimeMills},</if>
+            <if test="totalAddedValueTax != null">#{totalAddedValueTax},</if>
+            <if test="canRefundAmount != null">#{canRefundAmount},</if>
+            <if test="refundAmount != null">#{refundAmount},</if>
+            <if test="clubID != null">#{clubID},</if>
+            <if test="spID != null">#{spID},</if>
+            <if test="mainSpID != null">#{mainSpID},</if>
+            <if test="orderBeanAmount != null">#{orderBeanAmount},</if>
+            <if test="useBeanAmount != null">#{useBeanAmount},</if>
+            <if test="useBeanFlag != null">#{useBeanFlag},</if>
+            <if test="canRefundFlag != null">#{canRefundFlag},</if>
+            <if test="useBalanceFlag != null">#{useBalanceFlag},</if>
+            <if test="canRefundBeans != null">#{canRefundBeans},</if>
+            <if test="freePostageFee != null">#{freePostageFee},</if>
+            <if test="freePostageTicketID != null">#{freePostageTicketID},</if>
+            <if test="brokerage != null">#{brokerage},</if>
+            <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
+            <if test="refundsAmount != null">#{refundsAmount},</if>
+            <if test="orderStatusFlag != null and orderStatusFlag != ''">#{orderStatusFlag},</if>
+            <if test="buyStatus != null and buyStatus != ''">#{buyStatus},</if>
+            <if test="deliveryTimeMills != null and deliveryTimeMills != ''">#{deliveryTimeMills},</if>
+            <if test="orderDeliveryID != null">#{orderDeliveryID},</if>
+            <if test="splitFlag != null and splitFlag != ''">#{splitFlag},</if>
+            <if test="paying != null and paying != ''">#{paying},</if>
+            <if test="shopProductAmount != null">#{shopProductAmount},</if>
+            <if test="shopPostFee != null">#{shopPostFee},</if>
+            <if test="shopPostFlag != null and shopPostFlag != ''">#{shopPostFlag},</if>
+            <if test="shopTaxFee != null">#{shopTaxFee},</if>
+            <if test="payCmAmount != null">#{payCmAmount},</if>
+            <if test="shouldPayShopAmount != null">#{shouldPayShopAmount},</if>
+            <if test="payedShopAmount != null">#{payedShopAmount},</if>
+            <if test="shopOtherFee != null">#{shopOtherFee},</if>
+            <if test="receiptedFlag != null and receiptedFlag != ''">#{receiptedFlag},</if>
+            <if test="receiptedType != null and receiptedType != ''">#{receiptedType},</if>
+            <if test="costType != null and costType != ''">#{costType},</if>
+            <if test="proportional != null">#{proportional},</if>
+            <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">#{modifyShouldPayNote},</if>
+            <if test="modifyShouldPayUserID != null">#{modifyShouldPayUserID},</if>
+            <if test="modifyShouldPayDate != null">#{modifyShouldPayDate},</if>
+            <if test="zeroCostFlag != null">#{zeroCostFlag},</if>
+            <if test="differenceType != null and differenceType != ''">#{differenceType},</if>
+            <if test="differencePrice != null">#{differencePrice},</if>
+            <if test="svipShopReduction != null">#{svipShopReduction},</if>
+            <if test="splitCode != null and splitCode != ''">#{splitCode},</if>
+            <if test="paySuccessCounter != null">#{paySuccessCounter},</if>
+            <if test="onlinePayWays != null and onlinePayWays != ''">#{onlinePayWays},</if>
+            <if test="status != null and status != ''">#{status},</if>
+        </trim>
+    </insert>
+
+    <update id="updateCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder">
+        update cm_shop_order
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="shopOrderNo != null and shopOrderNo != ''">shopOrderNo = #{shopOrderNo},</if>
+            <if test="orderNo != null and orderNo != ''">orderNo = #{orderNo},</if>
+            <if test="orderID != null">orderID = #{orderID},</if>
+            <if test="organizeID != null">organizeID = #{organizeID},</if>
+            <if test="isColdChina != null">isColdChina = #{isColdChina},</if>
+            <if test="userID != null">userID = #{userID},</if>
+            <if test="shopID != null">shopID = #{shopID},</if>
+            <if test="orderPromotionsId != null">orderPromotionsId = #{orderPromotionsId},</if>
+            <if test="orderType != null">orderType = #{orderType},</if>
+            <if test="orderSubmitType != null">orderSubmitType = #{orderSubmitType},</if>
+            <if test="presentNum != null">presentNum = #{presentNum},</if>
+            <if test="itemCount != null">itemCount = #{itemCount},</if>
+            <if test="outStoreNum != null">outStoreNum = #{outStoreNum},</if>
+            <if test="outStoreTimes != null">outStoreTimes = #{outStoreTimes},</if>
+            <if test="townID != null">townID = #{townID},</if>
+            <if test="note != null and note != ''">note = #{note},</if>
+            <if test="eachDiscount != null">eachDiscount = #{eachDiscount},</if>
+            <if test="realPay != null">realPay = #{realPay},</if>
+            <if test="receiptAmount != null">receiptAmount = #{receiptAmount},</if>
+            <if test="accountAmount != null">accountAmount = #{accountAmount},</if>
+            <if test="productAmount != null">productAmount = #{productAmount},</if>
+            <if test="totalAmount != null">totalAmount = #{totalAmount},</if>
+            <if test="needPayAmount != null">needPayAmount = #{needPayAmount},</if>
+            <if test="discountAmount != null">discountAmount = #{discountAmount},</if>
+            <if test="preferential != null">preferential = #{preferential},</if>
+            <if test="promotionFullReduction != null">promotionFullReduction = #{promotionFullReduction},</if>
+            <if test="payFlag != null and payFlag != ''">payFlag = #{payFlag},</if>
+            <if test="orderTime != null and orderTime != ''">orderTime = #{orderTime},</if>
+            <if test="payTime != null and payTime != ''">payTime = #{payTime},</if>
+            <if test="finishTime != null and finishTime != ''">finishTime = #{finishTime},</if>
+            <if test="autoOverTimeMills != null">autoOverTimeMills = #{autoOverTimeMills},</if>
+            <if test="settleStatus != null and settleStatus != ''">settleStatus = #{settleStatus},</if>
+            <if test="payStatus != null and payStatus != ''">payStatus = #{payStatus},</if>
+            <if test="receiptStatus != null and receiptStatus != ''">receiptStatus = #{receiptStatus},</if>
+            <if test="sendOutStatus != null and sendOutStatus != ''">sendOutStatus = #{sendOutStatus},</if>
+            <if test="refundStatus != null">refundStatus = #{refundStatus},</if>
+            <if test="returnGoodsStatus != null">returnGoodsStatus = #{returnGoodsStatus},</if>
+            <if test="receiveGoodsTime != null and receiveGoodsTime != ''">receiveGoodsTime = #{receiveGoodsTime},</if>
+            <if test="autoReceiveTimeMills != null">autoReceiveTimeMills = #{autoReceiveTimeMills},</if>
+            <if test="totalAddedValueTax != null">totalAddedValueTax = #{totalAddedValueTax},</if>
+            <if test="canRefundAmount != null">canRefundAmount = #{canRefundAmount},</if>
+            <if test="refundAmount != null">refundAmount = #{refundAmount},</if>
+            <if test="clubID != null">clubID = #{clubID},</if>
+            <if test="spID != null">spID = #{spID},</if>
+            <if test="mainSpID != null">mainSpID = #{mainSpID},</if>
+            <if test="orderBeanAmount != null">orderBeanAmount = #{orderBeanAmount},</if>
+            <if test="useBeanAmount != null">useBeanAmount = #{useBeanAmount},</if>
+            <if test="useBeanFlag != null">useBeanFlag = #{useBeanFlag},</if>
+            <if test="canRefundFlag != null">canRefundFlag = #{canRefundFlag},</if>
+            <if test="useBalanceFlag != null">useBalanceFlag = #{useBalanceFlag},</if>
+            <if test="canRefundBeans != null">canRefundBeans = #{canRefundBeans},</if>
+            <if test="freePostageFee != null">freePostageFee = #{freePostageFee},</if>
+            <if test="freePostageTicketID != null">freePostageTicketID = #{freePostageTicketID},</if>
+            <if test="brokerage != null">brokerage = #{brokerage},</if>
+            <if test="delFlag != null and delFlag != ''">delFlag = #{delFlag},</if>
+            <if test="refundsAmount != null">refundsAmount = #{refundsAmount},</if>
+            <if test="orderStatusFlag != null and orderStatusFlag != ''">orderStatusFlag = #{orderStatusFlag},</if>
+            <if test="buyStatus != null and buyStatus != ''">buyStatus = #{buyStatus},</if>
+            <if test="deliveryTimeMills != null and deliveryTimeMills != ''">deliveryTimeMills = #{deliveryTimeMills},</if>
+            <if test="orderDeliveryID != null">orderDeliveryID = #{orderDeliveryID},</if>
+            <if test="splitFlag != null and splitFlag != ''">splitFlag = #{splitFlag},</if>
+            <if test="paying != null and paying != ''">paying = #{paying},</if>
+            <if test="shopProductAmount != null">shopProductAmount = #{shopProductAmount},</if>
+            <if test="shopPostFee != null">shopPostFee = #{shopPostFee},</if>
+            <if test="shopPostFlag != null and shopPostFlag != ''">shopPostFlag = #{shopPostFlag},</if>
+            <if test="shopTaxFee != null">shopTaxFee = #{shopTaxFee},</if>
+            <if test="payCmAmount != null">payCmAmount = #{payCmAmount},</if>
+            <if test="shouldPayShopAmount != null">shouldPayShopAmount = #{shouldPayShopAmount},</if>
+            <if test="payedShopAmount != null">payedShopAmount = #{payedShopAmount},</if>
+            <if test="shopOtherFee != null">shopOtherFee = #{shopOtherFee},</if>
+            <if test="receiptedFlag != null and receiptedFlag != ''">receiptedFlag = #{receiptedFlag},</if>
+            <if test="receiptedType != null and receiptedType != ''">receiptedType = #{receiptedType},</if>
+            <if test="costType != null and costType != ''">costType = #{costType},</if>
+            <if test="proportional != null">proportional = #{proportional},</if>
+            <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">modifyShouldPayNote = #{modifyShouldPayNote},</if>
+            <if test="modifyShouldPayUserID != null">modifyShouldPayUserID = #{modifyShouldPayUserID},</if>
+            <if test="modifyShouldPayDate != null">modifyShouldPayDate = #{modifyShouldPayDate},</if>
+            <if test="zeroCostFlag != null">zeroCostFlag = #{zeroCostFlag},</if>
+            <if test="differenceType != null and differenceType != ''">differenceType = #{differenceType},</if>
+            <if test="differencePrice != null">differencePrice = #{differencePrice},</if>
+            <if test="svipShopReduction != null">svipShopReduction = #{svipShopReduction},</if>
+            <if test="splitCode != null and splitCode != ''">splitCode = #{splitCode},</if>
+            <if test="paySuccessCounter != null">paySuccessCounter = #{paySuccessCounter},</if>
+            <if test="onlinePayWays != null and onlinePayWays != ''">onlinePayWays = #{onlinePayWays},</if>
+            <if test="status != null and status != ''">shopStatus = #{status},</if>
+        </trim>
+        where shopOrderID = #{shopOrderID}
+    </update>
+
+    <update id="updateDelCmShopOrderByShopOrderIDs" parameterType="String">
+        update cm_shop_order set delFlag=#{delFlag} where shopOrderID in
+        <foreach item="shopOrderID" collection="shopOrderIDs" open="(" separator="," close=")">
+            #{shopOrderID}
+        </foreach>
+    </update>
+
+    <delete id="delCmShopOrderByShopOrderID" parameterType="String">
+        delete
+        from cm_shop_order where shopOrderID = #{shopOrderID}
+    </delete>
+
+    <delete id="delCmShopOrderByShopOrderIDs" parameterType="String">
+        delete from cm_shop_order where shopOrderID in
+        <foreach item="shopOrderID" collection="shopOrderIDs" open="(" separator="," close=")">
+            #{shopOrderID}
+        </foreach>
+    </delete>
 </mapper>

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

@@ -2080,8 +2080,11 @@
                cs.unit,
                cs.stock,
                cs.costCheckFlag,
-               cs.shopPercent,
                cs.costPrice,
+               ifnull(cs.shopPercent, 0) as shopPercent,
+               ifnull(cs.organizePercent, 0) as organizePercent,
+               ifnull(cs.cmPercent, 0) as cmPercent,
+               ifnull(cs.costCheckFlag, 0)    as costType,
                chs.price
         from cm_sku cs
                  left join cm_hehe_sku chs on cs.skuId = chs.skuId

+ 21 - 0
src/main/resources/mappings/modules/user/NewCmShopMapper.xml

@@ -54,6 +54,9 @@
 		a.rebateAmount AS "rebateAmount",
 		a.bankAccountName AS "bankAccountName",
 		a.bankName AS "bankName",
+        a.cmBankAccount AS "cmBankAccount",
+		a.cmBankAccountName AS "cmBankAccountName",
+		a.cmBankName AS "cmBankName",
         a.AccountOwnership as AccountOwnership,
 		a.socialCreditCode AS "socialCreditCode",
 		u.email,
@@ -389,6 +392,16 @@
             <if test="bankName != null">
                 bankName=#{bankName},
             </if>
+            <if test="cmBankName != null">
+                cmBankName=#{cmBankName},
+            </if>
+            <if test="cmBankAccountName != null">
+                cmBankAccountName=#{cmBankAccountName},
+            </if>
+            <if test="cmBankAccount != null">
+                cmBankAccount=#{cmBankAccount},
+            </if>
+
             <if test="socialCreditCode != null">
                 socialCreditCode = #{socialCreditCode}
             </if>
@@ -575,6 +588,10 @@
         <result property="bankAccount"    column="bankAccount"    />
         <result property="bankAccountName"    column="bankAccountName"    />
         <result property="bankName"    column="bankName"    />
+        <result property="cmBankName"    column="cmBankName"    />
+        <result property="cmBankAccountName"    column="cmBankAccountName"    />
+        <result property="cmBankAccount"    column="cmBankAccount"    />
+
         <result property="checkMan"    column="checkMan"    />
         <result property="ableRebateAmount"    column="ableRebateAmount"    />
         <result property="website"    column="website"    />
@@ -635,7 +652,11 @@
             <if test="medicalPracticeLicenseImg3 != null and medicalPracticeLicenseImg3 != ''">medicalPracticeLicenseImg3 = #{medicalPracticeLicenseImg3},</if>
             <if test="bankAccount != null and bankAccount != ''">bankAccount = #{bankAccount},</if>
             <if test="bankAccountName != null and bankAccountName != ''">bankAccountName = #{bankAccountName},</if>
+            <if test="cmBankName != null and cmBankName != ''">cmBankName = #{cmBankName},</if>
+            <if test="cmBankAccountName != null and cmBankAccountName != ''">cmBankAccountName = #{cmBankAccountName},</if>
+            <if test="cmBankAccount != null and cmBankAccount != ''">cmBankAccount = #{cmBankAccount},</if>
             <if test="bankName != null and bankName != ''">bankName = #{bankName},</if>
+
             <if test="checkMan != null and checkMan != ''">checkMan = #{checkMan},</if>
             <if test="ableRebateAmount != null">ableRebateAmount = #{ableRebateAmount},</if>
             <if test="website != null and website != ''">website = #{website},</if>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderConfirmReturnRecord.jsp

@@ -125,7 +125,7 @@
 </ul>
 <br/>
 <div class="refund-btn-top">
-    <input type="button" class="btn btn-primary" onclick="window.location.href='${ctx}/order/cmReturnedPurchase/'"
+    <input type="button" class="btn btn-primary" onclick="window.history.go(-1)"
            value="返回">
     <input type="button" class="btn btn-primary print-now" value="打印">
 </div>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/bulkpurchase/refundRecord.jsp

@@ -104,7 +104,7 @@
         </c:if>
     </c:if>
     <c:if test="${from eq '2'}">
-        <li><a href="${ctx}/order/detail?id=${orderID}">订单详情</a></li>
+        <li><a href="${ctx}${orderType == 2 ?'/hehe/new':''}/order/detail?id=${orderID}">订单详情</a></li>
     </c:if>
     <c:if test="${from eq '3'}">
         <li><a href="${ctx}/shopOrder/checkPaymentOrder">订单财务信息</a></li>

+ 9 - 9
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheProductForm.jsp

@@ -297,17 +297,18 @@
            class="form-horizontal">
 <form:hidden path="id"/>
 <form:hidden path="productId" id="productId"/>
+<form:hidden path="isNewRecord" id="isNewRecord"/>
 <sys:message content="${message}"/>
     <%--        <form:hidden path="floorIds"/>--%>
 <div class="control-group">
     <label class="control-label"><font color="red">*</font>商品:</label>
     <div class="controls" id="addProduct">
-        <a href="JavaScript:;" onclick="showSelect()">请选择加入呵呵商城的商品</a>
+        <a href="JavaScript:;" onclick="showSelect()">请选择加入颜选美学商城的商品</a>
     </div>
     <table id="contentTable" class="table table-striped table-bordered table-condensed" hidden="hidden">
         <thead>
         <tr>
-            <th>图片</th>
+            <th style="text-align:right">图片</th>
             <th>商品名称</th>
             <th>供应商</th>
             <th>操作</th>
@@ -315,7 +316,7 @@
         </thead>
         <tbody>
         <tr>
-            <td><img id="mainImage" src="${cmHeheProduct.mainImage}" width="50px" height="50px"></td>
+            <td style="text-align:right"><img id="mainImage" src="${cmHeheProduct.mainImage}" width="50px" height="50px"></td>
             <td style="text-align: center" id="name">${cmHeheProduct.name}</td>
             <td id="shopName">${cmHeheProduct.shopName}</td>
             <td><a href="javascript:void(0);" onclick="deleteProduct()">删除</a></td>
@@ -333,7 +334,7 @@
             <c:forEach items="${cmHeheProduct.skus}" var="sku" varStatus="index">
                 <div>
                     <input type="number" style="display:none" value="${sku.skuId}" name="skus[${index.index}].skuId">
-                    <label class="control-label" style="text-align:left">
+                    <label class="control-label" style="text-align:right">
                         <font color="red">*</font>规格:${sku.unit}
                     </label>
                     <div class="controls">
@@ -347,7 +348,7 @@
                             <label><font color="red">*</font>成本价:${sku.costPrice}</label>
                         </c:if>
                         <c:if test="${sku.costCheckFlag eq 2}">
-                            <label><font color="red">*</font>成本比例百分比:${sku.shopPercent}%</label>
+                            <label><font color="red">*</font>比例:供应商${sku.shopPercent}%,集团${sku.organizePercent}%,采美${sku.cmPercent}%</label>
                         </c:if>
                     </div>
                 </div>
@@ -501,11 +502,10 @@
 
                             for (let i = 0; i < skus.length; i++) {
                                 var unit=i+1;
-                                var cost = skus[i].costCheckFlag == 1 ? '固定成本' : '比例成本';
-                                var costShow = skus[i].costCheckFlag == 1 ? '<label><font color="red">*</font>成本价:' + skus[i].costPrice + '</label>' : '<label><font color="red">*</font>成本比例百分比:' + skus[i].shopPercent + '%</label>';
+                                var cost = skus[i].costCheckFlag == 1 ? '固定成本' : '比例成本' ;
+                                var costShow = skus[i].costCheckFlag == 1 ? '<label><font color="red">*</font>成本价:' + skus[i].costPrice + '</label>' : '<label><font color="red">*</font>比例:供应商' + skus[i].shopPercent + '%,集团' + skus[i].organizePercent + '%,采美' + skus[i].cmPercent + '%</label>';
                                 html += '<div><input type="number" style="display:none" value="' + skus[i].skuId + '" name="skus[' + i + '].skuId">';
-                                html += '<label class="control-label"><font color="red">*</font>规格:规格' + unit;
-                                html += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>';
+                                html += '<label class="control-label" style="text-align:right"><font color="red">*</font>规格:' + skus[i].unit+'</label>';
                                 html += '<div class="controls"><font color="red">*</font>售价:';
                                 html += '<input type="number" style="width:100px;" min="0" id="price" name="skus[' + i + '].price" value="' + skus[i].price + '" required onblur="checkPrice(this)">';
                                 html += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';

+ 4 - 4
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheProductList.jsp

@@ -10,7 +10,7 @@
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
-			
+
 		});
 		function page(n,s){
 			$("#pageNo").val(n);
@@ -70,7 +70,7 @@
 				<th>商品名称</th>
 				<th>供应商名称</th>
 				<th>售价</th>
-				<th>成本价</th>
+				<th>成本价/比例</th>
 				<th>是否含税</th>
 				<th>商品状态</th>
 				<th>添加时间</th>
@@ -96,7 +96,7 @@
 						${cmHeheProduct.price}
 				</td>
 				<td>
-						${cmHeheProduct.costPrice}
+						${cmHeheProduct.costType eq 1?cmHeheProduct.costPrice:cmHeheProduct.shopPercent}${cmHeheProduct.costType eq 1?'':'%'}
 				</td>
 				<td>
 					${cmHeheProduct.includedTax eq 0 ? "不含税" : "含税"}-
@@ -158,4 +158,4 @@
 	}
 </script>
 </body>
-</html>
+</html>

+ 253 - 220
src/main/webapp/WEB-INF/views/modules/hehe/heheNewOrderDetail.jsp

@@ -250,14 +250,14 @@
             background: #fff;
             width: 125px;
             position: absolute;
-            left: 35px;
-            top: 30px;
+            left: 826px;
+            top: 5px;
             padding: 10px;
             border: 1px solid #666;
             -webkit-border-radius: 5px;
             -moz-border-radius: 5px;
             border-radius: 5px;
-            z-index: 999;
+            z-index: 100001;
             display: none
         }
 
@@ -391,7 +391,7 @@
     <tr>
         <td>下单时间: ${order.orderTime}</td>
         <td>订单号(ID): ${order.orderNo}(${order.orderID})</td>
-        <td>返佣订单: ${(order.rebateOrder ne '0' || order.rebateFlag eq '1')?'是':'否'}</td>
+<%--        <td>返佣订单: ${(order.rebateOrder ne '0' || order.rebateFlag eq '1')?'是':'否'}</td>--%>
     </tr>
     <tr>
         <td>订单类型: ${order.collageFlag eq 1?'拼团订单':'独立订单'}</td>
@@ -526,15 +526,15 @@
         <td>
             应收金额:<fmt:formatNumber value="${order.payableAmount}" type="currency"/>
             <span style="color: red">
-                <c:if test="${order.balancePayFee gt 0}">
-                    <a href="${ctx}/user/cmUserBalanceRecord/userBalanceRecord?userId=${order.userID}"
-                       style="color: red;text-decoration: underline">
-                        (账户余额抵扣: <fmt:formatNumber value="${order.balancePayFee}" type="currency"/>)
-                    </a>
-                </c:if>
-                <c:if test="${order.balancePayFee le 0}">
-                    (账户余额抵扣: <fmt:formatNumber value="${order.balancePayFee}" type="currency"/>)
-                </c:if>
+<%--                <c:if test="${order.balancePayFee gt 0}">--%>
+<%--                    <a href="${ctx}/user/cmUserBalanceRecord/userBalanceRecord?userId=${order.userID}"--%>
+<%--                       style="color: red;text-decoration: underline">--%>
+<%--                        (账户余额抵扣: <fmt:formatNumber value="${order.balancePayFee}" type="currency"/>)--%>
+<%--                    </a>--%>
+<%--                </c:if>--%>
+<%--                <c:if test="${order.balancePayFee le 0}">--%>
+<%--                    (账户余额抵扣: <fmt:formatNumber value="${order.balancePayFee}" type="currency"/>)--%>
+<%--                </c:if>--%>
 
 
             </span>
@@ -552,68 +552,68 @@
         </td>
         <td>
             退款金额(已完成):<fmt:formatNumber value="${returnValue}" type="currency"/>
-            <span style="color: red">
-                    (原<fmt:formatNumber value="${returnedPurchaseFee}" type="currency"/>,折扣取消
-                    <c:if test="${order.discountFee gt returnedPurchaseFee}"><fmt:formatNumber
-                            value="${returnedPurchaseFee}" type="currency"/></c:if>
-                    <c:if test="${order.discountFee le returnedPurchaseFee}"><fmt:formatNumber
-                            value="${order.discountFee}" type="currency"/></c:if>)
-                </span>
+<%--            <span style="color: red">--%>
+<%--                    (原<fmt:formatNumber value="${returnedPurchaseFee}" type="currency"/>,折扣取消--%>
+<%--                    <c:if test="${order.discountFee gt returnedPurchaseFee}"><fmt:formatNumber--%>
+<%--                            value="${returnedPurchaseFee}" type="currency"/></c:if>--%>
+<%--                    <c:if test="${order.discountFee le returnedPurchaseFee}"><fmt:formatNumber--%>
+<%--                            value="${order.discountFee}" type="currency"/></c:if>)--%>
+<%--                </span>--%>
         </td>
     </tr>
     <tr>
-        <td>
-            经理折扣:
-            <c:if test="${order.discountFee gt 0}">
-                <c:if test="${order.discountFee gt returnedPurchaseFee}">
-                    <fmt:formatNumber value="${order.discountFee - returnedPurchaseFee}" type="currency"/>
-                </c:if>
-                <c:if test="${order.discountFee le returnedPurchaseFee}">
-                    ¥0.00
-                </c:if>
-                <span style="color: red">
-                        (原<fmt:formatNumber value="${order.discountFee}" type="currency"/>,折扣取消
-                        <c:if test="${order.discountFee gt returnedPurchaseFee}">
-                            <fmt:formatNumber value="${returnedPurchaseFee}" type="currency"/>
-                        </c:if>
-                        <c:if test="${order.discountFee le returnedPurchaseFee}">
-                            <fmt:formatNumber value="${order.discountFee}" type="currency"/>
-                        </c:if>)
-                    </span>
-            </c:if>
-            <c:if test="${order.discountFee le 0}">¥0.00</c:if>
-        </td>
-        <td>运费:
-            <c:if test="${order.freight == 0}">
-                包邮
-            </c:if>
-            <c:if test="${order.freight == -1}">
-                到付
-            </c:if>
-            <c:if test="${order.freight == -2}">
-                仪器到付-产品包邮
-            </c:if>
-            <c:if test="${order.freight != -1 && order.freight != 0 && order.freight != -2}">
-                <fmt:formatNumber value="${order.freight}" type="currency"/>
-            </c:if>
-        </td>
-        <td style="position: relative;"><a class="operation-btn btn">功能</a>
-            <div class="operation-block">
-                <shiro:hasPermission name="order:order:edit">
-                    <%--包含订单充值商品就不显示--%>
-                    <c:if test="${order.rechargeGoods ne 1 and order.rechargeGoods ne 2}">
-                        <c:if test="${order.status == 11 || order.status == 12 || order.status == 21 || order.status == 22 || order.status == 31 || order.status == 32}">
-                            <a href="${ctx}/order/toDeliveryPage?id=${order.orderID}">发货</a>
-                        </c:if>
-                        <c:if test="${order.receiptStatus == 2 && order.status != 6 && order.status != 7}">
-                            <a href="javascript:void(0);" onclick="collection(${order.orderID})">抹平收款</a>
-                        </c:if>
-                    </c:if>
-                    <c:if test="${(order.organizeID == 0 or order.organizeID > 2) && order.status == 11 && order.payStatus == 1}">
-                        <a href="javascript:void(0);"
-                           onclick="modelShow('${order.orderID}')">编辑经理折扣</a>
-                    </c:if>
-                </shiro:hasPermission>
+<%--        <td>--%>
+<%--            经理折扣:--%>
+<%--            <c:if test="${order.discountFee gt 0}">--%>
+<%--                <c:if test="${order.discountFee gt returnedPurchaseFee}">--%>
+<%--                    <fmt:formatNumber value="${order.discountFee - returnedPurchaseFee}" type="currency"/>--%>
+<%--                </c:if>--%>
+<%--                <c:if test="${order.discountFee le returnedPurchaseFee}">--%>
+<%--                    ¥0.00--%>
+<%--                </c:if>--%>
+<%--                <span style="color: red">--%>
+<%--                        (原<fmt:formatNumber value="${order.discountFee}" type="currency"/>,折扣取消--%>
+<%--                        <c:if test="${order.discountFee gt returnedPurchaseFee}">--%>
+<%--                            <fmt:formatNumber value="${returnedPurchaseFee}" type="currency"/>--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${order.discountFee le returnedPurchaseFee}">--%>
+<%--                            <fmt:formatNumber value="${order.discountFee}" type="currency"/>--%>
+<%--                        </c:if>)--%>
+<%--                    </span>--%>
+<%--            </c:if>--%>
+<%--            <c:if test="${order.discountFee le 0}">¥0.00</c:if>--%>
+<%--        </td>--%>
+<%--        <td>运费:--%>
+<%--            <c:if test="${order.freight == 0}">--%>
+<%--                包邮--%>
+<%--            </c:if>--%>
+<%--            <c:if test="${order.freight == -1}">--%>
+<%--                到付--%>
+<%--            </c:if>--%>
+<%--            <c:if test="${order.freight == -2}">--%>
+<%--                仪器到付-产品包邮--%>
+<%--            </c:if>--%>
+<%--            <c:if test="${order.freight != -1 && order.freight != 0 && order.freight != -2}">--%>
+<%--                <fmt:formatNumber value="${order.freight}" type="currency"/>--%>
+<%--            </c:if>--%>
+<%--        </td>--%>
+<%--        <td style="position: relative;"><a class="operation-btn btn">功能</a>--%>
+<%--            <div class="operation-block">--%>
+<%--                <shiro:hasPermission name="order:order:edit">--%>
+<%--                    &lt;%&ndash;包含订单充值商品就不显示&ndash;%&gt;--%>
+<%--                    <c:if test="${order.rechargeGoods ne 1 and order.rechargeGoods ne 2}">--%>
+<%--                        <c:if test="${order.status == 11 || order.status == 12 || order.status == 21 || order.status == 22 || order.status == 31 || order.status == 32}">--%>
+<%--                            <a href="${ctx}/order/toDeliveryPage?id=${order.orderID}">发货</a>--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${order.receiptStatus == 2 && order.status != 6 && order.status != 7}">--%>
+<%--                            <a href="javascript:void(0);" onclick="collection(${order.orderID})">抹平收款</a>--%>
+<%--                        </c:if>--%>
+<%--                    </c:if>--%>
+<%--                    <c:if test="${(order.organizeID == 0 or order.organizeID > 2) && order.status == 11 && order.payStatus == 1}">--%>
+<%--                        <a href="javascript:void(0);"--%>
+<%--                           onclick="modelShow('${order.orderID}')">编辑经理折扣</a>--%>
+<%--                    </c:if>--%>
+<%--                </shiro:hasPermission>--%>
 <%--                <shiro:hasPermission name="order:order:applyrefound">--%>
 <%--                    <c:if test="${order.status == 12 || order.status == 13 || order.status == 21 || order.status == 22 || order.status == 23 || order.status == 31 || order.status == 32 || order.status == 33 || order.status == 4 || order.status == 5}">--%>
 <%--                        &lt;%&ndash;  返佣订单不能申请退款(退货) &ndash;%&gt;--%>
@@ -640,29 +640,29 @@
 <%--                    </c:if>--%>
 <%--                </shiro:hasPermission>--%>
 
-                <shiro:hasPermission name="order:order:edit">
-                    <c:if test="${order.status ne 0}">
-                        <a href="${ctx}/order/printOrder?orderID=${order.orderID}">打印发货单</a>
-                    </c:if>
-                    <a href="${ctx}/order/exportOrder?id=${order.orderID}">订单导出</a>
-                    <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2&orderType=2">订单备注</a>
-                    <%--包含订单充值商品就不显示--%>
-                    <c:if test="${empty order.rechargeGoods}">
-                        <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6 && order.status ne 4}">
-                            <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}">发货记录</a>
-                        </c:if>
-                        <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 6}">
-                            <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${order.orderID}&from=2">收退款记录
-                            </a>
-                        </c:if>
-                        <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 6}">
-                            <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByOrderID.rpc?orderID=${order.orderID}">退款(退货)记录
-                            </a>
-                        </c:if>
-                    </c:if>
-                </shiro:hasPermission>
-            </div>
-        </td>
+<%--                <shiro:hasPermission name="order:order:edit">--%>
+<%--                    <c:if test="${order.status ne 0}">--%>
+<%--                        <a href="${ctx}/order/printOrder?orderID=${order.orderID}">打印发货单</a>--%>
+<%--                    </c:if>--%>
+<%--                    <a href="${ctx}/order/exportOrder?id=${order.orderID}">订单导出</a>--%>
+<%--                    <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2&orderType=2">订单备注</a>--%>
+<%--                    &lt;%&ndash;包含订单充值商品就不显示&ndash;%&gt;--%>
+<%--                    <c:if test="${empty order.rechargeGoods}">--%>
+<%--                        <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6 && order.status ne 4}">--%>
+<%--                            <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}">发货记录</a>--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 6}">--%>
+<%--                            <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${order.orderID}&from=2">收退款记录--%>
+<%--                            </a>--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 6}">--%>
+<%--                            <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByOrderID.rpc?orderID=${order.orderID}">退款(退货)记录--%>
+<%--                            </a>--%>
+<%--                        </c:if>--%>
+<%--                    </c:if>--%>
+<%--                </shiro:hasPermission>--%>
+<%--            </div>--%>
+<%--        </td>--%>
     </tr>
     <tr>
         <td>拼团状态:
@@ -699,124 +699,149 @@
     <div class="order-rows">
         <span><label>下单时间:</label>${order.orderTime}</span>
         <span><label>子订单号(ID):</label>${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})</span>
-        <span><label>子订单金额:</label><fmt:formatNumber value="${shopOrder.realPay}" type="currency"/></span>
-        <c:if test="${shopOrder.postFeeCos eq '0'}">
-            <div class="print-wrapper">
-                <a href="${ctx}/order/printOrder?shopOrderID=${shopOrder.shopOrderID}">打印</a>
-                <a href="${ctx}/order/exportSubOrder?shopOrderID=${shopOrder.shopOrderID}">导出</a>
-                <c:if test="${order.status ne '0'}">
-                    <a onclick="copyText('${shopOrder.shopOrderID}')" style="cursor:pointer;">供应商订单二维码</a>
-                </c:if>
-                <c:if test="${shopOrder.orderArchiveId ne null}">
-                    <a href="${ctx}/archive/cmOrderArchive/form?id=${shopOrder.orderArchiveId}">查看订单资料</a>
-                </c:if>
-                <c:if test="${order.onlinePayFlag eq 0}">
-                    <c:if test="${order.status == 12 || order.status == 13 || order.status == 21 || order.status == 22 || order.status == 23 || order.status == 31 || order.status == 32 || order.status == 33 || order.status == 4 || order.status == 5}">
-                        <%--  返佣订单不能申请退款(退货) --%>
-                        <c:if test="${order.rebateOrder == '0'}">
-                            <c:if test="${order.toAudit eq 1}">
-                                <%--如果存在审核收款则不允许申请:1不能申请,其它可以申请--%>
-                                <c:if test="${order.toAudit eq 1}">
-                                    <%--弹窗提示--%>
-                                    <a href="#" onclick="return alertx('订单存在未审核的收款,暂不能退款。请将收款审核通过后再操作退款。')">申请退款</a>
-                                </c:if>
-                            </c:if>
-                            <c:if test="${order.toAudit ne 1}">
-                                <c:if test="${order.applyReturnedPurchaseFlag eq 1}">
-                                    <a href="${ctx}/bulkpurchase/cmRefundsProduct/applyRefound.rpc?orderID=${order.orderID}&onlineShopOrderId=${shopOrder.shopOrderID}&refundType=1"
-                                       <c:if test="${order.status == 21 || order.status == 22 || order.status == 23}">onclick="return confirmx('部分收款的订单、申请退款只能申请全部退款!', this.href)"
-                                    </c:if>
-                                    >申请退款</a>
-                                </c:if>
-                                <c:if test="${order.applyReturnedPurchaseFlag ne 1}">
-                                    <font title="存在未处理完的申请,请前往退款列表处理!">申请退款</font>
-                                </c:if>
-                            </c:if>
+        <span><label>子订单金额:</label><fmt:formatNumber
+                value="${order.onlinePayFlag eq 0?shopOrder.realPay:shopOrder.needPayAmount}" type="currency"/></span>
+        <td style="position: relative;"><a class="operation-btn btn"
+                                           onclick="operation(${shopOrder.shopOrderID})">功能</a>
+            <div style="position: relative;">
+                <div class="operation-block ${shopOrder.shopOrderID}">
+                    <shiro:hasPermission name="order:order:edit">
+                        <%--包含订单充值商品就不显示--%>
+                        <c:if test="${shopOrder.status == 0}">
+                            <a href="${ctx}/order/confirmOrder?orderID=${order.orderID}&shopOrderID=${shopOrder.shopOrderID}&orderType=2"
+                               onclick="return confirmx('是否确认订单?', this.href)">确认订单</a>
                         </c:if>
-                    </c:if>
-                </c:if>
+                    </shiro:hasPermission>
+
+
+                    <shiro:hasPermission name="order:order:edit">
+                        <%--包含订单充值商品就不显示--%>
+                        <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}&shopOrderID=${shopOrder.shopOrderID}&orderType=2">发货记录</a>
+                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${order.orderID}&shopOrderID=${shopOrder.shopOrderID}&from=2&orderType=2">收付款记录</a>
+                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByOrderID.rpc?orderID=${order.orderID}&shopOrderID=${shopOrder.shopOrderID}&orderType=2">退款(退货)记录</a>
+                        <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2&shopOrderID=${shopOrder.shopOrderID}&orderType=2">订单备注</a>
+                    </shiro:hasPermission>
+                </div>
             </div>
-        </c:if>
-        <c:if test="${order.onlinePayFlag eq 0}">
-            <br/>
-            <span><label>商品总额:</label><fmt:formatNumber value="${shopOrder.needPayAmount}" type="currency"/></span>
-            <span><label>优惠:</label><fmt:formatNumber value="${shopOrder.eachDiscount}" type="currency"/></span>
-            <span><label>应付金额:</label><fmt:formatNumber value="${shopOrder.realPay}" type="currency"/></span>
-            <span><label>已付金额:</label><fmt:formatNumber value="${shopOrder.receiptAmount}" type="currency"/></span>
-            <span><label>待付金额:</label><fmt:formatNumber value="${shopOrder.restAmount}" type="currency"/></span>
-            <br/>
-            <span><label>收款状态:</label>
-                    <c:if test="${shopOrder.shopReceiptStatus == 1}">
-                        <font color="red">待收款</font>
-                    </c:if>
-                    <c:if test="${shopOrder.shopReceiptStatus == 2}">
-                        <font color="#ff8c00">部分收款</font>
-                    </c:if>
-                    <c:if test="${shopOrder.shopReceiptStatus == 3}">
-                        <font color="green">已收款</font>
-                    </c:if>
-            </span>
-            <span><label>付款状态:</label>
-                    <c:if test="${shopOrder.payStatus == 1}">
-                        <font color="red">待付款</font>
-                    </c:if>
-                    <c:if test="${shopOrder.payStatus == 2}">
-                        <font color="#ff8c00">部分付款</font>
-                    </c:if>
-                    <c:if test="${shopOrder.payStatus == 3}">
-                        <font color="green">已付款</font>
-                    </c:if>
+        </td>
+        </tr>
+        <span>商品总额:<fmt:formatNumber value="${shopOrder.needPayAmount}" type="currency"/></span>
+        <span>运费:
+                    ${shopOrder.postageInfo}
             </span>
-            <span><label>发货状态:</label>
-                    <c:if test="${shopOrder.sendOutStatus == 1}">
-                        <font color="red">待发货</font>
-                    </c:if>
-                    <c:if test="${shopOrder.sendOutStatus == 2}">
-                        <font color="#ff8c00">部分发货</font>
-                    </c:if>
-                    <c:if test="${shopOrder.sendOutStatus == 3}">
-                        <font color="green">已发货</font>
-                    </c:if>
+        <span>子订单总额:<fmt:formatNumber value="${shopOrder.totalAmount}" type="currency"/></span>
+            <%--        <span>优惠:<fmt:formatNumber value="${shopOrder.eachDiscount}" type="currency"/></span>--%>
+        <span>应收金额:
+            <c:if test="${shopOrder.realPay!=null}"><fmt:formatNumber value="${shopOrder.realPay}"
+                                                                      type="currency"/></c:if>
+            <c:if test="${shopOrder.realPay==null}"><fmt:formatNumber value="${shopOrder.needPayAmount}"
+                                                                      type="currency"/></c:if>
+        </span>
+        <span>
+                已收金额:<fmt:formatNumber value="${shopOrder.receiptAmount}" type="currency"/>
+                <c:if test="${shopOrder.useBalanceFlag eq 1 and shopOrder.accountAmount ne null}">(余额抵扣¥${shopOrder.accountAmount})</c:if>
+<%--                <c:if test="${order.organizeID != 4&&shopOrder.commercialCode eq 'E1807059160' && (order.receiptStatus == 2 || order.receiptStatus == 3)}">--%>
+<%--                    <font color="red">(采美信息线上收款)</font>--%>
+<%--                </c:if>--%>
+
             </span>
-            <c:if test="${not empty shopOrder.note}">
-                <span>留言:${shopOrder.note}</span>
-            </c:if>
-        </c:if>
-        <c:if test="${order.onlinePayFlag eq 1}">
-            <c:if test="${shopOrder.postFeeCos eq '0'}">
-                <c:if test="${order.status ne 0 && order.status ne 11}">
-                    <div class="delivery-wrapper">
-                            <span>发货状态:
-                                <c:if test="${shopOrder.sendOutStatus == 1}">
-                                    <font color="red">待发货</font>
-                                </c:if>
-                                <c:if test="${shopOrder.sendOutStatus == 2}">
-                                    <font color="#ff8c00">部分发货</font>
+        <span>待收金额:<fmt:formatNumber value="${shopOrder.restAmount}" type="currency"/></span>
+        <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 ||
+				shopOrder.status eq 23 || shopOrder.status eq 31 ||shopOrder.status eq 32 ||shopOrder.status eq 33}">
+     交易中
+ </c:if>
+<%--            <c:if test="${shopOrder.status eq 0 || shopOrder.status eq 4 || shopOrder.status eq 5 || shopOrder.status eq 6 || shopOrder.status eq 7}">--%>
+<%--                ${fns:getDictLabel(shopOrder.status,"order_status","" )}--%>
+<%--                <c:if test="${shopOrder.status eq 0}">--%>
+<%--                    <span id="time" style="color: red"></span>--%>
+<%--                </c:if>--%>
+<%--                <c:if test="${shopOrder.status eq 6}">--%>
+<%--                    <font color="red">(--%>
+<%--                            <c:if test="${shopOrder.closeTime ne null}">--%>
+<%--                                ${shopOrder.closeTime}--%>
+<%--                            </c:if>--%>
+<%--                            <c:if test="${shopOrder.closeReason ne null}">--%>
+<%--                                , ${shopOrder.closeReason}--%>
+<%--                            </c:if>--%>
+<%--                    )</font>--%>
+<%--                </c:if>--%>
+<%--            </c:if>--%>
+<%--            订单状态 0:待确认 1:已确认 2:交易完成 3:订单完成 4:已关闭 5:交易全退--%>
+                            <c:if test="${shopOrder.status == 0}">
+                                <font color="red">待确认</font>
+                            </c:if>
+                            <c:if test="${shopOrder.status == 1}">
+                                <font color="red">已确认</font>
+                            </c:if>
+                            <c:if test="${shopOrder.status == 2}">
+                                <font color="red">交易完成</font>
+                            </c:if>
+                            <c:if test="${shopOrder.status == 3}">
+                                <font color="red">订单完成</font>
+                            </c:if>
+                            <c:if test="${shopOrder.status == 4}">
+                                <font color="red">已关闭</font>
+                            </c:if>
+                            <c:if test="${shopOrder.status == 5}">
+                                <font color="red">交易全退</font>
+                            </c:if>
+
+                        </span>
+        <span>收款状态:
+                            <c:if test="${shopOrder.shopReceiptStatus == 1}">
+                                <font color="red">待收款</font>
+                            </c:if>
+                            <c:if test="${shopOrder.shopReceiptStatus == 2}">
+                                <font color="#ff8c00">部分收款</font>
+                            </c:if>
+                            <c:if test="${shopOrder.shopReceiptStatus == 3}">
+                                <font color="green">已收款</font>
+                            </c:if>
+                        </span>
+
+        <span>发货状态:
+                            <c:if test="${shopOrder.sendOutStatus == 1}">
+                                <font color="red">待发货</font>
+                            </c:if>
+                            <c:if test="${shopOrder.sendOutStatus == 2}">
+                                <font color="#ff8c00">部分发货</font>
+                            </c:if>
+                            <c:if test="${shopOrder.sendOutStatus == 3}">
+                                <font color="green">已发货</font>
+                            </c:if>
+                        </span>
+        <span>付款状态:
+                            <c:if test="${shopOrder.payStatus == 1}">
+                                <font color="red">待付款</font>
+                            </c:if>
+                            <c:if test="${shopOrder.payStatus == 2}">
+                                <font color="#ff8c00">部分付款</font>
+                            </c:if>
+                            <c:if test="${shopOrder.payStatus == 3}">
+                                <font color="green">已付款</font>
+                            </c:if>
+                        </span>
+        <span>
+                                退款状态:
+                                <c:if test="${shopOrder.refundStatus == 1}">
+                                    <font>无退款</font>
                                 </c:if>
-                                <c:if test="${shopOrder.sendOutStatus == 3}">
-                                    <font color="green">已发货</font>
+<%--                                <c:if test="${shopOrder.refundStatus == 2}">--%>
+<%--                                    <font>退款中</font>--%>
+<%--                                </c:if>--%>
+<%--                                <c:if test="${shopOrder.orderStatusFlag == 2}">--%>
+<%--                                    <font>部分退款</font>--%>
+<%--                                </c:if>--%>
+                                <c:if test="${shopOrder.refundStatus == 3}">
+                                    <font>已退款</font>
                                 </c:if>
                             </span>
-                        <span>付款状态:<c:if test="${shopOrder.payStatus == 1}">
-                            <font color="red">待付款</font>
-                        </c:if>
-                                            <c:if test="${shopOrder.payStatus == 2}">
-                                                <font color="#ff8c00">部分付款</font>
-                                            </c:if>
-                                            <c:if test="${shopOrder.payStatus == 3}">
-                                                <font color="green">已付款</font>
-                                            </c:if></span>
-                        <c:if test="${shopOrder.payStatus == 3 or shopOrder.payStatus == 2}">
-                                    <span>已付金额: <fmt:formatNumber value="${shopOrder.payed}" type="currency"/>
-                                    </span>
-                        </c:if>
-                    </div>
-                </c:if>
-                <c:if test="${not empty shopOrder.note}">
-                    <div><label>留言:</label>${shopOrder.note}</div>
-                </c:if>
-            </c:if>
+        <c:if test="${not empty shopOrder.note}">
+            <span>留言:${shopOrder.note}</span>
         </c:if>
+            <%--        </c:if>--%>
     </div>
 
     <div class="order-rows">
@@ -1010,20 +1035,20 @@
 </c:forEach>
 <script type="text/javascript">
     (function () {
-        $('body').click(function (e) {
-            var target = $(e.target),
-                $block = $('.operation-block');
-            if (target.is('.operation-btn')) {
-                if ($block.css('display') === 'none') {
-                    $block.show();
-                } else {
-                    $block.hide();
-                }
-            }
-            if (!target.is('.operation-block') && !target.is('.operation-btn')) {
-                $block.hide();
-            }
-        });
+        // $('body').click(function (e) {
+        //     var target = $(e.target),
+        //         $block = $('.operation-block');
+        //     if (target.is('.operation-btn')) {
+        //         if ($block.css('display') === 'none') {
+        //             $block.show();
+        //         } else {
+        //             $block.hide();
+        //         }
+        //     }
+        //     if (!target.is('.operation-block') && !target.is('.operation-btn')) {
+        //         $block.hide();
+        //     }
+        // });
 
         $('.clauseId').each(function () {
             var self = $(this);
@@ -1044,7 +1069,15 @@
             }
         })
     })();
-
+    function operation(shopOrderID) {
+        var operationBlok = $('.' + shopOrderID)
+        if (operationBlok.css('display') == 'none') {
+            $('.operation-block').hide()
+            operationBlok.show()
+        } else {
+            operationBlok.hide()
+        }
+    }
     function openClauseInfo(index) {
         var content = $("#clauseContent" + index).val();
         if (content == '') {

+ 44 - 44
src/main/webapp/WEB-INF/views/modules/hehe/heheNewOrderList.jsp

@@ -943,23 +943,23 @@
             <li>${order.orderTime}</li>
             <li class="operation-wrap">
                 <a href="${ctx}/hehe/new/order/detail?id=${order.orderID}">查看详情</a>
-                <a class="operation-btn">功能</a>
-                <div class="operation-block">
-                    <shiro:hasPermission name="order:order:edit">
-                        <%--包含订单充值商品就不显示--%>
-                        <c:if test="${empty order.rechargeGoods}">
-                            <c:if test="${order.status == 11 || order.status == 12 || order.status == 21 || order.status == 22 || order.status == 31 || order.status == 32}">
-                                <a href="${ctx}/order/toDeliveryPage?id=${order.orderID}">发货</a>
-                            </c:if>
-                            <c:if test="${order.receiptStatus == 2 && order.status != 6 && order.status != 7}">
-                                <a href="javascript:void(0);" onclick="collection(${order.orderID})">抹平收款</a>
-                            </c:if>
-                        </c:if>
-                        <c:if test="${(order.organizeID == 0 or order.organizeID > 2) && order.status == 11 && order.payStatus == 1}">
-                            <a href="javascript:void(0);"
-                               onclick="modelShow('${order.orderID}')">编辑经理折扣</a>
-                        </c:if>
-                    </shiro:hasPermission>
+<%--                <a class="operation-btn">功能</a>--%>
+<%--                <div class="operation-block">--%>
+<%--                    <shiro:hasPermission name="order:order:edit">--%>
+<%--                        &lt;%&ndash;包含订单充值商品就不显示&ndash;%&gt;--%>
+<%--                        <c:if test="${empty order.rechargeGoods}">--%>
+<%--                            <c:if test="${order.status == 11 || order.status == 12 || order.status == 21 || order.status == 22 || order.status == 31 || order.status == 32}">--%>
+<%--                                <a href="${ctx}/order/toDeliveryPage?id=${order.orderID}">发货</a>--%>
+<%--                            </c:if>--%>
+<%--                            <c:if test="${order.receiptStatus == 2 && order.status != 6 && order.status != 7}">--%>
+<%--                                <a href="javascript:void(0);" onclick="collection(${order.orderID})">抹平收款</a>--%>
+<%--                            </c:if>--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${(order.organizeID == 0 or order.organizeID > 2) && order.status == 11 && order.payStatus == 1}">--%>
+<%--                            <a href="javascript:void(0);"--%>
+<%--                               onclick="modelShow('${order.orderID}')">编辑经理折扣</a>--%>
+<%--                        </c:if>--%>
+<%--                    </shiro:hasPermission>--%>
 
 <%--                    <shiro:hasPermission name="order:order:applyrefound">--%>
 <%--                        <c:if test="${order.status == 12 || order.status == 13 || order.status == 21 || order.status == 22 || order.status == 23 || order.status == 31 || order.status == 32 || order.status == 33 || order.status == 4 || order.status == 5}">--%>
@@ -988,33 +988,33 @@
 <%--                        </c:if>--%>
 <%--                    </shiro:hasPermission>--%>
 
-                    <shiro:hasPermission name="order:order:edit">
-                        <c:if test="${order.status == 0 || order.status == 11}">
-                            <a href="${ctx}/hehe/new/order/cancelOrder?orderID=${order.orderID}"
-                               onclick="return confirmx('是否取消订单?', this.href)">取消订单</a>
-                        </c:if>
-                        <c:if test="${order.status ne 0}">
-                            <a href="${ctx}/order/printOrder?orderID=${order.orderID}">打印发货单</a>
-                        </c:if>
-                        <%--<a href="/">供应商链接</a>--%>
-                        <a href="${ctx}/order/exportOrder?id=${order.orderID}">订单导出</a>
-                        <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=1&orderType=2">订单备注</a>
-                        <%--包含订单充值商品就不显示--%>
-                        <c:if test="${empty order.rechargeGoods}">
-                            <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6 && order.status ne 4}">
-                                <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}&orderType=2">发货记录</a>
-                            </c:if>
-                            <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 6}">
-                                <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${order.orderID}&from=1">收退款记录
-                                </a>
-                            </c:if>
-                            <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 6}">
-                                <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByOrderID.rpc?orderID=${order.orderID}">退款(退货)记录
-                                </a>
-                            </c:if>
-                        </c:if>
-                    </shiro:hasPermission>
-                </div>
+<%--                    <shiro:hasPermission name="order:order:edit">--%>
+<%--                        <c:if test="${order.status == 0 || order.status == 11}">--%>
+<%--                            <a href="${ctx}/hehe/new/order/cancelOrder?orderID=${order.orderID}"--%>
+<%--                               onclick="return confirmx('是否取消订单?', this.href)">取消订单</a>--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${order.status ne 0}">--%>
+<%--                            <a href="${ctx}/order/printOrder?orderID=${order.orderID}">打印发货单</a>--%>
+<%--                        </c:if>--%>
+<%--                        &lt;%&ndash;<a href="/">供应商链接</a>&ndash;%&gt;--%>
+<%--                        <a href="${ctx}/order/exportOrder?id=${order.orderID}">订单导出</a>--%>
+<%--                        <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=1&orderType=2">订单备注</a>--%>
+<%--                        &lt;%&ndash;包含订单充值商品就不显示&ndash;%&gt;--%>
+<%--                        <c:if test="${empty order.rechargeGoods}">--%>
+<%--                            <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6 && order.status ne 4}">--%>
+<%--                                <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}&orderType=2">发货记录</a>--%>
+<%--                            </c:if>--%>
+<%--                            <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 6}">--%>
+<%--                                <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${order.orderID}&from=1">收退款记录--%>
+<%--                                </a>--%>
+<%--                            </c:if>--%>
+<%--                            <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 6}">--%>
+<%--                                <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByOrderID.rpc?orderID=${order.orderID}">退款(退货)记录--%>
+<%--                                </a>--%>
+<%--                            </c:if>--%>
+<%--                        </c:if>--%>
+<%--                    </shiro:hasPermission>--%>
+<%--                </div>--%>
             </li>
         </ul>
     </c:forEach>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/hehe/userActivityProductList.jsp

@@ -183,4 +183,4 @@
     }
 </script>
 </body>
-</html>
+</html>

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

@@ -36,7 +36,7 @@
 			</c:if>
 		</c:if>
 		<c:if test="${source eq 2}">
-			<li><a href="${ctx}/order/detail?id=${orderID}">订单详情</a></li>
+			<li><a href="${ctx}${orderType == 2 ?'/hehe/new':''}/order/detail?id=${orderID}">订单详情</a></li>
 		</c:if>
 		<li class="active"><a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${orderID}&source=${source}&orderType=${orderType}">订单备注</a></li>
 		<li><a href="${ctx}/order/cmOrderRemark/toAddRemarksViewNew.rpc?orderID=${orderID}&shopOrderID=${shopOrderID}&source=${source}&orderType=${orderType}">添加订单备注</a></li>

+ 11 - 11
src/main/webapp/WEB-INF/views/modules/order/cmReturnedPurchaseList.jsp

@@ -183,17 +183,17 @@
 							<div>线上退回:<fmt:formatNumber type="number" pattern="#,##0.00"
 														value="${cmReturnedPurchase.refundOnlineFee}"/>元<br></div>
 						</c:if>
-<%--						<c:if test="${not empty cmReturnedPurchase.refundOfflineFee && cmReturnedPurchase.refundOfflineFee ne 0 }">--%>
-<%--							<div>线下转账:<fmt:formatNumber type="number" pattern="#,##0.00"--%>
-<%--														value="${cmReturnedPurchase.refundOfflineFee}"/>元--%>
-<%--							</div>--%>
-<%--						</c:if>--%>
-					</c:if>
-					<c:if test="${not empty cmReturnedPurchase.refundOfflineFee && cmReturnedPurchase.refundOfflineFee ne 0 }">
-						<div>线下转账:<fmt:formatNumber type="number" pattern="#,##0.00"
-													value="${cmReturnedPurchase.refundOfflineFee}"/>元
-						</div>
+						<c:if test="${not empty cmReturnedPurchase.refundOfflineFee && cmReturnedPurchase.refundOfflineFee ne 0 }">
+							<div>线下转账:<fmt:formatNumber type="number" pattern="#,##0.00"
+														value="${cmReturnedPurchase.refundOfflineFee}"/>元
+							</div>
+						</c:if>
 					</c:if>
+<%--					<c:if test="${not empty cmReturnedPurchase.refundOfflineFee && cmReturnedPurchase.refundOfflineFee ne 0 }">--%>
+<%--						<div>线下转账:<fmt:formatNumber type="number" pattern="#,##0.00"--%>
+<%--													value="${cmReturnedPurchase.refundOfflineFee}"/>元--%>
+<%--						</div>--%>
+<%--					</c:if>--%>
 				</td>
 				<td>
 					----
@@ -224,7 +224,7 @@
 <%--							</shiro:hasPermission>--%>
 <%--					</c:if>--%>
 					<%--审核通过---{撤销}--%>
-					<c:if test="${cmReturnedPurchase.status eq 2}">
+					<c:if test="${cmReturnedPurchase.status eq 2&&orderType!=2}">
 						<%--线上退款,不可撤销--%>
 						<c:if test="${empty cmReturnedPurchase.refundOnlineFee || cmReturnedPurchase.refundOnlineFee eq 0 }">
 							<shiro:hasPermission name="order:cmReturnedPurchase:chexiao">

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

@@ -612,29 +612,29 @@
         </td>
     </tr>
     <tr>
-        <c:if test="${order.organizeID != 4}">
-            <td>
-                经理折扣:
-                <c:if test="${order.discountFee gt 0}">
-                    <c:if test="${order.discountFee gt returnedPurchaseFee}">
-                        <fmt:formatNumber value="${order.discountFee - returnedPurchaseFee}" type="currency"/>
-                    </c:if>
-                    <c:if test="${order.discountFee le returnedPurchaseFee}">
-                        ¥0.00
-                    </c:if>
-                    <span style="color: red">
-                        (原<fmt:formatNumber value="${order.discountFee}" type="currency"/>,折扣取消
-                        <c:if test="${order.discountFee gt returnedPurchaseFee}">
-                            <fmt:formatNumber value="${returnedPurchaseFee}" type="currency"/>
-                        </c:if>
-                        <c:if test="${order.discountFee le returnedPurchaseFee}">
-                            <fmt:formatNumber value="${order.discountFee}" type="currency"/>
-                        </c:if>)
-                    </span>
-                </c:if>
-                <c:if test="${order.discountFee le 0}">¥0.00</c:if>
-            </td>
-        </c:if>
+<%--        <c:if test="${order.organizeID != 4}">--%>
+<%--            <td>--%>
+<%--                经理折扣:--%>
+<%--                <c:if test="${order.discountFee gt 0}">--%>
+<%--                    <c:if test="${order.discountFee gt returnedPurchaseFee}">--%>
+<%--                        <fmt:formatNumber value="${order.discountFee - returnedPurchaseFee}" type="currency"/>--%>
+<%--                    </c:if>--%>
+<%--                    <c:if test="${order.discountFee le returnedPurchaseFee}">--%>
+<%--                        ¥0.00--%>
+<%--                    </c:if>--%>
+<%--                    <span style="color: red">--%>
+<%--                        (原<fmt:formatNumber value="${order.discountFee}" type="currency"/>,折扣取消--%>
+<%--                        <c:if test="${order.discountFee gt returnedPurchaseFee}">--%>
+<%--                            <fmt:formatNumber value="${returnedPurchaseFee}" type="currency"/>--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${order.discountFee le returnedPurchaseFee}">--%>
+<%--                            <fmt:formatNumber value="${order.discountFee}" type="currency"/>--%>
+<%--                        </c:if>)--%>
+<%--                    </span>--%>
+<%--                </c:if>--%>
+<%--                <c:if test="${order.discountFee le 0}">¥0.00</c:if>--%>
+<%--            </td>--%>
+<%--        </c:if>--%>
         <%--        <td>运费:--%>
         <%--            <c:if test="${order.organizeID != 4}">--%>
         <%--                <c:if test="${order.freePostFlag == 0}">--%>

+ 84 - 22
src/main/webapp/WEB-INF/views/modules/user/newCmShopSetForm.jsp

@@ -5,17 +5,32 @@
 	<title>组织列表管理</title>
 	<meta name="decorator" content="default"/>
 	<script type="text/javascript">
-		$(document).ready(function() {
+		$(document).ready(function () {
+			accountOwnershipCheck()
+
 			//$("#name").focus();
 			$("#inputForm").validate({
-				submitHandler: function(form){
+				submitHandler: function (form) {
+					// if ($('#bankAccount').val() == "" || $('#bankAccountName').val() == "" || $('#bankName').val() == "") {
+					// 	if (!confirm('您还没填写供应商的账号归属,确定不填写了吗?')) {
+					// 		$('#AccountOwnership').val("1")
+					// 		accountOwnershipCheck()
+					// 		return false
+					// 	}
+					// } else if ($('#cmBankAccount').val() == "" || $('#cmBankAccountName').val() == "" || $('#cmBankName').val() == "") {
+					// 	if (!confirm('您还没填写付采美的账号归属,确定不填写了吗?')) {
+					// 		$('#AccountOwnership').val("0")
+					// 		accountOwnershipCheck()
+					// 		return false
+					// 	}
+					// }
 					loading('正在提交,请稍等...');
 					form.submit();
 				},
 				errorContainer: "#messageBox",
-				errorPlacement: function(error, element) {
+				errorPlacement: function (error, element) {
 					$("#messageBox").text("输入有误,请先更正。");
-					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
 						error.appendTo(element.parent().parent());
 					} else {
 						error.insertAfter(element);
@@ -24,6 +39,22 @@
 			});
 		});
 
+		function accountOwnershipCheck() {
+			if ($('#AccountOwnership').val() == 1) {
+				$('#AccountOwnership1').show()
+				$('#AccountOwnership0').hide()
+				// $('#bankAccount').val("")
+				// $('#bankAccountName').val("")
+				// $('#bankName').val("")
+			} else {
+				$('#AccountOwnership0').show()
+				$('#AccountOwnership1').hide()
+				// $('#cmBankAccount').val("")
+				// $('#cmBankAccountName').val("")
+				// $('#cmBankName').val("")
+			}
+		}
+
 	</script>
 </head>
 <body>
@@ -31,42 +62,73 @@
 	<li><a href="${ctx}/user/newCmShop/">供应商信息列表</a></li>
 	<li class="active"><a href="${ctx}/user/newCmShop/formShop?shopID=${newCmShop.shopID}">线下转账信息</a></li>
 </ul><br/>
-	<form:form id="inputForm" modelAttribute="newCmShop" action="${ctx}/user/newCmShop/updateShop" method="post" class="form-horizontal">
-		<form:hidden path="shopID"/>
-		<sys:message content="${message}"/>
-		<div class="control-group">
-			<label class="control-label"><font color="red">*</font>账号归属:</label>
-			<div class="controls">
-				<form:select path="AccountOwnership" placeholder="请选择" class="input-xlarge required">
-					<form:option value="0" label="采美" />
-					<form:option value="1" label="供应商" />
-				</form:select>
-			</div>
+<form:form id="inputForm" modelAttribute="newCmShop" action="${ctx}/user/newCmShop/updateShop" method="post"
+		   class="form-horizontal">
+	<form:hidden path="shopID"/>
+	<sys:message content="${message}"/>
+	<div class="control-group">
+		<label class="control-label"><font color="red">*</font>账号归属:</label>
+		<div class="controls">
+			<form:select path="AccountOwnership" placeholder="请选择" class="input-xlarge required"
+						 onchange="accountOwnershipCheck()">
+				<form:option value="0" label="采美"/>
+				<form:option value="1" label="供应商"/>
+			</form:select>
 		</div>
+	</div>
+	<div id="AccountOwnership1">
 		<div class="control-group">
 			<label class="control-label"><font color="red">*</font>开户行:</label>
 			<div class="controls">
-				<form:input path="bankName" placeholder="请输入开户行" htmlEscape="false" maxlength="30" class="input-xlarge required"/>
+				<form:input path="bankName" placeholder="请输入开户行" htmlEscape="false" maxlength="30"
+							class="input-xlarge required"/>
 			</div>
 		</div>
 
 		<div class="control-group">
 			<label class="control-label"><font color="red">*</font>银行卡号:</label>
 			<div class="controls">
-				<form:input  path="bankAccount" placeholder="请输入银行卡号" htmlEscape="false" type="number" maxlength="30" class="input-xlarge required"/>
+				<form:input path="bankAccount" placeholder="请输入银行卡号" htmlEscape="false" type="number" maxlength="30"
+							class="input-xlarge required"/>
 			</div>
 		</div>
 		<div class="control-group">
 			<label class="control-label"><font color="red">*</font>户名:</label>
 			<div class="controls">
-				<form:input path="bankAccountName" placeholder="请输入开户行" htmlEscape="false" maxlength="30"  class="input-xlarge required"/>
+				<form:input path="bankAccountName" placeholder="请输入开户行" htmlEscape="false" maxlength="30"
+							class="input-xlarge required"/>
+			</div>
+		</div>
+	</div>
+	<div id="AccountOwnership0">
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>付采美开户行:</label>
+			<div class="controls">
+				<form:input path="cmBankName" placeholder="请输入开户行" htmlEscape="false" maxlength="30"
+							class="input-xlarge required"/>
 			</div>
 		</div>
 
-		<div class="form-actions">
-			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
-			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>付采美银行卡号:</label>
+			<div class="controls">
+				<form:input path="cmBankAccount" placeholder="请输入银行卡号" htmlEscape="false" type="number" maxlength="30"
+							class="input-xlarge required"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>付采美户名:</label>
+			<div class="controls">
+				<form:input path="cmBankAccountName" placeholder="请输入开户行" htmlEscape="false" maxlength="30"
+							class="input-xlarge required"/>
+			</div>
 		</div>
-	</form:form>
+	</div>
+
+	<div class="form-actions">
+		<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+		<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+	</div>
+</form:form>
 </body>
 </html>

+ 114 - 87
src/main/webapp/static/common/jeesite.js

@@ -1,6 +1,6 @@
 /*!
  * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
- * 
+ *
  * 通用公共方法
  * @author ThinkGem
  * @version 2014-4-29
@@ -38,13 +38,14 @@ function include(id, path, file){
 // 获取URL地址参数
 function getQueryString(name, url) {
     var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
-    if (!url || url == ""){
-	    url = window.location.search;
-    }else{	
-    	url = url.substring(url.indexOf("?"));
+    if (!url || url == "") {
+        url = window.location.search;
+    } else {
+        url = url.substring(url.indexOf("?"));
     }
     r = url.substr(1).match(reg)
-    if (r != null) return unescape(r[2]); return null;
+    if (r != null) return unescape(r[2]);
+    return null;
 }
 
 //获取字典标签
@@ -77,12 +78,14 @@ function closeTip(){
 }
 
 //显示提示框
-function showTip(mess, type, timeout, lazytime){
-	resetTip();
-	setTimeout(function(){
-		top.$.jBox.tip(mess, (type == undefined || type == '' ? 'info' : type), {opacity:0, 
-			timeout:  timeout == undefined ? 2000 : timeout});
-	}, lazytime == undefined ? 500 : lazytime);
+function showTip(mess, type, timeout, lazytime) {
+    resetTip();
+    setTimeout(function () {
+        top.$.jBox.tip(mess, (type == undefined || type == '' ? 'info' : type), {
+            opacity: 0,
+            timeout: timeout == undefined ? 2000 : timeout
+        });
+    }, lazytime == undefined ? 500 : lazytime);
 }
 
 // 显示加载框
@@ -107,31 +110,55 @@ function alertx(mess, closed){
 // 确认对话框
 function confirmx(mess, href, closed){
 	top.$.jBox.confirm(mess,'系统提示',function(v,h,f){
-		if(v=='ok'){
-			if (typeof href == 'function') {
-				href();
-			}else{
-				resetTip(); //loading();
-				location = href;
-			}
-		}
-	},{buttonsFocus:1, closed:function(){
-		if (typeof closed == 'function') {
-			closed();
-		}
-	}});
-	top.$('.jbox-body .jbox-icon').css('top','55px');
-	return false;
+		if(v=='ok') {
+            if (href != null) {
+                if (typeof href == 'function') {
+                    href();
+                } else {
+                    resetTip(); //loading();
+                    location = href;
+                }
+            } else {
+                return true
+            }
+        }
+    }, {
+        buttonsFocus: 1, closed: function () {
+            if (typeof closed == 'function') {
+                closed();
+            }
+        }
+    });
+    top.$('.jbox-body .jbox-icon').css('top', '55px');
+    return false;
+}
+
+// 确认对话框
+function confirmF(mess, closed) {
+    top.$.jBox.confirm(mess, '系统提示', function (v, h, f) {
+        if (v == 'ok') {
+            return true
+        }
+    }, {
+        buttonsFocus: 1, closed: function () {
+            if (typeof closed == 'function') {
+                closed();
+            }
+        }
+    });
+    top.$('.jbox-body .jbox-icon').css('top', '55px');
+    return false;
 }
 
+
 // 提示输入对话框
-function promptx(title, lable, href, closed){
-	top.$.jBox("<div class='form-search' style='padding:20px;text-align:center;'>" + lable + ":<input type='text' id='txt' name='txt'/></div>", {
-			title: title, submit: function (v, h, f){
-	    if (f.txt == '') {
-	        top.$.jBox.tip("请输入" + lable + "。", 'error');
-	        return false;
-	    }
+function promptx(title, lable, href, closed) {
+    top.$.jBox("<div class='form-search' style='padding:20px;text-align:center;'>" + lable + ":<input type='text' id='txt' name='txt'/></div>", {
+        title: title, submit: function (v, h, f) {
+            if (f.txt == '') {
+                top.$.jBox.tip("请输入" + lable + "。", 'error');
+                return false;
+            }
 		if (typeof href == 'function') {
 			href();
 		}else{
@@ -215,60 +242,60 @@ function strToDate(date){
 }
 
 // 日期加减
-function addDate(date, dadd){  
-	date = date.valueOf();
-	date = date + dadd * 24 * 60 * 60 * 1000;
-	return new Date(date);  
+function addDate(date, dadd) {
+    date = date.valueOf();
+    date = date + dadd * 24 * 60 * 60 * 1000;
+    return new Date(date);
 }
 
 //截取字符串,区别汉字和英文
-function abbr(name, maxLength){  
- if(!maxLength){  
-     maxLength = 20;  
- }  
- if(name==null||name.length<1){  
-     return "";  
- }  
- var w = 0;//字符串长度,一个汉字长度为2   
- var s = 0;//汉字个数   
- var p = false;//判断字符串当前循环的前一个字符是否为汉字   
- var b = false;//判断字符串当前循环的字符是否为汉字   
- var nameSub;  
- for (var i=0; i<name.length; i++) {  
-    if(i>1 && b==false){  
-         p = false;  
-    }  
-    if(i>1 && b==true){  
-         p = true;  
-    }  
-    var c = name.charCodeAt(i);  
-    //单字节加1   
-    if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) {  
-         w++;  
-         b = false;  
-    }else {  
-         w+=2;  
-         s++;  
-         b = true;  
-    }  
-    if(w>maxLength && i<=name.length-1){  
-         if(b==true && p==true){  
-             nameSub = name.substring(0,i-2)+"...";  
-         }  
-         if(b==false && p==false){  
-             nameSub = name.substring(0,i-3)+"...";  
-         }  
-         if(b==true && p==false){  
-             nameSub = name.substring(0,i-2)+"...";  
-         }  
-         if(p==true){  
-             nameSub = name.substring(0,i-2)+"...";  
-         }  
-         break;  
-    }  
- }  
- if(w<=maxLength){  
-     return name;  
- }  
- return nameSub;  
+function abbr(name, maxLength) {
+    if (!maxLength) {
+        maxLength = 20;
+    }
+    if (name == null || name.length < 1) {
+        return "";
+    }
+    var w = 0;//字符串长度,一个汉字长度为2
+    var s = 0;//汉字个数
+    var p = false;//判断字符串当前循环的前一个字符是否为汉字
+    var b = false;//判断字符串当前循环的字符是否为汉字
+    var nameSub;
+    for (var i = 0; i < name.length; i++) {
+        if (i > 1 && b == false) {
+            p = false;
+        }
+        if (i > 1 && b == true) {
+            p = true;
+        }
+        var c = name.charCodeAt(i);
+        //单字节加1
+        if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
+            w++;
+            b = false;
+        } else {
+            w += 2;
+            s++;
+            b = true;
+        }
+        if (w > maxLength && i <= name.length - 1) {
+            if (b == true && p == true) {
+                nameSub = name.substring(0, i - 2) + "...";
+            }
+            if (b == false && p == false) {
+                nameSub = name.substring(0, i - 3) + "...";
+            }
+            if (b == true && p == false) {
+                nameSub = name.substring(0, i - 2) + "...";
+            }
+            if (p == true) {
+                nameSub = name.substring(0, i - 2) + "...";
+            }
+            break;
+        }
+    }
+    if (w <= maxLength) {
+        return name;
+    }
+    return nameSub;
 }

+ 9 - 2
src/test/java/com/caimei/info/InfoTest.java

@@ -4,6 +4,8 @@ import com.caimei.modules.coupon.dao.CmCouponVipDao;
 import com.caimei.modules.coupon.entity.CmVipCoupon;
 import com.caimei.modules.landing.domain.CmBrandLanding;
 import com.caimei.modules.landing.mapper.CmBrandLandingMapper;
+import com.caimei.modules.order.entity.NewShopOrder;
+import com.caimei.modules.order.service.NewShopOrderService;
 import com.caimei.modules.product.dao.CmOrganizeProductInfoMapper;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +27,8 @@ public class InfoTest extends SpringTransactionalContextTests {
 	private InfomationService infomationService;
 	@Autowired
 	CmOrganizeProductInfoMapper cmOrganizeProductInfoMapper;
+	@Autowired
+	NewShopOrderService newShopOrderService;
 
 	@Autowired
 	private InfoService infoService;
@@ -37,10 +41,13 @@ public class InfoTest extends SpringTransactionalContextTests {
 
 	@Test
 	public void test(){
-		CmBrandLanding cmBrandLanding = new CmBrandLanding();
+		NewShopOrder cmShopOrderByShopOrderID = newShopOrderService.getCmShopOrderByShopOrderID("29352");
+		System.out.println(cmShopOrderByShopOrderID);
+
+//		CmBrandLanding cmBrandLanding = new CmBrandLanding();
 //		cmBrandLanding.setType("not=1,2");
 
-		cmBrandLandingMapper.selectCmBrandLandingList(cmBrandLanding);
+//		cmBrandLandingMapper.selectCmBrandLandingList(cmBrandLanding);
 //		cmOrganizeProductInfoMapper.getCmOrganizeProductInfoList(null);
 //		String str = "/pages/goods/goods-classify?classType=2&id=1038&title=%E7%8E%BB%E5%B0%BF%E9%85%B8%EF%BC%88%E5%B0%8F%E5%88%86%E5%AD%90%EF%BC%89";
 //		String decode="";