PLF 5 سال پیش
والد
کامیت
503140ad97
86فایلهای تغییر یافته به همراه6634 افزوده شده و 29 حذف شده
  1. 1 4
      src/main/java/com/caimei/modules/club/controller/CmOperationUserController.java
  2. 27 5
      src/main/java/com/caimei/modules/club/controller/CmUserOrganizeController.java
  3. 118 0
      src/main/java/com/caimei/modules/club/entity/CmProductSn.java
  4. 79 0
      src/main/java/com/caimei/modules/order/controller/CmOrderRemarkController.java
  5. 172 0
      src/main/java/com/caimei/modules/order/controller/OrganizeOrderController.java
  6. 11 0
      src/main/java/com/caimei/modules/order/dao/BpClauseDao.java
  7. 13 0
      src/main/java/com/caimei/modules/order/dao/CmDiscernReceiptDao.java
  8. 18 0
      src/main/java/com/caimei/modules/order/dao/CmOrderRemarkDao.java
  9. 8 0
      src/main/java/com/caimei/modules/order/dao/CmPayShopRecordDao.java
  10. 12 0
      src/main/java/com/caimei/modules/order/dao/CmProductSnDao.java
  11. 10 0
      src/main/java/com/caimei/modules/order/dao/CmReceiptOrderRelationDao.java
  12. 16 0
      src/main/java/com/caimei/modules/order/dao/CmReturnedPurchaseDao.java
  13. 16 0
      src/main/java/com/caimei/modules/order/dao/CmReturnedPurchaseProductDao.java
  14. 12 0
      src/main/java/com/caimei/modules/order/dao/LogisticsBatchDao.java
  15. 12 0
      src/main/java/com/caimei/modules/order/dao/LogisticsInformationDao.java
  16. 12 0
      src/main/java/com/caimei/modules/order/dao/LogisticsRecordDao.java
  17. 10 0
      src/main/java/com/caimei/modules/order/dao/NewOrderConfigDao.java
  18. 13 0
      src/main/java/com/caimei/modules/order/dao/NewOrderDao.java
  19. 19 0
      src/main/java/com/caimei/modules/order/dao/NewOrderProductDao.java
  20. 15 0
      src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java
  21. 9 0
      src/main/java/com/caimei/modules/order/dao/OrderInvoiceDao.java
  22. 9 0
      src/main/java/com/caimei/modules/order/dao/OrderUserInfoDao.java
  23. 8 0
      src/main/java/com/caimei/modules/order/dao/ProductDao.java
  24. 65 0
      src/main/java/com/caimei/modules/order/entity/BpClause.java
  25. 62 0
      src/main/java/com/caimei/modules/order/entity/CmOrderRemark.java
  26. 447 0
      src/main/java/com/caimei/modules/order/entity/CmReturnedPurchase.java
  27. 281 0
      src/main/java/com/caimei/modules/order/entity/CmReturnedPurchaseProduct.java
  28. 93 0
      src/main/java/com/caimei/modules/order/entity/LogisticsBatch.java
  29. 30 0
      src/main/java/com/caimei/modules/order/entity/LogisticsDetailVo.java
  30. 39 0
      src/main/java/com/caimei/modules/order/entity/LogisticsInfoVo.java
  31. 145 0
      src/main/java/com/caimei/modules/order/entity/LogisticsInformation.java
  32. 93 0
      src/main/java/com/caimei/modules/order/entity/LogisticsRecord.java
  33. 781 0
      src/main/java/com/caimei/modules/order/entity/NewOrder.java
  34. 33 0
      src/main/java/com/caimei/modules/order/entity/NewOrderConfig.java
  35. 796 0
      src/main/java/com/caimei/modules/order/entity/NewOrderProduct.java
  36. 860 0
      src/main/java/com/caimei/modules/order/entity/NewShopOrder.java
  37. 127 0
      src/main/java/com/caimei/modules/order/entity/OrderInvoice.java
  38. 152 0
      src/main/java/com/caimei/modules/order/entity/OrderUserInfo.java
  39. 43 0
      src/main/java/com/caimei/modules/order/entity/ProductType.java
  40. 106 0
      src/main/java/com/caimei/modules/order/entity/ShopOrderReturned.java
  41. 9 0
      src/main/java/com/caimei/modules/order/service/BpClauseService.java
  42. 5 0
      src/main/java/com/caimei/modules/order/service/CmDiscernReceiptService.java
  43. 13 0
      src/main/java/com/caimei/modules/order/service/CmOrderRemarkService.java
  44. 7 0
      src/main/java/com/caimei/modules/order/service/CmReceiptOrderRelationService.java
  45. 11 0
      src/main/java/com/caimei/modules/order/service/CmReturnedPurchaseService.java
  46. 7 0
      src/main/java/com/caimei/modules/order/service/NewOrderConfigService.java
  47. 10 0
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  48. 12 0
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  49. 7 0
      src/main/java/com/caimei/modules/order/service/OrderUserInfoService.java
  50. 20 0
      src/main/java/com/caimei/modules/order/service/impl/BpClauseServiceImpl.java
  51. 18 0
      src/main/java/com/caimei/modules/order/service/impl/CmDiscernReceiptServiceImpl.java
  52. 34 0
      src/main/java/com/caimei/modules/order/service/impl/CmOrderRemarkServiceImpl.java
  53. 19 0
      src/main/java/com/caimei/modules/order/service/impl/CmReceiptOrderRelationServiceImpl.java
  54. 120 0
      src/main/java/com/caimei/modules/order/service/impl/CmReturnedPurchaseServiceImpl.java
  55. 19 0
      src/main/java/com/caimei/modules/order/service/impl/NewOrderConfigServiceImpl.java
  56. 192 0
      src/main/java/com/caimei/modules/order/service/impl/NewOrderServiceImpl.java
  57. 80 0
      src/main/java/com/caimei/modules/order/service/impl/NewShopOrderServiceImpl.java
  58. 18 0
      src/main/java/com/caimei/modules/order/service/impl/OrderUserInfoServiceImpl.java
  59. 4 2
      src/main/java/com/caimei/modules/products/controller/CmMallOrganizeProductsController.java
  60. 4 7
      src/main/java/com/caimei/modules/products/controller/CmMallProductsClassifyController.java
  61. 9 0
      src/main/java/com/caimei/modules/products/entity/CmMallProductsClassify.java
  62. 1 1
      src/main/java/com/caimei/modules/shiro/dao/UserDao.java
  63. 5 5
      src/main/java/com/caimei/modules/shiro/service/impl/ShiroServiceImpl.java
  64. 219 0
      src/main/java/com/caimei/utils/NewOrderStatus.java
  65. 28 0
      src/main/resources/mapper/BpClauseMapper.xml
  66. 23 0
      src/main/resources/mapper/CmDiscernReceiptMapper.xml
  67. 4 0
      src/main/resources/mapper/CmMallProductsClassifyMapper.xml
  68. 4 4
      src/main/resources/mapper/CmOperationUserMapper.xml
  69. 73 0
      src/main/resources/mapper/CmOrderRemarkMapper.xml
  70. 9 0
      src/main/resources/mapper/CmPayShopRecordMapper.xml
  71. 33 0
      src/main/resources/mapper/CmProductSnMapper.xml
  72. 18 0
      src/main/resources/mapper/CmReceiptOrderRelationMapper.xml
  73. 132 0
      src/main/resources/mapper/CmReturnedPurchaseMapper.xml
  74. 79 0
      src/main/resources/mapper/CmReturnedPurchaseProductMapper.xml
  75. 0 0
      src/main/resources/mapper/CmUserOrganizeMapper.xml
  76. 32 0
      src/main/resources/mapper/LogisticsBatchMapper.xml
  77. 27 0
      src/main/resources/mapper/LogisticsInformationMapper.xml
  78. 23 0
      src/main/resources/mapper/LogisticsRecordMapper.xml
  79. 10 0
      src/main/resources/mapper/NewOrderConfigMapper.xml
  80. 248 0
      src/main/resources/mapper/NewOrderMapper.xml
  81. 121 0
      src/main/resources/mapper/NewOrderProductMapper.xml
  82. 92 0
      src/main/resources/mapper/NewShopOrderMapper.xml
  83. 9 0
      src/main/resources/mapper/OrderInvoiceMapper.xml
  84. 31 0
      src/main/resources/mapper/OrderUserInfoMapper.xml
  85. 21 0
      src/main/resources/mapper/ProductMapper.xml
  86. 1 1
      src/main/resources/mapper/UserMapper.xml

+ 1 - 4
src/main/java/com/caimei/modules/club/controller/CmOperationUserController.java

@@ -13,12 +13,10 @@ import com.github.pagehelper.util.StringUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import org.thymeleaf.util.StringUtils;
 
 import java.util.Date;
@@ -67,8 +65,7 @@ public class CmOperationUserController {
             return jsonModel.error("该手机号码已被使用");
         }
         Date date = new Date();
-        String configFlag = cmOperationUser.getConfigFlag();
-        if (StringUtil.isNotEmpty(configFlag) && configFlag.length() != 2) {//保存生成邀请码
+        if (cmOperationUser.getConfigFlag().equals("2")) {//保存生成邀请码
             //生成随机码6位
             Integer flag = getInvitationCode();
             cmOperationUser.setInvitationCode(String.valueOf(flag));

+ 27 - 5
src/main/java/com/caimei/modules/club/controller/CmUserOrganizeController.java

@@ -19,7 +19,7 @@ import java.util.Date;
 import java.util.List;
 
 /**
- * 组织管理
+ * 会所管理
  */
 @Controller
 @RequestMapping(value = "/user/cmUserOrganize")
@@ -32,7 +32,7 @@ public class CmUserOrganizeController {
     private NewCmClubService newCmClubService;
 
     /**
-     * 组织列表
+     * 会所列表
      */
     @ResponseBody
     @RequestMapping(value = "/clubList")
@@ -77,12 +77,11 @@ public class CmUserOrganizeController {
      * 保存上线会所信息(添加,编辑)
      *
      * @param cmUserOrganize
-     * @param model
      * @return
      */
     @RequestMapping(value = "saveAddClubUser")
     @Transactional
-    public JsonModel saveAddClubUser(CmUserOrganize cmUserOrganize, Page page, NewCmClub newCmClub, CmUser cmUser, Model model) throws Exception {
+    public JsonModel saveAddClubUser(CmUserOrganize cmUserOrganize, Page page, NewCmClub newCmClub, CmUser cmUser) throws Exception {
         JsonModel jsonModel = JsonModel.newInstance();
         String contractMobile = newCmClub.getContractMobile();
         Integer userID = newCmClub.getUserID();
@@ -94,7 +93,7 @@ public class CmUserOrganizeController {
         cmUser.setBindMobile(contractMobile);
         List<CmUser> listBuyBindMobile = cmUserService.findListBuyBindMobile(cmUser);
         if (CollectionUtils.isNotEmpty(listBuyBindMobile) && listBuyBindMobile.size() > 0) {
-            return jsonModel.error("-1", model, "该手机号码已被使用");
+            return jsonModel.error("该手机号码已被使用");
         }
         //添加用户信息(新增或修改通用)
         cmUser.setName(newCmClub.getName());
@@ -202,4 +201,27 @@ public class CmUserOrganizeController {
         cmUser.setUserPermission(2);
         return cmUser;
     }
+
+    /**
+     * 上下线会所
+     *
+     * @param cmUser
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "switchLine")
+    public JsonModel switchLine(CmUser cmUser) {
+        if (cmUser.getClubStatus().equals("91")) {
+            cmUser.setClubStatus("90");
+        } else {
+            cmUser.setClubStatus("91");
+        }
+        cmUserService.update(cmUser);//更新用户表数据
+        NewCmClub newCmClub = new NewCmClub();
+        newCmClub.setClubID(Integer.parseInt(cmUser.getClubID()));
+        newCmClub.setUserID(cmUser.getUserID());
+        newCmClub.setStatus(90);
+        newCmClubService.update(newCmClub);//更新会所表数据
+        return JsonModel.newInstance().success();
+    }
 }

+ 118 - 0
src/main/java/com/caimei/modules/club/entity/CmProductSn.java

@@ -0,0 +1,118 @@
+package com.caimei.modules.club.entity;
+
+import java.io.Serializable;
+
+/**
+ * sn码Entity
+ * @author ye.qin
+ * @version 2018-11-28
+ */
+public class CmProductSn implements Serializable {
+	
+	private static final long serialVersionUID = 1L;
+	private Integer snID;
+	private String snCode;		// sn码
+	private String orderNo;		// 主订单编号
+	private Integer orderID;		// 主订单ID
+	private String shopOrderNo;		// 子订单编号
+	private Integer shopOrderID;		// 订单Id
+	private Integer productID;		// 商品Id
+	private Integer orderProductID;		// 商品订单ID
+	private String source;			// 来源
+	private String createTime;		// 创建时间
+	private String updateTime;		// 修改时间
+
+
+	public static long getSerialVersionUID() {
+		return serialVersionUID;
+	}
+
+
+	public Integer getSnID() {
+		return snID;
+	}
+
+	public void setSnID(Integer snID) {
+		this.snID = snID;
+	}
+
+	public String getSnCode() {
+		return snCode;
+	}
+
+	public void setSnCode(String snCode) {
+		this.snCode = snCode;
+	}
+
+	public String getOrderNo() {
+		return orderNo;
+	}
+
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+
+	public Integer getOrderID() {
+		return orderID;
+	}
+
+	public void setOrderID(Integer orderID) {
+		this.orderID = orderID;
+	}
+
+	public String getShopOrderNo() {
+		return shopOrderNo;
+	}
+
+	public void setShopOrderNo(String shopOrderNo) {
+		this.shopOrderNo = shopOrderNo;
+	}
+
+	public Integer getShopOrderID() {
+		return shopOrderID;
+	}
+
+	public void setShopOrderID(Integer shopOrderID) {
+		this.shopOrderID = shopOrderID;
+	}
+
+	public Integer getOrderProductID() {
+		return orderProductID;
+	}
+
+	public void setOrderProductID(Integer orderProductID) {
+		this.orderProductID = orderProductID;
+	}
+
+	public String getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(String createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(String updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public String getSource() {
+		return source;
+	}
+
+	public void setSource(String source) {
+		this.source = source;
+	}
+
+	public Integer getProductID() {
+		return productID;
+	}
+
+	public void setProductID(Integer productID) {
+		this.productID = productID;
+	}
+}

+ 79 - 0
src/main/java/com/caimei/modules/order/controller/CmOrderRemarkController.java

@@ -0,0 +1,79 @@
+package com.caimei.modules.order.controller;
+
+
+import com.caimei.modules.order.entity.CmOrderRemark;
+import com.caimei.modules.order.service.CmOrderRemarkService;
+import com.caimei.utils.JsonModel;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 订单备注Controller
+ *
+ */
+@Controller
+@RequestMapping(value = "/order/cmOrderRemark")
+public class CmOrderRemarkController {
+
+    @Autowired
+    private CmOrderRemarkService cmOrderRemarkService;
+
+    @ModelAttribute
+    public CmOrderRemark get(@RequestParam(required = false) String id) {
+        CmOrderRemark entity = null;
+        if (StringUtils.isNotBlank(id)) {
+            entity = cmOrderRemarkService.get(id);
+        }
+        if (entity == null) {
+            entity = new CmOrderRemark();
+        }
+        return entity;
+    }
+
+    //订单备注
+    @RequestMapping(value = "remarksView")
+    public JsonModel remarksView(Integer orderID, Integer shopOrderID) {
+        //通过商品ID获取对应备注信息
+        CmOrderRemark remark = new CmOrderRemark();
+        remark.setOrderID(orderID);
+        remark.setShopOrderID(shopOrderID);
+        List<CmOrderRemark> remarksList = cmOrderRemarkService.findList(remark);
+        return JsonModel.newInstance().success(remarksList);
+    }
+
+
+    /**
+     * 保存备注
+     *
+     * @param remarks
+     * @param orderID
+     * @param shopOrderID
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "addRemarks")
+    public JsonModel addRemarks(String remarks, Integer orderID, Integer shopOrderID) {
+        JsonModel jsonModel = JsonModel.newInstance();
+        try {
+            //保存备注信息
+            CmOrderRemark remark = new CmOrderRemark();
+            remark.setOrderID(orderID);
+            remark.setShopOrderID(shopOrderID);
+            remark.setRemarks(remarks);
+            cmOrderRemarkService.save(remark);
+            return jsonModel.success();
+        } catch (Exception e) {
+            return jsonModel.error("修改失败");
+        }
+    }
+}

+ 172 - 0
src/main/java/com/caimei/modules/order/controller/OrganizeOrderController.java

@@ -0,0 +1,172 @@
+package com.caimei.modules.order.controller;
+
+import com.caimei.modules.club.entity.Page;
+import com.caimei.modules.order.entity.*;
+import com.caimei.modules.order.service.*;
+import com.caimei.utils.JsonModel;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 组织订单
+ */
+@Controller
+@RequestMapping(value = "/order/organize")
+public class OrganizeOrderController {
+    @Autowired
+    private NewOrderService newOrderService;
+    @Autowired
+    private BpClauseService bpClauseService;
+    @Autowired
+    private CmReturnedPurchaseService cmReturnedPurchaseService;
+    @Autowired
+    private CmReceiptOrderRelationService cmReceiptOrderRelationService;
+    @Autowired
+    private NewOrderConfigService newOrderConfigService;
+    @Autowired
+    private CmDiscernReceiptService cmDiscernReceiptService;
+    @Autowired
+    private NewShopOrderService newShopOrderService;
+
+    @ModelAttribute
+    public NewOrder getOrder(@RequestParam(required = false) String id) {
+        NewOrder entity = null;
+        if (StringUtils.isNotBlank(id)) {
+            entity = newOrderService.get(id);
+        }
+        if (entity == null) {
+            entity = new NewOrder();
+        }
+        return entity;
+    }
+
+    /**
+     * 订单列表
+     */
+    @ResponseBody
+    @RequestMapping("orderList")
+    public JsonModel orderList(NewOrder order, Page page) {
+        if (null != order.getStartTime() && !"".equals(order.getStartTime()) && !order.getStartTime().endsWith("00:00:00")) {
+            order.setStartTime(order.getStartTime() + " 00:00:00");
+        }
+        if (null != order.getEndTime() && !"".equals(order.getEndTime()) && !order.getEndTime().endsWith("23:59:59")) {
+            order.setEndTime(order.getEndTime() + " 23:59:59");
+        }
+        if (null != order.getStartRefundTime() && !"".equals(order.getStartRefundTime()) && !order.getStartRefundTime().endsWith("00:00:00")) {
+            order.setStartRefundTime(order.getStartRefundTime() + " 00:00:00");
+        }
+        if (null != order.getEndRefundTime() && !"".equals(order.getEndRefundTime()) && !order.getEndRefundTime().endsWith("23:59:59")) {
+            order.setEndRefundTime(order.getEndRefundTime() + " 23:59:59");
+        }
+        if (null != order.getBuyer()) {
+            order.setBuyer(order.getBuyer().trim());
+        }
+        if (null != order.getReceiver()) {
+            order.setReceiver(order.getReceiver().trim());
+        }
+        //查询内部处理了已收,未付统计(包含运费)
+        Page<NewOrder> orderPage = newOrderService.findList(order, page);
+        return JsonModel.newInstance().success(orderPage);
+    }
+
+    /**
+     * 订单详情
+     */
+    @ResponseBody
+    @RequestMapping("detail")
+    public JsonModel detail(NewOrder order) {
+        Map<String, Object> map = new HashMap();
+        BpClause bpClause = new BpClause();
+        bpClause.setEnabledStatus("1");
+        List<BpClause> bpClauses = bpClauseService.findList(bpClause);
+        map.put("bpClauses", bpClauses);
+        //获取订单是否可以申请付款
+        List<Integer> oId = new ArrayList<>();
+        oId.add(order.getOrderID());
+        List<Integer> orderIdsInApplyReturn = cmReturnedPurchaseService.findOrderIDsInApplyReturnFlag(oId);
+        if (CollectionUtils.isNotEmpty(orderIdsInApplyReturn) && orderIdsInApplyReturn.size() > 0) {
+            order.setApplyReturnedPurchaseFlag("0");
+        } else {
+            order.setApplyReturnedPurchaseFlag("1");
+        }
+        //判断是否有在收款审核的订单
+        List<Integer> ids = cmReceiptOrderRelationService.toAudit(order.getOrderID());
+        if (ids != null && ids.size() > 0) {
+            order.setToAudit("1");
+        }
+        //一个子订单只有一个商品时,不可拆分
+        int count = 0;
+        for (NewShopOrder newShopOrder : order.getNewShopOrders()) {
+            if (newShopOrder.getShopID() != 998) {
+                count++;
+            }
+        }
+        if (order.getProductCount() == null) {
+            order.setProductCount(1);
+        }
+        if (order.getProductCount() <= count) {
+            order.setSplitFlag("0");
+        }
+        map.put("order", order);
+        if ("0".equals(order.getStatus())) {
+            try {
+                NewOrderConfig confirmOverTime = newOrderConfigService.getValueByKey("confirmOverTime");
+                Double value = confirmOverTime.getValue(); //待确认超过 value 小时自动取消订单
+                GregorianCalendar gc = new GregorianCalendar();
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Date orderTime = sdf.parse(order.getOrderTime());
+                gc.setTime(orderTime);
+                gc.add(Calendar.HOUR, value.intValue());
+                Date time = gc.getTime();
+                String ot = sdf.format(time);
+                if (time.after(new Date())) map.put("time", ot);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        CmReturnedPurchase cmReturnedPurchase = new CmReturnedPurchase();
+        cmReturnedPurchase.setStatus("2");
+        cmReturnedPurchase.setOrderID(order.getOrderID());
+        List<CmReturnedPurchase> dataList = cmReturnedPurchaseService.getReturnedPurchaseList(cmReturnedPurchase);
+        Double returnedPurchaseFee = 0D;    //退款(退货)总金额
+        Double refundFee = 0D;  //退款总额(给买家)
+        for (CmReturnedPurchase bean : dataList) {
+            if (!bean.getStatus().equals("3")) {
+                returnedPurchaseFee += bean.getReturnedPurchaseFee();
+                refundFee += bean.getRefundFee();
+            }
+        }
+        Double returnValue = 0d;   //退货价值
+        if (order.getDiscountFee() >= returnedPurchaseFee) {
+            returnValue = 0d;   //如果经理折扣大于退款(退货)总金额之和  那么先抵扣经理折扣  退款价值为0
+        } else {
+            returnValue = returnedPurchaseFee - order.getDiscountFee(); //抵用完经理折扣后才是真实价值
+        }
+        //订单已收金额
+        Double receiptAmount = cmDiscernReceiptService.findOrderReceipt(order.getOrderID());
+        map.put("returnValue", returnValue);
+        map.put("receiptAmount", receiptAmount == null ? 0 : receiptAmount);
+        map.put("returnedPurchaseFee", returnedPurchaseFee);
+        return JsonModel.newInstance().success(map);
+    }
+
+    /**
+     * 物流详情展示
+     */
+    @ResponseBody
+    @RequestMapping("logisticsDetails")
+    public JsonModel logisticsDetails(Integer orderID, String logisticsBatchID) {
+        List<LogisticsInfoVo> logisticsInfoVos = new ArrayList<>();
+        logisticsInfoVos = newShopOrderService.logisticsDetails(orderID, logisticsBatchID);
+        return JsonModel.newInstance().success(logisticsInfoVos);
+    }
+}

+ 11 - 0
src/main/java/com/caimei/modules/order/dao/BpClauseDao.java

@@ -0,0 +1,11 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.BpClause;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface BpClauseDao {
+    List<BpClause> findList(BpClause bpClause);
+}

+ 13 - 0
src/main/java/com/caimei/modules/order/dao/CmDiscernReceiptDao.java

@@ -0,0 +1,13 @@
+package com.caimei.modules.order.dao;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface CmDiscernReceiptDao {
+    List<Integer> findRebateOrderID(@Param("orderIds") List<Integer> collect);
+
+    Double findOrderReceipt(Integer orderID);
+}

+ 18 - 0
src/main/java/com/caimei/modules/order/dao/CmOrderRemarkDao.java

@@ -0,0 +1,18 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.CmOrderRemark;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface CmOrderRemarkDao{
+
+    CmOrderRemark get(String id);
+
+    List<CmOrderRemark> findList(CmOrderRemark remark);
+
+    void insert(CmOrderRemark remark);
+
+    void update(CmOrderRemark remark);
+}

+ 8 - 0
src/main/java/com/caimei/modules/order/dao/CmPayShopRecordDao.java

@@ -0,0 +1,8 @@
+package com.caimei.modules.order.dao;
+
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface CmPayShopRecordDao {
+    Double sumByShopOrderID(Integer shopOrderID);
+}

+ 12 - 0
src/main/java/com/caimei/modules/order/dao/CmProductSnDao.java

@@ -0,0 +1,12 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.club.entity.CmProductSn;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface CmProductSnDao {
+    List<CmProductSn> getListSignByOrderProduct(@Param("orderProductID") Integer orderProductID, @Param("shopOrderID") Integer shopOrderID);
+}

+ 10 - 0
src/main/java/com/caimei/modules/order/dao/CmReceiptOrderRelationDao.java

@@ -0,0 +1,10 @@
+package com.caimei.modules.order.dao;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface CmReceiptOrderRelationDao {
+    List<Integer> toAudit(Integer orderID);
+}

+ 16 - 0
src/main/java/com/caimei/modules/order/dao/CmReturnedPurchaseDao.java

@@ -0,0 +1,16 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.CmReturnedPurchase;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface CmReturnedPurchaseDao {
+    List<Integer> findOrderIDInReturnPurchase(@Param("orderIds") List<Integer> oId);
+
+    List<Integer> findOrderIDsInApplyReturnFlag(@Param("orderIds") List<Integer> oId);
+
+    List<CmReturnedPurchase> findList(CmReturnedPurchase cmReturnedPurchase);
+}

+ 16 - 0
src/main/java/com/caimei/modules/order/dao/CmReturnedPurchaseProductDao.java

@@ -0,0 +1,16 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.CmReturnedPurchaseProduct;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface CmReturnedPurchaseProductDao {
+    List<CmReturnedPurchaseProduct> findList(CmReturnedPurchaseProduct cmReturnedPurchaseProduct);
+
+    List<CmReturnedPurchaseProduct> getCmReturnedPurchaseProductList(CmReturnedPurchaseProduct purchaseProduct);
+
+    List<CmReturnedPurchaseProduct> findListByReturnTime(@Param("orderID")Integer orderID, @Param("shopOrderID")Integer shopOrderID, @Param("orderProductID")Integer orderProductID, @Param("returnTime")String returnTime);
+}

+ 12 - 0
src/main/java/com/caimei/modules/order/dao/LogisticsBatchDao.java

@@ -0,0 +1,12 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.LogisticsBatch;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface LogisticsBatchDao {
+    List<LogisticsBatch> findBatch(@Param("orderID")Integer orderID, @Param("logisticsBatchID")String logisticsBatchID);
+}

+ 12 - 0
src/main/java/com/caimei/modules/order/dao/LogisticsInformationDao.java

@@ -0,0 +1,12 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.LogisticsInformation;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface LogisticsInformationDao {
+    List<LogisticsInformation> findByLogisticsBatchID(@Param("logisticsBatchID") Integer logisticsBatchID);
+}

+ 12 - 0
src/main/java/com/caimei/modules/order/dao/LogisticsRecordDao.java

@@ -0,0 +1,12 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.LogisticsRecord;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface LogisticsRecordDao {
+    List<LogisticsRecord> findByLogisticsBatchID(@Param("logisticsBatchID") Integer logisticsBatchID);
+}

+ 10 - 0
src/main/java/com/caimei/modules/order/dao/NewOrderConfigDao.java

@@ -0,0 +1,10 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.NewOrderConfig;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface NewOrderConfigDao {
+    NewOrderConfig getValueByKey(@Param("key") String key);
+}

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

@@ -0,0 +1,13 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.NewOrder;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface NewOrderDao {
+    List<NewOrder> findList(NewOrder newOrder);
+
+    NewOrder get(String id);
+}

+ 19 - 0
src/main/java/com/caimei/modules/order/dao/NewOrderProductDao.java

@@ -0,0 +1,19 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.NewOrderProduct;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface NewOrderProductDao {
+    NewOrderProduct get(Integer orderProductID);
+
+    List<NewOrderProduct> findListByShopOrderID(Integer shopOrderID);
+
+    Integer getReturningNum(Integer orderProductID);
+
+    Integer getReturnedNum(Integer orderProductID);
+
+    Integer getReceivedNum(Integer orderProductID);
+}

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

@@ -0,0 +1,15 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.NewShopOrder;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface NewShopOrderDao {
+    NewShopOrder get(Integer shopOrderID);
+
+    NewShopOrder findByShopOrderID(Integer shopOrderID);
+
+    List<NewShopOrder> findListByOrderID(Integer orderID);
+}

+ 9 - 0
src/main/java/com/caimei/modules/order/dao/OrderInvoiceDao.java

@@ -0,0 +1,9 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.OrderInvoice;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface OrderInvoiceDao {
+    OrderInvoice getWithorderId(String orderId);
+}

+ 9 - 0
src/main/java/com/caimei/modules/order/dao/OrderUserInfoDao.java

@@ -0,0 +1,9 @@
+package com.caimei.modules.order.dao;
+
+import com.caimei.modules.order.entity.OrderUserInfo;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface OrderUserInfoDao {
+    OrderUserInfo findByOrderID(Integer orderID);
+}

+ 8 - 0
src/main/java/com/caimei/modules/order/dao/ProductDao.java

@@ -0,0 +1,8 @@
+package com.caimei.modules.order.dao;
+
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ProductDao {
+    String findProductBigTypeByProductID(Integer productID);
+}

+ 65 - 0
src/main/java/com/caimei/modules/order/entity/BpClause.java

@@ -0,0 +1,65 @@
+package com.caimei.modules.order.entity;
+
+import org.hibernate.validator.constraints.Length;
+
+import java.io.Serializable;
+
+/**
+ * 条款信息Entity
+ *
+ * @author LG
+ * @version 2017-08-24
+ */
+public class BpClause implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    private Integer id;
+    private String name;        // 名称
+    private String content;        // 内容
+    private String clauseType; //条款类型,0不需要分期中显示 1需要分期中显示,2分期不分期中都显示
+    private String enabledStatus;        // 启用/禁用状态
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getClauseType() {
+        return clauseType;
+    }
+
+    public void setClauseType(String clauseType) {
+        this.clauseType = clauseType;
+    }
+
+    public String getEnabledStatus() {
+        return enabledStatus;
+    }
+
+    public void setEnabledStatus(String enabledStatus) {
+        this.enabledStatus = enabledStatus;
+    }
+}

+ 62 - 0
src/main/java/com/caimei/modules/order/entity/CmOrderRemark.java

@@ -0,0 +1,62 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class CmOrderRemark implements Serializable {
+
+    private Integer id;
+    private Integer orderID; // 主订单ID
+    private Integer shopOrderID;  // 子订单ID
+    private String remarks;	// 备注
+    private Integer createBy;	// 创建者
+    private Date createDate;	// 创建日期
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getOrderID() {
+        return orderID;
+    }
+
+    public void setOrderID(Integer orderID) {
+        this.orderID = orderID;
+    }
+
+    public Integer getShopOrderID() {
+        return shopOrderID;
+    }
+
+    public void setShopOrderID(Integer shopOrderID) {
+        this.shopOrderID = shopOrderID;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public Integer getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(Integer createBy) {
+        this.createBy = createBy;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+}

+ 447 - 0
src/main/java/com/caimei/modules/order/entity/CmReturnedPurchase.java

@@ -0,0 +1,447 @@
+package com.caimei.modules.order.entity;
+
+import org.hibernate.validator.constraints.Length;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 退货退款Entity
+ *
+ * @author ye.qin
+ * @version 2019-05-24
+ */
+public class CmReturnedPurchase implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    private Integer id;
+    private String returnedNo;        // 退款退货编号
+    private Integer orderID;        // 主订单ID
+    private Integer organizeID;    //组织id
+    private String orderNo;         //主订单号
+    private String userName;        //买家名
+    //	private Integer shopOrderID;		// 子订单Id
+    private Integer userID;        // 用户ID(买家)
+    private String status;        // 状态:1待审核、2审核通过、3审核不通过
+    private String returnedWay;        // 退款方式 1有支付有退款(退款方式可多选具体参考以上金额)、4未支付无退款(未支付发起退款)
+    private String payType;//付款方式 付款方式 1建设银行7297, 2中信银行0897, 3中信银行7172, 4广发银行0115, 5广发银行5461
+    private String returnedBankInfo;        // 退款银行信息(银行名称、户名、开户行、银行账号)【V6.1.1版本已废弃拆分显示】
+    private String operatingOrderStatus;    //发起该操作时订单状态快照:0待确认,11待收待发,12待收部发,13待收全发,21部收待发,22部收部发,23部收全发,31已收待发,32已收部发,33已收全发,4交易完成,5订单完成,6已关闭,7交易全退
+    private Double returnedPurchaseFee;        // 退款(退货)总金额
+    private Double refundFee;        // 退款总额(给买家)
+    private String image1;        // 凭证图片1
+    private String image2;        // 凭证图片2
+    private String image3;        // 凭证图片3
+    private String image4;        // 凭证图片4
+    private String image5;        // 凭证图片5
+
+    private String reviewImage1;        // 凭证图片1
+    private String reviewImage2;        // 凭证图片2
+    private String reviewImage3;        // 凭证图片3
+    private String reviewImage4;        // 凭证图片4
+    private String reviewImage5;        // 凭证图片5
+
+    private String reviewRemarks;   //审核备注
+    private String returnTime;        // 申请退款时间
+    private String confirmReturnTime;        // 确认退款时间(审核退款时间)
+
+    private Date beginReturnTime;
+    private Date endReturnTime;
+
+    private Date beginConfirmReturnTime;
+    private Date endConfirmReturnTime;
+
+    //private List<List<CmReturnedPurchaseProduct>> cmReturnedPurchaseProductList;    //退款退货商品列表(用于前端接收)
+    private List<ShopOrderReturned> shopOrderReturnedList;    //退款退货商品列表
+    //private List<CmReturnedPurchaseProduct> productList;    //退款退货商品列表
+
+    private String bankAccountName;//银行账户名
+    private String bankAccountNo;//开户银行账户
+    private String openBank;//开户银行
+    private String bankAccountType;//账户类型:1公账,2私账
+    private Double refundBalanceFee;//退账户余额
+    private Double refundOnlineFee;//退线上退回
+    private Double refundOfflineFee;//退线下转账
+    private Integer applicationUserID;//申请人ID
+    private Integer reviewUserID;//审核人ID
+    //	private String reviewTime;		// 申请审核时间
+    private String applicationUserName;//申请人
+    private String reviewUserName;//审核人
+
+    public Integer getOrganizeID() {
+        return organizeID;
+    }
+
+    public void setOrganizeID(Integer organizeID) {
+        this.organizeID = organizeID;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    @Length(min = 0, max = 30, message = "退款退货编号长度必须介于 0 和 30 之间")
+    public String getReturnedNo() {
+        return returnedNo;
+    }
+
+    public void setReturnedNo(String returnedNo) {
+        this.returnedNo = returnedNo;
+    }
+
+    public Integer getOrderID() {
+        return orderID;
+    }
+
+    public void setOrderID(Integer orderID) {
+        this.orderID = orderID;
+    }
+
+//	@Length(min=0, max=11, message="子订单Id长度必须介于 0 和 11 之间")
+//	public Integer getShopOrderID() {
+//		return shopOrderID;
+//	}
+//
+//	public void setShopOrderID(Integer shopOrderID) {
+//		this.shopOrderID = shopOrderID;
+//	}
+
+    public Integer getUserID() {
+        return userID;
+    }
+
+    public void setUserID(Integer userID) {
+        this.userID = userID;
+    }
+
+    @Length(min = 0, max = 2, message = "状态:1退货退款中、2已完成、3已取消长度必须介于 0 和 2 之间")
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    @Length(min = 0, max = 11, message = "退款方式 1账户余额、2线下转账、3线上退回长度必须介于 0 和 11 之间")
+    public String getReturnedWay() {
+        return returnedWay;
+    }
+
+    public void setReturnedWay(String returnedWay) {
+        this.returnedWay = returnedWay;
+    }
+
+    @Length(min = 0, max = 300, message = "退款银行信息(银行名称、户名、开户行、银行账号)长度必须介于 0 和 300 之间")
+    public String getReturnedBankInfo() {
+        return returnedBankInfo;
+    }
+
+    public void setReturnedBankInfo(String returnedBankInfo) {
+        this.returnedBankInfo = returnedBankInfo;
+    }
+
+
+    public Double getReturnedPurchaseFee() {
+        return returnedPurchaseFee;
+    }
+
+    public void setReturnedPurchaseFee(Double returnedPurchaseFee) {
+        this.returnedPurchaseFee = returnedPurchaseFee;
+    }
+
+    public Double getRefundFee() {
+        return refundFee;
+    }
+
+    public void setRefundFee(Double refundFee) {
+        this.refundFee = refundFee;
+    }
+
+    public String getImage1() {
+        return image1;
+    }
+
+    public void setImage1(String image1) {
+        this.image1 = image1;
+    }
+
+    public String getImage2() {
+        return image2;
+    }
+
+    public void setImage2(String image2) {
+        this.image2 = image2;
+    }
+
+    public String getImage3() {
+        return image3;
+    }
+
+    public void setImage3(String image3) {
+        this.image3 = image3;
+    }
+
+    public String getImage4() {
+        return image4;
+    }
+
+    public void setImage4(String image4) {
+        this.image4 = image4;
+    }
+
+    public String getImage5() {
+        return image5;
+    }
+
+    public void setImage5(String image5) {
+        this.image5 = image5;
+    }
+
+    @Length(min = 0, max = 19, message = "申请退款时间长度必须介于 0 和 19 之间")
+    public String getReturnTime() {
+        return returnTime;
+    }
+
+    public void setReturnTime(String returnTime) {
+        this.returnTime = returnTime;
+    }
+
+    @Length(min = 0, max = 19, message = "确认退款时间长度必须介于 0 和 19 之间")
+    public String getConfirmReturnTime() {
+        return confirmReturnTime;
+    }
+
+    public void setConfirmReturnTime(String confirmReturnTime) {
+        this.confirmReturnTime = confirmReturnTime;
+    }
+
+    /*public List<List<CmReturnedPurchaseProduct>> getCmReturnedPurchaseProductList() {
+        return cmReturnedPurchaseProductList;
+    }
+
+    public void setCmReturnedPurchaseProductList(List<List<CmReturnedPurchaseProduct>> cmReturnedPurchaseProductList) {
+        this.cmReturnedPurchaseProductList = cmReturnedPurchaseProductList;
+    }*/
+
+    public List<ShopOrderReturned> getShopOrderReturnedList() {
+        return shopOrderReturnedList;
+    }
+
+    public void setShopOrderReturnedList(List<ShopOrderReturned> shopOrderReturnedList) {
+        this.shopOrderReturnedList = shopOrderReturnedList;
+    }
+
+    public String getReviewImage1() {
+        return reviewImage1;
+    }
+
+    public void setReviewImage1(String reviewImage1) {
+        this.reviewImage1 = reviewImage1;
+    }
+
+    public String getReviewImage2() {
+        return reviewImage2;
+    }
+
+    public void setReviewImage2(String reviewImage2) {
+        this.reviewImage2 = reviewImage2;
+    }
+
+    public String getReviewImage3() {
+        return reviewImage3;
+    }
+
+    public void setReviewImage3(String reviewImage3) {
+        this.reviewImage3 = reviewImage3;
+    }
+
+    public String getReviewImage4() {
+        return reviewImage4;
+    }
+
+    public void setReviewImage4(String reviewImage4) {
+        this.reviewImage4 = reviewImage4;
+    }
+
+    public String getReviewImage5() {
+        return reviewImage5;
+    }
+
+    public void setReviewImage5(String reviewImage5) {
+        this.reviewImage5 = reviewImage5;
+    }
+
+    public String getReviewRemarks() {
+        return reviewRemarks;
+    }
+
+    public void setReviewRemarks(String reviewRemarks) {
+        this.reviewRemarks = reviewRemarks;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Date getBeginReturnTime() {
+        return beginReturnTime;
+    }
+
+    public void setBeginReturnTime(Date beginReturnTime) {
+        this.beginReturnTime = beginReturnTime;
+    }
+
+    public Date getEndReturnTime() {
+        return endReturnTime;
+    }
+
+    public void setEndReturnTime(Date endReturnTime) {
+        this.endReturnTime = endReturnTime;
+    }
+
+    public Date getBeginConfirmReturnTime() {
+        return beginConfirmReturnTime;
+    }
+
+    public void setBeginConfirmReturnTime(Date beginConfirmReturnTime) {
+        this.beginConfirmReturnTime = beginConfirmReturnTime;
+    }
+
+    public Date getEndConfirmReturnTime() {
+        return endConfirmReturnTime;
+    }
+
+    public void setEndConfirmReturnTime(Date endConfirmReturnTime) {
+        this.endConfirmReturnTime = endConfirmReturnTime;
+    }
+
+    /*public List<CmReturnedPurchaseProduct> getProductList() {
+        return productList;
+    }
+
+    public void setProductList(List<CmReturnedPurchaseProduct> productList) {
+        this.productList = productList;
+    }*/
+
+    public String getOperatingOrderStatus() {
+        return operatingOrderStatus;
+    }
+
+    public void setOperatingOrderStatus(String operatingOrderStatus) {
+        this.operatingOrderStatus = operatingOrderStatus;
+    }
+
+    public String getBankAccountName() {
+        return bankAccountName;
+    }
+
+    public void setBankAccountName(String bankAccountName) {
+        this.bankAccountName = bankAccountName;
+    }
+
+    public String getBankAccountNo() {
+        return bankAccountNo;
+    }
+
+    public void setBankAccountNo(String bankAccountNo) {
+        this.bankAccountNo = bankAccountNo;
+    }
+
+    public String getOpenBank() {
+        return openBank;
+    }
+
+    public void setOpenBank(String openBank) {
+        this.openBank = openBank;
+    }
+
+    public String getBankAccountType() {
+        return bankAccountType;
+    }
+
+    public void setBankAccountType(String bankAccountType) {
+        this.bankAccountType = bankAccountType;
+    }
+
+    public Double getRefundBalanceFee() {
+        return refundBalanceFee;
+    }
+
+    public void setRefundBalanceFee(Double refundBalanceFee) {
+        this.refundBalanceFee = refundBalanceFee;
+    }
+
+    public Double getRefundOnlineFee() {
+        return refundOnlineFee;
+    }
+
+    public void setRefundOnlineFee(Double refundOnlineFee) {
+        this.refundOnlineFee = refundOnlineFee;
+    }
+
+    public Double getRefundOfflineFee() {
+        return refundOfflineFee;
+    }
+
+    public void setRefundOfflineFee(Double refundOfflineFee) {
+        this.refundOfflineFee = refundOfflineFee;
+    }
+
+    public Integer getApplicationUserID() {
+        return applicationUserID;
+    }
+
+    public void setApplicationUserID(Integer applicationUserID) {
+        this.applicationUserID = applicationUserID;
+    }
+
+    public Integer getReviewUserID() {
+        return reviewUserID;
+    }
+
+    public void setReviewUserID(Integer reviewUserID) {
+        this.reviewUserID = reviewUserID;
+    }
+
+    public String getApplicationUserName() {
+        return applicationUserName;
+    }
+
+    public void setApplicationUserName(String applicationUserName) {
+        this.applicationUserName = applicationUserName;
+    }
+
+    public String getReviewUserName() {
+        return reviewUserName;
+    }
+
+    public void setReviewUserName(String reviewUserName) {
+        this.reviewUserName = reviewUserName;
+    }
+
+    public String getPayType() {
+        return payType;
+    }
+
+    public void setPayType(String payType) {
+        this.payType = payType;
+    }
+}

+ 281 - 0
src/main/java/com/caimei/modules/order/entity/CmReturnedPurchaseProduct.java

@@ -0,0 +1,281 @@
+package com.caimei.modules.order.entity;
+
+
+import java.io.Serializable;
+
+/**
+ * 退货退款商品Entity
+ * @author ye.qin
+ * @version 2019-05-24
+ */
+public class CmReturnedPurchaseProduct implements Serializable {
+	
+	private static final long serialVersionUID = 1L;
+	private Integer id;
+	private Integer returnedID;		// 退货退款Id(退款退货表的ID)
+	private Integer shopOrderID;		// 子订单Id
+	private Integer productID;		// 商品Id
+	private Integer orderProductID;		// 订单商品Id
+	private Integer shopID;		// 供应商Id
+	private Integer applicationReturnedNum;		// 申请退货数量
+	private Integer applicationCancelNum;		// 申请取消数量
+	private Integer actualReturnedNum;		// 实际退货数量
+	private Integer actualCancelNum;		// 实际取消数量
+	private String returnedReceiver;		// 退款接收方:1采美、2供应商、3采美及供应商
+
+	private String status;	//退货状态	状态:1退货退款中、2已完成、3已取消
+
+	private Integer num;
+	private Integer presentNum;
+	private Double price;
+	private Double discount;
+	private Double discountPrice;
+	private Double taxRate;
+	private Double addedValueTax;
+	private String mainImage;
+	private String name;
+	private String shopName;
+	private Double totalFee;
+	private Double totalAddedValueTax;
+	private String unit;
+	private Boolean firstReturn;	//该订单商品是否是首次退货退款
+	private Integer notOutStore;//商品未出库数量
+	private Integer returnedPurchaseProductNum;//商品退货完成数量
+	private Integer cancelProductNum;   //取消数量
+
+	public Integer getId() {
+		return id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public Integer getReturnedID() {
+		return returnedID;
+	}
+
+	public void setReturnedID(Integer returnedID) {
+		this.returnedID = returnedID;
+	}
+	
+	public Integer getProductID() {
+		return productID;
+	}
+
+	public void setProductID(Integer productID) {
+		this.productID = productID;
+	}
+	
+	public Integer getOrderProductID() {
+		return orderProductID;
+	}
+
+	public void setOrderProductID(Integer orderProductID) {
+		this.orderProductID = orderProductID;
+	}
+	
+	public Integer getShopID() {
+		return shopID;
+	}
+
+	public void setShopID(Integer shopID) {
+		this.shopID = shopID;
+	}
+	
+	public Integer getApplicationReturnedNum() {
+		return applicationReturnedNum;
+	}
+
+	public void setApplicationReturnedNum(Integer applicationReturnedNum) {
+		this.applicationReturnedNum = applicationReturnedNum;
+	}
+	
+	public Integer getApplicationCancelNum() {
+		return applicationCancelNum;
+	}
+
+	public void setApplicationCancelNum(Integer applicationCancelNum) {
+		this.applicationCancelNum = applicationCancelNum;
+	}
+	
+	public Integer getActualReturnedNum() {
+		return actualReturnedNum;
+	}
+
+	public void setActualReturnedNum(Integer actualReturnedNum) {
+		this.actualReturnedNum = actualReturnedNum;
+	}
+	
+	public Integer getActualCancelNum() {
+		return actualCancelNum;
+	}
+
+	public void setActualCancelNum(Integer actualCancelNum) {
+		this.actualCancelNum = actualCancelNum;
+	}
+
+	public Integer getShopOrderID() {
+		return shopOrderID;
+	}
+
+	public void setShopOrderID(Integer shopOrderID) {
+		this.shopOrderID = shopOrderID;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getReturnedReceiver() {
+		return returnedReceiver;
+	}
+
+	public void setReturnedReceiver(String returnedReceiver) {
+		this.returnedReceiver = returnedReceiver;
+	}
+
+	public static long getSerialVersionUID() {
+		return serialVersionUID;
+	}
+
+	public Double getPrice() {
+		return price;
+	}
+
+	public void setPrice(Double price) {
+		this.price = price;
+	}
+
+	public Double getDiscount() {
+		return discount;
+	}
+
+	public void setDiscount(Double discount) {
+		this.discount = discount;
+	}
+
+	public Double getDiscountPrice() {
+		return discountPrice;
+	}
+
+	public void setDiscountPrice(Double discountPrice) {
+		this.discountPrice = discountPrice;
+	}
+
+	public Double getTaxRate() {
+		return taxRate;
+	}
+
+	public void setTaxRate(Double taxRate) {
+		this.taxRate = taxRate;
+	}
+
+	public Double getAddedValueTax() {
+		return addedValueTax;
+	}
+
+	public void setAddedValueTax(Double addedValueTax) {
+		this.addedValueTax = addedValueTax;
+	}
+
+	public String getMainImage() {
+		return mainImage;
+	}
+
+	public void setMainImage(String mainImage) {
+		this.mainImage = mainImage;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getShopName() {
+		return shopName;
+	}
+
+	public void setShopName(String shopName) {
+		this.shopName = shopName;
+	}
+
+	public Integer getNum() {
+		return num;
+	}
+
+	public void setNum(Integer num) {
+		this.num = num;
+	}
+
+	public Double getTotalFee() {
+		return totalFee;
+	}
+
+	public void setTotalFee(Double totalFee) {
+		this.totalFee = totalFee;
+	}
+
+	public Double getTotalAddedValueTax() {
+		return totalAddedValueTax;
+	}
+
+	public void setTotalAddedValueTax(Double totalAddedValueTax) {
+		this.totalAddedValueTax = totalAddedValueTax;
+	}
+
+	public String getUnit() {
+		return unit;
+	}
+
+	public void setUnit(String unit) {
+		this.unit = unit;
+	}
+
+	public Integer getPresentNum() {
+		return presentNum;
+	}
+
+	public void setPresentNum(Integer presentNum) {
+		this.presentNum = presentNum;
+	}
+
+	public Boolean getFirstReturn() {
+		return firstReturn;
+	}
+
+	public void setFirstReturn(Boolean firstReturn) {
+		this.firstReturn = firstReturn;
+	}
+
+	public Integer getNotOutStore() {
+		return notOutStore;
+	}
+
+	public void setNotOutStore(Integer notOutStore) {
+		this.notOutStore = notOutStore;
+	}
+
+	public Integer getReturnedPurchaseProductNum() {
+		return returnedPurchaseProductNum;
+	}
+
+	public void setReturnedPurchaseProductNum(Integer returnedPurchaseProductNum) {
+		this.returnedPurchaseProductNum = returnedPurchaseProductNum;
+	}
+
+	public Integer getCancelProductNum() {
+		return cancelProductNum;
+	}
+
+	public void setCancelProductNum(Integer cancelProductNum) {
+		this.cancelProductNum = cancelProductNum;
+	}
+}

+ 93 - 0
src/main/java/com/caimei/modules/order/entity/LogisticsBatch.java

@@ -0,0 +1,93 @@
+package com.caimei.modules.order.entity;
+
+
+import java.util.Date;
+
+/**
+ * @author lwt
+ * @date 2018-08-13
+ * @description 发货批次
+ */
+public class LogisticsBatch {
+    private Integer id;
+    private Integer shopOrderID;//子订单ID
+    private Integer orderID;//主订单ID
+    private Integer outStoreTimes;//第几批发货
+    private String mailer;//邮寄者  0 采美   1 供应商
+    private Integer shopID;//供应商ID
+    private Date updateDate;//最后更新时间
+    private Date deliveryTime;//发货时间
+    private Date receiptTime;//收货时间
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getShopOrderID() {
+        return shopOrderID;
+    }
+
+    public void setShopOrderID(Integer shopOrderID) {
+        this.shopOrderID = shopOrderID;
+    }
+
+    public Integer getOrderID() {
+        return orderID;
+    }
+
+    public void setOrderID(Integer orderID) {
+        this.orderID = orderID;
+    }
+
+    public Integer getOutStoreTimes() {
+        return outStoreTimes;
+    }
+
+    public void setOutStoreTimes(Integer outStoreTimes) {
+        this.outStoreTimes = outStoreTimes;
+    }
+
+    public String getMailer() {
+        return mailer;
+    }
+
+    public void setMailer(String mailer) {
+        this.mailer = mailer;
+    }
+
+    public Integer getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(Integer shopID) {
+        this.shopID = shopID;
+    }
+
+    public Date getUpdateDate() {
+        return updateDate;
+    }
+
+    public void setUpdateDate(Date updateDate) {
+        this.updateDate = updateDate;
+    }
+
+    public Date getDeliveryTime() {
+        return deliveryTime;
+    }
+
+    public void setDeliveryTime(Date deliveryTime) {
+        this.deliveryTime = deliveryTime;
+    }
+
+    public Date getReceiptTime() {
+        return receiptTime;
+    }
+
+    public void setReceiptTime(Date receiptTime) {
+        this.receiptTime = receiptTime;
+    }
+}

+ 30 - 0
src/main/java/com/caimei/modules/order/entity/LogisticsDetailVo.java

@@ -0,0 +1,30 @@
+package com.caimei.modules.order.entity;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 单条物流信息展示
+ */
+public class LogisticsDetailVo {
+
+    private String time;
+    private String desc;
+
+
+    public String getTime() {
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(Long.valueOf(time + "000")));
+    }
+
+    public void setTime(String time) {
+        this.time = time;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}

+ 39 - 0
src/main/java/com/caimei/modules/order/entity/LogisticsInfoVo.java

@@ -0,0 +1,39 @@
+package com.caimei.modules.order.entity;
+
+import java.util.List;
+
+/**
+ * 物流展示的VO
+ */
+public class LogisticsInfoVo {
+
+    private LogisticsBatch logisticsBatch;  // 物流批次
+
+    private List<LogisticsRecord> logisticsRecordList;  //一批物流 对多个货物
+
+    private List<LogisticsInformation> logisticsInformationList;  // 一批物流对多个快递记录
+
+    public LogisticsBatch getLogisticsBatch() {
+        return logisticsBatch;
+    }
+
+    public void setLogisticsBatch(LogisticsBatch logisticsBatch) {
+        this.logisticsBatch = logisticsBatch;
+    }
+
+    public List<LogisticsRecord> getLogisticsRecordList() {
+        return logisticsRecordList;
+    }
+
+    public void setLogisticsRecordList(List<LogisticsRecord> logisticsRecordList) {
+        this.logisticsRecordList = logisticsRecordList;
+    }
+
+    public List<LogisticsInformation> getLogisticsInformationList() {
+        return logisticsInformationList;
+    }
+
+    public void setLogisticsInformationList(List<LogisticsInformation> logisticsInformationList) {
+        this.logisticsInformationList = logisticsInformationList;
+    }
+}

+ 145 - 0
src/main/java/com/caimei/modules/order/entity/LogisticsInformation.java

@@ -0,0 +1,145 @@
+package com.caimei.modules.order.entity;
+
+
+import com.alibaba.fastjson.JSONArray;
+
+import java.beans.Transient;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author lwt
+ * @date 2018-08-13
+ * @description 物流信息表
+ */
+public class LogisticsInformation{
+    private Integer logisticsBatchID; // 发货批次表ID
+    private String type; // 类型:1 采美365  2 呵呵商城 3 大宗采购'
+    private Integer shopOrderID;
+    private Integer orderID;
+    private String orderProductID;
+    private String nu; //快递单号
+    private String state; //快递单当前的状态(0:在途,即货物处于运输过程中;1:揽件,货物已由快递公司揽收并且产生了第一条跟踪信息;2:疑难,货物寄送过程出了问题;3:签收,收件人已签收;4:退签,即货物由于用户拒签、超区等原因退回,而且发件人已经签收;5:派件,即快递正在进行同城派件;6:退回,货物正处于退回发件人的途中;)
+    private String info; //物流跟踪信息
+    private String logisticsCompanyName; //物流公司名称
+    private String logisticsCompanyCode; //物流公司代码
+    private Integer shopID; //供应商ID
+    private String remarks; //备注
+    private Date updateDate; //最后更新时间
+
+    // -----------------
+    private List<LogisticsDetailVo> logisticsDetailVos; // 格式化后的物流跟踪信息
+
+    public Integer getLogisticsBatchID() {
+        return logisticsBatchID;
+    }
+
+    public void setLogisticsBatchID(Integer logisticsBatchID) {
+        this.logisticsBatchID = logisticsBatchID;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Integer getShopOrderID() {
+        return shopOrderID;
+    }
+
+    public void setShopOrderID(Integer shopOrderID) {
+        this.shopOrderID = shopOrderID;
+    }
+
+    public Integer getOrderID() {
+        return orderID;
+    }
+
+    public void setOrderID(Integer orderID) {
+        this.orderID = orderID;
+    }
+
+    public String getOrderProductID() {
+        return orderProductID;
+    }
+
+    public void setOrderProductID(String orderProductID) {
+        this.orderProductID = orderProductID;
+    }
+
+    public String getNu() {
+        return nu;
+    }
+
+    public void setNu(String nu) {
+        this.nu = nu;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getInfo() {
+        return info;
+    }
+
+    public void setInfo(String info) {
+        this.info = info;
+    }
+
+    public String getLogisticsCompanyName() {
+        return logisticsCompanyName;
+    }
+
+    public void setLogisticsCompanyName(String logisticsCompanyName) {
+        this.logisticsCompanyName = logisticsCompanyName;
+    }
+
+    public String getLogisticsCompanyCode() {
+        return logisticsCompanyCode;
+    }
+
+    public void setLogisticsCompanyCode(String logisticsCompanyCode) {
+        this.logisticsCompanyCode = logisticsCompanyCode;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public Date getUpdateDate() {
+        return updateDate;
+    }
+
+    public void setUpdateDate(Date updateDate) {
+        this.updateDate = updateDate;
+    }
+
+    public Integer getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(Integer shopID) {
+        this.shopID = shopID;
+    }
+
+    @Transient
+    public List<LogisticsDetailVo> getLogisticsDetailVos() {
+        return JSONArray.parseArray(getInfo(), LogisticsDetailVo.class);
+    }
+
+    public void setLogisticsDetailVos(List<LogisticsDetailVo> logisticsDetailVos) {
+        this.logisticsDetailVos = logisticsDetailVos;
+    }
+}

+ 93 - 0
src/main/java/com/caimei/modules/order/entity/LogisticsRecord.java

@@ -0,0 +1,93 @@
+package com.caimei.modules.order.entity;
+
+
+/**
+ * @author lwt
+ * @date 2018-07-24
+ * @description 发货记录
+ */
+public class LogisticsRecord{
+
+    private Integer logisticsBatchID; //发货物流批次ID
+    private Integer orderID; //子订单ID
+    private Integer shopOrderID; //主订单ID
+    private Integer orderProductID; //订单商品ID
+    private Integer buyNum; //商品购买数量
+    private Integer num; //此次发货数量
+    private Integer productID; //商品ID
+    private String productName; //商品名称
+    private String image; //商品图片
+
+
+    public Integer getLogisticsBatchID() {
+        return logisticsBatchID;
+    }
+
+    public void setLogisticsBatchID(Integer logisticsBatchID) {
+        this.logisticsBatchID = logisticsBatchID;
+    }
+
+    public Integer getOrderID() {
+        return orderID;
+    }
+
+    public void setOrderID(Integer orderID) {
+        this.orderID = orderID;
+    }
+
+    public Integer getShopOrderID() {
+        return shopOrderID;
+    }
+
+    public void setShopOrderID(Integer shopOrderID) {
+        this.shopOrderID = shopOrderID;
+    }
+
+    public Integer getOrderProductID() {
+        return orderProductID;
+    }
+
+    public void setOrderProductID(Integer orderProductID) {
+        this.orderProductID = orderProductID;
+    }
+
+    public Integer getBuyNum() {
+        return buyNum;
+    }
+
+    public void setBuyNum(Integer buyNum) {
+        this.buyNum = buyNum;
+    }
+
+    public Integer getNum() {
+        return num;
+    }
+
+    public void setNum(Integer num) {
+        this.num = num;
+    }
+
+    public Integer getProductID() {
+        return productID;
+    }
+
+    public void setProductID(Integer productID) {
+        this.productID = productID;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public String getImage() {
+        return image;
+    }
+
+    public void setImage(String image) {
+        this.image = image;
+    }
+}

+ 781 - 0
src/main/java/com/caimei/modules/order/entity/NewOrder.java

@@ -0,0 +1,781 @@
+package com.caimei.modules.order.entity;
+
+import java.beans.Transient;
+import java.util.List;
+
+/**
+ * @author lwt
+ * @date 2018-07-24
+ * @description 主订单表
+ */
+public class NewOrder{
+    private Integer orderID;             // bigint(11) not null,
+    private String orderNo;             // varchar(30) comment '订单编号',
+    private Integer userID;              // bigint(11), 订单归属人
+    //采美组织: 默认为null,具体对应cm_mall_organize表ID
+    private Integer organizeID;
+    private String shopOrderIDs;        // varchar(100) comment '子订单ID',
+    private String orderSubmitType;     // char(2) comment '订单提交类型',
+    private String status;      // char(2) comment '订单状态'
+    // v5.0.0新状态 '0待确认,11待收待发,12待收部发,13待收全发,21部收待发,22部收部发,23部收全发,31已收待发,32已收部发,33已收全发,4交易完成,5订单完成,6已关闭,7交易全退'
+    private Double productTotalFee;   // decimal(20,6) comment '商品总金额',
+    private Double shouldPayProduct;            //应收商品金额==应付合计(只需要付商品金额)
+    private String hasActProduct; // '是否包含活动商品(受订单未支付自动关闭时间影响)  0 否 1 是',
+    private Double orderTotalFee;    // decimal(20,6) comment '订单总金额',
+    private Double payableAmount;       // 应付金额
+    private Double payTotalFee;         // decimal(20,6) comment '支付金额',
+    private Double balancePayFee;       // decimal(20,6) comment '余额支付',
+    private Double discountFee;         // decimal(20,6) comment '折扣金额',
+    private Integer spID;                // bigint(11),
+    private Integer mainSpID;            // bigint(6),
+    private String note;                // text comment '订单备注',
+    private Integer clubID;              // bigint(11),
+    private String clubScanTime;        // varchar(19),
+    private String payWay;              // 支付方式,(协销订单可能会存在多种进账方式用,隔开),
+    private Integer payTypeID;           // int(11) comment '支付类型',
+    private String orderSource;         // char(1) comment '订单来源',
+    private String orderTime;           // datetime comment '订单提交时间',
+    private String confirmTime;           // datetime comment '订单确认时间',
+    private String cooFreeFlag;          // char(1) comment '库分期免息状态',
+    private Integer cooFreeRate;         // int(3) comment '库分期分期费率',
+    private Double cooFreeAmount;       // decimal(20,2) comment '库分期免息金额',
+    private String confirmFlag;         // char(1) comment '订单确认标志',
+    private Integer clauseID;            // bigint(11) comment '条款ID',
+    private String clauseContent;       // text comment '条款内容',
+    private String clauseName;          // varchar(50) comment '条款名称',
+    private String freePostFlag;        // char(1) comment 免邮标志 运费:-1到付,0包邮,1需要运费
+    private Double freight;             // decimal(20,0) comment '运费' v5.0版本已废弃,运费已使用商品形式存储,
+    private Integer buyUserID;//            下单人
+    private String orderType;//      char(2) comment '订单类型 协销订单0 普通订单1',
+    private List<NewShopOrder> newShopOrders;
+    private OrderUserInfo bpOrderUserinfo; //订单用户信息表
+    private OrderInvoice orderInvoice;
+    private Integer productCount;		// 商品总数
+    private Integer presentCount;		// 赠送总数
+    private String payTime; //订单支付时间
+    private String payFlag;//是否已支付 未支付0 已支付1
+    private String onlinePayFlag;//能否显示支付 :0 能线上 1 线下
+    private Double preferential; //总优惠 自助下单活动优惠 协销下单price-折后单价
+    private String splitFlag; // 订单能否拆分 1 为可拆分, 0为不可拆分
+    private String closeReason; //订单取消原因
+    private String invoiceFlag;      //是否开发票 0 不开 1 开发票
+    // ---------------- v5.0.0 新加
+    private String receiptStatus; //(收款买家)收款状态:1待收款、2部分收款、3已收款
+    private String payStatus; //(付款供应商)付款状态:1待付款、2部分付款、3已付款
+    private String sendOutStatus; //发货状态:1待发货、2部分发货、3已发货
+    private String refundType; //退货退款类型:1部分退、2全部退
+    private String postageOrderFlag = "0"; //邮费订单标识 1是邮费订单  0不是邮费订单
+    private Double paidAmount;//已付金额(用户已支付金额包括余额支付和线上线下支付)
+    private Double totalDiscount;//订单退款已退的经理折扣金额
+    // -----------------  v5.0.0 end
+
+  //-------------        虚拟字段   ----------------------------
+    private String shopName;            //供应商
+    private String receiver;//收货人
+    private String buyer;//买家
+    private String alreadyReceipt;//已收金额(需要包含运费,目前只存在普通订单存在运费)
+    private String unReceipt;//未收金额(需要包含运费,目前只存在普通订单存在运费)
+    private String paid;//已付金额(不需要包含运费,等同于订单商品金额)
+    private String unpaid;//未付金额(不需要包含运费,等同于订单商品金额)
+    private String brokerage;//佣金
+    private String buyerName; //买家名称
+    private String mobile; //手机
+    private String address; //地址
+    private String startTime;
+    private String endTime;
+    private String startRefundTime;
+    private String endRefundTime;
+    private Double totalAddedValueTax;//总税费
+    private String shopNameInfo;//
+    private String orderRefundType = "";//
+    private String returnedPurchaseStatus;//1审核中,0不是审核中
+    private String applyReturnedPurchaseFlag;//0不可以申请,1可以申请(此标记只用于是否存在审核中或者审核不通过记录,存在记录则不可以申请)
+    private String spName;
+    private List<NewOrderProduct> orderProduct;// 订单内的商品集合
+    private String searchflag;//0搜索,1导出
+    private String[] shopNote;  //子订单备注   修改时用来记录一下的
+    private String rebateOrder;  //是不是返佣订单 是的1,  不是的0
+    private String[] ps;    //付款状态集合
+    private String shopOrderNo;//       varchar(30) comment '子订单编号'
+    private String toAudit;   //有没有收款待审核的订单 , 有的1
+
+    public Integer getOrganizeID() {
+        return organizeID;
+    }
+    public void setOrganizeID(Integer organizeID) {
+        this.organizeID = organizeID;
+    }
+
+    public String getToAudit() {
+        return toAudit;
+    }
+
+    public void setToAudit(String toAudit) {
+        this.toAudit = toAudit;
+    }
+
+    public String[] getPs() {
+        return ps;
+    }
+
+    public void setPs(String[] ps) {
+        this.ps = ps;
+    }
+
+    public String getShopOrderNo() {
+        return shopOrderNo;
+    }
+
+    public void setShopOrderNo(String shopOrderNo) {
+        this.shopOrderNo = shopOrderNo;
+    }
+
+    public Integer getOrderID() {
+        return orderID;
+    }
+
+    public void setOrderID(Integer orderID) {
+        this.orderID = orderID;
+    }
+
+    public Double getShouldPayProduct() {
+        return shouldPayProduct;
+    }
+
+    public void setShouldPayProduct(Double shouldPayProduct) {
+        this.shouldPayProduct = shouldPayProduct;
+    }
+
+    public String getSearchflag() {
+        return searchflag;
+    }
+
+    public void setSearchflag(String searchflag) {
+        this.searchflag = searchflag;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Integer getUserID() {
+        return userID;
+    }
+
+    public void setUserID(Integer userID) {
+        this.userID = userID;
+    }
+
+    public String getShopOrderIDs() {
+        return shopOrderIDs;
+    }
+
+    public void setShopOrderIDs(String shopOrderIDs) {
+        this.shopOrderIDs = shopOrderIDs;
+    }
+
+    public String getOrderSubmitType() {
+        return orderSubmitType;
+    }
+
+    public void setOrderSubmitType(String orderSubmitType) {
+        this.orderSubmitType = orderSubmitType;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public Double getProductTotalFee() {
+        return productTotalFee;
+    }
+
+    public void setProductTotalFee(Double productTotalFee) {
+        this.productTotalFee = productTotalFee;
+    }
+
+    public Double getOrderTotalFee() {
+        return orderTotalFee;
+    }
+
+    public void setOrderTotalFee(Double orderTotalFee) {
+        this.orderTotalFee = orderTotalFee;
+    }
+
+    public Double getPayTotalFee() {
+        return payTotalFee;
+    }
+
+    public void setPayTotalFee(Double payTotalFee) {
+        this.payTotalFee = payTotalFee;
+    }
+
+    public Double getBalancePayFee() {
+        return balancePayFee;
+    }
+
+    public void setBalancePayFee(Double balancePayFee) {
+        this.balancePayFee = balancePayFee;
+    }
+
+    public Double getDiscountFee() {
+        return discountFee;
+    }
+
+    public void setDiscountFee(Double discountFee) {
+        this.discountFee = discountFee;
+    }
+
+    public Integer getSpID() {
+        return spID;
+    }
+
+    public void setSpID(Integer spID) {
+        this.spID = spID;
+    }
+
+    public Integer getMainSpID() {
+        return mainSpID;
+    }
+
+    public void setMainSpID(Integer mainSpID) {
+        this.mainSpID = mainSpID;
+    }
+
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note;
+    }
+
+    public Integer getClubID() {
+        return clubID;
+    }
+
+    public void setClubID(Integer clubID) {
+        this.clubID = clubID;
+    }
+
+    public String getClubScanTime() {
+        return clubScanTime;
+    }
+
+    public void setClubScanTime(String clubScanTime) {
+        this.clubScanTime = clubScanTime;
+    }
+
+    public String getPayWay() {
+        return payWay;
+    }
+
+    public void setPayWay(String payWay) {
+        this.payWay = payWay;
+    }
+
+    public Integer getPayTypeID() {
+        return payTypeID;
+    }
+
+    public void setPayTypeID(Integer payTypeID) {
+        this.payTypeID = payTypeID;
+    }
+
+    public String getOrderSource() {
+        return orderSource;
+    }
+
+    public void setOrderSource(String orderSource) {
+        this.orderSource = orderSource;
+    }
+
+    public String getOrderTime() {
+        return orderTime;
+    }
+
+    public void setOrderTime(String orderTime) {
+        this.orderTime = orderTime;
+    }
+
+    public String getCooFreeFlag() {
+        return cooFreeFlag;
+    }
+
+    public void setCooFreeFlag(String cooFreeFlag) {
+        this.cooFreeFlag = cooFreeFlag;
+    }
+
+    public Integer getCooFreeRate() {
+        return cooFreeRate;
+    }
+
+    public void setCooFreeRate(Integer cooFreeRate) {
+        this.cooFreeRate = cooFreeRate;
+    }
+
+    public Double getCooFreeAmount() {
+        return cooFreeAmount;
+    }
+
+    public void setCooFreeAmount(Double cooFreeAmount) {
+        this.cooFreeAmount = cooFreeAmount;
+    }
+
+    public String getConfirmFlag() {
+        return confirmFlag;
+    }
+
+    public void setConfirmFlag(String confirmFlag) {
+        this.confirmFlag = confirmFlag;
+    }
+
+    public Integer getClauseID() {
+        return clauseID;
+    }
+
+    public void setClauseID(Integer clauseID) {
+        this.clauseID = clauseID;
+    }
+
+    public String getClauseContent() {
+        return clauseContent;
+    }
+
+    public void setClauseContent(String clauseContent) {
+        this.clauseContent = clauseContent;
+    }
+
+    public String getClauseName() {
+        return clauseName;
+    }
+
+    public void setClauseName(String clauseName) {
+        this.clauseName = clauseName;
+    }
+
+    public String getFreePostFlag() {
+        return freePostFlag;
+    }
+
+    public void setFreePostFlag(String freePostFlag) {
+        this.freePostFlag = freePostFlag;
+    }
+
+    public Double getFreight() {
+        return freight;
+    }
+
+    public void setFreight(Double freight) {
+        this.freight = freight;
+    }
+
+//    public Integer getFreePostageTicketID() {
+//        return freePostageTicketID;
+//    }
+//
+//    public void setFreePostageTicketID(Integer freePostageTicketID) {
+//        this.freePostageTicketID = freePostageTicketID;
+//    }
+
+    public Integer getBuyUserID() {
+        return buyUserID;
+    }
+
+    public void setBuyUserID(Integer buyUserID) {
+        this.buyUserID = buyUserID;
+    }
+
+    public String getOrderType() {
+        return orderType;
+    }
+
+    public void setOrderType(String orderType) {
+        this.orderType = orderType;
+    }
+
+    public List<NewShopOrder> getNewShopOrders() {
+        return newShopOrders;
+    }
+
+    public void setNewShopOrders(List<NewShopOrder> newShopOrders) {
+        this.newShopOrders = newShopOrders;
+    }
+
+    public OrderInvoice getOrderInvoice() {
+        return orderInvoice;
+    }
+
+    public void setOrderInvoice(OrderInvoice orderInvoice) {
+        this.orderInvoice = orderInvoice;
+    }
+
+    public Integer getProductCount() {
+        return productCount;
+    }
+
+    public void setProductCount(Integer productCount) {
+        this.productCount = productCount;
+    }
+
+    public Integer getPresentCount() {
+        return presentCount;
+    }
+
+    public void setPresentCount(Integer presentCount) {
+        this.presentCount = presentCount;
+    }
+
+    @Transient
+    public List<NewOrderProduct> getOrderProduct() {
+        return orderProduct;
+    }
+
+    public void setOrderProduct(List<NewOrderProduct> orderProduct) {
+        this.orderProduct = orderProduct;
+    }
+
+    @Transient
+    public String getBuyerName() {
+        return buyerName;
+    }
+
+    public void setBuyerName(String buyerName) {
+        this.buyerName = buyerName;
+    }
+
+    @Transient
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    @Transient
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+    @Transient
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+    @Transient
+    public String getReceiver() {
+        return receiver;
+    }
+
+    public void setReceiver(String receiver) {
+        this.receiver = receiver;
+    }
+    @Transient
+    public String getBuyer() {
+        return buyer;
+    }
+
+    public void setBuyer(String buyer) {
+        this.buyer = buyer;
+    }
+    @Transient
+    public String getAlreadyReceipt() {
+        return alreadyReceipt;
+    }
+
+    public void setAlreadyReceipt(String alreadyReceipt) {
+        this.alreadyReceipt = alreadyReceipt;
+    }
+    @Transient
+    public String getUnReceipt() {
+        return unReceipt;
+    }
+
+    public void setUnReceipt(String unReceipt) {
+        this.unReceipt = unReceipt;
+    }
+    @Transient
+    public String getPaid() {
+        return paid;
+    }
+
+    public void setPaid(String paid) {
+        this.paid = paid;
+    }
+    @Transient
+    public String getUnpaid() {
+        return unpaid;
+    }
+
+    public void setUnpaid(String unpaid) {
+        this.unpaid = unpaid;
+    }
+    @Transient
+    public String getBrokerage() {
+        return brokerage;
+    }
+
+    public void setBrokerage(String brokerage) {
+        this.brokerage = brokerage;
+    }
+
+    public OrderUserInfo getBpOrderUserinfo() {
+        return bpOrderUserinfo;
+    }
+
+    public void setBpOrderUserinfo(OrderUserInfo bpOrderUserinfo) {
+        this.bpOrderUserinfo = bpOrderUserinfo;
+    }
+
+    public String getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(String payTime) {
+        this.payTime = payTime;
+    }
+
+    public Double getPreferential() {
+        return preferential;
+    }
+
+    public void setPreferential(Double preferential) {
+        this.preferential = preferential;
+    }
+
+    @Transient
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+    @Transient
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+    @Transient
+    public String getSplitFlag() {
+        return splitFlag;
+    }
+
+    public void setSplitFlag(String splitFlag) {
+        this.splitFlag = splitFlag;
+    }
+
+    @Transient
+    public Double getTotalAddedValueTax() {
+        return totalAddedValueTax;
+    }
+
+    public void setTotalAddedValueTax(Double totalAddedValueTax) {
+        this.totalAddedValueTax = totalAddedValueTax;
+    }
+
+    public String getPayFlag() {
+        return payFlag;
+    }
+
+    public void setPayFlag(String payFlag) {
+        this.payFlag = payFlag;
+    }
+
+    public String getOnlinePayFlag() {
+        return onlinePayFlag;
+    }
+
+    public void setOnlinePayFlag(String onlinePayFlag) {
+        this.onlinePayFlag = onlinePayFlag;
+    }
+
+    public String getHasActProduct() {
+        return hasActProduct;
+    }
+
+    public void setHasActProduct(String hasActProduct) {
+        this.hasActProduct = hasActProduct;
+    }
+
+    public String getConfirmTime() {
+        return confirmTime;
+    }
+
+    public void setConfirmTime(String confirmTime) {
+        this.confirmTime = confirmTime;
+    }
+
+    public String getCloseReason() {
+        return closeReason;
+    }
+
+    public void setCloseReason(String closeReason) {
+        this.closeReason = closeReason;
+    }
+
+    @Transient
+    public String getShopNameInfo() {
+        return shopNameInfo;
+    }
+
+    public void setShopNameInfo(String shopNameInfo) {
+        this.shopNameInfo = shopNameInfo;
+    }
+
+    public String getInvoiceFlag() {
+        return invoiceFlag;
+    }
+
+    public void setInvoiceFlag(String invoiceFlag) {
+        this.invoiceFlag = invoiceFlag;
+    }
+
+    public Double getPayableAmount() {
+        return payableAmount;
+    }
+
+    public void setPayableAmount(Double payableAmount) {
+        this.payableAmount = payableAmount;
+    }
+
+    public String getReceiptStatus() {
+        return receiptStatus;
+    }
+
+    public void setReceiptStatus(String receiptStatus) {
+        this.receiptStatus = receiptStatus;
+    }
+
+    public String getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(String payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    public String getSendOutStatus() {
+        return sendOutStatus;
+    }
+
+    public void setSendOutStatus(String sendOutStatus) {
+        this.sendOutStatus = sendOutStatus;
+    }
+
+    public String getRefundType() {
+        return refundType;
+    }
+
+    public void setRefundType(String refundType) {
+        this.refundType = refundType;
+    }
+
+    public String getStartRefundTime() {
+        return startRefundTime;
+    }
+
+    public void setStartRefundTime(String startRefundTime) {
+        this.startRefundTime = startRefundTime;
+    }
+
+    public String getEndRefundTime() {
+        return endRefundTime;
+    }
+
+    public void setEndRefundTime(String endRefundTime) {
+        this.endRefundTime = endRefundTime;
+    }
+
+    public String getOrderRefundType() {
+        return orderRefundType;
+    }
+
+    public void setOrderRefundType(String orderRefundType) {
+        this.orderRefundType = orderRefundType;
+    }
+
+    public String[] getShopNote() {
+        return shopNote;
+    }
+
+    public void setShopNote(String[] shopNote) {
+        this.shopNote = shopNote;
+    }
+
+    public String getPostageOrderFlag() {
+        return postageOrderFlag;
+    }
+
+    public void setPostageOrderFlag(String postageOrderFlag) {
+        this.postageOrderFlag = postageOrderFlag;
+    }
+
+    @Transient
+    public String getRebateOrder() {
+        return rebateOrder;
+    }
+
+    public void setRebateOrder(String rebateOrder) {
+        this.rebateOrder = rebateOrder;
+    }
+    @Transient
+    public String getReturnedPurchaseStatus() {
+        return returnedPurchaseStatus;
+    }
+
+    public void setReturnedPurchaseStatus(String returnedPurchaseStatus) {
+        this.returnedPurchaseStatus = returnedPurchaseStatus;
+    }
+    @Transient
+    public String getSpName() {
+        return spName;
+    }
+
+    public void setSpName(String spName) {
+        this.spName = spName;
+    }
+
+    public String getApplyReturnedPurchaseFlag() {
+        return applyReturnedPurchaseFlag;
+    }
+
+    public void setApplyReturnedPurchaseFlag(String applyReturnedPurchaseFlag) {
+        this.applyReturnedPurchaseFlag = applyReturnedPurchaseFlag;
+    }
+    @Transient
+    public Double getPaidAmount() {
+        return paidAmount;
+    }
+
+    public void setPaidAmount(Double paidAmount) {
+        this.paidAmount = paidAmount;
+    }
+    @Transient
+    public Double getTotalDiscount() {
+        return totalDiscount;
+    }
+
+    public void setTotalDiscount(Double totalDiscount) {
+        this.totalDiscount = totalDiscount;
+    }
+}
+

+ 33 - 0
src/main/java/com/caimei/modules/order/entity/NewOrderConfig.java

@@ -0,0 +1,33 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+
+public class NewOrderConfig implements Serializable {
+    private String key;
+    private Double value;
+    private String description;
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public Double getValue() {
+        return value;
+    }
+
+    public void setValue(Double value) {
+        this.value = value;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 796 - 0
src/main/java/com/caimei/modules/order/entity/NewOrderProduct.java

@@ -0,0 +1,796 @@
+package com.caimei.modules.order.entity;
+
+import com.caimei.modules.club.entity.CmProductSn;
+import com.caimei.utils.AppUtils;
+
+import java.beans.Transient;
+import java.util.List;
+
+public class NewOrderProduct {
+    private Integer orderProductID;//       int(11) not null auto_increment,
+    private Integer shopOrderID;//       int(11) comment '子订单Id',
+    private String shopOrderNo;//    varchar(50) comment '子订单编号',
+    private Integer shopID;//      bigint(11) comment '供应商ID',
+    private String ledgerNo;        // 供应商分账易宝商户编号
+    private Integer productID;//      int(11) comment '商品Id',
+    private Integer num;//     int(11) comment '数量',
+    private Integer presentNum;//   int(11) comment '赠送数量',
+    private String outStoreType;// char(1) comment '出库类型',
+    private Integer skuID;//     int(11) comment 'skuId',
+    private String props;//     national varchar(1000) comment 'sku属性',
+    private String propName;//   national varchar(1000) comment '属性名',
+    private String productNo;//    national varchar(50) comment '商品编号',
+    private Double price;//     float comment '订单商品购买价格',
+    private Double shopProductAmount;        // 商品费  =  成本价快照  *  (购买数量  + 赠品数量)
+    private Double normalPrice;//     float comment '市场价 = 商品表市场价',
+    private Double totalAmount;//     float comment '总价',
+    private Double discount;//     decimal(20,6) comment '折扣',
+    private Double discountPrice;//     decimal(20,6) comment '折后单价',
+    private Double taxRate;//     decimal(20,0) comment '税率',
+    private Double addedValueTax;//     decimal(20,6) comment '增值税',
+    private Double totalAddedValueTax;//  decimal(20,6) comment '总增值税(应收税费)',
+    private Double shouldPayTotalTax;//  decimal(20,6) comment '总增值税(应付税费)',
+    private Double shopFee;//     decimal(20,6) comment '应付供应商金额',
+    private Double otherFee;//       decimal(20,6) comment '应付第三方金额',
+    private Double cmFee;//      decimal(20,6) comment '应付采美金额',
+    private Double singleShopFee;//    decimal(20,6) comment '单个应付供应商金额',
+    private Double singleOtherFee;//   decimal(20,6) comment '单个应付第三方金额',
+    private Double singleCmFee;//   decimal(20,6) comment '单个应付采美金额',
+    private Double shouldPayFee;//   decimal(20,6) comment '应付金额',
+    private String commentFlag;//        national char(1) comment '是否已评论:1是,空或0未评论',
+    private Double price0;//   float(10,2),
+    private Double price1;//   float comment '普通会员价',
+    private Double totalFee;//   float comment '总价',
+    private Double totalBeans;//  decimal(10,2) comment '获取到的总采美豆值',
+    private Double useBalanceAmount;//  double comment '使用余额金额',notOutStore
+    private Integer useBeanAmount;//  int(11) comment '使用采美豆数量',
+    private Integer notOutStore;//  int(11) comment '未出库数量',
+    private Integer cmbeanPrice;// int(11) comment '当前采美豆专区价格(采美豆)',
+    private String isGiftProduct;//  national varchar(255),
+    private String productActInfo;//  national varchar(255),
+    private String buyAgainFlag;//  national char(1) default '0' comment '订单商品再次购买标识 0否 1是',
+    private String confirmProductFlag;// national char(1) default '0' comment '订单商品供应商确认标志 0否 1是',
+    private NewShopOrder newShopOrder;
+    private String shopFeeFlag; //应付供应商 = 应付表的应付供应商  0否 1 是
+    private String orderNo;//        varchar(30) comment '主订单编号',
+    private Integer orderID;//        bigint(30) comment '主订单ID',
+    private String shopName; // 供应商名称
+    private String name; // 商品名称
+    private String aliasName;   //商品学名
+    private String unit;//保证规格
+    private String payStatus; //  0 未进账 1 待财务审核 2 已进账
+    private Double preferential;//优惠 (price - discountPrice) * num
+    private Double actPreferential;//活动优惠  类似满减优惠金额
+    private String image; // 商品图片
+    private Double discountFee; //协销订单:经理折扣(平摊到每个商品上,  按照每种商品的总价占订单总价的比例来均分);普通订单 无'
+    private String productUnit;//`productUnit` varchar(64) DEFAULT NULL COMMENT '商品单位',
+    private String productImage;//`productImage` varchar(100) DEFAULT NULL,
+    private String shopFee1; // 单个应付供应商金额
+    private String otherFee1; // 单个应付第三方金额
+    private String cmFee1; // 单个应付采美金额
+    // *****************  虚拟字段
+    private Integer deliveryNum; // 发货数量
+    private Integer outStoreTimes;  // 发货批次
+    private Double costPrice; // 成本价(快照商品成本价格)
+    private Integer stock; // 库存
+    private Integer status; // 状态
+    private String logisticsBatchID; // 发货批次ID
+    //private List<NewCmFinanceCharge> newCmFinanceChargeList; //订单商品id对应的多个出账记录
+    //private List<NewCmFinanceReceipts> newCmFinanceReceiptsList; //订单商品id对应一个进账记录  订单id对应多个
+    private String splitFlag;//订单商品是否可拆分   1可拆分(不可以进账确认) 0不可拆分----统计子订单中的
+    private String costCheckFlag; //成本价选中标志:1固定成本 2比例成
+    private Double costProportional;//比例成本百分比
+    private List<CmProductSn> cmProductSnList; //(重光电/轻光电)SN码
+
+    private String consignee;        //收货人
+    private String buyer;           //买家
+    private Integer thisTimePostNum;   // 虚拟字段  发货时记录当前次数该商品发了几个
+
+    private Integer returnedPurchaseProductNum;     //退货完成数量
+    private Integer returningPurchaseProductNum;   //退货中数量
+    private Integer cancelProductNum;   //取消数量
+    private Integer receivedNum;    //已收数量
+    private Integer returningNum;   //退货退款中数量
+    private Integer returnedNum;   //已退数量
+    private Boolean firstReturn;    //是否是第一次退货退款
+    private Double newCostPrice; // 成本价
+    private Double singleShouldPayTotalTax; //单个付供应商税费
+
+    public String getBuyer() {
+        return buyer;
+    }
+
+    public void setBuyer(String buyer) {
+        this.buyer = buyer;
+    }
+
+    public String getConsignee() {
+        return consignee;
+    }
+
+    public void setConsignee(String consignee) {
+        this.consignee = consignee;
+    }
+
+
+    public Double getShouldPayTotalTax() {
+        return shouldPayTotalTax;
+    }
+
+    public void setShouldPayTotalTax(Double shouldPayTotalTax) {
+        this.shouldPayTotalTax = shouldPayTotalTax;
+    }
+
+    public Integer getOrderProductID() {
+        return orderProductID;
+    }
+
+    public void setOrderProductID(Integer orderProductID) {
+        this.orderProductID = orderProductID;
+    }
+
+    public Integer getShopOrderID() {
+        return shopOrderID;
+    }
+
+    public void setShopOrderID(Integer shopOrderID) {
+        this.shopOrderID = shopOrderID;
+    }
+
+    public String getShopOrderNo() {
+        return shopOrderNo;
+    }
+
+    public void setShopOrderNo(String shopOrderNo) {
+        this.shopOrderNo = shopOrderNo;
+    }
+
+    public Integer getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(Integer shopID) {
+        this.shopID = shopID;
+    }
+
+    public Integer getProductID() {
+        return productID;
+    }
+
+    public void setProductID(Integer productID) {
+        this.productID = productID;
+    }
+
+    public Integer getNum() {
+        return num;
+    }
+
+    public void setNum(Integer num) {
+        this.num = num;
+    }
+
+    public Integer getPresentNum() {
+        return presentNum;
+    }
+
+    public void setPresentNum(Integer presentNum) {
+        this.presentNum = presentNum;
+    }
+
+    public String getOutStoreType() {
+        return outStoreType;
+    }
+
+    public void setOutStoreType(String outStoreType) {
+        this.outStoreType = outStoreType;
+    }
+
+    public Integer getSkuID() {
+        return skuID;
+    }
+
+    public void setSkuID(Integer skuID) {
+        this.skuID = skuID;
+    }
+
+    public String getProps() {
+        return props;
+    }
+
+    public void setProps(String props) {
+        this.props = props;
+    }
+
+    public String getPropName() {
+        return propName;
+    }
+
+    public void setPropName(String propName) {
+        this.propName = propName;
+    }
+
+    public String getProductNo() {
+        return productNo;
+    }
+
+    public void setProductNo(String productNo) {
+        this.productNo = productNo;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public Double getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(Double totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public Double getDiscount() {
+        return discount;
+    }
+
+    public void setDiscount(Double discount) {
+        this.discount = discount;
+    }
+
+    public Double getDiscountPrice() {
+        return discountPrice;
+    }
+
+    public void setDiscountPrice(Double discountPrice) {
+        this.discountPrice = discountPrice;
+    }
+
+    public Double getTaxRate() {
+        return taxRate;
+    }
+
+    public void setTaxRate(Double taxRate) {
+        this.taxRate = taxRate;
+    }
+
+    public Double getAddedValueTax() {
+        return addedValueTax;
+    }
+
+    public void setAddedValueTax(Double addedValueTax) {
+        this.addedValueTax = addedValueTax;
+    }
+
+    public Double getTotalAddedValueTax() {
+        return totalAddedValueTax;
+    }
+
+    public void setTotalAddedValueTax(Double totalAddedValueTax) {
+        this.totalAddedValueTax = totalAddedValueTax;
+    }
+
+    public Double getShopFee() {
+        return shopFee;
+    }
+
+    public void setShopFee(Double shopFee) {
+        this.shopFee = shopFee;
+    }
+
+    public Double getOtherFee() {
+        return otherFee;
+    }
+
+    public void setOtherFee(Double otherFee) {
+        this.otherFee = otherFee;
+    }
+
+    public Double getCmFee() {
+        return cmFee;
+    }
+
+    public void setCmFee(Double cmFee) {
+        this.cmFee = cmFee;
+    }
+
+    public Double getSingleShopFee() {
+        return singleShopFee;
+    }
+
+    public void setSingleShopFee(Double singleShopFee) {
+        this.singleShopFee = singleShopFee;
+    }
+
+    public Double getSingleOtherFee() {
+        return singleOtherFee;
+    }
+
+    public void setSingleOtherFee(Double singleOtherFee) {
+        this.singleOtherFee = singleOtherFee;
+    }
+
+    public Double getSingleCmFee() {
+        return singleCmFee;
+    }
+
+    public void setSingleCmFee(Double singleCmFee) {
+        this.singleCmFee = singleCmFee;
+    }
+
+    public Double getShouldPayFee() {
+        return shouldPayFee;
+    }
+
+    public void setShouldPayFee(Double shouldPayFee) {
+        this.shouldPayFee = shouldPayFee;
+    }
+
+    public String getCommentFlag() {
+        return commentFlag;
+    }
+
+    public void setCommentFlag(String commentFlag) {
+        this.commentFlag = commentFlag;
+    }
+
+    public Double getNormalPrice() {
+        return normalPrice;
+    }
+
+    public void setNormalPrice(Double normalPrice) {
+        this.normalPrice = normalPrice;
+    }
+
+    public Double getTotalFee() {
+        return totalFee;
+    }
+
+    public void setTotalFee(Double totalFee) {
+        this.totalFee = totalFee;
+    }
+
+    public Double getTotalBeans() {
+        return totalBeans;
+    }
+
+    public void setTotalBeans(Double totalBeans) {
+        this.totalBeans = totalBeans;
+    }
+
+    public Double getUseBalanceAmount() {
+        return useBalanceAmount;
+    }
+
+    public void setUseBalanceAmount(Double useBalanceAmount) {
+        this.useBalanceAmount = useBalanceAmount;
+    }
+
+    public Integer getUseBeanAmount() {
+        return useBeanAmount;
+    }
+
+    public void setUseBeanAmount(Integer useBeanAmount) {
+        this.useBeanAmount = useBeanAmount;
+    }
+
+    public Integer getNotOutStore() {
+        return notOutStore;
+    }
+
+    public void setNotOutStore(Integer notOutStore) {
+        this.notOutStore = notOutStore;
+    }
+
+    public Integer getCmbeanPrice() {
+        return cmbeanPrice;
+    }
+
+    public void setCmbeanPrice(Integer cmbeanPrice) {
+        this.cmbeanPrice = cmbeanPrice;
+    }
+
+    public String getIsGiftProduct() {
+        return isGiftProduct;
+    }
+
+    public void setIsGiftProduct(String isGiftProduct) {
+        this.isGiftProduct = isGiftProduct;
+    }
+
+    public String getProductActInfo() {
+        return productActInfo;
+    }
+
+    public void setProductActInfo(String productActInfo) {
+        this.productActInfo = productActInfo;
+    }
+
+    public String getBuyAgainFlag() {
+        return buyAgainFlag;
+    }
+
+    public void setBuyAgainFlag(String buyAgainFlag) {
+        this.buyAgainFlag = buyAgainFlag;
+    }
+
+    public String getConfirmProductFlag() {
+        return confirmProductFlag;
+    }
+
+    public void setConfirmProductFlag(String confirmProductFlag) {
+        this.confirmProductFlag = confirmProductFlag;
+    }
+
+    public NewShopOrder getNewShopOrder() {
+        return newShopOrder;
+    }
+
+    public void setNewShopOrder(NewShopOrder newShopOrder) {
+        this.newShopOrder = newShopOrder;
+    }
+
+    public String getShopFeeFlag() {
+        return shopFeeFlag;
+    }
+
+    public void setShopFeeFlag(String shopFeeFlag) {
+        this.shopFeeFlag = shopFeeFlag;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Integer getOrderID() {
+        return orderID;
+    }
+
+    public void setOrderID(Integer orderID) {
+        this.orderID = orderID;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Double getPrice0() {
+        return price0;
+    }
+
+    public void setPrice0(Double price0) {
+        this.price0 = price0;
+    }
+
+    public Double getPrice1() {
+        return price1;
+    }
+
+    public void setPrice1(Double price1) {
+        this.price1 = price1;
+    }
+
+    public String getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(String payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    public Double getActPreferential() {
+        return actPreferential;
+    }
+
+    public void setActPreferential(Double actPreferential) {
+        this.actPreferential = actPreferential;
+    }
+
+    public Double getPreferential() {
+        return preferential;
+    }
+
+    public void setPreferential(Double preferential) {
+        this.preferential = preferential;
+    }
+
+    @Transient
+    public String getImage() {
+        return AppUtils.getImageURL("product", image, 0, "");
+    }
+
+    public void setImage(String image) {
+        this.image = image;
+    }
+
+    @Transient
+    public Integer getDeliveryNum() {
+        return deliveryNum;
+    }
+
+    public void setDeliveryNum(Integer deliveryNum) {
+        this.deliveryNum = deliveryNum;
+    }
+
+    @Transient
+    public Integer getOutStoreTimes() {
+        return outStoreTimes;
+    }
+
+    public void setOutStoreTimes(Integer outStoreTimes) {
+        this.outStoreTimes = outStoreTimes;
+    }
+
+    public Double getCostPrice() {
+        return costPrice;
+    }
+
+    public void setCostPrice(Double costPrice) {
+        this.costPrice = costPrice;
+    }
+
+    @Transient
+    public Integer getStock() {
+        return stock;
+    }
+
+    public void setStock(Integer stock) {
+        this.stock = stock;
+    }
+
+    public Double getDiscountFee() {
+        return discountFee;
+    }
+
+    public void setDiscountFee(Double discountFee) {
+        this.discountFee = discountFee;
+    }
+
+    @Transient
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    @Transient
+    public String getLogisticsBatchID() {
+        return logisticsBatchID;
+    }
+
+    public void setLogisticsBatchID(String logisticsBatchID) {
+        this.logisticsBatchID = logisticsBatchID;
+    }
+
+    /*public List<NewCmFinanceReceipts> getNewCmFinanceReceiptsList() {
+        return newCmFinanceReceiptsList;
+    }
+
+    public void setNewCmFinanceReceiptsList(List<NewCmFinanceReceipts> newCmFinanceReceiptsList) {
+        this.newCmFinanceReceiptsList = newCmFinanceReceiptsList;
+    }
+
+    public List<NewCmFinanceCharge> getNewCmFinanceChargeList() {
+        return newCmFinanceChargeList;
+    }
+
+    public void setNewCmFinanceChargeList(List<NewCmFinanceCharge> newCmFinanceChargeList) {
+        this.newCmFinanceChargeList = newCmFinanceChargeList;
+    }*/
+
+    public String getLedgerNo() {
+        return ledgerNo;
+    }
+
+    public void setLedgerNo(String ledgerNo) {
+        this.ledgerNo = ledgerNo;
+    }
+
+    public String getShopFee1() {
+        return singleShopFee == null ? "" : singleShopFee.toString();
+    }
+
+    public void setShopFee1(String shopFee1) {
+        this.shopFee1 = shopFee1;
+    }
+
+    public String getOtherFee1() {
+        return singleOtherFee == null ? "" : singleOtherFee.toString();
+    }
+
+    public void setOtherFee1(String otherFee1) {
+        this.otherFee1 = otherFee1;
+    }
+
+    public String getCmFee1() {
+        return singleCmFee == null ? "" : singleCmFee.toString();
+    }
+
+    public void setCmFee1(String cmFee1) {
+        this.cmFee1 = cmFee1;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getProductUnit() {
+        return productUnit;
+    }
+
+    public void setProductUnit(String productUnit) {
+        this.productUnit = productUnit;
+    }
+
+    public String getProductImage() {
+        return AppUtils.getImageURL("product", productImage, 0, "");
+    }
+
+    public void setProductImage(String productImage) {
+        this.productImage = productImage;
+    }
+
+    public String getSplitFlag() {
+        return splitFlag;
+    }
+
+    public void setSplitFlag(String splitFlag) {
+        this.splitFlag = splitFlag;
+    }
+
+    @Transient
+    public String getCostCheckFlag() {
+        return costCheckFlag;
+    }
+
+    public void setCostCheckFlag(String costCheckFlag) {
+        this.costCheckFlag = costCheckFlag;
+    }
+
+    @Transient
+    public Double getCostProportional() {
+        return costProportional;
+    }
+
+    public void setCostProportional(Double costProportional) {
+        this.costProportional = costProportional;
+    }
+
+    public List<CmProductSn> getCmProductSnList() {
+        return cmProductSnList;
+    }
+
+    public void setCmProductSnList(List<CmProductSn> cmProductSnList) {
+        this.cmProductSnList = cmProductSnList;
+    }
+
+    @Transient
+    public Integer getReturnedPurchaseProductNum() {
+        return returnedPurchaseProductNum;
+    }
+
+    public void setReturnedPurchaseProductNum(Integer returnedPurchaseProductNum) {
+        this.returnedPurchaseProductNum = returnedPurchaseProductNum;
+    }
+
+    @Transient
+    public Integer getReturningPurchaseProductNum() {
+        return returningPurchaseProductNum;
+    }
+
+    public void setReturningPurchaseProductNum(Integer returningPurchaseProductNum) {
+        this.returningPurchaseProductNum = returningPurchaseProductNum;
+    }
+
+    @Transient
+    public Integer getCancelProductNum() {
+        return cancelProductNum;
+    }
+
+    public void setCancelProductNum(Integer cancelProductNum) {
+        this.cancelProductNum = cancelProductNum;
+    }
+
+    @Transient
+    public Integer getThisTimePostNum() {
+        return thisTimePostNum;
+    }
+
+    public void setThisTimePostNum(Integer thisTimePostNum) {
+        this.thisTimePostNum = thisTimePostNum;
+    }
+
+    @Transient
+    public Integer getReceivedNum() {
+        return receivedNum;
+    }
+
+    public void setReceivedNum(Integer receivedNum) {
+        this.receivedNum = receivedNum;
+    }
+
+    @Transient
+    public Integer getReturningNum() {
+        return returningNum;
+    }
+
+    public void setReturningNum(Integer returningNum) {
+        this.returningNum = returningNum;
+    }
+
+    @Transient
+    public Integer getReturnedNum() {
+        return returnedNum;
+    }
+
+    public void setReturnedNum(Integer returnedNum) {
+        this.returnedNum = returnedNum;
+    }
+
+    @Transient
+    public String getAliasName() {
+        return aliasName;
+    }
+
+    public void setAliasName(String aliasName) {
+        this.aliasName = aliasName;
+    }
+
+    @Transient
+    public Boolean getFirstReturn() {
+        return firstReturn;
+    }
+
+    public void setFirstReturn(Boolean firstReturn) {
+        this.firstReturn = firstReturn;
+    }
+
+    public Double getShopProductAmount() {
+        return shopProductAmount;
+    }
+
+    public void setShopProductAmount(Double shopProductAmount) {
+        this.shopProductAmount = shopProductAmount;
+    }
+
+    public Double getNewCostPrice() {
+        return newCostPrice;
+    }
+
+    public void setNewCostPrice(Double newCostPrice) {
+        this.newCostPrice = newCostPrice;
+    }
+
+    public Double getSingleShouldPayTotalTax() {
+        return singleShouldPayTotalTax;
+    }
+
+    public void setSingleShouldPayTotalTax(Double singleShouldPayTotalTax) {
+        this.singleShouldPayTotalTax = singleShouldPayTotalTax;
+    }
+}

+ 860 - 0
src/main/java/com/caimei/modules/order/entity/NewShopOrder.java

@@ -0,0 +1,860 @@
+package com.caimei.modules.order.entity;
+
+import java.beans.Transient;
+import java.math.BigInteger;
+import java.util.List;
+
+/**
+ * @author lwt
+ * @date 2018-07-24
+ * @description 子订单表
+ */
+public class NewShopOrder {
+    private Integer shopOrderID;//        int(11) not null auto_increment comment '子订单ID',
+    private Integer organizeID;//        组织Id
+    private String shopOrderNo;//       varchar(30) comment '子订单编号',
+    private String orderNo;//        varchar(30) comment '主订单编号',
+    private Integer orderID;             // bigint(11) not null 主订单ID,
+    private String receiptStatus;//主订单收款状态
+    private Double receiptTotalFee;//主订单已收金额
+    private Integer userID;//       int(11) comment '用户Id',
+    private Integer shopID;//       int(11) comment '供应商Id',
+    private Integer itemCount;//       int(11) comment '商品数量',
+    private Integer townID;//       int(11) comment '收货地址县区Id',
+    private Double productAmount;//     float comment '商品金额',
+    private Double shouldPayProduct;            //应收商品金额==应付合计(只需要付商品金额)
+    private Double fee;//     float comment '运费:-1到付,0包邮,其他为具体运费'    ****-----v5.0版本已废弃,运费已使用商品形式存储,
+    private Double discountAmount;//     float,
+    private Double accountAmount;//     decimal(20,2) comment '余额支付时使用的金额',
+    private Double totalAmount;//     decimal(20,2) comment '总价',
+    private String payFlag;//     national char(1) comment '是否已支付:1是,0否',
+    private String payTime;//     national varchar(19) comment '支付时间',
+    private String finishTime;//     national varchar(19) comment '订单完成时间',
+    private Integer status;//     int(11) comment '订单状态:见表c_orderstatus或枚举OrderStatus'   v5.0版本已废弃只有主订单状态,
+    private Integer refundStatus;//    int(11),
+    private BigInteger deliveryTimeMills;//   bigint(20) comment '发货时间(时间戳)',
+    private Double needPayAmount;//   decimal(20,2) comment '实付金额',
+    private Double canRefundAmount;//   float comment '退款金额',
+    private Double refundAmount;//   float,
+    private Integer clubID;//  int(11),
+    private Integer spID;//   int(11),
+    private Integer mainSpID;//    int(11),
+    private Integer orderBeanAmount;//   int(11) default 0,
+    private Integer useBeanAmount;//   int(11) default 0 comment '使用采美豆数量',
+    private Integer useBeanFlag;//     int(11) default 0 comment '是否使用采美豆',
+    private Integer canRefundFlag;//    int(11) default 0 comment '是否可以退货 1可以退款/退货 0不可退款/退货',
+    private Integer useBalanceFlag;//    int(11) default 0 comment '是否使用余额',
+    private Integer canRefundBeans;//    int(11) comment '可以退还的采美豆个数',
+    private Integer orderDeliveryID;//   int(1) comment '运费订单ID',
+    private Double freePostageFee;//    decimal(10,2) comment '订单包邮时本该支付的运费',
+    private Integer freePostageTicketID;//  int(11) comment '使用的包邮券Id,为空表示未使用包邮券',
+    private Double brokerage;//        decimal(11,2) comment '佣金',
+    private String delFlag;//        national varchar(20) default '0' comment '后台删除状态 0正常,其他删除',
+    private Double refundsAmount;//      decimal(20,2) default 0.00 comment '订单退款金额',
+    private String orderStatusFlag;//    national char(1) default '1' comment '订单状态标识,1:非退货退款订单、2:退货退款中、3退货退款完成',
+    private String buyStatus;//       national varchar(255),
+    private NewOrder order;
+    private List<NewOrderProduct> newOrderProducts;
+    private Double preferential; //订单商品的总优惠
+    private int orderSubmitType;
+    private int orderType;             // 订单类型
+    private String orderTime;//下单时间
+    private Integer presentNum;//赠品数量
+    private Integer outStoreNum;//已经发货的商品数量
+    private Integer outStoreTimes;//第几批发货  default 0
+    private Double totalAddedValueTax; // 税费
+    private String splitFlag; // 订单能否拆分 1 为可拆分, 0为不可拆分
+    private Double discountFee; // 经历折扣  v5.0版本已废弃,经理折扣只和主订单有关
+    private Long autoReceiveTimeMills;//自动收货时间点 毫秒计算
+    private Long autoOverTimeMills;// 订单彻底完成时间 不能售后 毫秒
+    private String receiveGoodsTime;//收货时间
+    private String note;//子订单备注信息
+    private String payStatus; //(付款供应商)付款状态:1待付款、2部分付款、3已付款
+    private String sendOutStatus; //发货状态:1待发货、2部分发货、3已发货
+    private String[] ps;    //付款状态集合
+    //-------------        虚拟字段   ----------------------------
+    private String shopName;            //供应商
+    private String receiver;//收货人
+    private String buyer;//买家
+    private String orderSource;//订单来源
+    private String alreadyReceipt;//已收金额
+    private String unReceipt;//未收金额
+    private String paid;//已付金额
+    private String unpaid;//未付金额
+    private String postFeeCos = "0";   //'0'=不是邮费商品子订单; '1'=是邮费商品子订单
+    private List<NewOrderProduct> snOrderProducts;//需要使用sn码的订单产品列表
+    private Boolean defaultStatus;  //控制填写的默认状态(运费订单,部分收款订单 默认不能操作,)
+
+    //--------------- 付款列表展示数据 ------------
+    private String paying;// 是否处于给供应商状态中   0不是的,  1是的
+    private String refunding;// 是否处于供应商退款状态中   0不是的,  1是的
+    private Double payTotalFee;  //主订单金额,  列表中展示需要
+    private Double shopProductAmount;  //付款单的商品费, 子订单商品的成本价的和
+    private Double shopPostFee;  // 付给供应商的运费
+    private Double shopTaxFee;  // 付给供应商的税费
+    private Double shouldPayShopAmount;  //付供应商 = 商品费 + 运费 + 税费
+    private Double payedShopAmount;  //已付款金额
+    private Double shopOtherFee;  //付第三方
+    private Double waitPayShop;  //待付
+    private String startTime;
+    private String endTime;
+    private String operatingMode = "1";// 付款列表操作模式    1付款申请, 2已付退款, 3查看信息
+    private String costType;     //固定成本1,  比例成本2  为空就是还没有设置过
+    private Double proportional;//比例成本的比例值
+    private String modifyShouldPayNote; //修改应付必填备注信息
+    private String modifyShouldPayUserID;  //修改应付金额的用户ID
+    private String modifyShouldPayDate;   //修改应付金额的时间
+    private Double payed;//已付金额
+
+    public String getReceiptStatus() {
+        return receiptStatus;
+    }
+
+    public void setReceiptStatus(String receiptStatus) {
+        this.receiptStatus = receiptStatus;
+    }
+
+    public Double getReceiptTotalFee() {
+        return receiptTotalFee;
+    }
+
+    public void setReceiptTotalFee(Double receiptTotalFee) {
+        this.receiptTotalFee = receiptTotalFee;
+    }
+
+    public Double getShouldPayProduct() {
+        return shouldPayProduct;
+    }
+
+    public void setShouldPayProduct(Double shouldPayProduct) {
+        this.shouldPayProduct = shouldPayProduct;
+    }
+
+    public Integer getShopOrderID() {
+        return shopOrderID;
+    }
+
+    public void setShopOrderID(Integer shopOrderID) {
+        this.shopOrderID = shopOrderID;
+    }
+
+    public String getShopOrderNo() {
+        return shopOrderNo;
+    }
+
+    public void setShopOrderNo(String shopOrderNo) {
+        this.shopOrderNo = shopOrderNo;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Integer getUserID() {
+        return userID;
+    }
+
+    public void setUserID(Integer userID) {
+        this.userID = userID;
+    }
+
+    public Integer getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(Integer shopID) {
+        this.shopID = shopID;
+    }
+
+    public Integer getItemCount() {
+        return itemCount;
+    }
+
+    public void setItemCount(Integer itemCount) {
+        this.itemCount = itemCount;
+    }
+
+    public Integer getTownID() {
+        return townID;
+    }
+
+    public void setTownID(Integer townID) {
+        this.townID = townID;
+    }
+
+    public Double getProductAmount() {
+        return productAmount;
+    }
+
+    public void setProductAmount(Double productAmount) {
+        this.productAmount = productAmount;
+    }
+
+    public Double getFee() {
+        return fee;
+    }
+
+    public void setFee(Double fee) {
+        this.fee = fee;
+    }
+
+    public Double getDiscountAmount() {
+        return discountAmount;
+    }
+
+    public void setDiscountAmount(Double discountAmount) {
+        this.discountAmount = discountAmount;
+    }
+
+    public Double getAccountAmount() {
+        return accountAmount;
+    }
+
+    public void setAccountAmount(Double accountAmount) {
+        this.accountAmount = accountAmount;
+    }
+
+    public Double getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(Double totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public String getPayFlag() {
+        return payFlag;
+    }
+
+    public void setPayFlag(String payFlag) {
+        this.payFlag = payFlag;
+    }
+
+    public String getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(String payTime) {
+        this.payTime = payTime;
+    }
+
+    public String getFinishTime() {
+        return finishTime;
+    }
+
+    public void setFinishTime(String finishTime) {
+        this.finishTime = finishTime;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getRefundStatus() {
+        return refundStatus;
+    }
+
+    public void setRefundStatus(Integer refundStatus) {
+        this.refundStatus = refundStatus;
+    }
+
+    public Double getNeedPayAmount() {
+        return needPayAmount;
+    }
+
+    public void setNeedPayAmount(Double needPayAmount) {
+        this.needPayAmount = needPayAmount;
+    }
+
+    public Double getCanRefundAmount() {
+        return canRefundAmount;
+    }
+
+    public void setCanRefundAmount(Double canRefundAmount) {
+        this.canRefundAmount = canRefundAmount;
+    }
+
+    public Double getRefundAmount() {
+        return refundAmount;
+    }
+
+    public void setRefundAmount(Double refundAmount) {
+        this.refundAmount = refundAmount;
+    }
+
+    public Integer getClubID() {
+        return clubID;
+    }
+
+    public void setClubID(Integer clubID) {
+        this.clubID = clubID;
+    }
+
+    public Integer getSpID() {
+        return spID;
+    }
+
+    public void setSpID(Integer spID) {
+        this.spID = spID;
+    }
+
+    public Integer getMainSpID() {
+        return mainSpID;
+    }
+
+    public void setMainSpID(Integer mainSpID) {
+        this.mainSpID = mainSpID;
+    }
+
+    public Integer getOrderBeanAmount() {
+        return orderBeanAmount;
+    }
+
+    public void setOrderBeanAmount(Integer orderBeanAmount) {
+        this.orderBeanAmount = orderBeanAmount;
+    }
+
+    public Integer getUseBeanAmount() {
+        return useBeanAmount;
+    }
+
+    public void setUseBeanAmount(Integer useBeanAmount) {
+        this.useBeanAmount = useBeanAmount;
+    }
+
+    public Integer getUseBeanFlag() {
+        return useBeanFlag;
+    }
+
+    public void setUseBeanFlag(Integer useBeanFlag) {
+        this.useBeanFlag = useBeanFlag;
+    }
+
+    public Integer getCanRefundFlag() {
+        return canRefundFlag;
+    }
+
+    public void setCanRefundFlag(Integer canRefundFlag) {
+        this.canRefundFlag = canRefundFlag;
+    }
+
+    public Integer getUseBalanceFlag() {
+        return useBalanceFlag;
+    }
+
+    public void setUseBalanceFlag(Integer useBalanceFlag) {
+        this.useBalanceFlag = useBalanceFlag;
+    }
+
+    public Integer getCanRefundBeans() {
+        return canRefundBeans;
+    }
+
+    public void setCanRefundBeans(Integer canRefundBeans) {
+        this.canRefundBeans = canRefundBeans;
+    }
+
+    public Integer getOrderDeliveryID() {
+        return orderDeliveryID;
+    }
+
+    public void setOrderDeliveryID(Integer orderDeliveryID) {
+        this.orderDeliveryID = orderDeliveryID;
+    }
+
+    public Double getFreePostageFee() {
+        return freePostageFee;
+    }
+
+    public void setFreePostageFee(Double freePostageFee) {
+        this.freePostageFee = freePostageFee;
+    }
+
+    public Integer getFreePostageTicketID() {
+        return freePostageTicketID;
+    }
+
+    public void setFreePostageTicketID(Integer freePostageTicketID) {
+        this.freePostageTicketID = freePostageTicketID;
+    }
+
+    public Double getBrokerage() {
+        return brokerage;
+    }
+
+    public void setBrokerage(Double brokerage) {
+        this.brokerage = brokerage;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Double getRefundsAmount() {
+        return refundsAmount;
+    }
+
+    public void setRefundsAmount(Double refundsAmount) {
+        this.refundsAmount = refundsAmount;
+    }
+
+    public String getOrderStatusFlag() {
+        return orderStatusFlag;
+    }
+
+    public void setOrderStatusFlag(String orderStatusFlag) {
+        this.orderStatusFlag = orderStatusFlag;
+    }
+
+    public String getBuyStatus() {
+        return buyStatus;
+    }
+
+    public void setBuyStatus(String buyStatus) {
+        this.buyStatus = buyStatus;
+    }
+
+    public NewOrder getOrder() {
+        return order;
+    }
+
+    public void setOrder(NewOrder order) {
+        this.order = order;
+    }
+
+    public List<NewOrderProduct> getNewOrderProducts() {
+        return newOrderProducts;
+    }
+
+    public void setNewOrderProducts(List<NewOrderProduct> newOrderProducts) {
+        this.newOrderProducts = newOrderProducts;
+    }
+
+    public Integer getOrderID() {
+        return orderID;
+    }
+
+    public void setOrderID(Integer orderID) {
+        this.orderID = orderID;
+    }
+
+    public int getOrderType() {
+        return orderType;
+    }
+
+    public void setOrderType(int orderType) {
+        this.orderType = orderType;
+    }
+
+    @Transient
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    @Transient
+    public String getReceiver() {
+        return receiver;
+    }
+
+    public void setReceiver(String receiver) {
+        this.receiver = receiver;
+    }
+
+    @Transient
+    public String getBuyer() {
+        return buyer;
+    }
+
+    public void setBuyer(String buyer) {
+        this.buyer = buyer;
+    }
+
+    @Transient
+    public String getOrderSource() {
+        return orderSource;
+    }
+
+    public void setOrderSource(String orderSource) {
+        this.orderSource = orderSource;
+    }
+
+    public String getOrderTime() {
+        return orderTime;
+    }
+
+    public void setOrderTime(String orderTime) {
+        this.orderTime = orderTime;
+    }
+
+    @Transient
+    public String getAlreadyReceipt() {
+        return alreadyReceipt;
+    }
+
+    public void setAlreadyReceipt(String alreadyReceipt) {
+        this.alreadyReceipt = alreadyReceipt;
+    }
+
+    @Transient
+    public String getUnReceipt() {
+        return unReceipt;
+    }
+
+    public void setUnReceipt(String unReceipt) {
+        this.unReceipt = unReceipt;
+    }
+
+    @Transient
+    public String getPaid() {
+        return paid;
+    }
+
+    public void setPaid(String paid) {
+        this.paid = paid;
+    }
+
+    @Transient
+    public String getUnpaid() {
+        return unpaid;
+    }
+
+    public void setUnpaid(String unpaid) {
+        this.unpaid = unpaid;
+    }
+
+    public Double getPreferential() {
+        return preferential;
+    }
+
+    public void setPreferential(Double preferential) {
+        this.preferential = preferential;
+    }
+
+    public int getOrderSubmitType() {
+        return orderSubmitType;
+    }
+
+    public void setOrderSubmitType(int orderSubmitType) {
+        this.orderSubmitType = orderSubmitType;
+    }
+
+    public BigInteger getDeliveryTimeMills() {
+        return deliveryTimeMills;
+    }
+
+    public void setDeliveryTimeMills(BigInteger deliveryTimeMills) {
+        this.deliveryTimeMills = deliveryTimeMills;
+    }
+
+    public Integer getPresentNum() {
+        return presentNum;
+    }
+
+    public void setPresentNum(Integer presentNum) {
+        this.presentNum = presentNum;
+    }
+
+    public Integer getOutStoreNum() {
+        return outStoreNum;
+    }
+
+    public void setOutStoreNum(Integer outStoreNum) {
+        this.outStoreNum = outStoreNum;
+    }
+
+    public Integer getOutStoreTimes() {
+        return outStoreTimes;
+    }
+
+    public void setOutStoreTimes(Integer outStoreTimes) {
+        this.outStoreTimes = outStoreTimes;
+    }
+
+    public Double getTotalAddedValueTax() {
+        return totalAddedValueTax;
+    }
+
+    public void setTotalAddedValueTax(Double totalAddedValueTax) {
+        this.totalAddedValueTax = totalAddedValueTax;
+    }
+
+    @Transient
+    public String getSplitFlag() {
+        return splitFlag;
+    }
+
+    public void setSplitFlag(String splitFlag) {
+        this.splitFlag = splitFlag;
+    }
+
+    public Double getDiscountFee() {
+        return discountFee;
+    }
+
+    public void setDiscountFee(Double discountFee) {
+        this.discountFee = discountFee;
+    }
+
+    public Long getAutoReceiveTimeMills() {
+        return autoReceiveTimeMills;
+    }
+
+    public void setAutoReceiveTimeMills(Long autoReceiveTimeMills) {
+        this.autoReceiveTimeMills = autoReceiveTimeMills;
+    }
+
+    public Long getAutoOverTimeMills() {
+        return autoOverTimeMills;
+    }
+
+    public void setAutoOverTimeMills(Long autoOverTimeMills) {
+        this.autoOverTimeMills = autoOverTimeMills;
+    }
+
+    public String getReceiveGoodsTime() {
+        return receiveGoodsTime;
+    }
+
+    public void setReceiveGoodsTime(String receiveGoodsTime) {
+        this.receiveGoodsTime = receiveGoodsTime;
+    }
+
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note;
+    }
+
+    public List<NewOrderProduct> getSnOrderProducts() {
+        return snOrderProducts;
+    }
+
+    public void setSnOrderProducts(List<NewOrderProduct> snOrderProducts) {
+        this.snOrderProducts = snOrderProducts;
+    }
+
+    public String getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(String payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    public String getSendOutStatus() {
+        return sendOutStatus;
+    }
+
+    public void setSendOutStatus(String sendOutStatus) {
+        this.sendOutStatus = sendOutStatus;
+    }
+
+    public String getPostFeeCos() {
+        return postFeeCos;
+    }
+
+    public void setPostFeeCos(String postFeeCos) {
+        this.postFeeCos = postFeeCos;
+    }
+
+    public Boolean getDefaultStatus() {
+        return defaultStatus;
+    }
+
+    public void setDefaultStatus(Boolean defaultStatus) {
+        this.defaultStatus = defaultStatus;
+    }
+
+    public String getPaying() {
+        return paying;
+    }
+
+    public void setPaying(String paying) {
+        this.paying = paying;
+    }
+
+    @Transient
+    public Double getPayTotalFee() {
+        return payTotalFee;
+    }
+
+    public void setPayTotalFee(Double payTotalFee) {
+        this.payTotalFee = payTotalFee;
+    }
+
+    public Double getShopProductAmount() {
+        return shopProductAmount;
+    }
+
+    public void setShopProductAmount(Double shopProductAmount) {
+        this.shopProductAmount = shopProductAmount;
+    }
+
+    public Double getShopPostFee() {
+        return shopPostFee;
+    }
+
+    public void setShopPostFee(Double shopPostFee) {
+        this.shopPostFee = shopPostFee;
+    }
+
+    public Double getShopTaxFee() {
+        return shopTaxFee;
+    }
+
+    public void setShopTaxFee(Double shopTaxFee) {
+        this.shopTaxFee = shopTaxFee;
+    }
+
+    public Double getShouldPayShopAmount() {
+        return shouldPayShopAmount;
+    }
+
+    public void setShouldPayShopAmount(Double shouldPayShopAmount) {
+        this.shouldPayShopAmount = shouldPayShopAmount;
+    }
+
+    public Double getPayedShopAmount() {
+        return payedShopAmount;
+    }
+
+    public void setPayedShopAmount(Double payedShopAmount) {
+        this.payedShopAmount = payedShopAmount;
+    }
+
+    public Double getShopOtherFee() {
+        return shopOtherFee;
+    }
+
+    public void setShopOtherFee(Double shopOtherFee) {
+        this.shopOtherFee = shopOtherFee;
+    }
+
+    @Transient
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    @Transient
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    @Transient
+    public Double getWaitPayShop() {
+        return waitPayShop;
+    }
+
+    public void setWaitPayShop(Double waitPayShop) {
+        this.waitPayShop = waitPayShop;
+    }
+
+    @Transient
+    public String getRefunding() {
+        return refunding;
+    }
+
+    public void setRefunding(String refunding) {
+        this.refunding = refunding;
+    }
+
+    @Transient
+    public String getOperatingMode() {
+        return operatingMode;
+    }
+
+    public void setOperatingMode(String operatingMode) {
+        this.operatingMode = operatingMode;
+    }
+
+    public String getCostType() {
+        return costType;
+    }
+
+    public void setCostType(String costType) {
+        this.costType = costType;
+    }
+
+    public Double getProportional() {
+        return proportional;
+    }
+
+    public void setProportional(Double proportional) {
+        this.proportional = proportional;
+    }
+
+    public String[] getPs() {
+        return ps;
+    }
+
+    public void setPs(String[] ps) {
+        this.ps = ps;
+    }
+
+    public String getModifyShouldPayNote() {
+        return modifyShouldPayNote;
+    }
+
+    public void setModifyShouldPayNote(String modifyShouldPayNote) {
+        this.modifyShouldPayNote = modifyShouldPayNote;
+    }
+
+    public String getModifyShouldPayUserID() {
+        return modifyShouldPayUserID;
+    }
+
+    public void setModifyShouldPayUserID(String modifyShouldPayUserID) {
+        this.modifyShouldPayUserID = modifyShouldPayUserID;
+    }
+
+    public String getModifyShouldPayDate() {
+        return modifyShouldPayDate;
+    }
+
+    public void setModifyShouldPayDate(String modifyShouldPayDate) {
+        this.modifyShouldPayDate = modifyShouldPayDate;
+    }
+
+    @Transient
+    public Double getPayed() {
+        return payed;
+    }
+
+    public void setPayed(Double payed) {
+        this.payed = payed;
+    }
+
+    public Integer getOrganizeID() {
+        return organizeID;
+    }
+
+    public void setOrganizeID(Integer organizeID) {
+        this.organizeID = organizeID;
+    }
+}

+ 127 - 0
src/main/java/com/caimei/modules/order/entity/OrderInvoice.java

@@ -0,0 +1,127 @@
+package com.caimei.modules.order.entity;
+
+import org.hibernate.validator.constraints.Length;
+
+import java.io.Serializable;
+
+/**
+ * 订单发票Entity
+ * @author jiangjunwen
+ * @version 2017-04-09
+ */
+public class OrderInvoice implements Serializable {
+	
+	private static final long serialVersionUID = 1L;
+	private Integer id;
+	private Long orderId;		// 订单ID
+	private String invoiceTitle;		// 发票抬头 个人名称或企业名称
+	private String invoiceType;		// 发票类型 普通发票
+	private String invoiceContent;		// 发票内容 商品明细
+	private String invoiceTitleType;		// 发票抬头类型 0个人  1 企业'
+	private String corporationTaxNum;		// 企业税号
+
+	private String type;//发票类型 0不开发票 1普通发票 2增值税发票
+	private String registeredAddress;//注册地址
+	private String registeredPhone;//注册电话
+	private String bankAccountNo;//开户银行账户
+	private String openBank;//开户银行
+
+	public Integer getId() {
+		return id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getRegisteredAddress() {
+		return registeredAddress;
+	}
+
+	public void setRegisteredAddress(String registeredAddress) {
+		this.registeredAddress = registeredAddress;
+	}
+
+	public String getRegisteredPhone() {
+		return registeredPhone;
+	}
+
+	public void setRegisteredPhone(String registeredPhone) {
+		this.registeredPhone = registeredPhone;
+	}
+
+	public String getBankAccountNo() {
+		return bankAccountNo;
+	}
+
+	public void setBankAccountNo(String bankAccountNo) {
+		this.bankAccountNo = bankAccountNo;
+	}
+
+	public String getOpenBank() {
+		return openBank;
+	}
+
+	public void setOpenBank(String openBank) {
+		this.openBank = openBank;
+	}
+
+	public Long getOrderId() {
+		return orderId;
+	}
+
+	public void setOrderId(Long orderId) {
+		this.orderId = orderId;
+	}
+	
+	@Length(min=0, max=100, message="发票抬头长度必须介于 0 和 100 之间")
+	public String getInvoiceTitle() {
+		return invoiceTitle;
+	}
+
+	public void setInvoiceTitle(String invoiceTitle) {
+		this.invoiceTitle = invoiceTitle;
+	}
+	
+	@Length(min=0, max=20, message="发票类型长度必须介于 0 和 20 之间")
+	public String getInvoiceType() {
+		return invoiceType;
+	}
+
+	public void setInvoiceType(String invoiceType) {
+		this.invoiceType = invoiceType;
+	}
+	
+	@Length(min=0, max=20, message="发票内容长度必须介于 0 和 20 之间")
+	public String getInvoiceContent() {
+		return invoiceContent;
+	}
+
+	public void setInvoiceContent(String invoiceContent) {
+		this.invoiceContent = invoiceContent;
+	}
+
+	public String getInvoiceTitleType() {
+		return invoiceTitleType;
+	}
+
+	public void setInvoiceTitleType(String invoiceTitleType) {
+		this.invoiceTitleType = invoiceTitleType;
+	}
+
+	public String getCorporationTaxNum() {
+		return corporationTaxNum;
+	}
+
+	public void setCorporationTaxNum(String corporationTaxNum) {
+		this.corporationTaxNum = corporationTaxNum;
+	}
+}

+ 152 - 0
src/main/java/com/caimei/modules/order/entity/OrderUserInfo.java

@@ -0,0 +1,152 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+
+/**
+ * 订单客户详情Entity
+ *
+ * @author 李文涛
+ * @version 2018-08-07
+ */
+public class OrderUserInfo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    private Integer id;
+    private Long orderId;        // 订单ID
+    private Long clubId;        // clubId
+    private Long userId;        // userId
+    private String name;        // 买家
+    private String shouHuoRen;        // 收货人
+    private String mobile;        // 手机
+    private String phone;        // 电话
+    private String postalCode;        // 邮编
+    private String province;        // 省、直辖市
+    private String city;        // 市
+    private String town;        // 县、区
+    private String address;        // 收货地址
+    private Double userMoney;    //账户余额
+    private Double ableUserMoney;    //可用余额
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Long getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Long orderId) {
+        this.orderId = orderId;
+    }
+
+    public Long getClubId() {
+        return clubId;
+    }
+
+    public void setClubId(Long clubId) {
+        this.clubId = clubId;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getShouHuoRen() {
+        return shouHuoRen;
+    }
+
+    public void setShouHuoRen(String shouHuoRen) {
+        this.shouHuoRen = shouHuoRen;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getPostalCode() {
+        return postalCode;
+    }
+
+    public void setPostalCode(String postalCode) {
+        this.postalCode = postalCode;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getTown() {
+        return town;
+    }
+
+    public void setTown(String town) {
+        this.town = town;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public Double getUserMoney() {
+        return userMoney;
+    }
+
+    public void setUserMoney(Double userMoney) {
+        this.userMoney = userMoney;
+    }
+
+    public Double getAbleUserMoney() {
+        return ableUserMoney;
+    }
+
+    public void setAbleUserMoney(Double ableUserMoney) {
+        this.ableUserMoney = ableUserMoney;
+    }
+}

+ 43 - 0
src/main/java/com/caimei/modules/order/entity/ProductType.java

@@ -0,0 +1,43 @@
+package com.caimei.modules.order.entity;
+
+
+/**
+ * @Author ye.qin
+ * @Description //TODO 商品常用一级分类枚举类型
+ * @Date 2018/11/27 17:09
+ */
+public enum ProductType {
+    Q1(1021, "轻光电"),
+    Q2(1022, "重光电"),
+    H1(1020, "仪器耗材"),
+    H2(1019, "会所常用品"),
+    C1(1018, "产品");
+
+    /** 等级编号 */
+    private Integer bigeTypeID;
+    /** 等级名称 */
+    private String typeName;
+
+    private ProductType(Integer bigeTypeID, String typeName) {
+        this.bigeTypeID = bigeTypeID;
+        this.typeName = typeName;
+    }
+
+    public Integer getBigeTypeID() {
+        return bigeTypeID;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public static String ProductType(int bigeTypeID){
+        for(ProductType type : ProductType.values()){
+            if(type.getBigeTypeID() == bigeTypeID){
+                return type.typeName;
+            }
+        }
+        return "";
+    }
+
+}

+ 106 - 0
src/main/java/com/caimei/modules/order/entity/ShopOrderReturned.java

@@ -0,0 +1,106 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class ShopOrderReturned implements Serializable {
+    private String shopName;
+    private Integer shopID;
+    private Integer shopOrderID;
+    private String shopOrderNo;
+    private String returnedReceiver;
+    private String payStatus;//付款供应商)付款状态:1待付款、2部分付款、3已付款
+    private String sendOutStatus;//发货状态:1待发货、2部分发货、3已发货
+    private Double needPayAmount;
+    private Double totalAmount;
+    private Double productAmount;//总金额 = 订单商品totalAmount
+    private List<CmReturnedPurchaseProduct> cmReturnedPurchaseProductList;
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    public Integer getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(Integer shopID) {
+        this.shopID = shopID;
+    }
+
+    public Integer getShopOrderID() {
+        return shopOrderID;
+    }
+
+    public void setShopOrderID(Integer shopOrderID) {
+        this.shopOrderID = shopOrderID;
+    }
+
+    public List<CmReturnedPurchaseProduct> getCmReturnedPurchaseProductList() {
+        return cmReturnedPurchaseProductList;
+    }
+
+    public void setCmReturnedPurchaseProductList(List<CmReturnedPurchaseProduct> cmReturnedPurchaseProductList) {
+        this.cmReturnedPurchaseProductList = cmReturnedPurchaseProductList;
+    }
+
+    public String getReturnedReceiver() {
+        return returnedReceiver;
+    }
+
+    public void setReturnedReceiver(String returnedReceiver) {
+        this.returnedReceiver = returnedReceiver;
+    }
+
+    public String getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(String payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    public String getSendOutStatus() {
+        return sendOutStatus;
+    }
+
+    public void setSendOutStatus(String sendOutStatus) {
+        this.sendOutStatus = sendOutStatus;
+    }
+
+    public Double getNeedPayAmount() {
+        return needPayAmount;
+    }
+
+    public void setNeedPayAmount(Double needPayAmount) {
+        this.needPayAmount = needPayAmount;
+    }
+
+    public Double getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(Double totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public Double getProductAmount() {
+        return productAmount;
+    }
+
+    public void setProductAmount(Double productAmount) {
+        this.productAmount = productAmount;
+    }
+
+    public String getShopOrderNo() {
+        return shopOrderNo;
+    }
+
+    public void setShopOrderNo(String shopOrderNo) {
+        this.shopOrderNo = shopOrderNo;
+    }
+}

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

@@ -0,0 +1,9 @@
+package com.caimei.modules.order.service;
+
+import com.caimei.modules.order.entity.BpClause;
+
+import java.util.List;
+
+public interface BpClauseService {
+    List<BpClause> findList(BpClause bpClause);
+}

+ 5 - 0
src/main/java/com/caimei/modules/order/service/CmDiscernReceiptService.java

@@ -0,0 +1,5 @@
+package com.caimei.modules.order.service;
+
+public interface CmDiscernReceiptService {
+    Double findOrderReceipt(Integer orderID);
+}

+ 13 - 0
src/main/java/com/caimei/modules/order/service/CmOrderRemarkService.java

@@ -0,0 +1,13 @@
+package com.caimei.modules.order.service;
+
+import com.caimei.modules.order.entity.CmOrderRemark;
+
+import java.util.List;
+
+public interface CmOrderRemarkService {
+    CmOrderRemark get(String id);
+
+    List<CmOrderRemark> findList(CmOrderRemark remark);
+
+    void save(CmOrderRemark remark);
+}

+ 7 - 0
src/main/java/com/caimei/modules/order/service/CmReceiptOrderRelationService.java

@@ -0,0 +1,7 @@
+package com.caimei.modules.order.service;
+
+import java.util.List;
+
+public interface CmReceiptOrderRelationService {
+    List<Integer> toAudit(Integer orderID);
+}

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

@@ -0,0 +1,11 @@
+package com.caimei.modules.order.service;
+
+import com.caimei.modules.order.entity.CmReturnedPurchase;
+
+import java.util.List;
+
+public interface CmReturnedPurchaseService {
+    List<Integer> findOrderIDsInApplyReturnFlag(List<Integer> oId);
+
+    List<CmReturnedPurchase> getReturnedPurchaseList(CmReturnedPurchase cmReturnedPurchase);
+}

+ 7 - 0
src/main/java/com/caimei/modules/order/service/NewOrderConfigService.java

@@ -0,0 +1,7 @@
+package com.caimei.modules.order.service;
+
+import com.caimei.modules.order.entity.NewOrderConfig;
+
+public interface NewOrderConfigService {
+    NewOrderConfig getValueByKey(String confirmOverTime);
+}

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

@@ -0,0 +1,10 @@
+package com.caimei.modules.order.service;
+
+import com.caimei.modules.club.entity.Page;
+import com.caimei.modules.order.entity.NewOrder;
+
+public interface NewOrderService {
+    Page<NewOrder> findList(NewOrder newOrder, Page page);
+
+    NewOrder get(String id);
+}

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

@@ -0,0 +1,12 @@
+package com.caimei.modules.order.service;
+
+import com.caimei.modules.order.entity.LogisticsInfoVo;
+import com.caimei.modules.order.entity.NewShopOrder;
+
+import java.util.List;
+
+public interface NewShopOrderService {
+    NewShopOrder findByShopOrderID(Integer shopOrderID);
+
+    List<LogisticsInfoVo> logisticsDetails(Integer orderID, String logisticsBatchID);
+}

+ 7 - 0
src/main/java/com/caimei/modules/order/service/OrderUserInfoService.java

@@ -0,0 +1,7 @@
+package com.caimei.modules.order.service;
+
+import com.caimei.modules.order.entity.OrderUserInfo;
+
+public interface OrderUserInfoService {
+    OrderUserInfo findByOrderID(Integer orderID);
+}

+ 20 - 0
src/main/java/com/caimei/modules/order/service/impl/BpClauseServiceImpl.java

@@ -0,0 +1,20 @@
+package com.caimei.modules.order.service.impl;
+
+import com.caimei.modules.order.dao.BpClauseDao;
+import com.caimei.modules.order.entity.BpClause;
+import com.caimei.modules.order.service.BpClauseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class BpClauseServiceImpl implements BpClauseService {
+    @Autowired
+    private BpClauseDao bpClauseDao;
+
+    @Override
+    public List<BpClause> findList(BpClause bpClause) {
+        return bpClauseDao.findList(bpClause);
+    }
+}

+ 18 - 0
src/main/java/com/caimei/modules/order/service/impl/CmDiscernReceiptServiceImpl.java

@@ -0,0 +1,18 @@
+package com.caimei.modules.order.service.impl;
+
+import com.caimei.modules.order.dao.CmDiscernReceiptDao;
+import com.caimei.modules.order.service.CmDiscernReceiptService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CmDiscernReceiptServiceImpl implements CmDiscernReceiptService {
+    @Autowired
+    private CmDiscernReceiptDao cmDiscernReceiptDao;
+
+    @Override
+    public Double findOrderReceipt(Integer orderID) {
+        Double receiptAmount = cmDiscernReceiptDao.findOrderReceipt(orderID);
+        return receiptAmount;
+    }
+}

+ 34 - 0
src/main/java/com/caimei/modules/order/service/impl/CmOrderRemarkServiceImpl.java

@@ -0,0 +1,34 @@
+package com.caimei.modules.order.service.impl;
+
+import com.caimei.modules.order.dao.CmOrderRemarkDao;
+import com.caimei.modules.order.entity.CmOrderRemark;
+import com.caimei.modules.order.service.CmOrderRemarkService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CmOrderRemarkServiceImpl implements CmOrderRemarkService {
+    @Autowired
+    private CmOrderRemarkDao cmOrderRemarkDao;
+
+    @Override
+    public CmOrderRemark get(String id) {
+        return cmOrderRemarkDao.get(id);
+    }
+
+    @Override
+    public List<CmOrderRemark> findList(CmOrderRemark remark) {
+        return cmOrderRemarkDao.findList(remark);
+    }
+
+    @Override
+    public void save(CmOrderRemark remark) {
+        if (remark.getId() == null) {
+            cmOrderRemarkDao.insert(remark);
+        } else {
+            cmOrderRemarkDao.update(remark);
+        }
+    }
+}

+ 19 - 0
src/main/java/com/caimei/modules/order/service/impl/CmReceiptOrderRelationServiceImpl.java

@@ -0,0 +1,19 @@
+package com.caimei.modules.order.service.impl;
+
+import com.caimei.modules.order.dao.CmReceiptOrderRelationDao;
+import com.caimei.modules.order.service.CmReceiptOrderRelationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CmReceiptOrderRelationServiceImpl implements CmReceiptOrderRelationService {
+    @Autowired
+    private CmReceiptOrderRelationDao cmReceiptOrderRelationDao;
+
+    @Override
+    public List<Integer> toAudit(Integer orderID) {
+        return cmReceiptOrderRelationDao.toAudit(orderID);
+    }
+}

+ 120 - 0
src/main/java/com/caimei/modules/order/service/impl/CmReturnedPurchaseServiceImpl.java

@@ -0,0 +1,120 @@
+package com.caimei.modules.order.service.impl;
+
+import com.caimei.modules.order.dao.CmReturnedPurchaseDao;
+import com.caimei.modules.order.dao.CmReturnedPurchaseProductDao;
+import com.caimei.modules.order.dao.NewOrderProductDao;
+import com.caimei.modules.order.entity.*;
+import com.caimei.modules.order.service.CmReturnedPurchaseService;
+import com.caimei.modules.order.service.NewShopOrderService;
+import com.caimei.utils.AppUtils;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+@Service
+public class CmReturnedPurchaseServiceImpl implements CmReturnedPurchaseService {
+    @Autowired
+    private CmReturnedPurchaseDao cmReturnedPurchaseDao;
+    @Autowired
+    private CmReturnedPurchaseProductDao cmReturnedPurchaseProductDao;
+    @Autowired
+    private NewOrderProductDao newOrderProductDao;
+    @Autowired
+    private NewShopOrderService newShopOrderService;
+    @Value("${malladmin.domain}")
+    private String domain;
+
+    @Override
+    public List<Integer> findOrderIDsInApplyReturnFlag(List<Integer> oId) {
+        return cmReturnedPurchaseDao.findOrderIDsInApplyReturnFlag(oId);
+    }
+
+    @Override
+    public List<CmReturnedPurchase> getReturnedPurchaseList(CmReturnedPurchase cmReturnedPurchase) {
+        List<CmReturnedPurchase> dataList = new ArrayList<CmReturnedPurchase>();
+        dataList = cmReturnedPurchaseDao.findList(cmReturnedPurchase);
+        if (null != dataList && dataList.size() > 0) {
+            for (CmReturnedPurchase bean : dataList) {
+                CmReturnedPurchaseProduct cmReturnedPurchaseProduct = new CmReturnedPurchaseProduct();
+                cmReturnedPurchaseProduct.setReturnedID(bean.getId());
+                List<CmReturnedPurchaseProduct> list = cmReturnedPurchaseProductDao.findList(cmReturnedPurchaseProduct);
+                for (CmReturnedPurchaseProduct item : list) {
+                    item.setMainImage(AppUtils.getImageURL("product", item.getMainImage(), 0, domain));//设置全路径
+                    //计算商品的未出库和已取消和已发货数量
+                    Integer notOutStore = 0;
+                    Integer returnedPurchaseProductNum = 0;
+                    Integer cancelProductNum = 0;
+                    NewOrderProduct newOrderProduct = newOrderProductDao.get(item.getOrderProductID());
+                    if (null != newOrderProduct) {
+                        notOutStore = newOrderProduct.getNotOutStore();
+                    }
+                    //获取退货退款记录
+                    CmReturnedPurchaseProduct purchaseProduct = new CmReturnedPurchaseProduct();
+                    purchaseProduct.setShopOrderID(item.getShopOrderID());
+                    purchaseProduct.setProductID(item.getProductID());
+                    List<CmReturnedPurchaseProduct> cmReturnedPurchaseProductList = cmReturnedPurchaseProductDao.getCmReturnedPurchaseProductList(purchaseProduct);
+                    if (CollectionUtils.isNotEmpty(cmReturnedPurchaseProductList)) {
+                        for (CmReturnedPurchaseProduct c : cmReturnedPurchaseProductList) {
+                            returnedPurchaseProductNum += c.getActualReturnedNum();
+                            cancelProductNum += c.getActualCancelNum();
+                        }
+                    }
+                    item.setNotOutStore(notOutStore);
+                    item.setReturnedPurchaseProductNum(returnedPurchaseProductNum);
+                    item.setCancelProductNum(cancelProductNum);
+
+
+                    //判断订单商品是否是首次退货退款
+                    Boolean isFirstReturn = false;
+                    List<CmReturnedPurchaseProduct> temporaryList = cmReturnedPurchaseProductDao.findListByReturnTime(bean.getOrderID(), item.getShopOrderID(), item.getOrderProductID(), bean.getReturnTime());
+                    if (null == temporaryList || temporaryList.size() == 0) {
+                        isFirstReturn = true;
+                    }
+                    item.setFirstReturn(isFirstReturn);
+                }
+
+                //遍历List根据子订单分组
+                Map map = new HashMap<String, List>();
+                for (CmReturnedPurchaseProduct bean1 : list) {
+                    if (map.containsKey(bean1.getShopOrderID())) {
+                        List data = (List) map.get(bean1.getShopOrderID());
+                        data.add(bean1);
+                    } else {
+                        List data = new ArrayList();
+                        data.add(bean1);
+                        map.put(bean1.getShopOrderID(), data);
+                    }
+                }
+                //遍历map 把刚刚按照子订单排序的map取出来放到对象中
+                List<ShopOrderReturned> shopOrderReturnedList = new ArrayList<ShopOrderReturned>();
+                Iterator<Map.Entry<String, List<CmReturnedPurchaseProduct>>> entries = map.entrySet().iterator();
+                while (entries.hasNext()) {
+                    ShopOrderReturned shopOrderReturned = new ShopOrderReturned();
+                    Map.Entry<String, List<CmReturnedPurchaseProduct>> entry = entries.next();
+                    if (entry.getValue().size() > 0) {
+                        shopOrderReturned.setCmReturnedPurchaseProductList(entry.getValue());
+                        CmReturnedPurchaseProduct item = entry.getValue().get(0);
+                        shopOrderReturned.setShopName(item.getShopName());
+                        shopOrderReturned.setShopID(item.getShopID());
+                        shopOrderReturned.setShopOrderID(item.getShopOrderID());
+                        shopOrderReturned.setReturnedReceiver(item.getReturnedReceiver());
+                        NewShopOrder shopOrder = newShopOrderService.findByShopOrderID(item.getShopOrderID());
+                        if (null != shopOrder) {
+                            shopOrderReturned.setProductAmount(shopOrder.getProductAmount());
+                            shopOrderReturned.setPayStatus(shopOrder.getPayStatus());
+                            shopOrderReturned.setSendOutStatus(shopOrder.getSendOutStatus());
+                            shopOrderReturned.setShopOrderNo(shopOrder.getShopOrderNo());
+                        }
+                    }
+                    shopOrderReturnedList.add(shopOrderReturned);
+                }
+
+                bean.setShopOrderReturnedList(shopOrderReturnedList);
+            }
+        }
+        return dataList;
+    }
+}

+ 19 - 0
src/main/java/com/caimei/modules/order/service/impl/NewOrderConfigServiceImpl.java

@@ -0,0 +1,19 @@
+package com.caimei.modules.order.service.impl;
+
+import com.caimei.modules.order.dao.NewOrderConfigDao;
+import com.caimei.modules.order.entity.NewOrderConfig;
+import com.caimei.modules.order.service.NewOrderConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class NewOrderConfigServiceImpl implements NewOrderConfigService {
+    @Autowired
+    private NewOrderConfigDao newOrderConfigDao;
+
+    @Override
+    public NewOrderConfig getValueByKey(String key) {
+        return newOrderConfigDao.getValueByKey(key);
+
+    }
+}

+ 192 - 0
src/main/java/com/caimei/modules/order/service/impl/NewOrderServiceImpl.java

@@ -0,0 +1,192 @@
+package com.caimei.modules.order.service.impl;
+
+import com.caimei.modules.club.entity.Page;
+import com.caimei.modules.order.dao.*;
+import com.caimei.modules.order.entity.*;
+import com.caimei.modules.order.service.NewOrderService;
+import com.caimei.modules.order.service.OrderUserInfoService;
+import com.caimei.utils.AppKeys;
+import com.caimei.utils.AppUtils;
+import com.caimei.utils.NewOrderStatus;
+import com.github.pagehelper.PageHelper;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class NewOrderServiceImpl implements NewOrderService {
+    @Autowired
+    private NewOrderDao newOrderDao;
+    @Autowired
+    private CmDiscernReceiptDao cmDiscernReceiptDao;
+    @Autowired
+    private CmReturnedPurchaseDao cmReturnedPurchaseDao;
+    @Autowired
+    private CmReceiptOrderRelationDao cmReceiptOrderRelationDao;
+    @Autowired
+    private NewShopOrderDao newShopOrderDao;
+    @Autowired
+    private OrderUserInfoService orderUserInfoService;
+    @Autowired
+    private NewOrderProductDao newOrderProductDao;
+    @Autowired
+    private CmPayShopRecordDao cmPayShopRecordDao;
+    @Autowired
+    private OrderInvoiceDao orderInvoiceDao;
+    @Value("${malladmin.domain}")
+    private String domain;
+
+    @Override
+    public Page<NewOrder> findList(NewOrder newOrder, Page page) {
+        PageHelper.startPage(page.getIndex(), page.getPageSize());
+        List<NewOrder> orderList = newOrderDao.findList(newOrder);
+        Page<NewOrder> orderPage = new Page<>(orderList);
+        List<Integer> oId = orderList.stream().map(NewOrder::getOrderID).collect(Collectors.toList());
+        //看看这些订单有哪些是返佣订单 返回他们的orderID
+        List<Integer> orderIds = null;
+        if (CollectionUtils.isNotEmpty(oId)) {
+            orderIds = cmDiscernReceiptDao.findRebateOrderID(orderList.stream().map(NewOrder::getOrderID).collect(Collectors.toList()));
+        }
+        //从查询到的订单列表中 找到正在退款中的订单集合
+        List<Integer> orderIdsInReturn = null;
+        List<Integer> orderIdsInApplyReturn = null;//查询可以申请退款的订单ID
+        if (CollectionUtils.isNotEmpty(oId)) {
+            orderIdsInReturn = cmReturnedPurchaseDao.findOrderIDInReturnPurchase(oId);
+            orderIdsInApplyReturn = cmReturnedPurchaseDao.findOrderIDsInApplyReturnFlag(oId);
+        }
+        for (NewOrder order : orderList) {
+            if (orderIds != null && orderIds.contains(order.getOrderID())) {
+                order.setRebateOrder("1");
+            } else {
+                order.setRebateOrder("0");
+                List<Integer> ids = cmReceiptOrderRelationDao.toAudit(order.getOrderID());
+                if (ids != null && ids.size() > 0) {
+                    order.setToAudit("1");
+                }
+            }
+            if (orderIdsInReturn != null && orderIdsInReturn.contains(order.getOrderID())) {
+                order.setReturnedPurchaseStatus("1");
+            } else {
+                order.setReturnedPurchaseStatus("0");
+            }
+            if (orderIdsInApplyReturn != null && orderIdsInApplyReturn.contains(order.getOrderID())) {
+                order.setApplyReturnedPurchaseFlag("0");
+            } else {
+                order.setApplyReturnedPurchaseFlag("1");
+            }
+
+            List<NewShopOrder> shopOrders = order.getNewShopOrders();
+            if (shopOrders != null && shopOrders.size() == 1) {
+                order.setShopName(shopOrders.get(0).getShopName());
+            }
+            int count = 0;
+            for (NewShopOrder shopOrder : order.getNewShopOrders()) {
+                shopOrder.setOrderID(order.getOrderID());
+                shopOrder.setOrderNo(order.getOrderNo());
+                shopOrder.setOrderType(Integer.valueOf(order.getOrderType()));
+                shopOrder.setReceiver(order.getReceiver());
+                shopOrder.setOrderSource(order.getOrderSource());
+                shopOrder.setOrderTime(order.getOrderTime());
+                shopOrder.setBuyer(order.getBuyer());
+                if (shopOrder.getShopID() != 998) {
+                    count++;
+                }
+
+                Integer shopOrderID = shopOrder.getShopOrderID();//子订单ID
+                //通过子订单ID查询子订单信息
+                NewShopOrder newShopOrder = newShopOrderDao.get(shopOrderID);
+                if (null != newShopOrder) {
+                    shopOrder.setFee(newShopOrder.getFee());
+                    shopOrder.setShouldPayProduct(newShopOrder.getShouldPayProduct());
+                } else {
+                    shopOrder.setFee(0d);
+                    shopOrder.setShouldPayProduct(0d);
+                }
+            }
+            //一个子订单只有一个商品时,不可拆分
+            if (order.getProductCount() == null) {
+                order.setProductCount(1);
+            }
+            if (order.getProductCount() <= count) {
+                order.setSplitFlag("0");
+            }
+        }
+        return orderPage;
+    }
+
+    @Override
+    public NewOrder get(String id) {
+        NewOrder newOrder = newOrderDao.get(id);
+        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) {
+            //获取订单客户
+            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());
+                    list.addAll(pList);
+                    shopOrder.setNewOrderProducts(pList);
+                    if (pList.stream().anyMatch(p -> p.getProductID().intValue() == 999)) shopOrder.setPostFeeCos("1");
+                    pList.stream().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);
+                        }
+                        item.setProductImage(AppUtils.getProductImageURL(item.getProductImage(), AppKeys.ORIGINAL_PICTURE, domain));
+                    });
+                    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();
+            });
+            //获取订单发票
+            OrderInvoice orderInvoice = orderInvoiceDao.getWithorderId(newOrder.getOrderID() + "");
+            if (null != orderInvoice) {
+                newOrder.setOrderInvoice(orderInvoice);
+            }
+        }
+        return newOrder;
+    }
+}

+ 80 - 0
src/main/java/com/caimei/modules/order/service/impl/NewShopOrderServiceImpl.java

@@ -0,0 +1,80 @@
+package com.caimei.modules.order.service.impl;
+
+import com.caimei.modules.club.entity.CmProductSn;
+import com.caimei.modules.order.dao.*;
+import com.caimei.modules.order.entity.*;
+import com.caimei.modules.order.service.NewShopOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class NewShopOrderServiceImpl implements NewShopOrderService {
+    @Autowired
+    private NewShopOrderDao newShopOrderDao;
+    @Autowired
+    private NewOrderProductDao newOrderProductDao;
+    @Autowired
+    private ProductDao productDao;
+    @Autowired
+    private CmProductSnDao cmProductSnDao;
+    @Autowired
+    private LogisticsBatchDao logisticsBatchDao;
+    @Autowired
+    private LogisticsRecordDao logisticsRecordDao;
+    @Autowired
+    private LogisticsInformationDao logisticsInformationDao;
+
+    @Override
+    public NewShopOrder findByShopOrderID(Integer shopOrderID) {
+        NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderID);
+        List<NewOrderProduct> list = newOrderProductDao.findListByShopOrderID(shopOrder.getShopOrderID());
+        List<NewOrderProduct> listSnProduct = new ArrayList<NewOrderProduct>();
+        List<NewOrderProduct> listAll = new ArrayList<NewOrderProduct>();
+        List<CmProductSn> listSn = new ArrayList<CmProductSn>();
+
+        //通过产品ID查找一级分类,如果在(重光电或者轻光电下则是SN产品)
+        if (null != list && list.size() > 0) {
+            for (NewOrderProduct bean : list) {
+                Integer productID = bean.getProductID();
+                String bigTypeName = productDao.findProductBigTypeByProductID(productID);
+                if (bigTypeName.equals(ProductType.Q1.getTypeName()) || bigTypeName.equals(ProductType.Q2.getTypeName())) {
+                    listSn = cmProductSnDao.getListSignByOrderProduct(bean.getOrderProductID(), bean.getShopOrderID());
+                    int num = bean.getNum() + bean.getPresentNum() - (listSn != null ? listSn.size() : 0);
+                    for (int i = 0; i < num; i++) {
+                        listSn.add(i, new CmProductSn());
+                    }
+                    bean.setCmProductSnList(listSn);
+                    listSnProduct.add(bean);
+                } else {
+                    bean.setCmProductSnList(null);
+                }
+                listAll.add(bean);
+            }
+        }
+        shopOrder.setSnOrderProducts(listSnProduct);
+        shopOrder.setNewOrderProducts(listAll);
+        return shopOrder;
+    }
+
+    @Override
+    public List<LogisticsInfoVo> logisticsDetails(Integer orderID, String logisticsBatchID) {
+        List<LogisticsInfoVo> result = new ArrayList<>();
+        //查询这个子订单所有的发货批次记录
+        List<LogisticsBatch> lbs = logisticsBatchDao.findBatch(orderID, logisticsBatchID);
+        for (LogisticsBatch l : lbs) {
+            LogisticsInfoVo liv = new LogisticsInfoVo();
+            // 每一批的发货商品记录
+            List<LogisticsRecord> lrs = logisticsRecordDao.findByLogisticsBatchID(l.getId());
+            // 每一批的发货物流记录
+            List<LogisticsInformation> lis = logisticsInformationDao.findByLogisticsBatchID(l.getId());
+            liv.setLogisticsBatch(l);
+            liv.setLogisticsInformationList(lis);
+            liv.setLogisticsRecordList(lrs);
+            result.add(liv);
+        }
+        return result;
+    }
+}

+ 18 - 0
src/main/java/com/caimei/modules/order/service/impl/OrderUserInfoServiceImpl.java

@@ -0,0 +1,18 @@
+package com.caimei.modules.order.service.impl;
+
+import com.caimei.modules.order.dao.OrderUserInfoDao;
+import com.caimei.modules.order.entity.OrderUserInfo;
+import com.caimei.modules.order.service.OrderUserInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class OrderUserInfoServiceImpl implements OrderUserInfoService {
+    @Autowired
+    private OrderUserInfoDao orderUserInfoDao;
+
+    @Override
+    public OrderUserInfo findByOrderID(Integer orderID) {
+        return orderUserInfoDao.findByOrderID(orderID);
+    }
+}

+ 4 - 2
src/main/java/com/caimei/modules/products/controller/CmMallOrganizeProductsController.java

@@ -12,7 +12,9 @@ import com.caimei.utils.JsonModel;
 import com.github.pagehelper.PageHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.thymeleaf.util.StringUtils;
 
@@ -85,8 +87,8 @@ public class CmMallOrganizeProductsController {
      * @return
      */
     @ResponseBody
-    @RequestMapping(value = "saveEditProductInfo")
-    public JsonModel saveEditProductInfo(CmMallOrganizeProducts cmMallOrganizeProducts) {
+    @RequestMapping(value = "saveEditProductInfo",method = RequestMethod.POST)
+    public JsonModel saveEditProductInfo(@RequestBody CmMallOrganizeProducts cmMallOrganizeProducts) {
         JsonModel jsonModel = JsonModel.newInstance();
         try {
             cmMallOrganizeProducts.setUpdateTime(new Date());

+ 4 - 7
src/main/java/com/caimei/modules/products/controller/CmMallProductsClassifyController.java

@@ -11,16 +11,13 @@ import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-import org.thymeleaf.expression.Maps;
 
-import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 import java.util.regex.Pattern;
 
 /**
@@ -70,8 +67,8 @@ public class CmMallProductsClassifyController {
      * @return
      */
     @ResponseBody
-    @RequestMapping(value = "save")
-    public JsonModel save(CmMallProductsClassify cmMallProductsClassify) {
+    @RequestMapping(value = "save", method = RequestMethod.POST)
+    public JsonModel save(@RequestBody CmMallProductsClassify cmMallProductsClassify) {
         JsonModel jsonModel = JsonModel.newInstance();
         //保存商品名字不能重复
         List<CmMallProductsClassify> productsClassifyListByName = cmMallProductsClassifyService.getProductsClassifyListByName(cmMallProductsClassify);

+ 9 - 0
src/main/java/com/caimei/modules/products/entity/CmMallProductsClassify.java

@@ -24,6 +24,7 @@ public class CmMallProductsClassify implements Serializable {
     private Date addTime;        // 添加时间
     private Date updateTime;        // 更新时间
     private String containsProduct;//是否包含商品,1包含商品,其它为不包含商品
+    private String postageToPay;  //邮费是否到付:1是,2否[是为到付,否为不到付并非包邮具体是否包邮参考邮费规则]
     private String delFlag;
 
     public Integer getId() {
@@ -111,4 +112,12 @@ public class CmMallProductsClassify implements Serializable {
     public void setDelFlag(String delFlag) {
         this.delFlag = delFlag;
     }
+
+    public String getPostageToPay() {
+        return postageToPay;
+    }
+
+    public void setPostageToPay(String postageToPay) {
+        this.postageToPay = postageToPay;
+    }
 }

+ 1 - 1
src/main/java/com/caimei/modules/shiro/dao/UserMapper.java → src/main/java/com/caimei/modules/shiro/dao/UserDao.java

@@ -6,7 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 @Mapper
-public interface UserMapper {
+public interface UserDao {
     CmMallAdminUser findByUsername(@Param("account") String account, @Param("organizeID") Integer organizeID);
 
     CmMallAdminUser findByUserId(Integer id);

+ 5 - 5
src/main/java/com/caimei/modules/shiro/service/impl/ShiroServiceImpl.java

@@ -1,6 +1,6 @@
 package com.caimei.modules.shiro.service.impl;
 
-import com.caimei.modules.shiro.dao.UserMapper;
+import com.caimei.modules.shiro.dao.UserDao;
 import com.caimei.modules.shiro.entity.CmMallAdminUser;
 import com.caimei.modules.shiro.service.ShiroService;
 import com.caimei.utils.TokenEncryptUtils;
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
 @Service
 public class ShiroServiceImpl implements ShiroService {
     @Autowired
-    private UserMapper userMapper;
+    private UserDao userDao;
 
     /**
      * 根据account查找用户
@@ -20,20 +20,20 @@ public class ShiroServiceImpl implements ShiroService {
      */
     @Override
     public CmMallAdminUser findByUsername(String account, Integer organizeID) {
-        CmMallAdminUser user = userMapper.findByUsername(account, organizeID);
+        CmMallAdminUser user = userDao.findByUsername(account, organizeID);
         return user;
     }
 
     @Override
     public String createToken(CmMallAdminUser user) throws Exception {
         // 获取当前时间戳(10位整数)
-        int time = (int) (System.currentTimeMillis() / 1000 + 3600*12);
+        int time = (int) (System.currentTimeMillis() / 1000 + 3600 * 12);
         String token = TokenEncryptUtils.encoded(time + "#,#" + user.getId() + "#,#" + user.getPassword());
         return token;
     }
 
     @Override
     public CmMallAdminUser findByUserId(Integer id) {
-        return userMapper.findByUserId(id);
+        return userDao.findByUserId(id);
     }
 }

+ 219 - 0
src/main/java/com/caimei/utils/NewOrderStatus.java

@@ -0,0 +1,219 @@
+/**
+ * <p>Description: Copyright © 2014-2015 CAIMEI365.com All Rights Reserved</p>
+ * @author zhang
+ * @date 2015年8月19日 上午11:00:10
+ */
+package com.caimei.utils;
+
+
+public enum NewOrderStatus {
+
+	WAIT_SURE("0","待确认"),
+
+	DAISHOU_DAIFA("11","待收待发"),
+	DAISHOU_BUFA("12","待收部发"),
+	DAISHOU_QUANFA("13","待收全发"),
+	BUSHOU_DAIFA("21","部收待发"),
+	BUSHOU_BUFA("22","部收部发"),
+	BUSHOU_QUANFA("23","部收全发"),
+	YISHOU_DAIFA("31","已收待发"),
+	YISHOU_BUFA("32","已收部发"),
+	YISHOU_QUANFA("33","已收全发"),
+
+	TRADE_SUCCESS("4", "交易完成"),
+	TRADE_FINISH("5","订单完成"),
+	TRADE_CLOSE("6", "交易关闭"),
+	WAIT_COMMENT("7","交易全退"),
+
+
+	//---数据库不存在的状态
+	WAIT_PAY("1","待支付"),
+	TRANSACTION("2","交易中"),
+	REFUND_RETURN("8","退货退款");
+
+
+	private String code;
+	private String desc;
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+	NewOrderStatus(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	/**
+	 * @Author ye.qin
+	 * @Description //TODO 是否部分收款
+	 * @Date 2019\5\31 0031 15:21
+	 * @Param
+	 * @return
+	 */
+	public static Boolean isBuFenShouKuan(String code){
+		Boolean res = false;
+		if(code.equals(BUSHOU_DAIFA.getCode())||code.equals(BUSHOU_BUFA.getCode())||code.equals(BUSHOU_QUANFA.getCode())){
+			res = true;
+		}
+		return res;
+	}
+
+	/**
+	 * @Author ye.qin
+	 * @Description //TODO 交易中
+	 * @Date 2019\5\31 0031 15:21
+	 * @Param
+	 * @return
+	 */
+	public static Boolean isTransaction(String code){
+		Boolean res = false;
+		if(code.equals(DAISHOU_DAIFA.getCode()) || code.equals(DAISHOU_BUFA.getCode()) || code.equals(DAISHOU_QUANFA.getCode()) ||code.equals(BUSHOU_DAIFA.getCode())||code.equals(BUSHOU_BUFA.getCode())||code.equals(BUSHOU_QUANFA.getCode())
+		||code.equals(YISHOU_DAIFA.getCode())||code.equals(YISHOU_BUFA.getCode())||code.equals(YISHOU_QUANFA.getCode())){
+			res = true;
+		}
+		return res;
+	}
+
+
+	/**
+	 * @Author ye.qin
+	 * @Description //TODO 待支付
+	 * @Date 2019\5\31 0031 15:23
+	 * @Param 
+	 * @return 
+	 */
+	public static Boolean isWaitPay(String code){
+		Boolean res = false;
+		if(code.equals(DAISHOU_DAIFA.getCode()) || code.equals(DAISHOU_BUFA.getCode()) || code.equals(DAISHOU_QUANFA.getCode()) ||code.equals(BUSHOU_DAIFA.getCode())||code.equals(BUSHOU_BUFA.getCode())||code.equals(BUSHOU_QUANFA.getCode())){
+			res = true;
+		}
+		return res;
+	}
+
+	/**
+	 * @Author ye.qin
+	 * @Description //TODO 待支付
+	 * @Date 2019\5\31 0031 15:23
+	 * @Param
+	 * @return
+	 */
+	public static Boolean isNotPay(String code){
+		Boolean res = false;
+		if(code.equals(DAISHOU_DAIFA.getCode()) || code.equals(DAISHOU_BUFA.getCode()) || code.equals(DAISHOU_QUANFA.getCode()) ){
+			res = true;
+		}
+		return res;
+	}
+
+
+	/**
+	 * @Author ye.qin
+	 * @Description //TODO 存在收货信息
+	 * @Date 2019\6\3 0003 21:52
+	 * @Param
+	 * @return
+	 */
+	public static Boolean hasReceived(String code){
+		Boolean res = false;
+		if(code.equals(DAISHOU_BUFA.getCode()) || code.equals(DAISHOU_QUANFA.getCode()) ||code.equals(BUSHOU_BUFA.getCode())||code.equals(BUSHOU_QUANFA.getCode()) || code.equals(YISHOU_BUFA.getCode()) || code.equals(YISHOU_QUANFA.getCode())
+				|| code.equals(TRADE_SUCCESS.getCode())|| code.equals(TRADE_FINISH.getCode()) || code.equals(WAIT_COMMENT.getCode())){
+			res = true;
+		}
+		return res;
+	}
+
+	/**
+	 * @Author ye.qin
+	 * @Description //TODO 是否展示物流信息
+	 * @Date 2019\6\3 0003 21:52
+	 * @Param
+	 * @return
+	 */
+    public static Boolean hasDeliver(String code){
+        Boolean res = false;
+        if( code.equals(DAISHOU_BUFA.getCode()) || code.equals(DAISHOU_QUANFA.getCode()) ||code.equals(BUSHOU_BUFA.getCode())||code.equals(BUSHOU_QUANFA.getCode()) || code.equals(YISHOU_BUFA.getCode()) || code.equals(YISHOU_QUANFA.getCode())
+            || code.equals(TRADE_SUCCESS.getCode())|| code.equals(TRADE_FINISH.getCode())){
+            res = true;
+        }
+        return res;
+    }
+
+    /**
+     * @Author ye.qin
+     * @Description //TODO 存在退款退货
+     * @Date 2019\6\3 0003 21:52
+     * @Param
+     * @return
+     */
+    public static Boolean hasReturn(String code){
+        Boolean res = false;
+
+        if(code.equals(DAISHOU_BUFA.getCode()) || code.equals(DAISHOU_QUANFA.getCode()) ||code.equals(BUSHOU_DAIFA.getCode())||code.equals(BUSHOU_BUFA.getCode())||code.equals(BUSHOU_QUANFA.getCode())
+                ||code.equals(YISHOU_DAIFA.getCode())||code.equals(YISHOU_BUFA.getCode())||code.equals(YISHOU_QUANFA.getCode())
+                || code.equals(TRADE_SUCCESS.getCode())|| code.equals(TRADE_FINISH.getCode())){
+            res = true;
+        }
+        return res;
+    }
+
+
+    public static String getNewOrderStatus(String code){
+        for(NewOrderStatus type : NewOrderStatus.values()){
+            if(type.getCode().equals(code)){
+                return type.desc;
+            }
+        }
+        return "";
+    }
+    public static String getNewOrderStatus1(String code){
+        for(NewOrderStatus type : NewOrderStatus.values()){
+            if(type.getCode().equals(code)){
+                if(isTransaction(code)){
+                    return "交易中";
+                }else{
+                    return type.desc;
+                }
+            }
+        }
+        return "";
+    }
+
+    public static String getPayTypeStr(String payType) {
+//        1建设银行7297、2广发银行0115、3中信银行7172、4中信银行0897、5中信银行0897-财付通、
+//        6中信银行0897-支付宝、7线上-支付宝、8线上-微信支付、9线上-快钱支付,10口头返佣',
+			if ("1".equals(payType))
+				return "建设银行7297";
+			if ("2".equals(payType))
+				return "广发银行0115";
+			if ("3".equals(payType))
+				return "中信银行7172";
+			if ("4".equals(payType))
+				return "中信银行0897";
+			if ("5".equals(payType))
+				return "中信银行0897-财付通";
+			if ("6".equals(payType))
+				return "6中信银行0897-支付宝";
+			if ("7".equals(payType))
+				return "线上-支付宝";
+			if ("8".equals(payType))
+				return "线上-微信支付";
+			if ("9".equals(payType))
+				return "线上-快钱支付";
+			if ("10".equals(payType))
+				return "口头返佣";
+			return "";
+	}
+}

+ 28 - 0
src/main/resources/mapper/BpClauseMapper.xml

@@ -0,0 +1,28 @@
+<?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.order.dao.BpClauseDao">
+    <sql id="bpClauseColumns">
+		a.id AS "id",
+		a.name AS "name",
+		a.content AS "content",
+		a.clauseType AS "clauseType",
+		a.enabledStatus AS "enabledStatus"
+	</sql>
+
+    <select id="findList" resultType="com.caimei.modules.order.entity.BpClause">
+        SELECT
+        <include refid="bpClauseColumns"/>
+        FROM bp_clause a
+        <where>
+
+            <if test="name != null and name != ''">
+                AND a.name LIKE concat('%',#{name},'%')
+            </if>
+            <if test="enabledStatus != null and enabledStatus != ''">
+                AND a.enabledStatus = #{enabledStatus}
+            </if>
+        </where>
+    </select>
+</mapper>

+ 23 - 0
src/main/resources/mapper/CmDiscernReceiptMapper.xml

@@ -0,0 +1,23 @@
+<?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.order.dao.CmDiscernReceiptDao">
+    <select id="findRebateOrderID" resultType="integer">
+        select cso.orderID AS orderID
+        from cm_receipt_order_relation cror left join cm_shop_order cso
+        on cror.orderID = cso.shopOrderID
+        where cror.relationType = '1' and cror.delFlag = '0'
+        and cso.orderID in
+        <foreach collection="orderIds" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </select>
+
+    <select id="findOrderReceipt" resultType="double">
+		select sum(associateAmount) from cm_receipt_order_relation cror
+		left join cm_discern_receipt cdr on cror.receiptID = cdr.id
+		where cror.orderID = #{orderID} and cror.delFlag = '0' and cror.relationType = '2'
+		and cdr.delFlag = '0' and cdr.receiptStatus = '3'
+	</select>
+</mapper>

+ 4 - 0
src/main/resources/mapper/CmMallProductsClassifyMapper.xml

@@ -12,6 +12,7 @@
 		a.status AS "status",
 		a.addTime AS "addTime",
 		a.updateTime AS "updateTime",
+		a.postageToPay AS "postageToPay",
 		a.delFlag AS "delFlag"
 	</sql>
 
@@ -56,6 +57,7 @@
 			status,
 			addTime,
 			updateTime,
+			postageToPay,
 			delFlag
 		) VALUES (
 			#{organizeID},
@@ -65,6 +67,7 @@
 			#{status},
 			#{addTime},
 			#{updateTime},
+			#{postageToPay},
 			#{delFlag}
 		)
 	</insert>
@@ -77,6 +80,7 @@
 			sort = #{sort},
 			status = #{status},
 			addTime = #{addTime},
+			postageToPay = #{postageToPay},
 			updateTime = #{updateTime}
 		WHERE id = #{id}
 	</update>

+ 4 - 4
src/main/resources/mapper/CmOperationUserMapper.xml

@@ -144,16 +144,16 @@
         <if test="openid != null and openid != ''">
             openid = #{openid},
         </if>
-        <if test="invitationCodeTime != null and invitationCodeTime != ''">
+        <if test="invitationCodeTime != null">
             invitationCodeTime = #{invitationCodeTime},
         </if>
-        <if test="bindTime != null and bindTime != ''">
+        <if test="bindTime != null">
             bindTime = #{bindTime},
         </if>
-        <if test="updateTime != null  and addTime != ''">
+        <if test="updateTime != null">
             updateTime = #{updateTime},
         </if>
-        <if test="addTime != null  and addTime != ''">
+        <if test="addTime != null">
             addTime = #{addTime},
         </if>
         <if test="linkName != null and linkName != ''">

+ 73 - 0
src/main/resources/mapper/CmOrderRemarkMapper.xml

@@ -0,0 +1,73 @@
+<?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.order.dao.CmOrderRemarkDao">
+    <sql id="cmOrderRemarkColumns">
+		su.id AS "id",
+		su.no AS "no",
+		a.orderId AS "orderId",
+		a.remarks AS "remarks",
+		a.createBy AS "createBy.id",
+		a.createDate AS "createDate",
+		su.name AS  "sysUserName"
+	</sql>
+
+    <select id="get" resultType="com.caimei.modules.order.entity.CmOrderRemark">
+        SELECT
+        <include refid="cmOrderRemarkColumns"/>
+        FROM cm_order_remark a
+        LEFT JOIN sys_user su ON su.id = a.createBy
+        WHERE a.id = #{id}
+        ORDER BY a.createDate
+    </select>
+
+    <select id="findList" resultType="com.caimei.modules.order.entity.CmOrderRemark">
+        SELECT
+        <include refid="cmOrderRemarkColumns"/>
+        FROM cm_order_remark a
+        LEFT JOIN sys_user su ON su.id = a.createBy
+        <if test="shopOrderID != null">
+            <where>
+                <if test="orderID != null and orderID != ''">
+                    AND (a.orderID = #{orderID} AND a.shopOrderID is null)
+                </if>
+                or (a.orderID = #{orderID} AND a.shopOrderID = #{shopOrderID})
+            </where>
+        </if>
+        <if test="shopOrderID == null">
+            <where>
+                <if test="orderID != null and orderID != ''">
+                    AND a.orderID = #{orderID} AND a.shopOrderID is null
+                </if>
+            </where>
+        </if>
+        ORDER BY a.createDate
+    </select>
+
+    <insert id="insert" parameterType="com.caimei.modules.order.entity.CmOrderRemark"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_order_remark(
+			orderID,
+			shopOrderID,
+			remarks,
+			createBy,
+			createDate
+		) VALUES (
+			#{orderID},
+			#{shopOrderID},
+			#{remarks},
+			#{createBy.id},
+			#{createDate}
+		)
+	</insert>
+
+    <update id="update">
+		UPDATE cm_order_remark SET
+			orderID = #{orderID},
+			shopOrderID = #{shopOrderID},
+			remarks = #{remarks},
+			createBy = #{createBy.id},
+			createDate = #{createDate}
+		WHERE id = #{id}
+	</update>
+</mapper>

+ 9 - 0
src/main/resources/mapper/CmPayShopRecordMapper.xml

@@ -0,0 +1,9 @@
+<?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.order.dao.CmPayShopRecordDao">
+    <select id="sumByShopOrderID"  resultType="double">
+		select sum(payAmount) from cm_pay_shop_record where shopOrderID = #{shopOrderID} and status = '1' and delFlag = '0'
+	</select>
+</mapper>

+ 33 - 0
src/main/resources/mapper/CmProductSnMapper.xml

@@ -0,0 +1,33 @@
+<?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.order.dao.CmProductSnDao">
+    <sql id="cmProductSnColumns">
+		a.snID AS "snID",
+		a.snCode AS "snCode",
+		a.orderNo AS "orderNo",
+		a.orderID AS "orderID",
+		a.shopOrderNo AS "shopOrderNo",
+		a.shopOrderID AS "shopOrderID",
+		a.productID AS "productID",
+		a.orderProductID AS "orderProductID",
+		a.source AS "source",
+		a.createTime AS "createTime",
+		a.updateTime AS "updateTime"
+	</sql>
+
+    <select id="getListSignByOrderProduct" parameterType="java.lang.Integer" resultType="com.caimei.modules.club.entity.CmProductSn">
+        SELECT
+        <include refid="cmProductSnColumns"/>
+        FROM cm_product_sn a
+        <where>
+            <if test="shopOrderID != null">
+                AND shopOrderID = #{shopOrderID}
+            </if>
+            <if test="orderProductID != null">
+                AND orderProductID = #{orderProductID}
+            </if>
+        </where>
+    </select>
+</mapper>

+ 18 - 0
src/main/resources/mapper/CmReceiptOrderRelationMapper.xml

@@ -0,0 +1,18 @@
+<?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.order.dao.CmReceiptOrderRelationDao">
+    <select id="toAudit" resultType="java.lang.Integer">
+		SELECT
+		  cdr.id
+		FROM
+		  `cm_receipt_order_relation` cror
+		  LEFT JOIN `cm_discern_receipt` cdr ON cror.receiptID = cdr.id
+		WHERE
+		  cdr.receiptStatus = '2'
+		  AND cror.relationType = '2'
+		  AND cror.delFlag = '0'
+		  AND cror.orderID = #{orderID}
+	</select>
+</mapper>

+ 132 - 0
src/main/resources/mapper/CmReturnedPurchaseMapper.xml

@@ -0,0 +1,132 @@
+<?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.order.dao.CmReturnedPurchaseDao">
+    <sql id="cmReturnedPurchaseColumns">
+		a.id AS "id",
+		a.returnedNo AS "returnedNo",
+		a.orderID AS "orderID",
+		a.userID AS "userID",
+		a.status AS "status",
+		a.returnedWay AS "returnedWay",
+		a.payType AS "payType",
+		a.operatingOrderStatus AS "operatingOrderStatus",
+		a.returnedBankInfo AS "returnedBankInfo",
+		a.returnedPurchaseFee AS "returnedPurchaseFee",
+		a.refundFee AS "refundFee",
+		a.image1 AS "image1",
+		a.image2 AS "image2",
+		a.image3 AS "image3",
+		a.image4 AS "image4",
+		a.image5 AS "image5",
+		a.remarks AS "remarks",
+		a.reviewImage1 AS "reviewImage1",
+		a.reviewImage2 AS "reviewImage2",
+		a.reviewImage3 AS "reviewImage3",
+		a.reviewImage4 AS "reviewImage4",
+		a.reviewImage5 AS "reviewImage5",
+		a.reviewRemarks AS "reviewRemarks",
+		a.returnTime AS "returnTime",
+		a.applicationUserID AS "applicationUserID",
+		a.reviewUserID AS "reviewUserID",
+		a.refundBalanceFee AS "refundBalanceFee",
+		a.refundOnlineFee AS "refundOnlineFee",
+		a.refundOfflineFee AS "refundOfflineFee",
+		a.bankAccountName AS "bankAccountName",
+		a.bankAccountNo AS "bankAccountNo",
+		a.openBank AS "openBank",
+		a.bankAccountType AS "bankAccountType",
+		a.confirmReturnTime AS "confirmReturnTime",
+		b.orderNo as "orderNo",
+		c.userName as "userName"
+	</sql>
+
+    <sql id="cmReturnedPurchaseJoins">
+		left join cm_order as b on a.orderID = b.orderID
+		left join user as c on a.userID = c.userID
+	</sql>
+
+    <select id="findOrderIDInReturnPurchase" resultType="integer">
+        select orderID from cm_returned_purchase where status = '1'
+        and orderID in
+        <foreach collection="orderIds" open="(" close=")" item="oId" separator=",">
+            #{oId}
+        </foreach>
+        and delFlag = 0
+    </select>
+
+    <select id="findOrderIDsInApplyReturnFlag" resultType="integer">
+        select orderID from cm_returned_purchase where status in (1,3)
+        and orderID in
+        <foreach collection="orderIds" open="(" close=")" item="oId" separator=",">
+            #{oId}
+        </foreach>
+        and delFlag = 0
+    </select>
+
+    <select id="findList" resultType="com.caimei.modules.order.entity.CmReturnedPurchase">
+        SELECT
+        <include refid="cmReturnedPurchaseColumns"/>
+        ,s.name AS "applicationUserName",
+        s1.name AS "reviewUserName",
+        co.organizeID AS "organizeID"
+        FROM cm_returned_purchase a
+        LEFT JOIN sys_user s on s.id = a.applicationUserID
+        LEFT JOIN sys_user s1 on s1.id = a.reviewUserID
+        LEFT JOIN cm_order co ON a.orderID=co.orderID
+        <include refid="cmReturnedPurchaseJoins"/>
+        <where>
+            <if test="organizeID != null and organizeID != '' and organizeID != 0 ">
+                AND co.organizeID = #{organizeID}
+            </if>
+            <if test="organizeID == 0 ">
+                AND co.organizeID IS NULL
+            </if>
+            <if test="id != null and id != ''">
+                AND a.id = #{id}
+            </if>
+            <if test="returnedNo != null and returnedNo != ''">
+                AND a.returnedNo = #{returnedNo}
+            </if>
+            <if test="orderID != null and orderID != ''">
+                AND a.orderID = #{orderID}
+            </if>
+            <if test="userID != null and userID != ''">
+                AND a.userID = #{userID}
+            </if>
+            <if test="status != null and status != ''">
+                AND a.status = #{status}
+            </if>
+            <if test="returnTime != null and returnTime != ''">
+                AND a.returnTime = #{returnTime}
+            </if>
+            <if test="confirmReturnTime != null and confirmReturnTime != ''">
+                AND a.confirmReturnTime = #{confirmReturnTime}
+            </if>
+            <if test="beginReturnTime != null and beginReturnTime != ''">
+                AND STR_TO_DATE(returnTime,'%Y-%m-%d %H:%i') <![CDATA[  >  ]]> STR_TO_DATE(#{beginReturnTime},'%Y-%m-%d %H:%i')
+            </if>
+            <if test="endReturnTime != null and endReturnTime != ''">
+                AND STR_TO_DATE(returnTime,'%Y-%m-%d %H:%i') <![CDATA[  <  ]]> STR_TO_DATE(#{endReturnTime},'%Y-%m-%d %H:%i')
+            </if>
+            <if test="beginConfirmReturnTime != null and beginConfirmReturnTime != ''">
+                AND STR_TO_DATE(confirmReturnTime,'%Y-%m-%d %H:%i') <![CDATA[  >  ]]> STR_TO_DATE(#{beginConfirmReturnTime},'%Y-%m-%d %H:%i')
+            </if>
+            <if test="endConfirmReturnTime != null and endConfirmReturnTime != ''">
+                AND STR_TO_DATE(confirmReturnTime,'%Y-%m-%d %H:%i') <![CDATA[  <  ]]> STR_TO_DATE(#{endConfirmReturnTime},'%Y-%m-%d %H:%i')
+            </if>
+            <if test="userName != null and userName != ''">
+                AND c.userName like
+                <if test="dbName == 'oracle'">'%'||#{userName}||'%'</if>
+                <if test="dbName == 'mssql'">'%'+#{userName}+'%'</if>
+                <if test="dbName == 'mysql'">concat('%',#{userName},'%')</if>
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                AND b.orderNo = #{orderNo}
+            </if>
+            and a.delFlag = 0
+        </where>
+            order by a.returnTime desc
+    </select>
+</mapper>

+ 79 - 0
src/main/resources/mapper/CmReturnedPurchaseProductMapper.xml

@@ -0,0 +1,79 @@
+<?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.order.dao.CmReturnedPurchaseProductDao">
+    <sql id="cmReturnedPurchaseProductColumns">
+		a.id AS "id",
+		a.returnedID AS "returnedID",
+		a.productID AS "productID",
+		a.orderProductID AS "orderProductID",
+		a.shopID AS "shopID",
+		a.shopOrderID as "shopOrderID",
+		a.returnedReceiver AS "returnedReceiver",
+		a.applicationReturnedNum AS "applicationReturnedNum",
+		a.applicationCancelNum AS "applicationCancelNum",
+		a.actualReturnedNum AS "actualReturnedNum",
+		a.actualCancelNum AS "actualCancelNum"
+	</sql>
+
+    <select id="findList" resultType="com.caimei.modules.order.entity.CmReturnedPurchaseProduct">
+        SELECT
+        <include refid="cmReturnedPurchaseProductColumns"/>,
+        b.price as price,b.discount as discount,b.discountPrice as discountPrice,b.num as num,b.presentNum as presentNum,
+        b.totalFee as totalFee,b.totalAddedValueTax as totalAddedValueTax,
+        b.taxRate as taxRate,b.addedValueTax as addedValueTax,c.mainImage as mainImage,
+        c.name as name,d.name as shopName,
+        c.unit as unit
+        FROM cm_returned_purchase_product a
+        left join cm_order_product b on a.orderProductID = b.orderProductID
+        left join product c on c.productID = a.productID
+        left join shop d on d.shopID = a.shopID
+        <where>
+            <if test="returnedID != null and returnedID != ''">
+                AND a.returnedID = #{returnedID}
+            </if>
+        </where>
+    </select>
+
+    <select id="getCmReturnedPurchaseProductList" resultType="com.caimei.modules.order.entity.CmReturnedPurchaseProduct">
+        SELECT
+        <include refid="cmReturnedPurchaseProductColumns"/>,
+        b.status as status
+        FROM cm_returned_purchase_product a
+        left join cm_returned_purchase b on a.returnedID = b.id
+        <where>
+            <if test="productID != null and productID != ''">
+                AND a.productID = #{productID}
+            </if>
+            <if test="shopOrderID != null and shopOrderID != ''">
+                AND a.shopOrderID = #{shopOrderID}
+            </if>
+            AND b.status in(2)
+            and b.delFlag = 0
+        </where>
+    </select>
+
+    <select id="findListByReturnTime" resultType="com.caimei.modules.order.entity.CmReturnedPurchaseProduct">
+        SELECT
+        *
+        FROM cm_returned_purchase_product a
+        left join cm_returned_purchase b on a.returnedID = b.id
+        <where>
+            <if test="shopOrderID != null and shopOrderID != ''">
+                AND a.shopOrderID = #{shopOrderID}
+            </if>
+            <if test="orderProductID != null and orderProductID != ''">
+                AND a.orderProductID = #{orderProductID}
+            </if>
+            <if test="orderID != null and orderID != ''">
+                AND b.orderID = #{orderID}
+            </if>
+            <if test="returnTime != null and returnTime != ''">
+                AND b.returnTime <![CDATA[  <  ]]> #{returnTime}
+            </if>
+            AND b.status in(1,2)
+            and b.delFlag = 0
+        </where>
+    </select>
+</mapper>

+ 0 - 0
src/main/resources/mapper/CmUserOrganizeMapper → src/main/resources/mapper/CmUserOrganizeMapper.xml


+ 32 - 0
src/main/resources/mapper/LogisticsBatchMapper.xml

@@ -0,0 +1,32 @@
+<?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.order.dao.LogisticsBatchDao">
+    <sql id="columns">
+        a.id AS id,
+        a.shopOrderID AS shopOrderID,
+        a.orderID AS orderID,
+        a.outStoreTimes AS outStoreTimes,
+        a.mailer AS mailer,
+        a.shopID AS shopID,
+        a.updateDate AS updateDate,
+        a.deliveryTime AS deliveryTime,
+        a.receiptTime AS receiptTime
+    </sql>
+
+    <select id="findBatch" resultType="com.caimei.modules.order.entity.LogisticsBatch">
+        select <include refid="columns"/>
+        from cm_logistics_batch a
+        <where>
+            1 = 1
+            <if test="orderID != null and orderID != ''">
+                and a.orderID = #{orderID}
+            </if>
+            <if test="logisticsBatchID != null and logisticsBatchID != ''">
+                and a.logisticsBatchID = #{logisticsBatchID}
+            </if>
+        </where>
+        order by a.deliveryTime desc
+    </select>
+</mapper>

+ 27 - 0
src/main/resources/mapper/LogisticsInformationMapper.xml

@@ -0,0 +1,27 @@
+<?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.order.dao.LogisticsInformationDao">
+    <sql id="columns">
+        a.id AS id,
+        a.logisticsBatchID AS logisticsBatchID,
+        a.type AS type,
+        a.shopOrderID AS shopOrderID,
+        a.orderProductID AS orderProductID,
+        a.orderID AS orderID,
+        a.nu AS nu,
+        a.state AS state,
+        a.info AS info,
+        a.logisticsCompanyName AS logisticsCompanyName,
+        a.logisticsCompanyCode AS logisticsCompanyCode,
+        a.shopID AS shopID,
+        a.updateDate AS updateDate,
+        a.remarks AS remarks
+    </sql>
+
+    <select id="findByLogisticsBatchID" resultType="com.caimei.modules.order.entity.LogisticsInformation">
+        select <include refid="columns"/>
+        from logistics_information a where a.logisticsBatchID = #{logisticsBatchID}
+    </select>
+</mapper>

+ 23 - 0
src/main/resources/mapper/LogisticsRecordMapper.xml

@@ -0,0 +1,23 @@
+<?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.order.dao.LogisticsRecordDao">
+    <sql id="columns">
+        a.id AS id,
+        a.logisticsBatchID AS logisticsBatchID,
+        a.shopOrderID AS shopOrderID,
+        a.orderID AS orderID,
+        a.orderProductID AS orderProductID,
+        a.buyNum AS buyNum,
+        a.num AS num,
+        a.productID AS productID,
+        a.productName AS productName,
+        a.image AS image
+    </sql>
+
+    <select id="findByLogisticsBatchID" resultType="com.caimei.modules.order.entity.LogisticsRecord">
+        select <include refid="columns"/>
+        from cm_logistics_record a where a.logisticsBatchID = #{logisticsBatchID}
+    </select>
+</mapper>

+ 10 - 0
src/main/resources/mapper/NewOrderConfigMapper.xml

@@ -0,0 +1,10 @@
+<?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.order.dao.NewOrderConfigDao">
+    <select id="getValueByKey"	resultType="com.caimei.modules.order.entity.NewOrderConfig">
+		select c.key AS 'key', c.value AS 'value' from cm_order_config c
+		where c.key = #{key}
+	</select>
+</mapper>

+ 248 - 0
src/main/resources/mapper/NewOrderMapper.xml

@@ -0,0 +1,248 @@
+<?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.order.dao.NewOrderDao">
+    <sql id="columns">
+		a.orderID AS orderID,
+		a.orderNo AS orderNo,
+		a.organizeID AS organizeID,
+		a.userID AS userID,
+		a.buyUserID AS buyUserID,
+		a.shopOrderIDs AS shopOrderIDs,
+		a.orderSubmitType AS orderSubmitType,
+		a.orderType AS orderType,
+		a.status AS status,
+		a.productTotalFee AS productTotalFee,
+		a.orderTotalFee AS orderTotalFee,
+		a.payTotalFee AS payTotalFee,
+		a.payableAmount AS payableAmount,
+		a.balancePayFee  AS balancePayFee ,
+		a.discountFee AS discountFee,
+		a.spID AS spID,
+		a.mainSpID AS mainSpID,
+		a.note AS note,
+		a.clubID AS clubID,
+		a.clubScanTime AS clubScanTime,
+		a.payWay AS payWay,
+		a.orderSource AS orderSource,
+		a.orderTime AS orderTime,
+		a.confirmTime AS confirmTime,
+		a.productCount AS productCount,
+		a.cooFreeFlag AS cooFreeFlag,
+		a.cooFreeRate AS cooFreeRate,
+		a.cooFreeAmount AS cooFreeAmount,
+		a.confirmFlag AS confirmFlag,
+		a.clauseID AS clauseID,
+		a.clauseContent AS clauseContent,
+		a.clauseName AS clauseName,
+		a.updateDate AS updateDate,
+		a.freePostFlag AS freePostFlag,
+		a.freight AS freight,
+		a.delFlag AS delFlag,
+		a.onlinePayFlag AS onlinePayFlag,
+		a.payTime AS payTime,
+		a.splitFlag AS splitFlag,
+		(select sum(cop.totalAddedValueTax) from cm_order_product cop where cop.orderID = a.orderID) AS totalAddedValueTax,
+		a.preferential AS preferential,
+		a.closeReason AS closeReason,
+		a.receiptStatus as receiptStatus,
+		a.payStatus	as payStatus,
+		a.sendOutStatus as sendOutStatus,
+		a.refundType as refundType,
+		a.postageOrderFlag AS postageOrderFlag
+	</sql>
+
+    <resultMap id="orderDisplayList" type="com.caimei.modules.order.entity.NewOrder">
+        <id column="orderID" property="orderID"/>
+        <result column="orderNo" property="orderNo"/>
+        <result column="organizeID" property="organizeID"/>
+        <result column="orderType" property="orderType"/>
+        <result column="shopName" property="shopName"/>
+        <result column="receiver" property="receiver"/>
+        <result column="buyer" property="buyer"/>
+        <result column="orderSource" property="orderSource"/>
+        <result column="orderTotalFee" property="orderTotalFee"/>
+        <result column="orderTime" property="orderTime"/>
+        <result column="productCount" property="productCount"/>
+        <result column="alreadyReceipt" property="alreadyReceipt"/>
+        <result column="unReceipt" property="unReceipt"/>
+        <result column="payTotalFee" property="payTotalFee"/>
+        <result column="payWay" property="payWay"/>
+        <result column="status" property="status"/>
+        <collection property="newShopOrders" ofType="com.caimei.modules.order.entity.NewShopOrder"
+                    select="loadShopOrders" column="orderNo" fetchType="eager">
+        </collection>
+    </resultMap>
+
+    <select id="findList" resultMap="orderDisplayList" parameterType="com.caimei.modules.order.entity.NewOrder">
+        SELECT DISTINCT
+        co.orderID AS orderID,
+        co.orderNo AS orderNo,
+        co.organizeID AS organizeID,
+        co.orderType AS orderType,
+        co.onlinePayFlag AS onlinePayFlag,
+        bou.shouHuoRen AS receiver,
+        bou.name AS buyer,
+        co.orderSource AS orderSource,
+        co.orderTotalFee AS orderTotalFee,
+        co.orderTime AS orderTime,
+        co.payTotalFee AS payTotalFee,
+        co.payWay AS payWay,
+        co.payStatus AS payStatus,
+        co.refundType AS refundType,
+        co.sendOutStatus AS sendOutStatus,
+        co.receiptStatus AS receiptStatus,
+        co.productCount AS productCount,
+        (SELECT IFNULL(sum(cop.shouldPayFee),0) FROM cm_order_product cop WHERE cop.orderId=co.orderID) AS "shouldPayProduct",
+        co.status AS status,
+        co.splitFlag AS splitFlag,
+        co.postageOrderFlag AS postageOrderFlag,
+        (case when co.orderType = '0' then
+        (select linkMan1 from serviceprovider where serviceProviderID = co.spID)
+        else
+        ''
+        end) AS spName
+        FROM cm_order co
+        LEFT JOIN bp_order_userinfo bou ON bou.orderId = co.orderID
+        <where>
+            <if test="orderID != null and orderID != ''">
+                AND co.orderID = #{orderID}
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                AND co.orderNo = #{orderNo}
+            </if>
+            <if test="organizeID != null and organizeID != '' and organizeID != 0 ">
+                AND co.organizeID = #{organizeID}
+            </if>
+            <if test="organizeID == 0 ">
+                AND co.organizeID IS NULL
+            </if>
+            <if test="status != null and status != ''">
+                <choose>
+                    <when test="status == '99'.toString()">
+                        AND co.status in (11,12,13,21,22,23,31,32,33)
+                    </when>
+                    <otherwise>
+                        AND co.status = #{status}
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="buyer != null and buyer != ''">
+                AND bou.name LIKE concat('%',#{buyer},'%')
+            </if>
+            <if test="orderType != null and orderType != ''">
+                AND co.orderType = #{orderType}
+            </if>
+            <if test="orderSource != null and orderSource != ''">
+                AND co.orderSource = #{orderSource}
+            </if>
+            <if test="orderTime != null and orderTime != ''">
+                AND co.orderTime = #{orderTime}
+            </if>
+            <if test="sendOutStatus != null and sendOutStatus != ''">
+                AND co.sendOutStatus = #{sendOutStatus}
+            </if>
+            <if test="startTime != null and startTime != ''">
+                AND co.orderTime <![CDATA[  >=  ]]> #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND co.orderTime <![CDATA[   <=  ]]> #{endTime}
+            </if>
+            <if test="receiver != null and receiver != ''">
+                AND bou.shouHuoRen LIKE concat('%',#{receiver},'%')
+            </if>
+
+            <if test="receiptStatus != null and receiptStatus != ''">
+                AND co.receiptStatus = #{receiptStatus}
+            </if>
+            <if test="payStatus != null and payStatus != ''">
+                AND co.payStatus = #{payStatus}
+            </if>
+            <if test="sendOutStatus != null and sendOutStatus != ''">
+                AND co.sendOutStatus = #{sendOutStatus}
+            </if>
+            <if test="returnedPurchaseStatus != null and returnedPurchaseStatus != ''">
+                AND
+                <if test="returnedPurchaseStatus == 1">
+                    exists
+                </if>
+                <if test="returnedPurchaseStatus == 0">
+                    not exists
+                </if>
+                (select 1 from cm_returned_purchase c3 where c3.status = '1' and c3.orderID = co.orderID and c3.delFlag = 0)
+            </if>
+            <if test="refundType != null and refundType != ''">
+                AND
+                <if test="refundType == 0">
+                    co.refundType is null
+                </if>
+                <if test="refundType == 1">
+                    co.refundType = '1'
+                </if>
+                <if test="refundType == 2">
+                    co.refundType = '2'
+                </if>
+            </if>
+            <if test="orderRefundType != null and orderRefundType != ''">
+                <if test="orderRefundType == 0">
+                    AND (select count(1) from cm_returned_purchase crp where co.orderID = crp.orderID  and crp.delFlag = 0) = 0
+                </if>
+                <if test="orderRefundType == 1">
+                    AND (select count(1) from cm_returned_purchase crp where co.orderID = crp.orderID  and crp.delFlag = 0) > 0
+                </if>
+                <if test="orderRefundType == 11">
+                    AND (select count(1) from cm_returned_purchase crp where co.orderID = crp.orderID and crp.status = 1  and crp.delFlag = 0) > 0
+                </if>
+                <if test="orderRefundType == 12">
+                    AND (select count(1) from cm_returned_purchase crp where co.orderID = crp.orderID and crp.status = 2 and crp.delFlag = 0
+                    <if test="startRefundTime != null and startRefundTime != ''">
+                        AND crp.confirmReturnTime <![CDATA[  >=  ]]> #{startRefundTime}
+                    </if>
+                    <if test="endRefundTime != null and endRefundTime != ''">
+                        AND crp.confirmReturnTime <![CDATA[   <=  ]]> #{endRefundTime}
+                    </if>
+                    ) > 0
+                </if>
+                <if test="orderRefundType == 13">
+                    AND (select count(1) from cm_returned_purchase crp where co.orderID = crp.orderID and crp.status = 3 and crp.delFlag = 0) > 0
+                </if>
+            </if>
+            <if test="rebateOrder != null and rebateOrder != ''">
+                AND
+                <if test="rebateOrder == 1">
+                    exists
+                </if>
+                <if test="rebateOrder == 0">
+                    not exists
+                </if>
+                (select 1 from cm_receipt_order_relation c1 where c1.relationType = '1'
+                and c1.orderID in (select c2.shopOrderID from cm_shop_order c2 where c2.orderID = co.orderID)
+                and c1.delFlag = '0')
+            </if>
+            AND co.delFlag = 0
+        </where>
+            ORDER BY co.orderID DESC, co.orderTime DESC
+    </select>
+
+    <select id="loadShopOrders" parameterType="string" resultType="com.caimei.modules.order.entity.NewShopOrder">
+		SELECT
+		cs.shopOrderID AS shopOrderID,
+		cs.shopOrderNo AS shopOrderNo,
+		cs.shopOrderNo AS shopOrderNo,
+		cs.itemCount AS itemCount,
+		cs.needPayAmount AS needPayAmount,
+		s.name AS shopName,
+		cs.status AS status,
+		cs.shopID AS shopID
+		FROM cm_shop_order cs
+		LEFT JOIN shop s ON cs.shopID = s.shopID
+		WHERE cs.orderNo = #{orderNo} AND cs.delFlag = 0
+	</select>
+
+    <select id="get" resultType="com.caimei.modules.order.entity.NewOrder">
+        SELECT <include refid="columns"/>
+        FROM cm_order a
+        WHERE a.orderID = #{id}
+    </select>
+</mapper>

+ 121 - 0
src/main/resources/mapper/NewOrderProductMapper.xml

@@ -0,0 +1,121 @@
+<?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.order.dao.NewOrderProductDao">
+    <sql id="orderProductColumns">
+		a.`orderProductID` AS `orderProductID`,
+		  a.`orderNo` AS `orderNo`,
+		  a.`orderID` AS `orderID`,
+		  a.`shopOrderID` AS `shopOrderID`,
+		  a.`shopOrderNo` AS `shopOrderNo`,
+		  a.`shopID` AS `shopID`,
+		  a.`productID` AS `productID`,
+		  a.`num` AS `num`,
+		  a.`presentNum` AS `presentNum`,
+		  a.`outStoreType` AS `outStoreType`,
+		  a.`skuID` AS `skuID`,
+		  a.`props` AS `props`,
+		  a.`propName` AS `propName`,
+		  a.`productNo` AS `productNo`,
+		  a.`price` AS `price`,
+		  a.`normalPrice` AS `normalPrice`,
+		  a.`price0` AS `price0`,
+		  a.`price1` AS `price1`,
+		  a.`totalAmount` AS `totalAmount`,
+		  a.`totalFee` AS `totalFee`,
+		  a.`shouldPayFee` AS `shouldPayFee`,
+		  a.`discount` AS `discount`,
+		  a.`discountPrice` AS `discountPrice`,
+		  a.`taxRate` AS `taxRate`,
+		  a.`addedValueTax` AS `addedValueTax`,
+		  a.`totalAddedValueTax` AS `totalAddedValueTax`,
+		  IFNULL(a.`shouldPayTotalTax` ,0) AS `shouldPayTotalTax`,
+		  a.`shopFee` AS `shopFee`,
+		  a.`otherFee` AS `otherFee`,
+		  a.`cmFee` AS `cmFee`,
+		  a.`singleShopFee` AS `singleShopFee`,
+		  a.`singleOtherFee` AS `singleOtherFee`,
+		  a.`singleCmFee` AS `singleCmFee`,
+		  a.`status` AS `status`,
+		  a.`commentFlag` AS `commentFlag`,
+		  a.`totalBeans` AS `totalBeans`,
+		  a.`useBalanceAmount` AS `useBalanceAmount`,
+		  a.`useBeanAmount` AS `useBeanAmount`,
+		  a.`notOutStore` AS `notOutStore`,
+		  a.`cmbeanPrice` AS `cmbeanPrice`,
+		  a.`isActProduct` AS `isActProduct`,
+		  a.`isGiftProduct` AS `isGiftProduct`,
+		  a.`productActInfo` AS `productActInfo`,
+		  a.`buyAgainFlag` AS `buyAgainFlag`,
+		  a.`confirmProductFlag` AS `confirmProductFlag`,
+		  a.`payStatus` AS `payStatus`,
+		  a.`name` AS `name`,
+		  p.`unit` AS `unit`,
+		  a.`actType` AS `actType`,
+		  a.`actPreferential` AS `actPreferential`,
+		  a.`preferential` AS `preferential`,
+		  (select mainImage from product p where p.productID = a.productID) AS image,
+		  a.`discountFee` AS `discountFee`,
+		  (select cso.status from cm_shop_order cso where cso.shopOrderID = a.shopOrderID) AS status,
+		  a.`productUnit` AS `productUnit`,
+		  a.`productImage` AS `productImage`,
+		  a.`shopName` AS `shopName`,
+		  p.costProportional AS costProportional,
+		  p.stock AS stock,
+		  p.costCheckFlag AS costCheckFlag,
+		  p.costPrice AS costPrice,
+		  a.costPrice as newCostPrice,
+		  p.aliasName AS aliasName,
+		  a.singleShouldPayTotalTax AS singleShouldPayTotalTax
+	</sql>
+
+    <sql id="orderProductJoins">
+		LEFT JOIN product p ON p.productID = a.productID
+    </sql>
+
+    <select id="get" resultType="com.caimei.modules.order.entity.NewOrderProduct">
+        SELECT
+        <include refid="orderProductColumns"/>
+        FROM cm_order_product a
+        <include refid="orderProductJoins"/>
+        WHERE a.orderProductID = #{orderProductID}
+    </select>
+
+	<select id="findListByShopOrderID" resultType="com.caimei.modules.order.entity.NewOrderProduct">
+		SELECT
+		<include refid="orderProductColumns"/>
+		FROM cm_order_product a
+		<include refid="orderProductJoins"/>
+		WHERE a.shopOrderID = #{shopOrderID}
+	</select>
+
+	<select id="getReturningNum" resultType="Integer">
+		SELECT
+		  IFNULL(sum(a.actualReturnedNum+a.actualCancelNum),0)
+		FROM cm_returned_purchase_product a
+		right join cm_returned_purchase b on a.returnedID = b.id
+		WHERE a.orderProductID = #{orderProductID}
+		and b.status = 1
+        and b.delFlag = 0
+    </select>
+
+	<select id="getReturnedNum" resultType="Integer">
+		SELECT
+		  IFNULL(sum(a.actualReturnedNum+a.actualCancelNum),0)
+		FROM cm_returned_purchase_product a
+		right join cm_returned_purchase b on a.returnedID = b.id
+		WHERE a.orderProductID = #{orderProductID}
+		and b.status = 2
+		and b.delFlag = 0
+	</select>
+
+	<select id="getReceivedNum" resultType="Integer">
+		SELECT
+		  IFNULL(sum(a.num),0)
+		FROM cm_logistics_record a
+		right join cm_logistics_batch b on a.logisticsBatchID = b.id
+		WHERE a.orderProductID = #{orderProductID}
+		and b.status = 1
+	</select>
+</mapper>

+ 92 - 0
src/main/resources/mapper/NewShopOrderMapper.xml

@@ -0,0 +1,92 @@
+<?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.order.dao.NewShopOrderDao">
+    <sql id="shopOrderColumns">
+			a.shopOrderID AS shopOrderID,
+			a.orderID AS orderID,
+			a.organizeID AS organizeID,
+			a.shopOrderNo AS  shopOrderNo,
+			a.orderNo AS  orderNo,
+			a.userID  AS userID,
+			a.shopID  AS shopID,
+			a.itemCount  AS itemCount,
+			a.townID  AS townID,
+			a.productAmount  AS productAmount,
+			a.fee  AS fee,
+			a.discountAmount AS  discountAmount,
+			a.accountAmount AS  accountAmount,
+			a.totalAmount AS  totalAmount,
+			a.payFlag  AS payFlag,
+			a.payTime  AS payTime,
+			a.finishTime AS finishTime,
+			a.status  AS status,
+			a.refundStatus AS  refundStatus,
+			a.needPayAmount AS  needPayAmount,
+			a.canRefundAmount AS  canRefundAmount,
+			a.refundAmount AS  refundAmount,
+			a.clubID  AS clubID,
+			a.spID AS  spID,
+			a.mainSpID  AS mainSpID,
+			a.orderBeanAmount AS  orderBeanAmount,
+			a.useBeanAmount AS  useBeanAmount,
+			a.useBeanFlag AS  useBeanFlag,
+			a.canRefundFlag AS  canRefundFlag,
+			a.useBalanceFlag  AS useBalanceFlag,
+			a.canRefundBeans AS  canRefundBeans,
+			a.freePostageFee AS  freePostageFee,
+			a.freePostageTicketID  AS freePostageTicketID,
+			a.brokerage  AS brokerage,
+			a.delFlag  AS delFlag,
+			a.refundsAmount  AS refundsAmount,
+			a.orderStatusFlag  AS orderStatusFlag,
+			a.buyStatus AS buyStatus,
+			a.orderSubmitType AS orderSubmitType,
+			a.orderType AS orderType,
+			a.orderTime AS orderTime,
+			a.deliveryTimeMills AS deliveryTimeMills,
+			a.presentNum AS presentNum,
+			a.preferential AS preferential,
+			a.outStoreNum AS outStoreNum,
+			IFNULL(a.outStoreTimes, 0) AS outStoreTimes,
+			a.discountFee AS discountFee,
+			a.splitFlag AS splitFlag,
+			a.autoReceiveTimeMills AS autoReceiveTimeMills,
+			a.autoOverTimeMills AS autoOverTimeMills,
+    		a.receiveGoodsTime AS receiveGoodsTime,
+    		a.totalAddedValueTax AS totalAddedValueTax,
+    		a.note AS note,
+    		a.payStatus AS payStatus,
+    		a.sendOutStatus AS sendOutStatus,
+    		a.shopProductAmount AS shopProductAmount,
+    		a.shopPostFee AS shopPostFee,
+    		a.shopTaxFee AS shopTaxFee,
+    		a.shouldPayShopAmount AS shouldPayShopAmount,
+    		a.payedShopAmount AS payedShopAmount,
+    		a.shopOtherFee AS shopOtherFee,
+    		a.paying AS paying,
+    		a.costType AS costType,
+    		a.modifyShouldPayNote AS modifyShouldPayNote,
+    		proportional AS proportional
+	</sql>
+
+    <select id="get" resultType="com.caimei.modules.order.entity.NewShopOrder" useCache="false" flushCache="true">
+        select <include refid="shopOrderColumns"/>
+        from cm_shop_order a
+        where a.shopOrderID = #{shopOrderID}
+    </select>
+
+	<select id="findByShopOrderID" resultType="com.caimei.modules.order.entity.NewShopOrder">
+		select <include refid="shopOrderColumns"/>
+		from cm_shop_order a
+		where a.shopOrderID = #{shopOrderID}
+	</select>
+
+	<select id="findListByOrderID" resultType="com.caimei.modules.order.entity.NewShopOrder">
+		SELECT <include refid="shopOrderColumns"/>,
+		b.name as shopName
+		FROM cm_shop_order a left join shop b on a.shopID = b.shopID
+		WHERE a.orderID = #{orderID} ORDER BY a.shopOrderNo DESC
+	</select>
+</mapper>

+ 9 - 0
src/main/resources/mapper/OrderInvoiceMapper.xml

@@ -0,0 +1,9 @@
+<?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.order.dao.OrderInvoiceDao">
+    <select id="getWithorderId" resultType="com.caimei.modules.order.entity.OrderInvoice">
+		SELECT  * from bp_order_invoice where orderId=#{orderId}
+	</select>
+</mapper>

+ 31 - 0
src/main/resources/mapper/OrderUserInfoMapper.xml

@@ -0,0 +1,31 @@
+<?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.order.dao.OrderUserInfoDao">
+    <sql id="columns">
+        a.id AS id,
+        a.orderId AS orderId,
+        a.clubId AS clubId,
+        a.userId AS userId,
+        a.name AS name,
+        a.shouHuoRen AS shouHuoRen,
+        a.mobile AS mobile,
+        a.phone AS phone,
+        a.postalCode AS postalCode,
+        a.townId AS townId,
+        a.province AS province,
+        a.city AS city,
+        a.town AS town,
+        a.address AS address
+    </sql>
+
+    <select id="findByOrderID" resultType="com.caimei.modules.order.entity.OrderUserInfo" parameterType="int">
+        SELECT <include refid="columns"/>,
+        c.userMoney as userMoney,c.ableUserMoney as ableUserMoney
+        FROM bp_order_userinfo a
+        LEFT JOIN cm_order b on a.orderId = b.orderID
+        LEFT JOIN user c on b.userID = c.userID
+        WHERE a.orderId = #{orderID}
+    </select>
+</mapper>

+ 21 - 0
src/main/resources/mapper/ProductMapper.xml

@@ -0,0 +1,21 @@
+<?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.order.dao.ProductDao">
+    <select id="findProductBigTypeByProductID" parameterType="java.lang.Integer" resultType="java.lang.String">
+        SELECT
+        tb.name
+        FROM
+        bigType AS tb
+        INNER JOIN smallType AS ts
+        ON tb.bigTypeID = ts.bigTypeID
+        INNER JOIN tinyType AS tt
+        ON ts.smallTypeID = tt.smallTypeID
+        INNER JOIN product AS tp
+        ON tt.tinyTypeID = tp.tinyTypeID
+        <where>
+            tp.productID = #{productId}
+        </where>
+    </select>
+</mapper>

+ 1 - 1
src/main/resources/mapper/UserMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.modules.shiro.dao.UserMapper">
+<mapper namespace="com.caimei.modules.shiro.dao.UserDao">
     <select id="findByUsername" resultType="com.caimei.modules.shiro.entity.CmMallAdminUser">
         SELECT
           *