소스 검색

手动分账

zhijiezhao 3 년 전
부모
커밋
16d8b21b3a

+ 19 - 3
src/main/java/com/caimei/modules/order/dao/NewOrderDao.java

@@ -2,9 +2,7 @@ package com.caimei.modules.order.dao;
 
 import com.caimei.modules.coupon.entity.CmCoupon;
 import com.caimei.modules.coupon.entity.CmCouponOrderRecord;
-import com.caimei.modules.order.entity.CmFile;
-import com.caimei.modules.order.entity.NewOrder;
-import com.caimei.modules.order.entity.NewOrderProduct;
+import com.caimei.modules.order.entity.*;
 import com.caimei.modules.product.entity.CmPromotion;
 import com.caimei.modules.user.entity.NewCmSp;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
@@ -197,4 +195,22 @@ public interface NewOrderDao extends CrudDao<NewOrder> {
      * @param id
      */
     void deleteCouponOrderRecord(Integer id);
+
+    List<OrderReceiptRelationPo> getUndividedPaidReceipt(String currentTime);
+
+    List<OrderReceiptRelationPo> getOnlineBalance(String currentTime);
+
+    List<OrderProductVo> getOrderProductByOrderId(Integer orderId);
+
+    Double getOrderProductPaidAmount(Integer orderProductId);
+
+    List<ShopOrderVo> getShopOrderListByOrderId(Integer orderId);
+
+    Double getPaidShipping(Integer orderId, Integer shopId);
+
+    String getShopCommercialCode(Integer shopId);
+
+    OrderVo getOrderByOrderId(Integer orderId);
+
+    void insertSplitAccount(SplitAccountPo splitAccount);
 }

+ 426 - 0
src/main/java/com/caimei/modules/order/entity/CartItemVo.java

@@ -0,0 +1,426 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 购物车商品列表
+ *
+ * @author : Charles
+ * @date : 2021/6/25
+ */
+public class CartItemVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 购物车Id
+     */
+    private Integer id;
+    /**
+     * 购买数量
+     */
+    private Integer number;
+    /**
+     * 购物商品效状态:0有效,1后台删除的,2冻结的,3下架,4售罄 >7库存不足,5价格仅会员可见,6未公开价格, 8价格仅医美机构可见
+     */
+    private Integer status;
+    /**
+     * 商品Id
+     */
+    private Integer productId;
+    /**
+     * 供应商Id
+     */
+    private Integer shopId;
+    /**
+     * 商品名称
+     */
+    private String name;
+    /**
+     * 主图
+     */
+    private String image;
+    /**
+     * 商品Code
+     */
+    private String productCode;
+    /**
+     * 价格
+     */
+    private Double price;
+    /**
+     * 划线价
+     */
+    private Double originalPrice;
+    /**
+     * 单位/规格
+     */
+    private String unit;
+    /**
+     * 库存
+     */
+    private Integer stock;
+    /**
+     * 起订量
+     */
+    private Integer min;
+    /**
+     * 增量
+     */
+    private Integer step;
+    /**
+     * 价格可见度: 0公开价格,1不公开价格,2仅对会员机构公开,3仅对医美机构公开
+     */
+    private Integer priceFlag;
+    /**
+     * 启用阶梯价格标识:1是,0否
+     */
+    private Integer ladderFlag;
+    /**
+     * 是否含税 0不含税,1含税,2未知
+     */
+    private Integer includedTax;
+    /**
+     * 机构税率
+     */
+    private Double taxRate;
+    /**
+     * 发票类型(基于是否含税基础) 1增值税票,2普通票, 3不能开票
+     */
+    private Integer invoiceType;
+    /**
+     * 是否是赠品 2是,其他否
+     */
+    private Integer productType;
+    /**
+     * 商品是否处于活动状态 1是 0否
+     */
+    private Integer actStatus;
+    /**
+     * 商品可见度:3:所有人可见,2:普通机构可见,1:会员机构可见,4:仅医美机构可见
+     */
+    private Integer visibility;
+    /**
+     * 商品上架状态:0逻辑删除 1待审核 2已上架 3已下架 8审核未通过 9已冻结
+     */
+    private Integer validFlag;
+    /**
+     * 商品的类别:1正常商品(默认),2二手商品
+     */
+    private Integer productCategory;
+    /**
+     * 商品促销活动
+     */
+    private PromotionsVo promotions;
+    /**
+     * 阶梯价列表
+     */
+    private List<LadderPriceVo> ladderPrices;
+    /**
+     * 前端商品勾选状态
+     */
+    private Boolean isChecked;
+    /**
+     * 商品属性:1产品,2仪器
+     */
+    private Integer commodityType;
+    /**
+     * 超级会员优惠商品标识:0不是,1是
+     */
+    private Integer svipProductFlag;
+    /**
+     * 超级会员优惠价类型:1折扣价,2直接优惠价
+     */
+    private Integer svipPriceType;
+    /**
+     * 超级会员折扣
+     */
+    private Double svipDiscount;
+    /**
+     * 超级会员优惠价
+     */
+    private Double svipDiscountPrice;
+    /**
+     * 超级会员价格标签
+     */
+    private String svipPriceTag;
+    /**
+     * 购物车该商品总优惠金额
+     */
+    private Double svipTotalReducedPrice;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getNumber() {
+        return number;
+    }
+
+    public void setNumber(Integer number) {
+        this.number = number;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getShopId() {
+        return shopId;
+    }
+
+    public void setShopId(Integer shopId) {
+        this.shopId = shopId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getImage() {
+        return image;
+    }
+
+    public void setImage(String image) {
+        this.image = image;
+    }
+
+    public String getProductCode() {
+        return productCode;
+    }
+
+    public void setProductCode(String productCode) {
+        this.productCode = productCode;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public Double getOriginalPrice() {
+        return originalPrice;
+    }
+
+    public void setOriginalPrice(Double originalPrice) {
+        this.originalPrice = originalPrice;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public Integer getStock() {
+        return stock;
+    }
+
+    public void setStock(Integer stock) {
+        this.stock = stock;
+    }
+
+    public Integer getMin() {
+        return min;
+    }
+
+    public void setMin(Integer min) {
+        this.min = min;
+    }
+
+    public Integer getStep() {
+        return step;
+    }
+
+    public void setStep(Integer step) {
+        this.step = step;
+    }
+
+    public Integer getPriceFlag() {
+        return priceFlag;
+    }
+
+    public void setPriceFlag(Integer priceFlag) {
+        this.priceFlag = priceFlag;
+    }
+
+    public Integer getLadderFlag() {
+        return ladderFlag;
+    }
+
+    public void setLadderFlag(Integer ladderFlag) {
+        this.ladderFlag = ladderFlag;
+    }
+
+    public Integer getIncludedTax() {
+        return includedTax;
+    }
+
+    public void setIncludedTax(Integer includedTax) {
+        this.includedTax = includedTax;
+    }
+
+    public Double getTaxRate() {
+        return taxRate;
+    }
+
+    public void setTaxRate(Double taxRate) {
+        this.taxRate = taxRate;
+    }
+
+    public Integer getInvoiceType() {
+        return invoiceType;
+    }
+
+    public void setInvoiceType(Integer invoiceType) {
+        this.invoiceType = invoiceType;
+    }
+
+    public Integer getProductType() {
+        return productType;
+    }
+
+    public void setProductType(Integer productType) {
+        this.productType = productType;
+    }
+
+    public Integer getActStatus() {
+        return actStatus;
+    }
+
+    public void setActStatus(Integer actStatus) {
+        this.actStatus = actStatus;
+    }
+
+    public Integer getVisibility() {
+        return visibility;
+    }
+
+    public void setVisibility(Integer visibility) {
+        this.visibility = visibility;
+    }
+
+    public Integer getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(Integer validFlag) {
+        this.validFlag = validFlag;
+    }
+
+    public Integer getProductCategory() {
+        return productCategory;
+    }
+
+    public void setProductCategory(Integer productCategory) {
+        this.productCategory = productCategory;
+    }
+
+    public PromotionsVo getPromotions() {
+        return promotions;
+    }
+
+    public void setPromotions(PromotionsVo promotions) {
+        this.promotions = promotions;
+    }
+
+    public List<LadderPriceVo> getLadderPrices() {
+        return ladderPrices;
+    }
+
+    public void setLadderPrices(List<LadderPriceVo> ladderPrices) {
+        this.ladderPrices = ladderPrices;
+    }
+
+    public Boolean getChecked() {
+        return isChecked;
+    }
+
+    public void setChecked(Boolean checked) {
+        isChecked = checked;
+    }
+
+    public Integer getCommodityType() {
+        return commodityType;
+    }
+
+    public void setCommodityType(Integer commodityType) {
+        this.commodityType = commodityType;
+    }
+
+    public Integer getSvipProductFlag() {
+        return svipProductFlag;
+    }
+
+    public void setSvipProductFlag(Integer svipProductFlag) {
+        this.svipProductFlag = svipProductFlag;
+    }
+
+    public Integer getSvipPriceType() {
+        return svipPriceType;
+    }
+
+    public void setSvipPriceType(Integer svipPriceType) {
+        this.svipPriceType = svipPriceType;
+    }
+
+    public Double getSvipDiscount() {
+        return svipDiscount;
+    }
+
+    public void setSvipDiscount(Double svipDiscount) {
+        this.svipDiscount = svipDiscount;
+    }
+
+    public Double getSvipDiscountPrice() {
+        return svipDiscountPrice;
+    }
+
+    public void setSvipDiscountPrice(Double svipDiscountPrice) {
+        this.svipDiscountPrice = svipDiscountPrice;
+    }
+
+    public String getSvipPriceTag() {
+        return svipPriceTag;
+    }
+
+    public void setSvipPriceTag(String svipPriceTag) {
+        this.svipPriceTag = svipPriceTag;
+    }
+
+    public Double getSvipTotalReducedPrice() {
+        return svipTotalReducedPrice;
+    }
+
+    public void setSvipTotalReducedPrice(Double svipTotalReducedPrice) {
+        this.svipTotalReducedPrice = svipTotalReducedPrice;
+    }
+}

+ 124 - 0
src/main/java/com/caimei/modules/order/entity/LadderPriceVo.java

@@ -0,0 +1,124 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/6/28
+ */
+public class LadderPriceVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+    /**
+     * 商品id
+     */
+    private Integer productId;
+    /**
+     * 第几阶梯
+     */
+    private Integer ladderNum;
+    /**
+     * 购买数量
+     */
+    private Integer buyNum;
+    /**
+     * 购买价格
+     */
+    private Double buyPrice;
+    /**
+     * 下一阶数量
+     */
+    private Integer maxNum;
+    /**
+     * 显示数量 如:1~3
+     */
+    private String numRange;
+    /**
+     * 订单商品Id(保存订单用)
+     */
+    private Integer orderProductId;
+    /**
+     * 创建时间(保存订单用)
+     */
+    private Date createDate;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getLadderNum() {
+        return ladderNum;
+    }
+
+    public void setLadderNum(Integer ladderNum) {
+        this.ladderNum = ladderNum;
+    }
+
+    public Integer getBuyNum() {
+        return buyNum;
+    }
+
+    public void setBuyNum(Integer buyNum) {
+        this.buyNum = buyNum;
+    }
+
+    public Double getBuyPrice() {
+        return buyPrice;
+    }
+
+    public void setBuyPrice(Double buyPrice) {
+        this.buyPrice = buyPrice;
+    }
+
+    public Integer getMaxNum() {
+        return maxNum;
+    }
+
+    public void setMaxNum(Integer maxNum) {
+        this.maxNum = maxNum;
+    }
+
+    public String getNumRange() {
+        return numRange;
+    }
+
+    public void setNumRange(String numRange) {
+        this.numRange = numRange;
+    }
+
+    public Integer getOrderProductId() {
+        return orderProductId;
+    }
+
+    public void setOrderProductId(Integer orderProductId) {
+        this.orderProductId = orderProductId;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+}

+ 186 - 0
src/main/java/com/caimei/modules/order/entity/LogisticsRecordVo.java

@@ -0,0 +1,186 @@
+package com.caimei.modules.order.entity;
+
+
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/7/22
+ */
+public class LogisticsRecordVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * id
+     */
+    private Integer id;
+    /**
+     * 发货物流批次Id
+     */
+    private Integer logisticsBatchId;
+    /**
+     * 子订单Id
+     */
+    private Integer shopOrderId;
+    /**
+     * 主订单Id
+     */
+    private Integer orderId;
+    /**
+     * 订单商品Id
+     */
+    private Integer orderProductId;
+    /**
+     * 商品购买数量
+     */
+    private Integer buyNum;
+    /**
+     * 此次发货数量
+     */
+    private Integer num;
+    /**
+     * 包装规格
+     */
+    private String unit;
+    /**
+     * 商品Id
+     */
+    private Integer productId;
+    /**
+     * 商品名称
+     */
+    private String productName;
+    /**
+     * 商品图片
+     */
+    private String image;
+    /**
+     * 已发货数量
+     */
+    private Integer shipmentsNum;
+    /**
+     * 已退货数量
+     */
+    private Integer returnedNum;
+    /**
+     * 未发货数量
+     */
+    private Integer notShippedNum;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getLogisticsBatchId() {
+        return logisticsBatchId;
+    }
+
+    public void setLogisticsBatchId(Integer logisticsBatchId) {
+        this.logisticsBatchId = logisticsBatchId;
+    }
+
+    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 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 String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    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;
+    }
+
+    public Integer getShipmentsNum() {
+        return shipmentsNum;
+    }
+
+    public void setShipmentsNum(Integer shipmentsNum) {
+        this.shipmentsNum = shipmentsNum;
+    }
+
+    public Integer getReturnedNum() {
+        return returnedNum;
+    }
+
+    public void setReturnedNum(Integer returnedNum) {
+        this.returnedNum = returnedNum;
+    }
+
+    public Integer getNotShippedNum() {
+        return notShippedNum;
+    }
+
+    public void setNotShippedNum(Integer notShippedNum) {
+        this.notShippedNum = notShippedNum;
+    }
+}

+ 709 - 0
src/main/java/com/caimei/modules/order/entity/OrderProductVo.java

@@ -0,0 +1,709 @@
+package com.caimei.modules.order.entity;
+
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/7/21
+ */
+public class OrderProductVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 商品分账商户号
+     */
+    private String splitCode;
+    /**
+     * 商品Id
+     */
+    private Integer productId;
+    /**
+     * 供应商Id
+     */
+    private Integer shopId;
+    /**
+     * 商品名称
+     */
+    private String name;
+    /**
+     * 主图
+     */
+    private String image;
+    /**
+     * 价格
+     */
+    private Double price;
+    /**
+     * 供应商名称
+     */
+    private String shopName;
+    /**
+     * 商品的类别:1正常商品(默认),2二手商品
+     */
+    private Integer productCategory;
+    /**
+     * 成本价选中标志:1固定成本 2比例成
+     */
+    private Integer costCheckFlag;
+    /**
+     * 成本价
+     */
+    private Double costPrice;
+    /**
+     * 市场价 = 商品表市场价
+     */
+    private Double normalPrice;
+    /**
+     * 比例成本百分比
+     */
+    private Double costProportional;
+    /**
+     * 启用阶梯价标志 0否 1是
+     */
+    private Integer ladderPriceFlag;
+    /**
+     * 折后单价
+     */
+    private Double discountPrice;
+    /**
+     * 折扣比例
+     */
+    private Double discount;
+    /**
+     * 总价  = price X num
+     */
+    private Double totalAmount;
+    /**
+     * 折后总价  = discountPrice X num + totalAddedValueTax
+     */
+    private Double totalFee;
+    /**
+     * 应付金额 = totalFee - discountFee(经理折扣,仅后台下单有经理折扣)
+     */
+    private Double shouldPayFee;
+    /**
+     * 包装规格
+     */
+    private String productUnit;
+    /**
+     * 购买数量
+     */
+    private Integer num;
+    /**
+     * 赠送数量
+     */
+    private Integer presentNum;
+    /**
+     * 协销订单:经理折扣(平摊到每个商品上,按照每种商品的总价占订单总价的比例来均分);普通订单 无
+     */
+    private Double discountFee;
+    /**
+     * 是否含税 0不含税,1含税,2未知
+     */
+    private Integer includedTax;
+    /**
+     * 发票类型(基于是否含税基础) 1增值税票,2普通票, 3不能开票
+     */
+    private Integer invoiceType;
+    /**
+     * 机构 税率
+     */
+    private Double taxRate;
+    /**
+     * 机构 单个税费=税率X折后单价
+     */
+    private Double addedValueTax;
+    /**
+     * 机构 总税费=单个税费X购买数量
+     */
+    private Double totalAddedValueTax;
+    /**
+     * 供应商 税率
+     */
+    private Double shopTaxRate;
+    /**
+     * 供应商 单个付供应商税费=税率X成本
+     */
+    private Double singleShouldPayTotalTax;
+    /**
+     * 供应商 总税费(应付税费)=单个税费X购买数量
+     */
+    private Double shouldPayTotalTax;
+    /**
+     * 供应商 商品费=成本价*(购买数量  + 赠品数量)
+     */
+    private Double shopProductAmount;
+    /**
+     * 后台设置的单个应付供应商金额
+     */
+    private Double singleShopFee;
+    /**
+     * 该商品总的应付供应商金额
+     */
+    private Double shopFee;
+    /**
+     * 后台设置单个应付第三方金额
+     */
+    private Double singleOtherFee;
+    /**
+     * 该商品总的应付第三方金额
+     */
+    private Double otherFee;
+    /**
+     * 后台计算的单个应付采美金额
+     */
+    private Double singleCmFee;
+    /**
+     * 该商品总的应付采美金额 (受赠品影响)
+     */
+    private Double cmFee;
+    /**
+     * 支付状态 0 未进账 1 待财务审核 2 已进账(适用协销的单笔线下进账和自助订单线下或异常进账)
+     */
+    private Integer payStatus;
+    /**
+     * 订单商品再次购买标识 0否 1是
+     */
+    private Integer buyAgainFlag;
+    /**
+     * 未出库数量
+     */
+    private Integer notOutStore;
+    /**
+     * 下单时商品购买价格类型快照 0 机构价,1活动价 ,2阶梯价
+     */
+    private Integer actProduct;
+    /**
+     * 商品类型(0正常商品,1协商赠品,2促销赠品)
+     */
+    private Integer productType;
+//    /**
+//     * 阶梯价列表(临时用,保存订单阶梯价格)
+//     */
+//    private List<LadderPriceVo> ladderPrices;
+    /**
+     * 订单号(保存订单用)
+     */
+    private Integer orderId;
+    /**
+     * 订单编号(保存订单用)
+     */
+    private String orderNo;
+    /**
+     * 子订单ID(保存订单用)
+     */
+    private Integer shopOrderId;
+    /**
+     * 子订单编号(保存订单用)
+     */
+    private String shopOrderNo;
+    /**
+     * 订单商品Id(保存订单用)
+     */
+    private Integer orderProductId;
+    /**
+     * 订单促销id
+     */
+    private Integer orderPromotionsId;
+    /**
+     * 商品促销活动
+     */
+    private PromotionsVo productPromotion;
+    /**
+     * 已发货数量
+     */
+    private Integer shipmentsNum;
+
+    /**
+     * 已退货数量
+     */
+    private Integer returnedNum;
+
+    /**
+     * 已取消发货数量
+     */
+    private Integer actualCancelNum;
+    /**
+     * 商品前台展示单价是否含税,1不含税,2含税,3其他
+     */
+    private Integer includedTaxFlag;
+    /**
+     * 超级会员优惠价格标识:0不是,1是
+     */
+    private Integer svipPriceFlag;
+    /**
+     * 超级会员优惠价类型:1折扣价,2直接优惠价
+     */
+    private Integer svipPriceType;
+    /**
+     * 超级会员折扣
+     */
+    private Double svipDiscount;
+    /**
+     * 超级会员价格标签
+     */
+    private String svipPriceTag;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getSplitCode() {
+        return splitCode;
+    }
+
+    public void setSplitCode(String splitCode) {
+        this.splitCode = splitCode;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getShopId() {
+        return shopId;
+    }
+
+    public void setShopId(Integer shopId) {
+        this.shopId = shopId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getImage() {
+        return image;
+    }
+
+    public void setImage(String image) {
+        this.image = image;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    public Integer getProductCategory() {
+        return productCategory;
+    }
+
+    public void setProductCategory(Integer productCategory) {
+        this.productCategory = productCategory;
+    }
+
+    public Integer getCostCheckFlag() {
+        return costCheckFlag;
+    }
+
+    public void setCostCheckFlag(Integer costCheckFlag) {
+        this.costCheckFlag = costCheckFlag;
+    }
+
+    public Double getCostPrice() {
+        return costPrice;
+    }
+
+    public void setCostPrice(Double costPrice) {
+        this.costPrice = costPrice;
+    }
+
+    public Double getNormalPrice() {
+        return normalPrice;
+    }
+
+    public void setNormalPrice(Double normalPrice) {
+        this.normalPrice = normalPrice;
+    }
+
+    public Double getCostProportional() {
+        return costProportional;
+    }
+
+    public void setCostProportional(Double costProportional) {
+        this.costProportional = costProportional;
+    }
+
+    public Integer getLadderPriceFlag() {
+        return ladderPriceFlag;
+    }
+
+    public void setLadderPriceFlag(Integer ladderPriceFlag) {
+        this.ladderPriceFlag = ladderPriceFlag;
+    }
+
+    public Double getDiscountPrice() {
+        return discountPrice;
+    }
+
+    public void setDiscountPrice(Double discountPrice) {
+        this.discountPrice = discountPrice;
+    }
+
+    public Double getDiscount() {
+        return discount;
+    }
+
+    public void setDiscount(Double discount) {
+        this.discount = discount;
+    }
+
+    public Double getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(Double totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public Double getTotalFee() {
+        return totalFee;
+    }
+
+    public void setTotalFee(Double totalFee) {
+        this.totalFee = totalFee;
+    }
+
+    public Double getShouldPayFee() {
+        return shouldPayFee;
+    }
+
+    public void setShouldPayFee(Double shouldPayFee) {
+        this.shouldPayFee = shouldPayFee;
+    }
+
+    public String getProductUnit() {
+        return productUnit;
+    }
+
+    public void setProductUnit(String productUnit) {
+        this.productUnit = productUnit;
+    }
+
+    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 Double getDiscountFee() {
+        return discountFee;
+    }
+
+    public void setDiscountFee(Double discountFee) {
+        this.discountFee = discountFee;
+    }
+
+    public Integer getIncludedTax() {
+        return includedTax;
+    }
+
+    public void setIncludedTax(Integer includedTax) {
+        this.includedTax = includedTax;
+    }
+
+    public Integer getInvoiceType() {
+        return invoiceType;
+    }
+
+    public void setInvoiceType(Integer invoiceType) {
+        this.invoiceType = invoiceType;
+    }
+
+    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 getShopTaxRate() {
+        return shopTaxRate;
+    }
+
+    public void setShopTaxRate(Double shopTaxRate) {
+        this.shopTaxRate = shopTaxRate;
+    }
+
+    public Double getSingleShouldPayTotalTax() {
+        return singleShouldPayTotalTax;
+    }
+
+    public void setSingleShouldPayTotalTax(Double singleShouldPayTotalTax) {
+        this.singleShouldPayTotalTax = singleShouldPayTotalTax;
+    }
+
+    public Double getShouldPayTotalTax() {
+        return shouldPayTotalTax;
+    }
+
+    public void setShouldPayTotalTax(Double shouldPayTotalTax) {
+        this.shouldPayTotalTax = shouldPayTotalTax;
+    }
+
+    public Double getShopProductAmount() {
+        return shopProductAmount;
+    }
+
+    public void setShopProductAmount(Double shopProductAmount) {
+        this.shopProductAmount = shopProductAmount;
+    }
+
+    public Double getSingleShopFee() {
+        return singleShopFee;
+    }
+
+    public void setSingleShopFee(Double singleShopFee) {
+        this.singleShopFee = singleShopFee;
+    }
+
+    public Double getShopFee() {
+        return shopFee;
+    }
+
+    public void setShopFee(Double shopFee) {
+        this.shopFee = shopFee;
+    }
+
+    public Double getSingleOtherFee() {
+        return singleOtherFee;
+    }
+
+    public void setSingleOtherFee(Double singleOtherFee) {
+        this.singleOtherFee = singleOtherFee;
+    }
+
+    public Double getOtherFee() {
+        return otherFee;
+    }
+
+    public void setOtherFee(Double otherFee) {
+        this.otherFee = otherFee;
+    }
+
+    public Double getSingleCmFee() {
+        return singleCmFee;
+    }
+
+    public void setSingleCmFee(Double singleCmFee) {
+        this.singleCmFee = singleCmFee;
+    }
+
+    public Double getCmFee() {
+        return cmFee;
+    }
+
+    public void setCmFee(Double cmFee) {
+        this.cmFee = cmFee;
+    }
+
+    public Integer getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(Integer payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    public Integer getBuyAgainFlag() {
+        return buyAgainFlag;
+    }
+
+    public void setBuyAgainFlag(Integer buyAgainFlag) {
+        this.buyAgainFlag = buyAgainFlag;
+    }
+
+    public Integer getNotOutStore() {
+        return notOutStore;
+    }
+
+    public void setNotOutStore(Integer notOutStore) {
+        this.notOutStore = notOutStore;
+    }
+
+    public Integer getActProduct() {
+        return actProduct;
+    }
+
+    public void setActProduct(Integer actProduct) {
+        this.actProduct = actProduct;
+    }
+
+    public Integer getProductType() {
+        return productType;
+    }
+
+    public void setProductType(Integer productType) {
+        this.productType = productType;
+    }
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    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 getOrderProductId() {
+        return orderProductId;
+    }
+
+    public void setOrderProductId(Integer orderProductId) {
+        this.orderProductId = orderProductId;
+    }
+
+    public Integer getOrderPromotionsId() {
+        return orderPromotionsId;
+    }
+
+    public void setOrderPromotionsId(Integer orderPromotionsId) {
+        this.orderPromotionsId = orderPromotionsId;
+    }
+
+    public PromotionsVo getProductPromotion() {
+        return productPromotion;
+    }
+
+    public void setProductPromotion(PromotionsVo productPromotion) {
+        this.productPromotion = productPromotion;
+    }
+
+    public Integer getShipmentsNum() {
+        return shipmentsNum;
+    }
+
+    public void setShipmentsNum(Integer shipmentsNum) {
+        this.shipmentsNum = shipmentsNum;
+    }
+
+    public Integer getReturnedNum() {
+        return returnedNum;
+    }
+
+    public void setReturnedNum(Integer returnedNum) {
+        this.returnedNum = returnedNum;
+    }
+
+    public Integer getActualCancelNum() {
+        return actualCancelNum;
+    }
+
+    public void setActualCancelNum(Integer actualCancelNum) {
+        this.actualCancelNum = actualCancelNum;
+    }
+
+    public Integer getIncludedTaxFlag() {
+        return includedTaxFlag;
+    }
+
+    public void setIncludedTaxFlag(Integer includedTaxFlag) {
+        this.includedTaxFlag = includedTaxFlag;
+    }
+
+    public Integer getSvipPriceFlag() {
+        return svipPriceFlag;
+    }
+
+    public void setSvipPriceFlag(Integer svipPriceFlag) {
+        this.svipPriceFlag = svipPriceFlag;
+    }
+
+    public Integer getSvipPriceType() {
+        return svipPriceType;
+    }
+
+    public void setSvipPriceType(Integer svipPriceType) {
+        this.svipPriceType = svipPriceType;
+    }
+
+    public Double getSvipDiscount() {
+        return svipDiscount;
+    }
+
+    public void setSvipDiscount(Double svipDiscount) {
+        this.svipDiscount = svipDiscount;
+    }
+
+    public String getSvipPriceTag() {
+        return svipPriceTag;
+    }
+
+    public void setSvipPriceTag(String svipPriceTag) {
+        this.svipPriceTag = svipPriceTag;
+    }
+}

+ 200 - 0
src/main/java/com/caimei/modules/order/entity/OrderReceiptRelationPo.java

@@ -0,0 +1,200 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+
+/**
+ * 收款项和订单关系表
+ *
+ * @author : Charles
+ * @date : 2021/7/14
+ */
+
+public class OrderReceiptRelationPo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 收款项和订单关系表id
+     */
+    private Integer id;
+    /**
+     * 关系类型:1返佣订单(返佣款)、2非返佣订单(订单款或者非订单款)、3超级会员款、4二手商品上架费,5认证通会员款
+     */
+    private Integer relationType;
+    /**
+     * 识别款项Id(对应cm_discern_receipt表)
+     */
+    private Integer receiptId;
+    /**
+     * 关联金额:1普通收款(线下):收款具体对该应母订单的收金额、2线上支付:付款金额就等于该金额、3返佣收款:默认为0
+     */
+    private Double associateAmount;
+    /**
+     * 关联方式: 1手动 2自动
+     */
+    private Integer associationType;
+    /**
+     * 订单Id(relationType值为1是为子订单ID,为2时为主订单ID)
+     */
+    private Integer orderId;
+    /**
+     *  超级会员购买记录Id
+     */
+    private Integer vipRecordId;
+    /**
+     * 优惠券购买记录id
+     */
+    private Integer couponRecordId;
+    /**
+     *  认证通会员购买记录Id
+     */
+    private Integer authVipRecordId;
+    /**
+     * 删除标记 0 否,其余是
+     */
+    private Integer delFlag;
+    /**
+     * 米花科技平台唯一流水号
+     */
+    private String mbOrderId;
+    /**
+     * 商户唯一订单请求号(订单编号#随机时间戳)
+     */
+    private String orderRequestNo;
+    /**
+     * 分账状态:0待分账,1已分账(只针对线上支付)
+     */
+    private Integer splitStatus;
+    /**
+     * 付款类型:1建设银行7297、2广发银行0115、3中信银行7172、4中信银行0897、5中信银行0897-财付通、6中信银行0897-支付宝、
+     * 7线上-支付宝、8线上-微信支付、9线上-快钱支付、10口头返佣、11广发银行5461、12PC-B2B网银、13PC-微信支付、14PC-支付宝、
+     * 15小程序-微信支付、16余额抵扣、20银联转账
+     */
+    private Integer payType;
+    /**
+     * 二手商品上架费用对应的二手商品id
+     */
+    private Integer productId;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getRelationType() {
+        return relationType;
+    }
+
+    public void setRelationType(Integer relationType) {
+        this.relationType = relationType;
+    }
+
+    public Integer getReceiptId() {
+        return receiptId;
+    }
+
+    public void setReceiptId(Integer receiptId) {
+        this.receiptId = receiptId;
+    }
+
+    public Double getAssociateAmount() {
+        return associateAmount;
+    }
+
+    public void setAssociateAmount(Double associateAmount) {
+        this.associateAmount = associateAmount;
+    }
+
+    public Integer getAssociationType() {
+        return associationType;
+    }
+
+    public void setAssociationType(Integer associationType) {
+        this.associationType = associationType;
+    }
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    public Integer getVipRecordId() {
+        return vipRecordId;
+    }
+
+    public void setVipRecordId(Integer vipRecordId) {
+        this.vipRecordId = vipRecordId;
+    }
+
+    public Integer getCouponRecordId() {
+        return couponRecordId;
+    }
+
+    public void setCouponRecordId(Integer couponRecordId) {
+        this.couponRecordId = couponRecordId;
+    }
+
+    public Integer getAuthVipRecordId() {
+        return authVipRecordId;
+    }
+
+    public void setAuthVipRecordId(Integer authVipRecordId) {
+        this.authVipRecordId = authVipRecordId;
+    }
+
+    public Integer getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Integer delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public String getMbOrderId() {
+        return mbOrderId;
+    }
+
+    public void setMbOrderId(String mbOrderId) {
+        this.mbOrderId = mbOrderId;
+    }
+
+    public String getOrderRequestNo() {
+        return orderRequestNo;
+    }
+
+    public void setOrderRequestNo(String orderRequestNo) {
+        this.orderRequestNo = orderRequestNo;
+    }
+
+    public Integer getSplitStatus() {
+        return splitStatus;
+    }
+
+    public void setSplitStatus(Integer splitStatus) {
+        this.splitStatus = splitStatus;
+    }
+
+    public Integer getPayType() {
+        return payType;
+    }
+
+    public void setPayType(Integer payType) {
+        this.payType = payType;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+}

+ 185 - 0
src/main/java/com/caimei/modules/order/entity/OrderUserinfoVo.java

@@ -0,0 +1,185 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/7/22
+ */
+public class OrderUserinfoVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 订单用户信息表Id
+     */
+    private Integer id;
+    /**
+     * 订单ID
+     */
+    private Integer orderId;
+    /**
+     * 机构ID
+     */
+    private Integer clubId;
+    /**
+     * 用户ID
+     */
+    private Integer userId;
+    /**
+     * 买家(name)
+     */
+    private String name;
+    /**
+     * 收货人(shouHuoRen)
+     */
+    private String receiver;
+    /**
+     * 手机
+     */
+    private String mobile;
+    /**
+     * 电话
+     */
+    private String phone;
+    /**
+     * 邮编
+     */
+    private String postalCode;
+    /**
+     * 县区ID
+     */
+    private Integer townId;
+    /**
+     * 省、直辖市
+     */
+    private String province;
+    /**
+     * 市
+     */
+    private String city;
+    /**
+     * 县、区
+     */
+    private String town;
+    /**
+     * 收货地址
+     */
+    private String address;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    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 getClubId() {
+        return clubId;
+    }
+
+    public void setClubId(Integer clubId) {
+        this.clubId = clubId;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getReceiver() {
+        return receiver;
+    }
+
+    public void setReceiver(String receiver) {
+        this.receiver = receiver;
+    }
+
+    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 Integer getTownId() {
+        return townId;
+    }
+
+    public void setTownId(Integer townId) {
+        this.townId = townId;
+    }
+
+    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;
+    }
+}

+ 920 - 0
src/main/java/com/caimei/modules/order/entity/OrderVo.java

@@ -0,0 +1,920 @@
+package com.caimei.modules.order.entity;
+
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/7/20
+ */
+public class OrderVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * orderSeen:订单对机构可见度,1可见,2不可见
+     */
+    private Integer orderSeen;
+    /**
+     * 订单号
+     */
+    private Integer orderId;
+    /**
+     * 订单来源:1WWW、2CRM、4客服[适用后台下单]、5外单[适用后台下单]、6小程序[采美,星范]、7呵呵商城小程序、8维沙小程序
+     */
+    private Integer orderSource;
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+    /**
+     * 用户Id
+     */
+    private Integer userId;
+    /**
+     * 机构Id
+     */
+    private Integer clubId;
+    /**
+     * 组织Id
+     */
+    private Integer organizeId;
+    /**
+     * 用户身份:1协销 2会员机构 3供应商 4普通机构
+     */
+    private Integer userIdentity;
+    /**
+     * 机构名称(协销订单列表用)
+     */
+    private String clubName;
+    /**
+     * 超级会员标识,1是,不是
+     */
+    private Integer svipUserFlag;
+    /**
+     * 下单人Id(协销Id,或运营人Id,或用户Id)
+     */
+    private Integer buyUserId;
+    /**
+     * 订单提交时间
+     */
+    private String orderTime;
+    /**
+     * 更新时间
+     */
+    private String updateDate;
+    /**
+     * 订单状态 0 有效  其它无效
+     */
+    private Integer delFlag;
+    /**
+     * 采美豆抵扣运费的抵扣数量
+     */
+    private Integer userBeans;
+    /**
+     * 订单类型 协销订单 0, 普通订单 1
+     */
+    private Integer orderType;
+    /**
+     * 订单提交类型 0:个人自己下单 1:企业自己下单 2:员工帮会所下单 3:协销帮会所下单  4:后台下单 5:采美豆订单
+     */
+    private Integer orderSubmitType;
+    /**
+     * 订单确认标志,0否,1后台确认,2买家确认(适用协销订单并且1或2都算已确认订单,主动订单默认1为确认)
+     */
+    private Integer confirmFlag;
+    /**
+     * 是否能走线上支付 0可以 1不可以 只能线下
+     */
+    private Integer onlinePayFlag;
+    /**
+     * 订单是否可拆分   1可拆分 0不可拆分
+     */
+    private Integer splitFlag;
+    /**
+     * 是否已支付 未支付0 已支付1
+     */
+    private Integer payFlag;
+    /**
+     * (向买家)收款状态:1待收款、2部分收款、3已收款
+     */
+    private Integer receiptStatus;
+    /**
+     * (向供应商)付款状态:1待付款、2部分付款、3已付款
+     */
+    private Integer payStatus;
+    /**
+     * 订单0成本标识:0订单有成本,1订单无成本(订单中所有商品成本为0)
+     */
+    private Integer zeroCostFlag;
+    /**
+     * 发货状态:1待发货、2部分发货、3已发货
+     */
+    private Integer sendOutStatus;
+    /**
+     * 退货退款类型:0未发生退款、1部分退、2全部退
+     */
+    private Integer refundType;
+    /**
+     * 确认付款供应商标识 0未确认,1已确认
+     */
+    private Integer affirmPaymentFlag;
+    /**
+     * 购买总数
+     */
+    private Integer productCount;
+
+    /**
+     * 赠送总数  不计算价格
+     */
+    private Integer presentCount;
+    /**
+     * 促销赠品总数
+     */
+    private Integer promotionalGiftsCount;
+    /**
+     * 是否包含活动商品(受订单未支付自动关闭时间影响)  0 否 1 是
+     */
+    private Integer hasActProduct;
+    /**
+     * 促销满减优惠
+     */
+    private Double promotionFullReduction;
+    /**
+     * 超级会员优惠
+     */
+    private Double svipFullReduction;
+    /**
+     * 二手商品订单标识  0非二手商品订单、 1二手商品订单
+     */
+    private Integer secondHandOrderFlag;
+    /**
+     * 是否开发票 没开发票 0 开个人发票 1 开企业发票2
+     */
+    private Integer invoiceFlag;
+    /**
+     * 免邮标志  运费:-1到付,0包邮,1需要运费,-2仪器到付其它包邮
+     */
+    private Integer postageFlag;
+    /**
+     * -1到付,0包邮,大于0具体金额,-2仪器到付其它包邮(且运费已使用商品形式存储)
+     */
+    private Double postage;
+    /**
+     * 商品总金额 (商品单价乘以数量,再加上税费)
+     */
+    private Double productTotalFee;
+    /**
+     * 小计金额 (商品折后单价乘以数量,再加上税费)
+     */
+    private Double orderTotalFee;
+    /**
+     * 经理折扣
+     */
+    private Double discountFee;
+    /**
+     * 使用优惠券金额
+     */
+    private Double couponAmount;
+    /**
+     * 订单总额(小计金额减去经理折扣后,再加上运费)
+     */
+    private Double payTotalFee;
+    /**
+     * 真实支付金额(订单总额减去抵扣的账户余额)
+     */
+    private Double payableAmount;
+    /**
+     * 余额支付金额
+     */
+    private Double balancePayFee;
+    /**
+     * 0待确认,11待收待发,12待收部发,13待收全发,21部收待发,22部收部发,23部收全发,31已收待发,32已收部发,33已收全发,4交易完成,5订单完成,6已关闭,7交易全退
+     */
+    private Integer status;
+    /**
+     * 订单确认时间
+     */
+    private String confirmTime;
+    /**
+     * 订单支付时间
+     */
+    private String payTime;
+    /**
+     * 返佣订单标识 0非返佣订单,1返佣订单
+     */
+    private Integer rebateFlag;
+    /**
+     * 条款ID
+     */
+    private Integer clauseId;
+    /**
+     * 条款名称
+     */
+    private String clauseName;
+    /**
+     * 子订单ID
+     */
+    private String shopOrderIds;
+    /**
+     * 订单取消原因
+     */
+    private String closeReason;
+    /**
+     * 订单取消时间
+     */
+    private String closeTime;
+    /**
+     * 订单备注
+     */
+    private String note;
+    /**
+     * 已支付成功次数统计(适用线上多笔付款用来确认当前是哪一笔)
+     */
+    private Integer paySuccessCounter;
+    /**
+     * 子订单信息
+     */
+    private List<ShopOrderVo> shopOrderList;
+    /**
+     * 支付按钮是否消失,true消失
+     */
+    private boolean payButton = false;
+    /**
+     * 待付总金额
+     */
+    private Double pendingPayments;
+    /**
+     * 付款总金额
+     */
+    private Double receiptAmount;
+    /**
+     * 订单标识:#订单号#
+     */
+    private String orderMark;
+    /**
+     * 是否包含充值商品
+     */
+    private boolean rechargeGoods = false;
+    /**
+     * 总税费
+     */
+    private Double expensesOfTaxation;
+    /**
+     * 退款总金额
+     */
+    private Double returnedPurchaseFee;
+    /**
+     * 是否有商品发票属性的限制,为true时只能线下支付
+     */
+    private boolean invoiceStatus = false;
+    /**
+     * 客户名称
+     */
+    private String userName;
+    /**
+     * 收款详情是否可以查看
+     */
+    private Boolean authority = false;
+    /**
+     * 存在退款中的记录 (0:否,1:是)
+     */
+    private String haveReturning;
+    /**
+     * 存在收款中的记录 (0:否,1:是)
+     */
+    private String haveReceipting;
+    /**
+     * 剩余应收金额
+     */
+    private Double surplusAmount;
+    /**
+     * 已支付金额
+     */
+    private Double paidAmount;
+    /**
+     * 待审金额
+     */
+    private Double unCheckAmount;
+    /**
+     * 退货退款价值(抵扣经理折扣后)
+     */
+    private Double returnValue;
+    /**
+     * 退款总额(给买家)
+     */
+    private Double refundFee;
+    /**
+     * 订单状态备注
+     */
+    private String statusName;
+    /**
+     * 总税费
+     */
+    private Double totalAddedValueTax;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getOrderSeen() {
+        return orderSeen;
+    }
+
+    public void setOrderSeen(Integer orderSeen) {
+        this.orderSeen = orderSeen;
+    }
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    public Integer getOrderSource() {
+        return orderSource;
+    }
+
+    public void setOrderSource(Integer orderSource) {
+        this.orderSource = orderSource;
+    }
+
+    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 getClubId() {
+        return clubId;
+    }
+
+    public void setClubId(Integer clubId) {
+        this.clubId = clubId;
+    }
+
+    public Integer getOrganizeId() {
+        return organizeId;
+    }
+
+    public void setOrganizeId(Integer organizeId) {
+        this.organizeId = organizeId;
+    }
+
+    public Integer getUserIdentity() {
+        return userIdentity;
+    }
+
+    public void setUserIdentity(Integer userIdentity) {
+        this.userIdentity = userIdentity;
+    }
+
+    public String getClubName() {
+        return clubName;
+    }
+
+    public void setClubName(String clubName) {
+        this.clubName = clubName;
+    }
+
+    public Integer getSvipUserFlag() {
+        return svipUserFlag;
+    }
+
+    public void setSvipUserFlag(Integer svipUserFlag) {
+        this.svipUserFlag = svipUserFlag;
+    }
+
+    public Integer getBuyUserId() {
+        return buyUserId;
+    }
+
+    public void setBuyUserId(Integer buyUserId) {
+        this.buyUserId = buyUserId;
+    }
+
+    public String getOrderTime() {
+        return orderTime;
+    }
+
+    public void setOrderTime(String orderTime) {
+        this.orderTime = orderTime;
+    }
+
+    public String getUpdateDate() {
+        return updateDate;
+    }
+
+    public void setUpdateDate(String updateDate) {
+        this.updateDate = updateDate;
+    }
+
+    public Integer getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Integer delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Integer getUserBeans() {
+        return userBeans;
+    }
+
+    public void setUserBeans(Integer userBeans) {
+        this.userBeans = userBeans;
+    }
+
+    public Integer getOrderType() {
+        return orderType;
+    }
+
+    public void setOrderType(Integer orderType) {
+        this.orderType = orderType;
+    }
+
+    public Integer getOrderSubmitType() {
+        return orderSubmitType;
+    }
+
+    public void setOrderSubmitType(Integer orderSubmitType) {
+        this.orderSubmitType = orderSubmitType;
+    }
+
+    public Integer getConfirmFlag() {
+        return confirmFlag;
+    }
+
+    public void setConfirmFlag(Integer confirmFlag) {
+        this.confirmFlag = confirmFlag;
+    }
+
+    public Integer getOnlinePayFlag() {
+        return onlinePayFlag;
+    }
+
+    public void setOnlinePayFlag(Integer onlinePayFlag) {
+        this.onlinePayFlag = onlinePayFlag;
+    }
+
+    public Integer getSplitFlag() {
+        return splitFlag;
+    }
+
+    public void setSplitFlag(Integer splitFlag) {
+        this.splitFlag = splitFlag;
+    }
+
+    public Integer getPayFlag() {
+        return payFlag;
+    }
+
+    public void setPayFlag(Integer payFlag) {
+        this.payFlag = payFlag;
+    }
+
+    public Integer getReceiptStatus() {
+        return receiptStatus;
+    }
+
+    public void setReceiptStatus(Integer receiptStatus) {
+        this.receiptStatus = receiptStatus;
+    }
+
+    public Integer getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(Integer payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    public Integer getZeroCostFlag() {
+        return zeroCostFlag;
+    }
+
+    public void setZeroCostFlag(Integer zeroCostFlag) {
+        this.zeroCostFlag = zeroCostFlag;
+    }
+
+    public Integer getSendOutStatus() {
+        return sendOutStatus;
+    }
+
+    public void setSendOutStatus(Integer sendOutStatus) {
+        this.sendOutStatus = sendOutStatus;
+    }
+
+    public Integer getRefundType() {
+        return refundType;
+    }
+
+    public void setRefundType(Integer refundType) {
+        this.refundType = refundType;
+    }
+
+    public Integer getAffirmPaymentFlag() {
+        return affirmPaymentFlag;
+    }
+
+    public void setAffirmPaymentFlag(Integer affirmPaymentFlag) {
+        this.affirmPaymentFlag = affirmPaymentFlag;
+    }
+
+    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;
+    }
+
+    public Integer getPromotionalGiftsCount() {
+        return promotionalGiftsCount;
+    }
+
+    public void setPromotionalGiftsCount(Integer promotionalGiftsCount) {
+        this.promotionalGiftsCount = promotionalGiftsCount;
+    }
+
+    public Integer getHasActProduct() {
+        return hasActProduct;
+    }
+
+    public void setHasActProduct(Integer hasActProduct) {
+        this.hasActProduct = hasActProduct;
+    }
+
+    public Double getPromotionFullReduction() {
+        return promotionFullReduction;
+    }
+
+    public void setPromotionFullReduction(Double promotionFullReduction) {
+        this.promotionFullReduction = promotionFullReduction;
+    }
+
+    public Double getSvipFullReduction() {
+        return svipFullReduction;
+    }
+
+    public void setSvipFullReduction(Double svipFullReduction) {
+        this.svipFullReduction = svipFullReduction;
+    }
+
+    public Integer getSecondHandOrderFlag() {
+        return secondHandOrderFlag;
+    }
+
+    public void setSecondHandOrderFlag(Integer secondHandOrderFlag) {
+        this.secondHandOrderFlag = secondHandOrderFlag;
+    }
+
+    public Integer getInvoiceFlag() {
+        return invoiceFlag;
+    }
+
+    public void setInvoiceFlag(Integer invoiceFlag) {
+        this.invoiceFlag = invoiceFlag;
+    }
+
+    public Integer getPostageFlag() {
+        return postageFlag;
+    }
+
+    public void setPostageFlag(Integer postageFlag) {
+        this.postageFlag = postageFlag;
+    }
+
+    public Double getPostage() {
+        return postage;
+    }
+
+    public void setPostage(Double postage) {
+        this.postage = postage;
+    }
+
+    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 getDiscountFee() {
+        return discountFee;
+    }
+
+    public void setDiscountFee(Double discountFee) {
+        this.discountFee = discountFee;
+    }
+
+    public Double getCouponAmount() {
+        return couponAmount;
+    }
+
+    public void setCouponAmount(Double couponAmount) {
+        this.couponAmount = couponAmount;
+    }
+
+    public Double getPayTotalFee() {
+        return payTotalFee;
+    }
+
+    public void setPayTotalFee(Double payTotalFee) {
+        this.payTotalFee = payTotalFee;
+    }
+
+    public Double getPayableAmount() {
+        return payableAmount;
+    }
+
+    public void setPayableAmount(Double payableAmount) {
+        this.payableAmount = payableAmount;
+    }
+
+    public Double getBalancePayFee() {
+        return balancePayFee;
+    }
+
+    public void setBalancePayFee(Double balancePayFee) {
+        this.balancePayFee = balancePayFee;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getConfirmTime() {
+        return confirmTime;
+    }
+
+    public void setConfirmTime(String confirmTime) {
+        this.confirmTime = confirmTime;
+    }
+
+    public String getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(String payTime) {
+        this.payTime = payTime;
+    }
+
+    public Integer getRebateFlag() {
+        return rebateFlag;
+    }
+
+    public void setRebateFlag(Integer rebateFlag) {
+        this.rebateFlag = rebateFlag;
+    }
+
+    public Integer getClauseId() {
+        return clauseId;
+    }
+
+    public void setClauseId(Integer clauseId) {
+        this.clauseId = clauseId;
+    }
+
+    public String getClauseName() {
+        return clauseName;
+    }
+
+    public void setClauseName(String clauseName) {
+        this.clauseName = clauseName;
+    }
+
+    public String getShopOrderIds() {
+        return shopOrderIds;
+    }
+
+    public void setShopOrderIds(String shopOrderIds) {
+        this.shopOrderIds = shopOrderIds;
+    }
+
+    public String getCloseReason() {
+        return closeReason;
+    }
+
+    public void setCloseReason(String closeReason) {
+        this.closeReason = closeReason;
+    }
+
+    public String getCloseTime() {
+        return closeTime;
+    }
+
+    public void setCloseTime(String closeTime) {
+        this.closeTime = closeTime;
+    }
+
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note;
+    }
+
+    public Integer getPaySuccessCounter() {
+        return paySuccessCounter;
+    }
+
+    public void setPaySuccessCounter(Integer paySuccessCounter) {
+        this.paySuccessCounter = paySuccessCounter;
+    }
+
+    public List<ShopOrderVo> getShopOrderList() {
+        return shopOrderList;
+    }
+
+    public void setShopOrderList(List<ShopOrderVo> shopOrderList) {
+        this.shopOrderList = shopOrderList;
+    }
+
+    public boolean isPayButton() {
+        return payButton;
+    }
+
+    public void setPayButton(boolean payButton) {
+        this.payButton = payButton;
+    }
+
+    public Double getPendingPayments() {
+        return pendingPayments;
+    }
+
+    public void setPendingPayments(Double pendingPayments) {
+        this.pendingPayments = pendingPayments;
+    }
+
+    public Double getReceiptAmount() {
+        return receiptAmount;
+    }
+
+    public void setReceiptAmount(Double receiptAmount) {
+        this.receiptAmount = receiptAmount;
+    }
+
+    public String getOrderMark() {
+        return orderMark;
+    }
+
+    public void setOrderMark(String orderMark) {
+        this.orderMark = orderMark;
+    }
+
+    public boolean isRechargeGoods() {
+        return rechargeGoods;
+    }
+
+    public void setRechargeGoods(boolean rechargeGoods) {
+        this.rechargeGoods = rechargeGoods;
+    }
+
+    public Double getExpensesOfTaxation() {
+        return expensesOfTaxation;
+    }
+
+    public void setExpensesOfTaxation(Double expensesOfTaxation) {
+        this.expensesOfTaxation = expensesOfTaxation;
+    }
+
+    public Double getReturnedPurchaseFee() {
+        return returnedPurchaseFee;
+    }
+
+    public void setReturnedPurchaseFee(Double returnedPurchaseFee) {
+        this.returnedPurchaseFee = returnedPurchaseFee;
+    }
+
+    public boolean isInvoiceStatus() {
+        return invoiceStatus;
+    }
+
+    public void setInvoiceStatus(boolean invoiceStatus) {
+        this.invoiceStatus = invoiceStatus;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Boolean getAuthority() {
+        return authority;
+    }
+
+    public void setAuthority(Boolean authority) {
+        this.authority = authority;
+    }
+
+    public String getHaveReturning() {
+        return haveReturning;
+    }
+
+    public void setHaveReturning(String haveReturning) {
+        this.haveReturning = haveReturning;
+    }
+
+    public String getHaveReceipting() {
+        return haveReceipting;
+    }
+
+    public void setHaveReceipting(String haveReceipting) {
+        this.haveReceipting = haveReceipting;
+    }
+
+    public Double getSurplusAmount() {
+        return surplusAmount;
+    }
+
+    public void setSurplusAmount(Double surplusAmount) {
+        this.surplusAmount = surplusAmount;
+    }
+
+    public Double getPaidAmount() {
+        return paidAmount;
+    }
+
+    public void setPaidAmount(Double paidAmount) {
+        this.paidAmount = paidAmount;
+    }
+
+    public Double getUnCheckAmount() {
+        return unCheckAmount;
+    }
+
+    public void setUnCheckAmount(Double unCheckAmount) {
+        this.unCheckAmount = unCheckAmount;
+    }
+
+    public Double getReturnValue() {
+        return returnValue;
+    }
+
+    public void setReturnValue(Double returnValue) {
+        this.returnValue = returnValue;
+    }
+
+    public Double getRefundFee() {
+        return refundFee;
+    }
+
+    public void setRefundFee(Double refundFee) {
+        this.refundFee = refundFee;
+    }
+
+    public String getStatusName() {
+        return statusName;
+    }
+
+    public void setStatusName(String statusName) {
+        this.statusName = statusName;
+    }
+
+    public Double getTotalAddedValueTax() {
+        return totalAddedValueTax;
+    }
+
+    public void setTotalAddedValueTax(Double totalAddedValueTax) {
+        this.totalAddedValueTax = totalAddedValueTax;
+    }
+}

+ 244 - 0
src/main/java/com/caimei/modules/order/entity/PayParamBo.java

@@ -0,0 +1,244 @@
+package com.caimei.modules.order.entity;
+
+
+
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/7/30
+ */
+
+public class PayParamBo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 用户Id
+     */
+    private Integer userId;
+    /**
+     * 订单Id
+     */
+    private Integer orderId;
+    /**
+     * 二手发布商品id
+     */
+    private Integer productId;
+    /**
+     * 会员购买记录Id
+     */
+    private Integer vipRecordId;
+    /**
+     * 优惠券购买记录id
+     */
+    private Integer couponRecordId;
+    /**
+     * 会员套餐id
+     */
+    private Integer vipId;
+    /**
+     * 支付金额,单位分,必须大于2
+     */
+    private Integer payAmount;
+    /**
+     * 支付方式,
+     * 银联:UNIONPAY,
+     * 微信:WEIXIN,
+     * 支付宝:ALIPAY,
+     * 银联转账:TRANSFER
+     */
+    private String payWay;
+    /**
+     * 支付类型(现阶段主要是区分微信支付)
+     * 微信小程序支付: MINIAPP_WEIXIN
+     * 微信公众号支付: JSAPI_WEIXIN
+     */
+    private String payType;
+    /**
+     * 微信小程序code,微信小程序支付使用
+     */
+    private String code;
+    /**
+     * 微信公众号state参数
+     */
+    private String state;
+    /**
+     * 页面回调地址
+     */
+    private String returnUrl;
+    /**
+     * 微信openId
+     */
+    private String openId;
+    /**
+     * 异步通知回调
+     */
+    private String notifyUrl;
+    /**
+     * 银行编码(银联支付使用)
+     */
+    private String bankCode;
+    /**
+     * 用户类型(银联支付使用)
+     * 企业:ENTERPRISE
+     * 个人:USER
+     */
+    private String userType;
+    /**
+     * 购买优惠券id
+     */
+    private Integer couponId;
+    /**
+     *  1小程序 2网站
+     */
+    private Integer source;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getVipRecordId() {
+        return vipRecordId;
+    }
+
+    public void setVipRecordId(Integer vipRecordId) {
+        this.vipRecordId = vipRecordId;
+    }
+
+    public Integer getCouponRecordId() {
+        return couponRecordId;
+    }
+
+    public void setCouponRecordId(Integer couponRecordId) {
+        this.couponRecordId = couponRecordId;
+    }
+
+    public Integer getVipId() {
+        return vipId;
+    }
+
+    public void setVipId(Integer vipId) {
+        this.vipId = vipId;
+    }
+
+    public Integer getPayAmount() {
+        return payAmount;
+    }
+
+    public void setPayAmount(Integer payAmount) {
+        this.payAmount = payAmount;
+    }
+
+    public String getPayWay() {
+        return payWay;
+    }
+
+    public void setPayWay(String payWay) {
+        this.payWay = payWay;
+    }
+
+    public String getPayType() {
+        return payType;
+    }
+
+    public void setPayType(String payType) {
+        this.payType = payType;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getReturnUrl() {
+        return returnUrl;
+    }
+
+    public void setReturnUrl(String returnUrl) {
+        this.returnUrl = returnUrl;
+    }
+
+    public String getOpenId() {
+        return openId;
+    }
+
+    public void setOpenId(String openId) {
+        this.openId = openId;
+    }
+
+    public String getNotifyUrl() {
+        return notifyUrl;
+    }
+
+    public void setNotifyUrl(String notifyUrl) {
+        this.notifyUrl = notifyUrl;
+    }
+
+    public String getBankCode() {
+        return bankCode;
+    }
+
+    public void setBankCode(String bankCode) {
+        this.bankCode = bankCode;
+    }
+
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
+    public Integer getCouponId() {
+        return couponId;
+    }
+
+    public void setCouponId(Integer couponId) {
+        this.couponId = couponId;
+    }
+
+    public Integer getSource() {
+        return source;
+    }
+
+    public void setSource(Integer source) {
+        this.source = source;
+    }
+}

+ 78 - 0
src/main/java/com/caimei/modules/order/entity/PromotionPriceVo.java

@@ -0,0 +1,78 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/6/25
+ */
+public class PromotionPriceVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 促销Id
+     */
+    private Integer promotionsId;
+    /**
+     * 商品Id
+     */
+    private Integer productId;
+    /**
+     * 购买数量
+     */
+    private Integer number;
+    /**
+     * 价格
+     */
+    private Double price;
+    /**
+     * 划线价
+     */
+    private Double originalPrice;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getPromotionsId() {
+        return promotionsId;
+    }
+
+    public void setPromotionsId(Integer promotionsId) {
+        this.promotionsId = promotionsId;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getNumber() {
+        return number;
+    }
+
+    public void setNumber(Integer number) {
+        this.number = number;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public Double getOriginalPrice() {
+        return originalPrice;
+    }
+
+    public void setOriginalPrice(Double originalPrice) {
+        this.originalPrice = originalPrice;
+    }
+}

+ 239 - 0
src/main/java/com/caimei/modules/order/entity/PromotionsVo.java

@@ -0,0 +1,239 @@
+package com.caimei.modules.order.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/6/25
+ */
+public class PromotionsVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 活动可见度, 1所有人,2仅对机构
+     */
+    private Integer seen;
+    /**
+     * 是否支持叠加优惠,1支持,2不支持
+     */
+    private Integer discount;
+    /**
+     * 促销id
+     */
+    private Integer id;
+    /**
+     * 促销名称
+     */
+    private String name;
+    /**
+     * 促销描述
+     */
+    private String description;
+    /**
+     * 分类: 1单品促销,2凑单促销,3店铺促销
+     */
+    private Integer type;
+    /**
+     * 促销方式:1优惠,2满减,3满赠
+     */
+    private Integer mode;
+    /**
+     * 优惠价/满减/满赠的设定价格(如满999赠商品)
+     */
+    private Double touchPrice;
+    /**
+     * 减免价格
+     */
+    private Double reducedPrice;
+    /**
+     * 时效:1永久,2区间过期,其它无效
+     */
+    private Integer status;
+    /**
+     * 商品id
+     */
+    private Integer productId;
+    /**
+     * 店铺id(店铺促销时供应商ID)
+     */
+    private Integer shopId;
+    /**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date beginTime;
+    /**
+     * 截止时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+    /**
+     * 该优惠下(该购物车商品)价格列表
+     */
+    private List<PromotionPriceVo> productList;
+    /**
+     * 该优惠下赠品
+     */
+    private List<CartItemVo> giftList;
+    /**
+     * 主订单id(保存订单促销用)
+     */
+    private Integer orderId;
+    /**
+     * 促销id(保存订单促销用)
+     */
+    private Integer promotionsId;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getSeen() {
+        return seen;
+    }
+
+    public void setSeen(Integer seen) {
+        this.seen = seen;
+    }
+
+    public Integer getDiscount() {
+        return discount;
+    }
+
+    public void setDiscount(Integer discount) {
+        this.discount = discount;
+    }
+
+    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 getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getMode() {
+        return mode;
+    }
+
+    public void setMode(Integer mode) {
+        this.mode = mode;
+    }
+
+    public Double getTouchPrice() {
+        return touchPrice;
+    }
+
+    public void setTouchPrice(Double touchPrice) {
+        this.touchPrice = touchPrice;
+    }
+
+    public Double getReducedPrice() {
+        return reducedPrice;
+    }
+
+    public void setReducedPrice(Double reducedPrice) {
+        this.reducedPrice = reducedPrice;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getShopId() {
+        return shopId;
+    }
+
+    public void setShopId(Integer shopId) {
+        this.shopId = shopId;
+    }
+
+    public Date getBeginTime() {
+        return beginTime;
+    }
+
+    public void setBeginTime(Date beginTime) {
+        this.beginTime = beginTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public List<PromotionPriceVo> getProductList() {
+        return productList;
+    }
+
+    public void setProductList(List<PromotionPriceVo> productList) {
+        this.productList = productList;
+    }
+
+    public List<CartItemVo> getGiftList() {
+        return giftList;
+    }
+
+    public void setGiftList(List<CartItemVo> giftList) {
+        this.giftList = giftList;
+    }
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    public Integer getPromotionsId() {
+        return promotionsId;
+    }
+
+    public void setPromotionsId(Integer promotionsId) {
+        this.promotionsId = promotionsId;
+    }
+}

+ 548 - 0
src/main/java/com/caimei/modules/order/entity/ShopOrderVo.java

@@ -0,0 +1,548 @@
+package com.caimei.modules.order.entity;
+
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/7/20
+ */
+public class ShopOrderVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 子订单ID
+     */
+    private Integer shopOrderId;
+    /**
+     * 子订单编号
+     */
+    private String shopOrderNo;
+    /**
+     * 订单号
+     */
+    private Integer orderId;
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+    /**
+     * 供应商Id
+     */
+    private Integer shopId;
+    /**
+     * 供应商名称
+     */
+    private String shopName;
+    /**
+     * 供应商logo
+     */
+    private String shopLogo;
+    /**
+     * 子订单备注信息
+     */
+    private String note;
+    /**
+     * 用户ID
+     */
+    private Integer userId;
+    /**
+     * 购买机构Id
+     */
+    private Integer clubId;
+    /**
+     * 协销Id
+     */
+    private Integer spId;
+    /**
+     * 订单促销id(店铺促销)
+     */
+    private Integer orderPromotionsId;
+    /**
+     * 促销满减优惠(店铺促销)
+     */
+    private Double promotionFullReduction;
+    /**
+     * 超级会员优惠
+     */
+    private Double svipShopReduction;
+    /**
+     * (付款供应商)付款状态:1待付款、2部分付款、3已付款
+     */
+    private Integer payStatus;
+    /**
+     * 已付款金额
+     */
+    private Double payedShopAmount;
+    /**
+     * 佣金 =  应付采美
+     */
+    private Double brokerage;
+    /**
+     * 可退款金额 = 余额抵扣金额
+     */
+    private Double canRefundAmount;
+    /**
+     * 购买数量
+     */
+    private Integer itemCount;
+    /**
+     * 总价 = totalFee
+     */
+    private Double totalAmount;
+    /**
+     * 总金额 = 订单商品totalAmount
+     */
+    private Double productAmount;
+    /**
+     * 需要支付金额 shouldPayFee +运费
+     */
+    private Double needPayAmount;
+    /**
+     * 付供应商 商品费=成本价*(购买数量  + 赠品数量)
+     */
+    private Double shopProductAmount;
+    /**
+     * 付供应商 运费
+     */
+    private Double shopPostFee;
+    /**
+     * 付供应商税费
+     */
+    private Double shopTaxFee;
+    /**
+     * 付供应商 = 商品费 + 运费 + 税费
+     */
+    private Double shouldPayShopAmount;
+    /**
+     * 已经发货的商品数量
+     */
+    private Integer outStoreNum;
+    /**
+     * 子订单发货批次 默认值 = 0 即没过发货
+     */
+    private Integer outStoreTimes;
+    /**
+     * 发货状态:1待发货、2部分发货、3已发货
+     */
+    private Integer sendOutStatus;
+    /**
+     * 赠品数
+     */
+    private Integer presentNum;
+    /**
+     * 订单提交时间
+     */
+    private String orderTime;
+    /**
+     * 0:个人自己下单 1:企业自己下单 2:员工帮会所下单 3:协销帮会所下单  4:后台下单 5:采美豆订单
+     */
+    private Integer orderSubmitType;
+    /**
+     * 订单能否拆分 1 为可拆分, 0为不可拆分
+     */
+    private Integer splitFlag;
+    /**
+     * 付第三方
+     */
+    private Double shopOtherFee;
+    /**
+     * 子订单店铺促销活动
+     */
+    private PromotionsVo shopPromotion;
+    /**
+     * 订单商品信息
+     */
+    private List<OrderProductVo> orderProductList;
+    /**
+     * 发货物流记录
+     */
+    private List<LogisticsRecordVo> logisticsRecordList;
+    /**
+     * 收货地址
+     */
+    private OrderUserinfoVo userInfo;
+    /**
+     * (收款买家)收款状态:1待收款、2部分收款、3已收款
+     */
+    private Integer receiptStatus;
+    /**
+     * 供应商已退金额
+     */
+    private BigDecimal shopRefundAmount;
+    /**
+     * 存在退款中的记录 (0:否,1:是)
+     */
+    private String haveReturning;
+    /**
+     * 子订单返佣标识
+     */
+    private Integer receiptedFlag;
+    /**
+     * 返佣类型 10口头返佣   1或者其他值都是返佣
+     */
+    private Integer receiptedType;
+    /**
+     * 返佣订单关联页面展示用
+     */
+    private OrderVo mainOrder;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    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 getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Integer getShopId() {
+        return shopId;
+    }
+
+    public void setShopId(Integer shopId) {
+        this.shopId = shopId;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    public String getShopLogo() {
+        return shopLogo;
+    }
+
+    public void setShopLogo(String shopLogo) {
+        this.shopLogo = shopLogo;
+    }
+
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    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 getOrderPromotionsId() {
+        return orderPromotionsId;
+    }
+
+    public void setOrderPromotionsId(Integer orderPromotionsId) {
+        this.orderPromotionsId = orderPromotionsId;
+    }
+
+    public Double getPromotionFullReduction() {
+        return promotionFullReduction;
+    }
+
+    public void setPromotionFullReduction(Double promotionFullReduction) {
+        this.promotionFullReduction = promotionFullReduction;
+    }
+
+    public Double getSvipShopReduction() {
+        return svipShopReduction;
+    }
+
+    public void setSvipShopReduction(Double svipShopReduction) {
+        this.svipShopReduction = svipShopReduction;
+    }
+
+    public Integer getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(Integer payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    public Double getPayedShopAmount() {
+        return payedShopAmount;
+    }
+
+    public void setPayedShopAmount(Double payedShopAmount) {
+        this.payedShopAmount = payedShopAmount;
+    }
+
+    public Double getBrokerage() {
+        return brokerage;
+    }
+
+    public void setBrokerage(Double brokerage) {
+        this.brokerage = brokerage;
+    }
+
+    public Double getCanRefundAmount() {
+        return canRefundAmount;
+    }
+
+    public void setCanRefundAmount(Double canRefundAmount) {
+        this.canRefundAmount = canRefundAmount;
+    }
+
+    public Integer getItemCount() {
+        return itemCount;
+    }
+
+    public void setItemCount(Integer itemCount) {
+        this.itemCount = itemCount;
+    }
+
+    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 Double getNeedPayAmount() {
+        return needPayAmount;
+    }
+
+    public void setNeedPayAmount(Double needPayAmount) {
+        this.needPayAmount = needPayAmount;
+    }
+
+    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 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 Integer getSendOutStatus() {
+        return sendOutStatus;
+    }
+
+    public void setSendOutStatus(Integer sendOutStatus) {
+        this.sendOutStatus = sendOutStatus;
+    }
+
+    public Integer getPresentNum() {
+        return presentNum;
+    }
+
+    public void setPresentNum(Integer presentNum) {
+        this.presentNum = presentNum;
+    }
+
+    public String getOrderTime() {
+        return orderTime;
+    }
+
+    public void setOrderTime(String orderTime) {
+        this.orderTime = orderTime;
+    }
+
+    public Integer getOrderSubmitType() {
+        return orderSubmitType;
+    }
+
+    public void setOrderSubmitType(Integer orderSubmitType) {
+        this.orderSubmitType = orderSubmitType;
+    }
+
+    public Integer getSplitFlag() {
+        return splitFlag;
+    }
+
+    public void setSplitFlag(Integer splitFlag) {
+        this.splitFlag = splitFlag;
+    }
+
+    public Double getShopOtherFee() {
+        return shopOtherFee;
+    }
+
+    public void setShopOtherFee(Double shopOtherFee) {
+        this.shopOtherFee = shopOtherFee;
+    }
+
+    public PromotionsVo getShopPromotion() {
+        return shopPromotion;
+    }
+
+    public void setShopPromotion(PromotionsVo shopPromotion) {
+        this.shopPromotion = shopPromotion;
+    }
+
+    public List<OrderProductVo> getOrderProductList() {
+        return orderProductList;
+    }
+
+    public void setOrderProductList(List<OrderProductVo> orderProductList) {
+        this.orderProductList = orderProductList;
+    }
+
+    public List<LogisticsRecordVo> getLogisticsRecordList() {
+        return logisticsRecordList;
+    }
+
+    public void setLogisticsRecordList(List<LogisticsRecordVo> logisticsRecordList) {
+        this.logisticsRecordList = logisticsRecordList;
+    }
+
+    public OrderUserinfoVo getUserInfo() {
+        return userInfo;
+    }
+
+    public void setUserInfo(OrderUserinfoVo userInfo) {
+        this.userInfo = userInfo;
+    }
+
+    public Integer getReceiptStatus() {
+        return receiptStatus;
+    }
+
+    public void setReceiptStatus(Integer receiptStatus) {
+        this.receiptStatus = receiptStatus;
+    }
+
+    public BigDecimal getShopRefundAmount() {
+        return shopRefundAmount;
+    }
+
+    public void setShopRefundAmount(BigDecimal shopRefundAmount) {
+        this.shopRefundAmount = shopRefundAmount;
+    }
+
+    public String getHaveReturning() {
+        return haveReturning;
+    }
+
+    public void setHaveReturning(String haveReturning) {
+        this.haveReturning = haveReturning;
+    }
+
+    public Integer getReceiptedFlag() {
+        return receiptedFlag;
+    }
+
+    public void setReceiptedFlag(Integer receiptedFlag) {
+        this.receiptedFlag = receiptedFlag;
+    }
+
+    public Integer getReceiptedType() {
+        return receiptedType;
+    }
+
+    public void setReceiptedType(Integer receiptedType) {
+        this.receiptedType = receiptedType;
+    }
+
+    public OrderVo getMainOrder() {
+        return mainOrder;
+    }
+
+    public void setMainOrder(OrderVo mainOrder) {
+        this.mainOrder = mainOrder;
+    }
+}

+ 209 - 0
src/main/java/com/caimei/modules/order/entity/SplitAccountPo.java

@@ -0,0 +1,209 @@
+package com.caimei.modules.order.entity;
+
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/8/3
+ */
+public class SplitAccountPo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+    /**
+     * 主订单id
+     */
+    private Integer orderId;
+    /**
+     * 商品id,仅对二手发布商品
+     */
+    private Integer productId;
+    /**
+     * 订单商品id
+     */
+    private Integer orderProductId;
+    /**
+     * 供应商id
+     */
+    private Integer shopId;
+    /**
+     * 超级会员套餐id
+     */
+    private Integer vipRecordId;
+    /**
+     * 优惠券购买记录id
+     */
+    private Integer couponRecordId;
+    /**
+     * 认证通会员购买记录id
+     */
+    private Integer authVipRecordId;
+    /**
+     * 分账类型:1公账-专票,2私账-无票,3公账-普票,4供应商子商户,5佣金账户
+     */
+    private Integer type;
+    /**
+     * 子商户商编
+     */
+    private String subUserNo;
+    /**
+     * 分账金额
+     */
+    private Double splitAccount;
+    /**
+     * 米花科技平台唯一流水号
+     */
+    private String mbOrderId;
+    /**
+     * 商户唯一订单请求号(订单编号#随机时间戳)
+     */
+    private String orderRequestNo;
+    /**
+     * 付款状态,0待付,1付款成功
+     */
+    private Integer payStatus;
+    /**
+     * 商品类型:1商品成本,2供应商运费,3佣金,4二手发布
+     */
+    private Integer productType;
+    /**
+     * 分账时间
+     */
+    private Date splitTime;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    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 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 getVipRecordId() {
+        return vipRecordId;
+    }
+
+    public void setVipRecordId(Integer vipRecordId) {
+        this.vipRecordId = vipRecordId;
+    }
+
+    public Integer getCouponRecordId() {
+        return couponRecordId;
+    }
+
+    public void setCouponRecordId(Integer couponRecordId) {
+        this.couponRecordId = couponRecordId;
+    }
+
+    public Integer getAuthVipRecordId() {
+        return authVipRecordId;
+    }
+
+    public void setAuthVipRecordId(Integer authVipRecordId) {
+        this.authVipRecordId = authVipRecordId;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getSubUserNo() {
+        return subUserNo;
+    }
+
+    public void setSubUserNo(String subUserNo) {
+        this.subUserNo = subUserNo;
+    }
+
+    public Double getSplitAccount() {
+        return splitAccount;
+    }
+
+    public void setSplitAccount(Double splitAccount) {
+        this.splitAccount = splitAccount;
+    }
+
+    public String getMbOrderId() {
+        return mbOrderId;
+    }
+
+    public void setMbOrderId(String mbOrderId) {
+        this.mbOrderId = mbOrderId;
+    }
+
+    public String getOrderRequestNo() {
+        return orderRequestNo;
+    }
+
+    public void setOrderRequestNo(String orderRequestNo) {
+        this.orderRequestNo = orderRequestNo;
+    }
+
+    public Integer getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(Integer payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    public Integer getProductType() {
+        return productType;
+    }
+
+    public void setProductType(Integer productType) {
+        this.productType = productType;
+    }
+
+    public Date getSplitTime() {
+        return splitTime;
+    }
+
+    public void setSplitTime(Date splitTime) {
+        this.splitTime = splitTime;
+    }
+}

+ 273 - 0
src/main/java/com/caimei/modules/order/service/SplitAccountService.java

@@ -0,0 +1,273 @@
+package com.caimei.modules.order.service;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.caimei.modules.order.dao.NewOrderDao;
+import com.caimei.modules.order.entity.*;
+import com.caimei.modules.order.utils.PayUtil;
+import com.caimei.utils.MathUtil;
+import com.thinkgem.jeesite.common.persistence.Page;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Service
+@Transactional(readOnly = true)
+public class SplitAccountService {
+
+    /**
+     * 日志对象
+     */
+    protected Logger logger = LoggerFactory.getLogger(getClass());
+    //正式
+//    public static final String callUrl = "https://core.caimei365.com/order/pay/delay/split/callback";
+    //测试
+    public static final String callUrl = "https://core-b.caimei365.com/order/pay/delay/split/callback";
+
+    @Resource
+    private NewOrderDao newOrderDao;
+
+    @Transactional(readOnly = false)
+    public void SplitAccount() {
+        logger.info("【手动分账开始】>>>>>>>>>>手动分账");
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String currentTime = format.format(calendar.getTime());
+        // 查询未分账已支付收款
+        List<OrderReceiptRelationPo> orderRelations = newOrderDao.getUndividedPaidReceipt(currentTime);
+        // 上面过滤了余额抵扣, 把线上余额抵扣单补充到list里面,线上余额抵扣的金额视为正常收款金额进行分账
+        List<OrderReceiptRelationPo> onlineRelations = newOrderDao.getOnlineBalance(currentTime);
+        if (null != onlineRelations && orderRelations.size() > 0) {
+            // 过滤不足分账金额的单
+            onlineRelations.removeIf(o -> o.getAssociateAmount() < 0.01);
+            // 把线上余额抵扣订单加入分账
+            orderRelations.addAll(onlineRelations);
+        }
+        if (null != orderRelations && orderRelations.size() > 0) {
+            for (OrderReceiptRelationPo orderRelation : orderRelations) {
+                logger.info("【手动分账】>>>>>>>>>>订单id:" + orderRelation.getOrderId() + ",进入手动分账");
+                // 收款对应的订单信息
+                OrderVo order = newOrderDao.getOrderByOrderId(orderRelation.getOrderId());
+                PayParamBo payParam = new PayParamBo();
+                payParam.setPayAmount(MathUtil.mul(orderRelation.getAssociateAmount(), 100).intValue());
+                if (12 == orderRelation.getPayType()) {
+                    // 网银支付
+                    payParam.setPayWay("UNIONPAY");
+                }
+                if (20 == orderRelation.getPayType()) {
+                    payParam.setPayWay("TRANSFER");
+                }
+                List<SplitAccountPo> splitBillDetail = setSplitAccountDetail(order, payParam);
+                List<Map<String, String>> maps = new ArrayList<>();
+                //供应商子商户金额
+                for (SplitAccountPo account : splitBillDetail) {
+                    if (null != account.getType() && 4 == account.getType()) {
+                        //每个有供应商子商户的分账给对应供应商子商户
+                        addMaps(maps, account.getSplitAccount(), account.getSubUserNo());
+                    }
+                }
+                //公账-专票总金额,私账-无票总金额,公账-普票总金额
+                //佣金进网络
+                double totalAmount1 = 0.00;
+                double totalAmount2 = 0.00;
+                double totalAmount3 = 0.00;
+                double totalAmount4 = 0.00;
+                for (SplitAccountPo account : splitBillDetail) {
+                    if (1 == account.getType()) {
+                        totalAmount1 = MathUtil.add(totalAmount1, account.getSplitAccount()).doubleValue();
+                    } else if (2 == account.getType()) {
+                        totalAmount2 = MathUtil.add(totalAmount2, account.getSplitAccount()).doubleValue();
+                    } else if (3 == account.getType()) {
+                        totalAmount3 = MathUtil.add(totalAmount3, account.getSplitAccount()).doubleValue();
+                    } else if (5 == account.getType()) {
+                        totalAmount4 = MathUtil.add(totalAmount4, account.getSplitAccount()).doubleValue();
+                    }
+                }
+                addMaps(maps, totalAmount1, PayUtil.publicAccountNo);
+                addMaps(maps, totalAmount2, PayUtil.privateAccountNo);
+                addMaps(maps, totalAmount3, PayUtil.commonInvoiceNo);
+                // 网络
+                 addMaps(maps, totalAmount4, PayUtil.brokerage);
+//                addMaps(maps, totalAmount4, PayUtil.publicAccountNo);
+                String parameters = JSON.toJSONString(maps);
+                logger.info("【手动分账】>>>>>>>>>>分账参数: " + parameters);
+
+                //第三方分账接口
+                JSONObject result = null;
+                try {
+                    // 时间戳
+                    long time = System.currentTimeMillis() / 1000;
+                    JSONObject json = new JSONObject();
+                    json.put("merAccount", PayUtil.merAccount);
+                    json.put("orderId", orderRelation.getOrderRequestNo());
+                    json.put("requestNo", orderRelation.getOrderRequestNo());
+                    json.put("mbOrderId", orderRelation.getMbOrderId());
+                    json.put("time", time);
+                    json.put("splitBillDetail", parameters);
+                    json.put("notifyUrl", callUrl);
+                    logger.info("回调接口>>>" + callUrl);
+                    String sign = PayUtil.getPaySign(json, PayUtil.merKey);
+                    json.put("sign", sign);
+                    logger.info("发送参数json----->" + json);
+                    String data = PayUtil.privateKeyEncrypt(json, PayUtil.merKey);
+                    result = PayUtil.httpGet("https://platform.mhxxkj.com/paygateway/mbpay/splitOrder/v1", PayUtil.merAccount, data);
+                } catch (Exception e) {
+                    logger.error("【手动分账】>>>>>>>>>>错误信息", e);
+                }
+                if (result != null) {
+                    String code = result.getString("code");
+                    if (!"000000".equals(code)) {
+                        String msg = result.getString("msg");
+                        logger.info("【手动分账】>>>>>>>>>>第三方延迟分账失败>>>>>>>msg:" + msg);
+                    } else {
+                        for (SplitAccountPo splitAccount : splitBillDetail) {
+                            splitAccount.setMbOrderId(orderRelation.getMbOrderId());
+                            splitAccount.setOrderRequestNo(orderRelation.getOrderRequestNo());
+                            splitAccount.setPayStatus(1);
+                            // 保存分账详情
+                            newOrderDao.insertSplitAccount(splitAccount);
+                        }
+                        logger.info("【手动分账】>>>>>>>>>>此订单分账结束");
+                    }
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 分账参数添加
+     */
+    private void addMaps(List<Map<String, String>> maps, Double shopTotalAmount, String subUserNo) {
+        if (MathUtil.compare(shopTotalAmount, 0) > 0) {
+            Map<String, String> map = new HashMap<>(3);
+            map.put("subUserNo", subUserNo);
+            map.put("splitBillType", "2");
+            map.put("splitBillValue", MathUtil.mul(shopTotalAmount, 100).toString());
+            maps.add(map);
+        }
+    }
+
+    /**
+     * 分账详情
+     */
+    private List<SplitAccountPo> setSplitAccountDetail(OrderVo order, PayParamBo payParam) {
+        List<SplitAccountPo> list = new ArrayList<>();
+        // 本次支付金额,单位/元
+        double payAmount = MathUtil.div(payParam.getPayAmount(), 100).doubleValue();
+        // 待分账总金额
+        double splitAmount = payAmount;
+        // 总手续费
+        double procedureFee;
+        if ("UNIONPAY".equals(payParam.getPayWay())) {
+            procedureFee = 8.00;
+        } else if ("TRANSFER".equals(payParam.getPayWay())) {
+            //银联转账12
+            procedureFee = 12.00;
+        } else {
+            //手续费
+            procedureFee = MathUtil.mul(payAmount, 0.0038, 2).doubleValue();
+            if (MathUtil.compare(procedureFee, 0) == 0) {
+                procedureFee = 0.01;
+            }
+        }
+        splitAmount = MathUtil.sub(splitAmount, procedureFee).doubleValue();
+        // 商品数据
+        List<OrderProductVo> orderProductList = newOrderDao.getOrderProductByOrderId(order.getOrderId());
+        for (OrderProductVo orderProduct : orderProductList) {
+            double costPrice = MathUtil.mul(orderProduct.getCostPrice(), orderProduct.getNum()).doubleValue();
+            // 不含税能开发票
+            if (Integer.valueOf(0).equals(orderProduct.getIncludedTax()) && !Integer.valueOf(3).equals(orderProduct.getInvoiceType())) {
+                //应付总税费
+                Double payableTax = MathUtil.mul(orderProduct.getSingleShouldPayTotalTax(), orderProduct.getNum()).doubleValue();
+                costPrice = MathUtil.add(costPrice, payableTax).doubleValue();
+            }
+            // 判断是否支付过
+            Double paidAmount = newOrderDao.getOrderProductPaidAmount(orderProduct.getOrderProductId());
+            if (paidAmount != null && MathUtil.compare(paidAmount, 0) > 0) {
+                costPrice = MathUtil.sub(costPrice, paidAmount).doubleValue();
+                splitAmount = MathUtil.sub(splitAmount, costPrice).doubleValue();
+            }
+            if (paidAmount == null || MathUtil.compare(paidAmount, costPrice) < 0) {
+                // 待分账金额>=本次待分账金额
+                if (MathUtil.compare(splitAmount, costPrice) > 0) {
+                    splitAmount = MathUtil.sub(splitAmount, costPrice).doubleValue();
+                } else {
+                    costPrice = splitAmount;
+                    splitAmount = 0.00;
+                }
+            }
+            if (costPrice > 0) {
+                SplitAccountPo splitAccount = new SplitAccountPo();
+                splitAccount.setOrderId(order.getOrderId());
+                splitAccount.setOrderProductId(orderProduct.getOrderProductId());
+                splitAccount.setShopId(orderProduct.getShopId());
+                splitAccount.setSplitAccount(costPrice);
+                splitAccount.setProductType(1);
+                if (StringUtils.isNotBlank(orderProduct.getSplitCode())) {
+                    // 该商品设置了商户号
+                    splitAccount.setType(4);
+                    splitAccount.setSubUserNo(orderProduct.getSplitCode());
+                }
+                logger.info("成本分账参数------------->" + splitAccount);
+                list.add(splitAccount);
+            }
+            if (MathUtil.compare(splitAmount, 0) == 0) {
+                break;
+            }
+        }
+        // 付供应商运费,是以供应商为单位的
+        if (MathUtil.compare(splitAmount, 0) > 0) {
+            List<ShopOrderVo> shopOrderList = newOrderDao.getShopOrderListByOrderId(order.getOrderId());
+            for (ShopOrderVo shopOrder : shopOrderList) {
+                // 运费
+                Double shopPostFee = shopOrder.getShopPostFee();
+                if (MathUtil.compare(shopPostFee, 0) > 0) {
+                    // 查询已支付运费
+                    Double shipping = newOrderDao.getPaidShipping(order.getOrderId(), shopOrder.getShopId());
+                    shopPostFee = MathUtil.sub(shopPostFee, shipping).doubleValue();
+                    if (MathUtil.compare(splitAmount, shopPostFee) > -1) {
+                        splitAmount = MathUtil.sub(splitAmount, shopPostFee).doubleValue();
+                    } else {
+                        shopPostFee = splitAmount;
+                        splitAmount = 0.00;
+                    }
+                    String commercialCode = newOrderDao.getShopCommercialCode(shopOrder.getShopId());
+                    SplitAccountPo splitAccount = new SplitAccountPo();
+                    splitAccount.setOrderId(order.getOrderId());
+                    splitAccount.setShopId(shopOrder.getShopId());
+                    splitAccount.setSplitAccount(shopPostFee);
+                    splitAccount.setProductType(2);
+                    if (StringUtils.isNotBlank(commercialCode)) {
+                        //供应商拥有子商户号
+                        splitAccount.setType(4);
+                        splitAccount.setSubUserNo(commercialCode);
+                    }
+                    logger.info("付供应商运费分账参数------------->" + splitAccount);
+                    list.add(splitAccount);
+                }
+            }
+        }
+        //佣金,公账
+        if (MathUtil.compare(splitAmount, 0) > 0) {
+            SplitAccountPo splitAccount = new SplitAccountPo();
+            splitAccount.setOrderId(order.getOrderId());
+            splitAccount.setSplitAccount(splitAmount);
+            splitAccount.setProductType(3);
+            splitAccount.setType(5);
+            //佣金进采美网络
+            splitAccount.setSubUserNo(PayUtil.brokerage);
+            logger.info("佣金分账参数------------->" + splitAccount);
+            list.add(splitAccount);
+        }
+        return list;
+    }
+
+}

+ 135 - 0
src/main/java/com/caimei/modules/order/utils/PayUtil.java

@@ -0,0 +1,135 @@
+package com.caimei.modules.order.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.caimei.modules.order.utils.HashUtil;
+import com.caimei.modules.order.utils.HttpClient4Utils;
+import com.caimei.modules.order.utils.RSAUtil;
+
+import java.security.NoSuchAlgorithmException;
+import java.security.spec.InvalidKeySpecException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/7/30
+ */
+public class PayUtil {
+    /**
+     * 商户标识
+     */
+    public static final String merAccount = "aa9aee6a148843a6a9e4ea117df4454b";
+    /**
+     * 私钥,商户密钥
+     */
+    public static final String merKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAM0qCTZFdi1I59/Jeis+8KVhzSNhsRrKiOlHazIVyxNLzUQvFpWN5PlfVKlnJToorURTStfjAv01HD0Z4ZvMauuHhDT0bptiDln928Ld6SzX889X2nsCxl0Q+WzrkFsnT6gotvGnTeQGUgbBV3SQD3IUOwRwxoWYbrZqxtqHFxqRAgMBAAECgYEAvsHx9MMbAToDVmEXtXP8/lh0Cwy/RgDA0d30voni2pslTNtXbVCUcIUBy8y6oVvG1nt3YEmTsuiZy/nvehPT6GV1Gqj8T6lqWQ8KQKsDGlubvh23tzNM90me2TLZEPdNqC5CPRrwYrjght4BXgzu7s2+5FpeYCob1gVNi+w0Jz0CQQD0dXb9Oez+Ybnxb3rCghGWM6cxi8fsqk6MuKaleg53qfXrkgAVH78faeWzRaeSbVOh5+Z9kX5HUeynfM7E/f4nAkEA1tmnvJp4JQaouO1Trzbnkhowjea5daK/tDE8K0hIMHUjAw+c1QTteGOVGBFBHWPkUwkSCd2HKmk4URkp/snMhwJAO32+qF+Jclq8EqqLmHxo5UHKxX7793d2yD5Dp++tR6fgBiUwyfNA4tc1pEwmPLdIbBVwfUyEC70/N39jHoOlbwI/dX6SPJI9IgKCQp+HJEriWQP5iaCjy7E1JVXHkeP1lop4mzPukJAhTbUn1AGbmncGZmKPetWrFYZ1ReR9EtlJAkEA2kBmARWyOTt8fbikImuHr65M+BDgD+2fkuDb5+tqJljNmSqAIRRwcXj1Je6vkzlDJuSw3wlG6iliFtwe0cq7+w==";
+    /**
+     * 公钥
+     */
+    public static final String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNKgk2RXYtSOffyXorPvClYc0jYbEayojpR2syFcsTS81ELxaVjeT5X1SpZyU6KK1EU0rX4wL9NRw9GeGbzGrrh4Q09G6bYg5Z/dvC3eks1/PPV9p7AsZdEPls65BbJ0+oKLbxp03kBlIGwVd0kA9yFDsEcMaFmG62asbahxcakQIDAQAB";
+    /**
+     * 用户编号
+     */
+    public static final String merNo = "10001720";
+    /**
+     * 公账-专票,子商户商编
+     */
+    public static final String publicAccountNo = "20001793";
+    /**
+     * 公账-普票,子商户商编
+     */
+    public static final String commonInvoiceNo = "20001754";
+    /**
+     * 私账-无票,子商户商编
+     */
+    public static final String privateAccountNo = "20001924";
+    /**
+     * 彩美网络,佣金账户
+     */
+    public static final String brokerage="20004104";
+
+    /**
+     * 支付状态转换
+     */
+    public static String getPayTypeId(String payType, String userType) {
+        if ("ALIPAY_H5".equals(payType)) {
+            //支付宝H5
+            return "14";
+        } else if ("JSAPI_WEIXIN".equals(payType)) {
+            //微信公众号支付
+            return "13";
+        } else if ("MINIAPP_WEIXIN".equals(payType)) {
+            //微信小程序支付
+            return "15";
+        } else if ("GATEWAY_UNIONPAY".equals(payType) && "ENTERPRISE".equals(userType)) {
+            //企业网银
+            return "12";
+        } else if ("GATEWAY_UNIONPAY".equals(payType) && "USER".equals(userType)){
+            //个人网银
+            return "17";
+        }else{
+            //银联转账
+            return "20";
+        }
+    }
+
+    /**
+     * 生成RSA签名:sign
+     */
+    public static String getPaySign(JSONObject json, String merKey) {
+        StringBuffer buffer		= new StringBuffer();
+        TreeMap<String, Object> treeMap = new TreeMap<String, Object>();
+        for (Map.Entry<String, Object> entry : json.entrySet()) {
+            if (entry.getValue() != null) {
+                treeMap.put(entry.getKey(), entry.getValue());
+            }
+        }
+        for (Map.Entry<String, Object> entry : treeMap.entrySet()) {
+            if (entry.getValue() != null) {
+                buffer.append(entry.getValue());
+            }
+        }
+        buffer.append(merKey.replaceAll("(\r\n|\r|\n|\n\r)", ""));
+        System.out.println(buffer.toString());
+        return HashUtil.md5(buffer.toString()).toUpperCase();
+    }
+
+    //get请求
+    public static JSONObject httpGet(String url, String merAccount, String data) {
+        //请求参数为如下:merAccount、data
+        Map<String, String> paramMap	= new HashMap<String, String>();
+        paramMap.put("data", data);
+        paramMap.put("merAccount", merAccount);
+        String responseBody	= HttpClient4Utils.sendHttpRequest(url, paramMap, "UTF-8", false);
+        return JSON.parseObject(responseBody);
+    }
+    //post请求
+    public static JSONObject httpPost(String url, String merAccount, String data) {
+        //请求参数为如下:merAccount、data
+        Map<String, String> paramMap	= new HashMap<String, String>();
+        paramMap.put("data", data);
+        paramMap.put("merAccount", merAccount);
+        String responseBody	= HttpClient4Utils.sendHttpRequest(url, paramMap, "UTF-8", true);
+        return JSON.parseObject(responseBody);
+    }
+    /**
+     * 公钥解密
+     */
+    public static JSONObject publicKeyDecrypt(String data, String publicKey) throws NoSuchAlgorithmException, InvalidKeySpecException {
+        JSONObject result	= null;
+        String jsonStr = RSAUtil.publicDecrypt(data.trim(), publicKey);
+        result = JSON.parseObject(jsonStr);
+        return result;
+    }
+
+    /**
+     * 私钥加密
+     */
+    public static String privateKeyEncrypt(JSONObject json, String privateKey) throws NoSuchAlgorithmException, InvalidKeySpecException {
+        return RSAUtil.privateEncrypt(json.toJSONString(), privateKey);
+    }
+}

+ 61 - 0
src/main/java/com/caimei/modules/order/web/SplitAccountController.java

@@ -0,0 +1,61 @@
+package com.caimei.modules.order.web;
+
+import com.caimei.modules.order.dao.NewOrderDao;
+import com.caimei.modules.order.dao.NewShopOrderDao;
+import com.caimei.modules.order.entity.NewShopOrder;
+import com.caimei.modules.order.entity.OrderReceiptRelationPo;
+import com.caimei.modules.order.service.SplitAccountService;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "${adminPath}/splitAccount/")
+public class SplitAccountController extends BaseController {
+
+    @Resource
+    private SplitAccountService splitAccountService;
+
+    @Resource
+    private NewOrderDao newOrderDao;
+
+    @RequestMapping("split")
+    public String SplitAccount(RedirectAttributes redirectAttributes){
+        //设置分账间隔,2-3分钟,禁止重复分账
+//        newOrderDao.findSplitTime();
+        //查询是否有账单可分账,没有return
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String currentTime = format.format(calendar.getTime());
+        // 查询未分账已支付收款
+        List<OrderReceiptRelationPo> orderRelations = newOrderDao.getUndividedPaidReceipt(currentTime);
+        // 上面过滤了余额抵扣, 把线上余额抵扣单补充到list里面,线上余额抵扣的金额视为正常收款金额进行分账
+        List<OrderReceiptRelationPo> onlineRelations = newOrderDao.getOnlineBalance(currentTime);
+        if (null != onlineRelations && onlineRelations.size() > 0) {
+            // 过滤不足分账金额的单
+            onlineRelations.removeIf(o -> o.getAssociateAmount() < 0.01);
+            // 把线上余额抵扣订单加入分账
+            orderRelations.addAll(onlineRelations);
+        }
+        if (null != orderRelations && orderRelations.size() > 0) {
+            splitAccountService.SplitAccount();
+            addMessage(redirectAttributes, "分账成功!");
+        }else{
+            addMessage(redirectAttributes, "暂无收款金额可进行分账!");
+        }
+        return "redirect:" + Global.getAdminPath() + "/shopOrder/splitList/?repage";
+    }
+}

+ 1092 - 0
src/main/webapp/WEB-INF/views/modules/order/cmSplitAccountList.jsp

@@ -0,0 +1,1092 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>子订单手动分账</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        .pay-wrapper {
+            padding: 0 10px
+        }
+
+        .pay-list-item {
+            margin-bottom: 30px
+        }
+
+        .pay-table th {
+            background: #f9f9f9
+        }
+
+        .pay-table tr:first-child th {
+            background: #eee !important
+        }
+
+        .pay-table td {
+            background: #fff !important
+        }
+
+        input[type="checkbox"]::before {
+            content: '\a0';
+            display: inline-block;
+            vertical-align: .2em;
+            width: .8em;
+            height: .8em;
+            margin-right: .2em;
+            border-radius: .2em;
+            text-indent: .15em;
+            line-height: .65
+        }
+
+        .t-btn {
+            width: 100px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            background: #fff;
+            border: 1px solid #ddd;
+            margin-bottom: 10px
+        }
+
+        #select-all {
+            width: 70px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            background: #fff;
+            border: 1px solid #ddd;
+            margin-bottom: 10px
+        }
+
+        #select-all:active {
+            background: #3daae9;
+            color: #fff
+        }
+
+        .pay-more-func {
+            float: right;
+            color: #2fa4e7;
+            cursor: pointer
+        }
+
+        .pay-more-func span:first-child {
+            margin-right: 6px
+        }
+
+        .pay-more-func span:hover {
+            color: #7aa9c3
+        }
+
+        .mask {
+            width: 100%;
+            height: 100%;
+            position: fixed;
+            top: 0;
+            background: rgba(0, 0, 0, 0.7);
+            display: none
+        }
+
+        .revise-popup-content, .tips-popup-content {
+            width: 40%;
+            height: auto;
+            padding-bottom: 30px;
+            background: #fff;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%)
+        }
+
+        .revise-popup-content {
+            width: 450px;
+            height: 360px;
+            overflow-y: scroll;
+            padding: 0 15px 30px 15px
+        }
+
+        .tips-popup-content {
+            width: 30%
+        }
+
+        .tips-popup-content p {
+            text-align: center;
+            padding: 80px;
+            font-size: 20px
+        }
+
+        .revise-popup-content h4, .tips-popup-content h4 {
+            padding-left: 10px;
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px solid #eee;
+            margin-bottom: 20px
+        }
+
+        .revise-popup-content div {
+            margin-top: 7px;
+            text-align: center
+        }
+
+        .revise-popup-content label {
+            width: 70px;
+            text-align: right;
+            vertical-align: text-bottom
+        }
+
+        .revise-popup-content button {
+            width: 80px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:first-child {
+            margin-left: -104px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:last-child {
+            margin-left: 30px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span span {
+            margin-left: 10px
+        }
+
+        .revise-popup-content > div:last-child {
+            text-align: center;
+            margin-top: 20px
+        }
+
+        .revise-popup-content input {
+            width: 100px;
+            margin-bottom: 0px
+        }
+
+        .popup-cfm-btn, .tips-cfm-btn {
+            background: #3daae9;
+            color: #fff;
+            border: none
+        }
+
+        .tips-cfm-btn {
+            width: 100px;
+            height: 40px;
+            margin: auto;
+            display: block;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px
+        }
+
+        .popup-cancel-btn {
+            background: #fff;
+            color: #555;
+            border: 1px solid #ddd;
+            margin-left: 20px
+        }
+
+        .popup-tips {
+            color: red;
+            display: none
+        }
+
+        #close-btn, #close-btn1 {
+            top: 8px;
+            right: 10px;
+            width: 18px;
+            position: absolute;
+            cursor: pointer
+        }
+
+        .tips-input-wrapper {
+            width: 100px
+        }
+
+        .reset-btn {
+            background: #fff;
+            color: #555;
+            border: 1px solid #ddd;
+            margin-right: 20px
+        }
+
+        .pay-status {
+            height: 40px;
+            line-height: 40px;
+            display: block
+        }
+
+        .form-search label {
+            width: 80px;
+            text-align: left;
+            margin-top: 12px
+        }
+
+        .remark-textarea {
+            width: 95%;
+            height: 100px;
+            resize: none
+        }
+
+        .remark-title {
+            text-align: left !important
+        }
+
+        .remark-title span {
+            color: red
+        }
+
+        .ul-form {
+            white-space: nowrap;
+            margin-left: -10px !important
+        }
+
+        .ul-form label {
+            width: 90px;
+            text-align: left;
+            margin-top: 15px
+        }
+
+        .time-space-symbols {
+            width: 100px;
+            display: inline-block;
+            text-align: center
+        }
+
+        #btnSubmit {
+            width: 128px;
+            margin-left: 165px
+        }
+
+        .pay-status label {
+            margin-left: 0
+        }
+
+        .pay-status label:first-child {
+            margin-left: 10px
+        }
+
+        .weishaIcon {background:darkorange;color:white;margin:0 0px;padding:0 3px;font-style:normal;font-size: 12px; display:inline-block;border-radius:2px}
+
+    </style>
+    <script type="text/javascript">
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+     <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
+     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
+     <li class="active tab-li"><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
+</ul>
+<form:form id="searchForm"
+           action="${ctx}/splitAccount/split" method="post" class="breadcrumb form-search">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <div class="pay-status">
+        <span style="color: red">点击右侧分账按钮,可将以下展示的所有订单的收款金额进行分账,将应付供应商款项金额分账给对应供应商。</span>
+        <input id="btnSubmit" class="btn btn-primary" type="submit" onclick="return confirmx('确定将展示的子订单全部分账吗?', '${ctx}/splitAccount/split')" value="手动分账"/>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<div class="pay-wrapper">
+    <c:forEach items="${page.list}" var="s" varStatus="sIndex">
+        <div class="pay-list-item">
+            <table class="table table-striped table-bordered table-condensed pay-table">
+                <tr>
+                    <th>子订单编号(ID)</th>
+                    <th colspan="3">订单编号(ID)</th>
+                    <th colspan="2">订单金额</th>
+                    <th colspan="3">下单时间</th>
+                    <th>收款状态</th>
+                    <th>收款金额</th>
+                    <th colspan="3">经理折扣</th>
+                    <th>优惠券</th>
+                    <th>成本类型</th>
+                </tr>
+                <tr>
+                    <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></td>
+                    <td colspan="3"><a href="${ctx}/order/detail?id=${s.orderID}">${s.orderNo}(${s.orderID})</a></td>
+                    <td colspan="2"><fmt:formatNumber value="${s.payTotalFee}" type="number" pattern="#,##0.00"/></td>
+                    <td colspan="3">${s.orderTime}</td>
+                        <%--此处对应订单列表收款状态--%>
+                    <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">
+                        <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
+                        <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
+                        <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
+                    </td>
+                    <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">${s.receiptTotalFee}</a></td>
+                    <td colspan="3">
+                        <c:if test="${s.discountTotalFee gt 0}">
+                            <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
+                                <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
+                                                  type="currency"/>
+                            </c:if>
+                            <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
+                                ¥0.00
+                            </c:if>
+                            <c:if test="${s.returnedPurchaseTotalFee gt 0}">
+                                <span style="color: red">
+                                    (原<fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>,因退货折扣取消
+                                    <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
+                                        <fmt:formatNumber value="${s.returnedPurchaseTotalFee}" type="currency"/>
+                                    </c:if>
+                                    <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
+                                        <fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>
+                                    </c:if>)
+                                </span>
+                            </c:if>
+                        </c:if>
+                        <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
+                    </td>
+                    <td>
+                            ${s.couponAmount}
+                    </td>
+                    <td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
+                            test="${s.costType == '2'}">比例成本</c:if></td>
+                </tr>
+                <tr>
+                    <th>供应商</th>
+                    <th colspan="3">机构</th>
+                    <th>机构运费</th>
+                    <th>供应商运费</th>
+                    <th colspan="3">商品费</th>
+                    <th colspan="2">付款状态</th>
+                    <th colspan="3">应付税费</th>
+                    <th>付供应商</th>
+                    <th>付第三方</th>
+                </tr>
+                <tr>
+                    <td>${s.shopName}</td>
+                    <td colspan="3">
+                        <c:if test="${s.organizeID eq 1}"><span class="org-note">星范</span></c:if>
+                            ${s.clubName}
+                        <c:if test="${s.orderType eq 2}"><font color="red">(呵呵商城)</font></c:if>
+                        <c:if test="${s.organizeID == 3}"></c:if>
+                    </td>
+                    <td>
+                        <c:if test="${s.freight == 0}">
+                            包邮
+                        </c:if>
+                        <c:if test="${s.freight == -1}">
+                            到付
+                        </c:if>
+                        <c:if test="${s.freight == -2}">
+                            仪器到付-产品包邮
+                        </c:if>
+                        <c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
+                            <fmt:formatNumber value="${s.freight}" type="currency"/>
+                            <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
+                        </c:if>
+                        <c:if test="${s.userBeans > 0}">
+                            <br><font color="red">(采美豆抵用:${s.userBeans})</font>
+                        </c:if>
+                    </td>
+                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                                                          pattern="#,##0.00"/></td>
+                    <td colspan="3" class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number"
+                                                                          pattern="#,##0.00"/></td>
+                    <td colspan="2"><c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
+                            color="red">待付款</font></c:if>
+                        <c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
+                        <c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if></td>
+                    <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number"
+                                                                    pattern="#,##0.00"/></td>
+                    <td class="supplier-fee">
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2 }">
+                            <font color="#E15616"><fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/></font>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <font color="black">${s.shouldPayShopAmount+s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <font color="black">${s.shouldPayShopAmount-s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
+                        </c:if>
+                    </td>
+                    <input type="hidden" class="payedShopAmount" value="${s.payedShopAmount}">
+                    <input type="hidden" class="productAmount" value="${s.productAmount}">
+                    <input type="hidden" class="costType" value="${s.costType}">
+                    <input type="hidden" class="proportional" value="${s.proportional}">
+                    <input type="hidden" class="modifyShouldPayNote" value="${s.modifyShouldPayNote}">
+                    <td class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number"
+                                                                  pattern="#,##0.00"/></td>
+                </tr>
+                <tr>
+                    <th>商品名</th>
+                    <th>规格</th>
+                    <th>数量<%--(赠品)--%></th>
+                    <th>退货</th>
+                    <th colspan="2">单价</th>
+                    <th colspan="3">机构税率 / 单税费 / 总税费</th>
+                    <th colspan="2">总价</th>
+                    <th colspan="3">供应商税率 / 单税费 / 总税费</th>
+                    <th>成本(单)</th>
+                    <th>成本(总)</th>
+                </tr>
+                <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
+                    <tr class="pay-product-item">
+                        <input type="hidden" class="p-copId" value="${p.orderProductID}">
+                        <td style="width:300px;" class="p-name">
+                            <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
+                            <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
+                                ${p.name}
+                        </td>
+                        <td style="width:80px;">${p.unit}</td>
+                        <td class="p-num" data-num="${p.num + p.presentNum}">
+                                ${p.num}
+                            <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
+                        </td>
+                        <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
+                        <td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                                                          type="number" pattern="#,##0.00"/>
+                            <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
+                                <label style="color: red">
+                                    (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+                                </label>
+                            </c:if>
+                        </td>
+                        <td>${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.taxRate?0.0:p.taxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
+                        <td>${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.addedValueTax ?0.00:p.addedValueTax}</td>
+                        <td>
+                            <c:choose>
+                                <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
+                                    ---
+                                </c:when>
+                                <c:otherwise>
+                                    <fmt:formatNumber
+                                            value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}"
+                                            type="number" pattern="#,##0.00"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </td>
+                        <td colspan="2"><fmt:formatNumber
+                                value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
+                                type="number" pattern="#,##0.00"/></td>
+                        <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
+                        <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
+                        <td class="p-taxes-t">
+                            <c:choose>
+                                <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
+                                    ---
+                                </c:when>
+                                <c:otherwise>
+                                    <fmt:formatNumber
+                                            value="${empty p.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
+                                            type="number" pattern="#,##0.00"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </td>
+                        <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
+                                                                  pattern="#,##0.00"/></td>
+                        <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
+                                              type="number" pattern="#,##0.00"/></td>
+                    </tr>
+                </c:forEach>
+            </table>
+            <div class="pay-more-func">
+                <c:if test="${s.paying ne '1' and s.payStatus eq '1' and !s.modifyPayable}">
+                    <shiro:hasPermission name="order:cmPayShop:modifyPay">
+                        <a href="${ctx}/shopOrder/toChangePayShopAmount?shopOrderID=${s.shopOrderID}">修改成本</a>
+                    </shiro:hasPermission>
+                </c:if>
+                <c:if test="${(s.modifyPayable and s.paying ne '1') || s.payStatus eq '2'}">
+                    <a href="${ctx}/order/cmPayShop/differencePriceForm?shopOrderId=${s.shopOrderID}">供应商差价</a>
+                </c:if>
+                <c:if test="${s.paying ne '1' and s.payStatus eq '2'}">
+                    <c:if test="${!s.modifyPayable || s.receiptStatus eq '3'}">
+                        <shiro:hasPermission name="order:cmPayShop:modifyPay">
+                            <a href="${ctx}/shopOrder/toApplyPayWipe?shopOrderID=${s.shopOrderID}">付款抹平</a>
+                        </shiro:hasPermission>
+                    </c:if>
+                </c:if>
+                <a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${s.shopOrderID}">应付备注</a>
+                <a href="${ctx}/shopOrder/payedAndRefundRecordList?shopOrderID=${s.shopOrderID}&operatingMode=${operatingMode}">退/付款记录</a>
+            </div>
+        </div>
+    </c:forEach>
+</div>
+<div class="mask revise-popup">
+    <div class="revise-popup-content">
+        <h4>确认提示</h4>
+        <ul class="nav nav-tabs" id="myTab">
+            <li class="active" id="li-fixed-cost"><a class="revise-tab" href="#fixed-cost">固定成本修改</a></li>
+            <li id="li-proportional-cost"><a class="revise-tab" href="#proportional-cost">销售比例成本修改</a></li>
+        </ul>
+        <div class="tab-content">
+            <div class="tab-pane active revise-content" id="fixed-cost">
+                <table class="table table-striped table-bordered table-condensed pay-table div-table">
+                    <tr>
+                        <th>商品名</th>
+                        <th>成本(单)</th>
+                        <th>税费(单)</th>
+                    </tr>
+                </table>
+            </div>
+            <div class="tab-pane revise-content" id="proportional-cost">
+                <div>
+                    <div style="display: inline-block">
+                        <p>
+                            <span>子订单金额:<span id="div-productAmount"></span></span>
+                        </p>
+                    </div>
+                    <div style="display: inline-block">
+                        <p>
+                            <span>成本(总)占订单金额的<input type="number" id="proportional">%</span>
+                        </p>
+                    </div>
+                </div>
+            </div>
+            <div>
+                <div style="display: inline-block">
+                    <p>
+                        <span>运费:<input type="number" id="div-freight" onchange="inputnum(this)"></span>
+                    </p>
+                </div>
+                <div style="display: inline-block">
+                    <p>
+                        <span>付第三方:<input type="number" id="div-third-party-fee" onchange="inputnum(this)"></span>
+                    </p>
+                </div>
+            </div>
+            <div>
+                <div style="display: inline-block">
+                    <p>
+                        <span>付供应商:<span id="div-supplier-fee"></span></span>
+                    </p>
+                </div>
+                <div style="display: inline-block">
+                    <p>
+                        <span>已付供应商:<span id="div-payedShopAmount"></span></span>
+                    </p>
+                </div>
+                <div>
+                    <div class="remark-title"><span>* </span>备注:</div>
+                    <textarea name="modifyShouldPayNote" class="remark-textarea" maxlength="200"
+                              placeholder="建议填写修改前和修改后的金额对比" cols="100" rows="10"></textarea>
+                </div>
+            </div>
+        </div>
+        <div class="popup-tips">不能为空</div>
+        <div>
+            <button class="reset-btn">恢复默认值</button>
+            <button class="popup-cfm-btn">确定</button>
+            <button class="popup-cancel-btn">取消</button>
+        </div>
+        <img id="close-btn" src="/static/images/close-btn.png" alt="close-btn">
+    </div>
+</div>
+
+<div class="mask tips-popup">
+    <div class="tips-popup-content">
+        <h4>信息提示</h4>
+        <p></p>
+        <button class="tips-cfm-btn" onclick="$('.tips-popup').hide()">确定</button>
+        <img id="close-btn1" src="/static/images/close-btn.png" alt="close-btn">
+    </div>
+</div>
+<div class="pagination">${page}</div>
+<c:if test="${empty page.list}">
+    <p style="text-align: center;"><font color="#1e90ff">暂无待分账子订单……</font></p>
+</c:if>
+<script>
+    (function () {
+        var payTableEle = $('.pay-table'),
+            payProductEle = $('.pay-product-item');
+        payTableEle.each(function (i, l) {
+            var leftLength = $(this).find('tr').length,
+                productLength = $(this).find('.pay-product-item').length;
+            // 左侧栏合并单元格
+            // $(this).find('tr:first-child th:first-child').attr('rowspan', leftLength);
+            // 商品列表合并单元格
+            /*$(this).find('.mergeRows').attr('rowspan',productLength);*/
+        });
+
+
+        var getCheckedArr = sessionStorage.getItem('checkedIndexArr'),
+            allCheckedEle = $('.pay-all-status');
+        if (getCheckedArr) {
+            getCheckedArr = JSON.parse(getCheckedArr);
+            if (getCheckedArr.length > 0) {
+                allCheckedEle.prop('checked', false);
+                $.each(getCheckedArr, function (index, value) {
+                    $('.pay-checkbox').eq(value).prop('checked', true);
+                })
+            } else {
+                allCheckedEle.prop('checked', true);
+            }
+        } else {
+            allCheckedEle.prop('checked', true);
+        }
+
+        $('.tab-li').on('click', function () {
+            if (getCheckedArr) {
+                sessionStorage.removeItem('checkedIndexArr');
+            }
+        })
+
+        // 点击全选
+        // var selectAllBtn = $('#select-all'),
+        //     selectedInput = $('.pay-wrapper input[type=checkbox]');
+        // selectAllBtn.on('click', function () {
+        //     if (selectedInput.length > 0) {
+        //         var shopid = '';
+        //         for (var i = 0; i < selectedInput.length; i++) {
+        //             var id = $(selectedInput[i]).attr('data-shopid');
+        //             if (shopid == '') {
+        //                 //第一个选中的 选择框
+        //                 shopid = id;
+        //             } else {
+        //                 //后面的
+        //                 if (shopid != id) {
+        //                     alertx("应付多个订单时,它们必须属于同一个供应商");
+        //                     return false;
+        //                 }
+        //             }
+        //         }
+        //         if ($(this).text() === '全选') {
+        //             for (var i = 0; i < selectedInput.length; i++) {
+        //                 selectedInput[i].checked = true;
+        //             }
+        //             $(this).text('取消全选');
+        //         } else {
+        //             for (var i = 0; i < selectedInput.length; i++) {
+        //                 selectedInput[i].checked = false;
+        //             }
+        //             $(this).text('全选');
+        //         }
+        //     }
+        // });
+
+        function renderPopup(p, f, t, th, s, ps, plist) {
+            if (plist == '') {
+                $('.div-table tr:gt(0)').remove();
+                return;
+            }
+            var tsize = plist.size(),
+                str = '';
+            for (var i = 0; i < tsize; i++) {
+                var current = $(plist.get(i));
+                str += '<tr>' +
+                    '<td>' + current.find('.p-name').text() + '</td>' +
+                    '<td class="tips-input-wrapper">' +
+                    '<input type="number" onchange="inputnum(this)" data-num=' + current.find('.p-num').attr('data-num') + ' data-copid=' + current.find('.p-copId').attr('value') + ' data-ov=' + current.find('.p-costprice').text().replace(',', '') + ' value=' + current.find('.p-costprice').text().replace(',', '') + ' class="modify-product-costprice">' +
+                    '</td>' +
+                    '<td class="tips-input-wrapper">' +
+                    '<input type="number" onchange="inputnum(this)" data-num=' + current.find('.p-num').attr('data-num') + '  data-ov=' + current.find('.p-taxes').text().replace(',', '') + ' value=' + current.find('.p-taxes').text().replace(',', '') + ' class="modify-product-taxes">' +
+                    '</td>' +
+                    '</tr>';
+            }
+            $('.div-table').append(str);
+        }
+
+        function showTips1(content) {
+            var block = $('.popup-tips');
+            block.text(content);
+            block.show();
+        }
+
+        function btnToGrey() {
+            $('.popup-cfm-btn').css({'background': '#ddd', 'color': '#555'});
+            $('.popup-cfm-btn').attr('disabled', true);
+        }
+
+        function btnToNormal() {
+            $('.popup-cfm-btn').css({'background': '#3daae9', 'color': '#fff'});
+            $('.popup-cfm-btn').attr('disabled', false);
+        }
+
+        function renderSupplierFee() {
+            var productFee = Number($('#popup-product-fee').val()),
+                supplierPaidFee = Number($('#popup-sPaid-fee').text()),
+                freight = Number($('#popup-freight').val()),
+                taxes = Number($('#popup-taxes').val()),
+                totalFee = productFee + freight + taxes;
+            $('#popup-supplier-fee').text(totalFee);
+            if (totalFee < supplierPaidFee) {
+                showTips1('付供应商的金额不能小于已付款金额');
+                btnToGrey();
+            } else {
+                showTips1('');
+                $('.popup-tips').hide();
+                btnToNormal();
+            }
+        }
+
+        function showTips(text) {
+            $('.tips-popup p').text(text);
+            $('.tips-popup').show();
+        }
+
+        function toZero(thisEle) {
+            if (Number(thisEle.val()) < 0) {
+                thisEle.val(0);
+            }
+        }
+
+//			点击修改应付
+        $('body').on('click', '.revise-amount', function () {
+            var index = $(this).index(),
+                wrapper = $(this).closest('.pay-list-item'),
+                plist = wrapper.find('.pay-product-item'),
+                productFee = wrapper.find('.product-fee').text().replace(',', ''),
+                freight = wrapper.find('.freight').text().replace(',', ''),
+                taxes = wrapper.find('.taxes').text().replace(',', ''),
+                supplierFee = wrapper.find('.supplier-fee').text().replace(',', ''),
+                thirdPartyFee = wrapper.find('.third-party-fee').text().replace(',', ''),
+                payedShopAmount = wrapper.find('.payedShopAmount').val(),
+                productAmount = wrapper.find('.productAmount').val(),
+                costType = wrapper.find('.costType').val(),
+                modifyShouldPayNote = wrapper.find('.modifyShouldPayNote').val();
+            $('.revise-popup').attr('data-shoporderid', $(this).attr('data-shoporderid'));
+            $('.revise-popup').show();
+            $('#div-freight').attr('value', freight);
+            $('#div-freight').attr('data-ov', freight);
+            $('#div-third-party-fee').attr('value', thirdPartyFee);
+            $('#div-third-party-fee').attr('data-ov', thirdPartyFee);
+            $('#div-supplier-fee').text(Number(supplierFee).toFixed(2));
+            $('#div-supplier-fee').attr('data-ov', Number(supplierFee).toFixed(2));
+            $('#div-payedShopAmount').text(payedShopAmount);
+            $('#div-productAmount').text(productAmount);
+            $('.remark-textarea').val(modifyShouldPayNote);
+            $('#proportional').attr('value', wrapper.find('.proportional').attr('value'));
+            $('#proportional').attr('data-ov', wrapper.find('.proportional').attr('value'));
+            $('#myTab li:first').addClass('active').siblings().removeClass('active');
+            if (costType == '1') { //显示固定成本编辑
+                renderPopup(productFee, freight, taxes, thirdPartyFee, supplierFee, payedShopAmount, plist);
+                //隐藏比例成本
+                $('#proportional-cost').css('display', 'none');
+                $('#li-proportional-cost').css('display', 'none');
+                $('#fixed-cost').css('display', 'block');
+                $('#li-fixed-cost').css('display', 'block');
+                $('#li-fixed-cost').addClass('active');
+            } else if (costType == '2') { //显示比例成本编辑
+                //隐藏固定成本
+                $('#fixed-cost').css('display', 'none');
+                $('#li-fixed-cost').css('display', 'none');
+                $('#proportional-cost').css('display', 'block');
+                $('#li-proportional-cost').css('display', 'block');
+                $('#li-proportional-cost').addClass('active');
+            } else { //第一次设置两种编辑方式都显示
+                renderPopup(productFee, freight, taxes, thirdPartyFee, supplierFee, payedShopAmount, plist);
+                $('#proportional-cost').css('display', 'none');
+                $('#li-proportional-cost').css('display', 'block');
+                $('#fixed-cost').css('display', 'block');
+                $('#li-fixed-cost').css('display', 'block');
+                $('#li-fixed-cost').addClass('active');
+            }
+        });
+
+        $('#apply').on('click', function () {
+            var checked = $('.pay-wrapper input[type=checkbox]:checked'), params = '?';
+            for (var i = 0; i < checked.length; i++) {
+                var shoporderId = $(checked[i]).attr('data-shoporderid');
+                params += ('&shopOrderIDs=' + shoporderId);
+                var receiptStatus = $(checked[i]).attr('data-receiptStatus');
+                var modifyPayable = $(checked[i]).attr('data-modifyPayable');
+                if (modifyPayable && "3" != receiptStatus) {
+                    alertx('存在母订单线上支付尚未完成的情况,子订单(' + shoporderId + ')不能申请付款');
+                    return false;
+                }
+            }
+            if (checked.length < 1 || params == '?') {
+                alertx('请至少选择一个订单');
+                return false;
+            }
+            window.location.href = '${ctx}/order/cmPayShop/applyEdit' + params;
+        });
+
+        //付第三方
+        $('#applyShopOtherFee').on('click', function () {
+            var checked = $('.pay-wrapper input[type=checkbox]:checked');
+            if (checked.length < 1) {
+                alertx('请选择一个子订单');
+                return false;
+            }
+            if (checked.length > 1) {
+                alertx('每次只能选择一个子订单进行付第三方申请');
+                return false;
+            }
+            var isPayShopOtherFee = $(checked[0]).attr('data-isPayShopOtherFee');
+            if ("false" == isPayShopOtherFee) {
+                alertx("付第三方处于待审核状态,暂不能操作");
+                return false;
+            }
+            var shopOrderId = $(checked[0]).attr('data-shoporderid');
+
+            window.location.href = '${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=' + shopOrderId;
+        });
+
+        $('#refund').on('click', function () {
+            var checked = $('.pay-wrapper input[type=checkbox]:checked'), params = '?';
+            for (var i = 0; i < checked.length; i++) {
+                params += ('&shopOrderIDs=' + $(checked[i]).attr('data-shoporderid'));
+            }
+            if (checked.length < 1 || params == '?') {
+                alertx('请至少选择一个订单');
+                return false;
+            }
+            window.location.href = '${ctx}/order/cmRefundShop/toRefund' + params;
+        });
+
+        //恢复默认值
+        $('.reset-btn').on('click', function () {
+            var elements = $('.modify-product-costprice,#div-freight,.modify-product-taxes,#div-third-party-fee,#proportional');
+            elements.each(function () {
+                $(this).attr('value', $(this).attr('data-ov'));
+            });
+            validAndAdd();
+        });
+
+        $('#close-btn, .popup-cancel-btn').on('click', function () {
+            $('.revise-popup').hide();
+            renderPopup('', '', '', '', '', '', '');
+        })
+
+        $("#popup-product-fee").on("input propertychange", function () {
+            toZero($(this));
+            renderSupplierFee();
+        })
+
+        $("#popup-freight").on("input propertychange", function () {
+            toZero($(this));
+            renderSupplierFee();
+        })
+
+        $("#popup-taxes").on("input propertychange", function () {
+            toZero($(this));
+            renderSupplierFee();
+        })
+
+        $("#popup-third-party").on("input propertychange", function () {
+            toZero($(this));
+            if (!$(this).text().trim()) {
+                showTips1('');
+                $('.popup-tips').hide();
+                btnToNormal();
+            }
+        });
+
+        $('#close-btn1').on('click', function () {
+            $('.tips-popup').hide();
+        });
+
+
+        $('.popup-cfm-btn').on('click', function () {
+            var freight = Number($('#div-freight').attr('value')), //运费
+                third_party_fee = Number($('#div-third-party-fee').attr('value')), //运费
+                shopOrderID = $(this).parents('.revise-popup').attr('data-shoporderid'),//子订单ID
+                params = '?shopOrderID=' + shopOrderID + '&freight=' + freight + '&thirdPartyFee=' + third_party_fee;
+            if ($('#fixed-cost').css('display') == 'block') { //固定成本显示
+                params += '&costType=1';
+                var tr_items = $('.div-table tr:gt(0)');
+                for (var i = 0; i < tr_items.size(); i++) {
+                    var item = $(tr_items.get(i)),
+                        param = item.find('.modify-product-costprice').attr('data-copid');
+                    param += ('_' + Number(item.find('.modify-product-costprice').val()));
+                    param += ('_' + Number(item.find('.modify-product-taxes').val()));
+                    params += ('&param=' + param);
+                }
+            }
+            if ($('#proportional-cost').css('display') == 'block') { //比例成本显示
+                params += '&costType=2';
+                params += '&proportional=' + $('#proportional').val();
+            }
+            var remark = $('.remark-textarea').val();
+            if (!remark) {
+                showTips('备注不能为空');
+                return false;
+            }
+            $.ajax({
+                url: "${ctx}/order/cmPayShop/modifyPayShopAmount" + params,
+                type: "POST",
+                data: {'modifyShouldPayNote': remark},
+                success: function (res) {
+                    if (res.success) {
+                        $('.revise-popup').hide();
+                        $('#searchForm').submit();
+                    } else {
+                        alertx(res.msg);
+                    }
+                }
+            });
+        });
+
+        $('body').on('input propertychange', '.modify-product-costprice', function () {
+            validAndAdd();
+        });
+        $('body').on('input propertychange', '#div-freight', function () {
+            validAndAdd();
+        });
+        $('body').on('input propertychange', '.modify-product-taxes', function () {
+            validAndAdd();
+        });
+        $('body').on('input propertychange', '#div-third-party-fee', function () {
+            validAndAdd();
+        });
+        $('body').on('input propertychange', '#proportional', function () {
+            validAndAdd();
+        });
+
+        function validAndAdd() {
+            //先还原按钮
+            showTips1('');
+            $('.popup-tips').hide();
+            btnToNormal();
+            var total = 0;
+            if ($('#fixed-cost').css('display') == 'block') { //固定成本显示
+                var elements = $('.modify-product-costprice,#div-freight,.modify-product-taxes,#div-third-party-fee');
+                elements.each(function () {
+                    var ele = $(this);
+                    if (ele.attr('value') == '') {
+                        showTips1('成本/运费/税费/付第三方不能为空');
+                        btnToGrey();
+                        return false;
+                    }
+                    if (Number(ele.attr('value')) < 0) {
+                        // ele.attr('value', 0.01);
+                        showTips1('金额不可以为负');
+                        btnToGrey();
+                        return false;
+                    }
+                    /*if (ele.hasClass('modify-product-costprice') && Number(ele.attr('value')) == 0) {
+                        showTips1('成本必须大于零');
+                        btnToGrey();
+                        return false;
+                    }*/
+                    if (ele.attr('id') != 'div-third-party-fee') {
+                        if (ele.hasClass('modify-product-costprice') || ele.hasClass('modify-product-taxes')) {
+                            total += (Number($(this).attr('value')) * Number($(this).attr('data-num')));
+                        } else {
+                            total += Number($(this).attr('value'));
+                        }
+                    }
+                });
+            }
+            if ($('#proportional-cost').css('display') == 'block') { //比例成本显示
+                var productAmount = Number($('#div-productAmount').text()),
+                    proportional = $('#proportional').attr('value'),
+                    freight = $('#div-freight').attr('value'),   //运费
+                    third_party_fee = $('#div-third-party-fee').attr('value');  //付第三方
+                if (proportional == '' || isNaN(Number(proportional))) {
+                    showTips1('请输入成本比例');
+                    btnToGrey();
+                    return false;
+                }
+                if (Number(proportional) <= 0) {
+                    showTips1('成本比例必须大于零');
+                    btnToGrey();
+                    return false;
+                }
+                if (freight == '' || isNaN(Number(freight))) {
+                    showTips1('请输入运费');
+                    btnToGrey();
+                    return false;
+                }
+                if (Number(freight) < 0) {
+                    showTips1('运费不能小于零');
+                    btnToGrey();
+                    return false;
+                }
+                if (third_party_fee == '' || isNaN(Number(third_party_fee))) {
+                    showTips1('请输入付第三方金额');
+                    btnToGrey();
+                    return false;
+                }
+                if (Number(third_party_fee) < 0) {
+                    showTips1('付第三方金额不能小于零');
+                    btnToGrey();
+                    return false;
+                }
+                total = (productAmount * Number(proportional) / 100) + Number(freight);
+            }
+            if (Number($('#div-payedShopAmount').text()) > total) {
+                //已付供应商 > 付供应商   不能够
+                showTips1('付供应商的金额不能小于已付款金额');
+                btnToGrey();
+                return false;
+            }
+            $('#div-supplier-fee').text(total.toFixed(2));
+        }
+
+        var shopid = '';
+        $('body').on('click', '.pay-wrapper input[type=checkbox]', function () {
+            var that = $(this),
+                sid = $(this).data('shopid'),
+                status = Boolean($(this).attr('checked'));
+            if (status) {
+                if (shopid != '' && shopid != sid) {
+                    that.get(0).checked = false;
+//						showTips('应付多个订单时,它们必须属于同一个供应商');
+                    alertx("应付多个订单时,它们必须属于同一个供应商")
+                } else {
+                    shopid = sid;
+                }
+            } else {
+                shopid = '';
+            }
+        });
+
+        // $('#myTab a:first').tab('show');
+        $('#myTab a').click(function (e) {
+            e.preventDefault();
+            var parentLi = $(this).closest('li'),
+                index = parentLi.index(),
+                reviseContentEle = $('.revise-content');
+            parentLi.addClass('active').siblings().removeClass('active');
+            reviseContentEle.eq(index).show().siblings('.revise-content').hide();
+            if ($('#li-fixed-cost,#li-proportional-cost').length == 2) {
+                validAndAdd();
+            }
+        })
+
+        $('.pay-all-status').on('click', function () {
+            var thisStatus = $(this).prop('checked');
+            if (thisStatus) {
+                $('.pay-other-status').prop('checked', false);
+            }
+        })
+
+        $('.pay-other-status').on('click', function () {
+            var thisStatus = $(this).prop('checked');
+            if (thisStatus) {
+                $('.pay-all-status').prop('checked', false);
+            }
+        })
+    })()
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字
+     */
+    function onlynum(obj) {
+        obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+    }
+
+    function inputnum(obj, val) {
+        obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
+        obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
+        obj.value = obj.value.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
+        obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+        obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
+    }
+</script>
+</body>
+</html>