zhijiezhao пре 1 година
родитељ
комит
4020a4e775
25 измењених фајлова са 2460 додато и 2075 уклоњено
  1. 3 0
      src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java
  2. 28 161
      src/main/java/com/caimei/modules/order/entity/ChangePayShopOther.java
  3. 193 443
      src/main/java/com/caimei/modules/order/entity/CmPayShop.java
  4. 54 127
      src/main/java/com/caimei/modules/order/entity/CmPayShopRecord.java
  5. 13 0
      src/main/java/com/caimei/modules/order/entity/NewShopOrder.java
  6. 19 0
      src/main/java/com/caimei/modules/order/entity/OtherFeeDto.java
  7. 9 2
      src/main/java/com/caimei/modules/order/service/CmPayShopService.java
  8. 3 0
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  9. 142 135
      src/main/java/com/caimei/modules/order/web/CmPayShopController.java
  10. 25 4
      src/main/resources/mappings/modules/order/CmPayShopMapper.xml
  11. 318 290
      src/main/resources/mappings/modules/order/CmPayShopRecordMapper.xml
  12. 48 2
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  13. 326 251
      src/main/webapp/WEB-INF/views/modules/order/cmPayFormList.jsp
  14. 11 3
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopChange.jsp
  15. 15 89
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp
  16. 4 2
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp
  17. 422 146
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp
  18. 266 102
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherEdit.jsp
  19. 168 76
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherForm.jsp
  20. 102 92
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetail.jsp
  21. 82 40
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetails.jsp
  22. 59 37
      src/main/webapp/WEB-INF/views/modules/order/cmSettlementList.jsp
  23. 12 8
      src/main/webapp/WEB-INF/views/modules/order/cmSplitAccountList.jsp
  24. 58 43
      src/main/webapp/WEB-INF/views/modules/order/payedAndRefundRecordList.jsp
  25. 80 22
      src/main/webapp/WEB-INF/views/modules/order/shopOtherFeeForm.jsp

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

@@ -1,6 +1,7 @@
 package com.caimei.modules.order.dao;
 
 import com.caimei.modules.order.entity.NewShopOrder;
+import com.caimei.modules.order.entity.OtherFeeDto;
 import com.caimei.modules.order.entity.SettleRecord;
 import com.caimei.modules.product.entity.Shop;
 import com.caimei.po.neworder.CmShopOrder;
@@ -197,4 +198,6 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
     List<NewShopOrder> getShopOrderlist(NewShopOrder newShopOrder);
 
     void updateStatus(NewShopOrder shopOrder);
+
+    OtherFeeDto findCmProfit(Integer shopOrderId);
 }

+ 28 - 161
src/main/java/com/caimei/modules/order/entity/ChangePayShopOther.java

@@ -1,5 +1,7 @@
 package com.caimei.modules.order.entity;
 
+import lombok.Data;
+
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
@@ -10,12 +12,37 @@ import java.util.Date;
  * @author : plf
  * @date : 2021/5/26
  */
+@Data
 public class ChangePayShopOther implements Serializable {
-
+    /**
+     * 采美中介费开户名
+     */
+    private String cmBankAccountName;
+    /**
+     * 付第三方采美中介费
+     */
+    private Double cmShopOtherFee;
+    /**
+     * 采美中介费帐号
+     */
+    private String cmBankAccount;
+    /**
+     * 采美中介费开户行
+     */
+    private String cmBankName;
+    /**
+     * 采美中介费账户类型 0公账 1私账
+     */
+    private Integer cmType;
+    /**
+     * 中介费标记 0不申请 1申请
+     */
+    private Integer otherFeeFlag;
     /**
      * 1线下付第三方  2 线上付三方
      */
     private Integer payType;
+
     private Integer id;
     /**
      * 子订单Id
@@ -100,164 +127,4 @@ public class ChangePayShopOther implements Serializable {
     private Integer payShopId;
 
     private Integer redirectType;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public Integer getPayType() {
-        return payType;
-    }
-
-    public void setPayType(Integer payType) {
-        this.payType = payType;
-    }
-
-    public Integer getShopOrderId() {
-        return shopOrderId;
-    }
-
-    public void setShopOrderId(Integer shopOrderId) {
-        this.shopOrderId = shopOrderId;
-    }
-
-    public BigDecimal getShopOtherFee() {
-        return shopOtherFee;
-    }
-
-    public void setShopOtherFee(BigDecimal shopOtherFee) {
-        this.shopOtherFee = shopOtherFee;
-    }
-
-    public Integer getModifyUserId() {
-        return modifyUserId;
-    }
-
-    public void setModifyUserId(Integer modifyUserId) {
-        this.modifyUserId = modifyUserId;
-    }
-
-    public String getBankAccountName() {
-        return bankAccountName;
-    }
-
-    public void setBankAccountName(String bankAccountName) {
-        this.bankAccountName = bankAccountName;
-    }
-
-    public String getBankAccount() {
-        return bankAccount;
-    }
-
-    public void setBankAccount(String bankAccount) {
-        this.bankAccount = bankAccount;
-    }
-
-    public String getBankName() {
-        return bankName;
-    }
-
-    public void setBankName(String bankName) {
-        this.bankName = bankName;
-    }
-
-    public Integer getType() {
-        return type;
-    }
-
-    public void setType(Integer type) {
-        this.type = type;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    public String getRemarkImage() {
-        return remarkImage;
-    }
-
-    public void setRemarkImage(String remarkImage) {
-        this.remarkImage = remarkImage;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String[] getRemarkImages() {
-        return remarkImages;
-    }
-
-    public void setRemarkImages(String[] remarkImages) {
-        this.remarkImages = remarkImages;
-    }
-
-    public String getSystemName() {
-        return systemName;
-    }
-
-    public void setSystemName(String systemName) {
-        this.systemName = systemName;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    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 getPayShopId() {
-        return payShopId;
-    }
-
-    public void setPayShopId(Integer payShopId) {
-        this.payShopId = payShopId;
-    }
-
-    public Integer getRedirectType() {
-        return redirectType;
-    }
-
-    public void setRedirectType(Integer redirectType) {
-        this.redirectType = redirectType;
-    }
 }

+ 193 - 443
src/main/java/com/caimei/modules/order/entity/CmPayShop.java

@@ -1,6 +1,7 @@
 package com.caimei.modules.order.entity;
 
 import com.thinkgem.jeesite.common.persistence.DataEntity;
+import lombok.Data;
 import org.hibernate.validator.constraints.Length;
 
 import java.beans.Transient;
@@ -12,462 +13,211 @@ import java.util.List;
  * @author lwt
  * @version 2019-07-01
  */
+@Data
 public class CmPayShop extends DataEntity<CmPayShop> {
 
     private static final long serialVersionUID = 1L;
 
-    private String organizeID;//组织ID
-    private String shopID;        // 供应商Id
-    private String name;        // 付款单名称
-    private String shopName;        // 供应商名称
-    private String bankAccountName;        // 付款账号的户名
-    private String bankAccount;        // 付款账号
-    private String bankName;        // 付款账号的开户行
-    private String type;        //  付款账号的类型 0公账, 1私账
-    private Double totalAmount;        // 付供应商总金额
-    private Double balancePayFee;        // 余额支付
-    private Double transferPayFee;        // 转账支付
-    private String payType;        // 付款银行
-    private String bankNameType;        // 付款银行名称
-    private Double wipePayment;        // '付款抹平金额'
-    private String wipeRemarks;        // '付款抹平备注'
+    /**
+     * 付第三方采美中介费付款时间
+     */
+    private String cmOtherPayTime;
+    /**
+     * 付第三方 采美中介费付款方式(付款银行)
+     */
+    private Integer cmOtherPayType;
+    /**
+     * 付第三方采美中介费
+     */
+    private Double cmShopOtherFee;
+    /**
+     * 付第三方采美中介费申请标记 0不申请 1申请
+     */
+    private Integer otherFeeFlag;
+    /**
+     * 付第三方采美中介费开户名
+     */
+    private String cmBankAccountName;
+    /**
+     * 付第三方采美中介费付款帐号
+     */
+    private String cmBankAccount;
+    /**
+     * 付第三方采美中介费开户行
+     */
+    private String cmBankName;
+    /**
+     * 付第三方采美中介费账户类型 0公账, 1私账
+     */
+    private Integer cmType;
+    /**
+     * 组织ID
+     */
+    private String organizeID;
+    /**
+     *供应商Id
+     */
+    private String shopID;
+    /**
+     * 付款单名称
+     */
+    private String name;
+    /**
+     * 供应商名称
+     */
+    private String shopName;
+    /**
+     * 付款账号的户名
+     */
+    private String bankAccountName;
+    /**
+     * 付款账号
+     */
+    private String bankAccount;
+    /**
+     * 付款账号的开户行
+     */
+    private String bankName;
+    /**
+     * 付款账号的类型 0公账, 1私账
+     */
+    private String type;
+    /**
+     * 付供应商总金额
+     */
+    private Double totalAmount;
+    /**
+     *  余额支付
+     */
+    private Double balancePayFee;
+    /**
+     * 转账支付
+     */
+    private Double transferPayFee;
+    /**
+     * 付款银行
+     */
+    private String payType;
+    /**
+     * 付款银行名称
+     */
+    private String bankNameType;
+    /**
+     * 付款抹平金额
+     */
+    private Double wipePayment;
+    /**
+     * 付款抹平备注
+     */
+    private String wipeRemarks;
+    /**
+     *
+     */
     private String wipeRemarkImages;
-    private String wipeTime;        // 抹平申请时间
+    /**
+     * 抹平申请时间
+     */
+    private String wipeTime;
+    /**
+     *
+     */
     private List<String> wipeImages;
-    private String applicant;        // 申请人
-    private String applicantName;        // 申请人名称
-    private String applyTime;        // 申请时间
-    private String reviewer;        // 审核人
-    private String reviewerName;        // 审核人名称
-    private String reviewTime;        // 审核时间
-    private String payTime;        //付款时间
-    private String status;        // 审核状态  0待审核,  1审核通过 2 审核不通过
-    private String reason;        // 审核不通过原因
-    private Integer paymentType; //付款类型: 1子订单付款 2供应商差价 3付第三方
-    private String rebateFee; // 返佣服务费
+    /**
+     * 申请人
+     */
+    private String applicant;
+    /**
+     * 申请人名称
+     */
+    private String applicantName;
+    /**
+     * 申请时间
+     */
+    private String applyTime;
+    /**
+     * 审核人
+     */
+    private String reviewer;
+    /**
+     * 审核人名称
+     */
+    private String reviewerName;
+    /**
+     * 审核时间
+     */
+    private String reviewTime;
+    /**
+     * 付款时间
+     */
+    private String payTime;
+    /**
+     * 审核状态  0待审核,  1审核通过 2 审核不通过
+     */
+    private String status;
+    /**
+     * 审核不通过原因
+     */
+    private String reason;
+    /**
+     * 付款类型: 1子订单付款 2供应商差价 3付第三方
+     */
+    private Integer paymentType;
+    /**
+     * 返佣服务费
+     */
+    private String rebateFee;
 
     private String startTime;
     private String endTime;
     private String startTime2;
     private String endTime2;
-    private Double ableRebateAmount;//供应商可用余额
-    private Double rebateAmount;//供应商余额
-    private List<NewShopOrder> shopOrders;  //付款单关联的子订单
-    private String reApply;  // 审核不通过  重新修改发起申请
-
-    private String shopOrderNo;// 子订单编号
-
-    private String shopOrderID;  // 子订单ID
-    private String orderID;  //主订单ID
-    private String orderNo;  //订单编号
-    private String rePayment; //1可以重申,2不可以重申
-    //报表字段
-    //1建设银行7297, 2中信银行0897, 3中信银行7172, 4广发银行0115, 5广发银行5461, 6线上分账
+    /**
+     * 供应商可用余额
+     */
+    private Double ableRebateAmount;
+    /**
+     * 供应商余额
+     */
+    private Double rebateAmount;
+    /**
+     * 付款单关联的子订单
+     */
+    private List<NewShopOrder> shopOrders;
+    /**
+     * 审核不通过  重新修改发起申请
+     */
+    private String reApply;
+    /**
+     * 子订单编号
+     */
+    private String shopOrderNo;
+    /**
+     * 子订单ID
+     */
+    private String shopOrderID;
+    /**
+     * 主订单ID
+     */
+    private String orderID;
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+    /**
+     * 1可以重申,2不可以重申
+     */
+    private String rePayment;
+    /** 报表字段
+     * 1建设银行7297, 2中信银行0897, 3中信银行7172, 4广发银行0115, 5广发银行5461, 6线上分账
+     */
     private String payBank;
-    //付款类型: 1子订单付款 2供应商差价 3付第三方
+    /**
+     * 付款类型: 1子订单付款 2供应商差价 3付第三方
+     */
     private String payTypeStr;
-    //  付款账号的类型 0公账, 1私账
+    /**
+     * 付款账号的类型 0公账, 1私账
+     */
     private String typeStr;
-
     private Integer redirectType;
-
-    public String getRebateFee() {
-        return rebateFee;
-    }
-
-    public void setRebateFee(String rebateFee) {
-        this.rebateFee = rebateFee;
-    }
-
-    public String getPayBank() {
-        return payBank;
-    }
-
-    public void setPayBank(String payBank) {
-        this.payBank = payBank;
-    }
-
-    public String getPayTypeStr() {
-        return payTypeStr;
-    }
-
-    public void setPayTypeStr(String payTypeStr) {
-        this.payTypeStr = payTypeStr;
-    }
-
-    public String getBankNameType() {
-        return bankNameType;
-    }
-
-    public void setBankNameType(String bankNameType) {
-        this.bankNameType = bankNameType;
-    }
-
-    public String getTypeStr() {
-        return typeStr;
-    }
-
-    public void setTypeStr(String typeStr) {
-        this.typeStr = typeStr;
-    }
-
-    public String getStartTime2() {
-        return startTime2;
-    }
-
-    public void setStartTime2(String startTime2) {
-        this.startTime2 = startTime2;
-    }
-
-    public String getEndTime2() {
-        return endTime2;
-    }
-
-    public void setEndTime2(String endTime2) {
-        this.endTime2 = endTime2;
-    }
-
-    public Double getWipePayment() {
-        return wipePayment;
-    }
-
-    public void setWipePayment(Double wipePayment) {
-        this.wipePayment = wipePayment;
-    }
-
-    public String getWipeRemarks() {
-        return wipeRemarks;
-    }
-
-    public void setWipeRemarks(String wipeRemarks) {
-        this.wipeRemarks = wipeRemarks;
-    }
-
-    public String getWipeRemarkImages() {
-        return wipeRemarkImages;
-    }
-
-    public void setWipeRemarkImages(String wipeRemarkImages) {
-        this.wipeRemarkImages = wipeRemarkImages;
-    }
-
-    @Length(min = 0, max = 19, message = "抹平时间长度必须介于 0 和 19 之间")
-    public String getWipeTime() {
-        return wipeTime;
-    }
-
-    public void setWipeTime(String wipeTime) {
-        this.wipeTime = wipeTime;
-    }
-
-    public List<String> getWipeImages() {
-        return wipeImages;
-    }
-
-    public void setWipeImages(List<String> wipeImages) {
-        this.wipeImages = wipeImages;
-    }
-
-    public CmPayShop() {
-        super();
-    }
-
-    public CmPayShop(String id) {
-        super(id);
-    }
-
-    @Length(min = 0, max = 11, message = "供应商Id长度必须介于 0 和 11 之间")
-    public String getShopID() {
-        return shopID;
-    }
-
-    public void setShopID(String shopID) {
-        this.shopID = shopID;
-    }
-
-    @Length(min = 0, max = 250, message = "付款单名称长度必须介于 0 和 250 之间")
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Length(min = 0, max = 20, message = "供应商名称长度必须介于 0 和 20 之间")
-    public String getShopName() {
-        return shopName;
-    }
-
-    public void setShopName(String shopName) {
-        this.shopName = shopName;
-    }
-
-    @Length(min = 0, max = 30, message = "付款账号的户名长度必须介于 0 和 30 之间")
-    public String getBankAccountName() {
-        return bankAccountName;
-    }
-
-    public void setBankAccountName(String bankAccountName) {
-        this.bankAccountName = bankAccountName;
-    }
-
-    @Length(min = 0, max = 30, message = "付款账号长度必须介于 0 和 30 之间")
-    public String getBankAccount() {
-        return bankAccount;
-    }
-
-    public void setBankAccount(String bankAccount) {
-        this.bankAccount = bankAccount;
-    }
-
-    @Length(min = 0, max = 19, message = "付款账号的开户行长度必须介于 0 和 19 之间")
-    public String getBankName() {
-        return bankName;
-    }
-
-    public void setBankName(String bankName) {
-        this.bankName = bankName;
-    }
-
-    @Length(min = 0, max = 1, message = " 付款账号的类型 0公账, 1私账长度必须介于 0 和 1 之间")
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public Double getTotalAmount() {
-        return totalAmount;
-    }
-
-    public void setTotalAmount(Double totalAmount) {
-        this.totalAmount = totalAmount;
-    }
-
-    public Double getBalancePayFee() {
-        return balancePayFee;
-    }
-
-    public void setBalancePayFee(Double balancePayFee) {
-        this.balancePayFee = balancePayFee;
-    }
-
-    public Double getTransferPayFee() {
-        return transferPayFee;
-    }
-
-    public void setTransferPayFee(Double TransferPayFee) {
-        this.transferPayFee = TransferPayFee;
-    }
-
-    @Length(min = 0, max = 20, message = "付款银行长度必须介于 0 和 20 之间")
-    public String getPayType() {
-        return payType;
-    }
-
-    public void setPayType(String bankNo) {
-        this.payType = bankNo;
-    }
-
-    @Length(min = 0, max = 11, message = "申请人长度必须介于 0 和 11 之间")
-    public String getApplicant() {
-        return applicant;
-    }
-
-    public void setApplicant(String applicant) {
-        this.applicant = applicant;
-    }
-
-    @Length(min = 0, max = 19, message = "申请时间长度必须介于 0 和 19 之间")
-    public String getApplyTime() {
-        return applyTime;
-    }
-
-    public void setApplyTime(String applyTime) {
-        this.applyTime = applyTime;
-    }
-
-    @Length(min = 0, max = 11, message = "审核人长度必须介于 0 和 11 之间")
-    public String getReviewer() {
-        return reviewer;
-    }
-
-    public void setReviewer(String reviewer) {
-        this.reviewer = reviewer;
-    }
-
-    @Length(min = 0, max = 19, message = "审核时间长度必须介于 0 和 19 之间")
-    public String getReviewTime() {
-        return reviewTime;
-    }
-
-    public void setReviewTime(String reviewTime) {
-        this.reviewTime = reviewTime;
-    }
-
-    @Length(min = 0, max = 1, message = "审核状态  0待审核,  1审核通过长度必须介于 0 和 1 之间")
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    @Length(min = 0, max = 20, message = "审核不通过原因长度必须介于 0 和 20 之间")
-    public String getReason() {
-        return reason;
-    }
-
-    public void setReason(String reason) {
-        this.reason = reason;
-    }
-
-    @Transient
-    public List<NewShopOrder> getShopOrders() {
-        return shopOrders;
-    }
-
-    public void setShopOrders(List<NewShopOrder> shopOrders) {
-        this.shopOrders = shopOrders;
-    }
-
-    @Transient
-    public String getApplicantName() {
-        return applicantName;
-    }
-
-    public void setApplicantName(String applicantName) {
-        this.applicantName = applicantName;
-    }
-
-    @Transient
-    public String getReviewerName() {
-        return reviewerName;
-    }
-
-    public void setReviewerName(String reviewerName) {
-        this.reviewerName = reviewerName;
-    }
-
-    @Transient
-    public String getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(String startTime) {
-        this.startTime = startTime;
-    }
-
-    @Transient
-    public String getEndTime() {
-        return endTime;
-    }
-
-    public void setEndTime(String endTime) {
-        this.endTime = endTime;
-    }
-
-    @Transient
-    public Double getAbleRebateAmount() {
-        return ableRebateAmount;
-    }
-
-    public void setAbleRebateAmount(Double ableRebateAmount) {
-        this.ableRebateAmount = ableRebateAmount;
-    }
-
-    @Transient
-    public Double getRebateAmount() {
-        return rebateAmount;
-    }
-
-    public void setRebateAmount(Double rebateAmount) {
-        this.rebateAmount = rebateAmount;
-    }
-
-    @Transient
-    public String getReApply() {
-        return reApply;
-    }
-
-    public void setReApply(String reApply) {
-        this.reApply = reApply;
-    }
-
-    @Transient
-    public String getShopOrderNo() {
-        return shopOrderNo;
-    }
-
-    public void setShopOrderNo(String shopOrderNo) {
-        this.shopOrderNo = shopOrderNo;
-    }
-
-    public String getShopOrderID() {
-        return shopOrderID;
-    }
-
-    public void setShopOrderID(String shopOrderID) {
-        this.shopOrderID = shopOrderID;
-    }
-
-    public String getOrderID() {
-        return orderID;
-    }
-
-    public void setOrderID(String orderID) {
-        this.orderID = orderID;
-    }
-
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
-    }
-
-    public String getRePayment() {
-        return rePayment;
-    }
-
-    public void setRePayment(String rePayment) {
-        this.rePayment = rePayment;
-    }
-
-    public String getPayTime() {
-        return payTime;
-    }
-
-    public void setPayTime(String payTime) {
-        this.payTime = payTime;
-    }
-
-    public String getOrganizeID() {
-        return organizeID;
-    }
-
-    public void setOrganizeID(String organizeID) {
-        this.organizeID = organizeID;
-    }
-
-    public Integer getPaymentType() {
-        return paymentType;
-    }
-
-    public void setPaymentType(Integer paymentType) {
-        this.paymentType = paymentType;
-    }
-
-    public Integer getRedirectType() {
-        return redirectType;
-    }
-
-    public void setRedirectType(Integer redirectType) {
-        this.redirectType = redirectType;
-    }
 }

+ 54 - 127
src/main/java/com/caimei/modules/order/entity/CmPayShopRecord.java

@@ -1,139 +1,66 @@
 package com.caimei.modules.order.entity;
 
 import com.thinkgem.jeesite.common.persistence.DataEntity;
+import lombok.Data;
 import org.hibernate.validator.constraints.Length;
 
 /**
  * 付款记录表Entity
- *
- * @author lwt
- * @version 2019-07-01
  */
+@Data
 public class CmPayShopRecord extends DataEntity<CmPayShopRecord> {
 
     private static final long serialVersionUID = 1L;
-    private String shopID;        // 供应商Id
-    private String shopOrderID;        // 子订单ID
-    private String shopOrderNo;        // 授权人手机号
-    private Double payAmount;        // 付款金额
-    private Double wipePayment;        // '付款抹平金额'
-    private Integer paymentType;    //付款类型: 1子订单付款 2供应商差价 3付第三方
-    private String payType;        // 付款方式
-    private String payTime;        // 付款时间
-    private String wipeTime;        // 抹平申请时间
-    private String payShopID;        // 付款单表id
-    private String status;        // 0待审核, 1已审核
-    private String bankNameType;     // 银行账户
-
-    public CmPayShopRecord() {
-        super();
-    }
-
-    public CmPayShopRecord(String id) {
-        super(id);
-    }
-
-    @Length(min = 0, max = 11, message = "供应商Id长度必须介于 0 和 11 之间")
-    public String getShopID() {
-        return shopID;
-    }
-
-    public void setShopID(String shopID) {
-        this.shopID = shopID;
-    }
-
-    @Length(min = 0, max = 11, message = "子订单ID长度必须介于 0 和 11 之间")
-    public String getShopOrderID() {
-        return shopOrderID;
-    }
-
-    public void setShopOrderID(String shopOrderID) {
-        this.shopOrderID = shopOrderID;
-    }
-
-    @Length(min = 0, max = 30, message = "授权人手机号长度必须介于 0 和 30 之间")
-    public String getShopOrderNo() {
-        return shopOrderNo;
-    }
-
-    public void setShopOrderNo(String shopOrderNo) {
-        this.shopOrderNo = shopOrderNo;
-    }
-
-    public Double getPayAmount() {
-        return payAmount;
-    }
-
-    public void setPayAmount(Double payAmount) {
-        this.payAmount = payAmount;
-    }
-
-    public Double getWipePayment() {
-        return wipePayment;
-    }
-
-    public void setWipePayment(Double wipePayment) {
-        this.wipePayment = wipePayment;
-    }
-
-    @Length(min = 0, max = 1, message = "付款方式长度必须介于 0 和 1 之间")
-    public String getPayType() {
-        return payType;
-    }
-
-    public void setPayType(String payType) {
-        this.payType = payType;
-    }
-
-    @Length(min = 0, max = 19, message = "付款时间长度必须介于 0 和 19 之间")
-    public String getPayTime() {
-        return payTime;
-    }
-
-    public void setPayTime(String payTime) {
-        this.payTime = payTime;
-    }
-
-    @Length(min = 0, max = 19, message = "抹平时间长度必须介于 0 和 19 之间")
-    public String getWipeTime() {
-        return wipeTime;
-    }
-
-    public void setWipeTime(String wipeTime) {
-        this.wipeTime = wipeTime;
-    }
-
-    @Length(min = 0, max = 11, message = "付款单表id长度必须介于 0 和 11 之间")
-    public String getPayShopID() {
-        return payShopID;
-    }
-
-    public void setPayShopID(String payShopID) {
-        this.payShopID = payShopID;
-    }
-
-    @Length(min = 0, max = 1, message = "0待审核, 1已审核长度必须介于 0 和 1 之间")
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public Integer getPaymentType() {
-        return paymentType;
-    }
-
-    public void setPaymentType(Integer paymentType) {
-        this.paymentType = paymentType;
-    }
-
-    public String getBankNameType() {
-        return bankNameType;
-    }
-
-    public void setBankNameType(String bankName) {
-        this.bankNameType = bankName;
-    }
+    /**
+     * 供应商Id
+     */
+    private String shopID;
+    /**
+     * 子订单ID
+     */
+    private String shopOrderID;
+    /**
+     * 授权人手机号
+     */
+    private String shopOrderNo;
+    /**
+     * 付采美金额 (付第三方采美中介费)
+     */
+    private Double payCmAmount;
+    /**
+     * 付款金额
+     */
+    private Double payAmount;
+    /**
+     * 付款抹平金额
+     */
+    private Double wipePayment;
+    /**
+     * 付款类型: 1子订单付款 2供应商差价 3付第三方
+     */
+    private Integer paymentType;
+    /**
+     * 付款方式
+     */
+    private String payType;
+    /**
+     * 付款时间
+     */
+    private String payTime;
+    /**
+     * 抹平申请时间
+     */
+    private String wipeTime;
+    /**
+     * 付款单表id
+     */
+    private String payShopID;
+    /**
+     * 0待审核, 1已审核
+     */
+    private String status;
+    /**
+     * 银行账户
+     */
+    private String bankNameType;
 }

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

@@ -18,6 +18,19 @@ import java.util.List;
 @Data
 public class NewShopOrder extends DataEntity<NewShopOrder> {
 
+    /**
+     * 线下账户类型 0公账 1私账
+     */
+    private Integer cmAccountType;
+
+    /**
+     * 付第三方采美中介费
+     */
+    private Double cmShopOtherFee;
+    /**
+     *  供应商运费
+     */
+    private Double supplierFreight;
     private OrderUserInfo bpOrderUserinfo;
     private String closeReason;
     private Integer orderSeen;

+ 19 - 0
src/main/java/com/caimei/modules/order/entity/OtherFeeDto.java

@@ -0,0 +1,19 @@
+package com.caimei.modules.order.entity;
+
+import lombok.Data;
+
+@Data
+public class OtherFeeDto {
+    /**
+     * 采美自营利润(既采美中介费)
+     */
+    private Double cmProfit;
+    /**
+     * 子订单可用线上支付渠道1微信2支付宝3个人网银4企业网银
+     */
+    private String onlinePayWays;
+    /**
+     * 线下账户类型 0公账 1私账(线下子订单私账/公账类型)
+     */
+    private Integer cmAccountType;
+}

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

@@ -296,7 +296,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                         p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
                     }*/
                     // 付采美总金额
-                    allServeAmount = MathUtil.add(allServeAmount, MathUtil.mul(MathUtil.sub(p.getNum(),p.getReturnedNum()), p.getCmCostPrice())).doubleValue();
+                    allServeAmount = MathUtil.add(allServeAmount, MathUtil.mul(MathUtil.sub(p.getNum(), p.getReturnedNum()), p.getCmCostPrice())).doubleValue();
                     // 子订单利润
                     if (p.getReturnedNum().equals(p.getNum())) {
                         brokerage = MathUtil.add(brokerage, 0).doubleValue();
@@ -788,6 +788,8 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                     logger.info("check ----> 付款金额异常, 付款金额大于待付款金额");
                     throw new Exception("付款金额异常, 付款金额大于待付款金额");
                 }
+                double v = null == cmPayShop.getCmShopOtherFee() ? 0 : cmPayShop.getCmShopOtherFee();
+                shopOrder.setCmShopOtherFee(v);
                 shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() == null ? 0D : MathUtil.add(shopOrder.getPayedShopAmount(), MathUtil.sub(record.getPayAmount(), shopOrder.getShopOtherFee())).doubleValue());
                 shopOrder.setPaying("0"); //退出付款进行状态
                 newShopOrderDao.update(shopOrder);
@@ -805,9 +807,11 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                     }
                 }
                 if (f) //所有的子订单都是全部付款
+                {
                     newOrderDao.updatePayStatus("3", shopOrder.getOrderID());
-                else
+                } else {
                     newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
+                }
             }
             cmPayShop.setReviewer(currentUser.getId());
             cmPayShop.setReviewTime(DateUtils.getDateTime());
@@ -1090,6 +1094,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             payShop.setBankName(payShopOther.getBankName());
             payShop.setType(payShopOther.getType().toString());
         }
+        payShop.setOtherFeeFlag(payShopOther.getOtherFeeFlag());
         payShop.setTotalAmount(payShopOther.getShopOtherFee().doubleValue());
         payShop.setBalancePayFee(0d);
         payShop.setTransferPayFee(payShopOther.getShopOtherFee().doubleValue());
@@ -1110,6 +1115,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         payShopRecord.setShopOrderID(payShopOther.getShopOrderId().toString());
         payShopRecord.setShopOrderNo(shopOrder.getOrderNo());
         payShopRecord.setPayAmount(payShopOther.getShopOtherFee().doubleValue());
+        payShopRecord.setPayCmAmount(payShopOther.getCmShopOtherFee());
         payShopRecord.setWipePayment(0d);
         payShopRecord.setPaymentType(3);
         payShopRecord.setPayShopID(payShop.getId());
@@ -1309,6 +1315,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 payShopOther.setOrderId(shopOrder.getOrderID());
                 payShopOther.setOrderNo(shopOrder.getOrderNo());
                 payShopOther.setShopOrderNo(shopOrder.getShopOrderNo());
+                payShopOther.setShopOrderId(shopOrderId);
             }
         }
         payShopOther.setPayShopId(payShopId);

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

@@ -2956,4 +2956,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         }
     }
 
+    public OtherFeeDto getOtherFeeDto(Integer shopOrderId) {
+        return newShopOrderDao.findCmProfit(shopOrderId);
+    }
 }

+ 142 - 135
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -325,70 +325,70 @@ public class CmPayShopController extends BaseController {
         //子订单的成本方式第一次填写以后就不能修改了
         // 固定成本
         //if ("1".equals(costType)) {
-            // List<CmReturnedPurchaseProduct> rL = cmReturnedPurchaseProductService.findReturnedByShopOrderID(Integer.parseInt(shopOrderID));
-            for (NewOrderProduct product : newOrderProducts) {
-                Integer orderProductID = product.getOrderProductID();
-                Double costPrice = product.getCostPrice() == null ? 0d : product.getCostPrice();
-                Double organizeCostPrice = product.getOrganizeCostPrice() == null ? 0d : product.getOrganizeCostPrice();
-                Double cmCostPrice = product.getCmCostPrice() == null ? 0d : product.getCmCostPrice();
-                if (soZeroCostFlag && costPrice > 0) {
-                    soZeroCostFlag = false;
-                }
-                // 在订单商品含税的情况下, 成本计算税费
-                if ("0".equals(product.getIncludedTax()) && null != product.getSupplierTaxRate() && product.getSupplierTaxRate() > 0d) {
-                    costPrice = MathUtil.add(costPrice, MathUtil.div(MathUtil.mul(costPrice, product.getSupplierTaxRate()), 100)).doubleValue();
-                }
-                // product.setSingleShouldPayTotalTax(MathUtil.div(MathUtil.mul(MathUtil.div(product.getCostPrice(), MathUtil.div(MathUtil.add(product.getTaxRate(), 100),100)), product.getSupplierTaxRate()), 100).doubleValue());
-                Double singleShouldPayTotalTax = product.getSingleShouldPayTotalTax() == null ? 0d : product.getSingleShouldPayTotalTax();
-                Double supplierTaxRate = product.getSupplierTaxRate() == null ? 0d : product.getSupplierTaxRate();
-                // 获取已被退款的商品数量
-                Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(Integer.parseInt(shopOrderID), orderProductID);
-                returnNum = returnNum == null ? 0 : returnNum;
-                NewOrderProduct orderProduct = newOrderProductService.get(String.valueOf(orderProductID));
-                // 修改前
-                if (StringUtils.isEmpty(dbcostType)) {
-                    CmChangePayShopProduct cmChangePayShopProduct = new CmChangePayShopProduct();
-                    cmChangePayShopProduct.setRecondType("1");
-                    cmChangePayShopProduct.setChangeType("1");
-                    cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId));
-                    cmChangePayShopProduct.setOrderProductId(orderProductID);
-                    cmChangePayShopProduct.setOrderProductName(product.getName());
-                    // 同步使用机构税率 作为供应商税率
-                    cmChangePayShopProduct.setSupplierTaxRate(product.getTaxRate());
-                    cmChangePayShopProduct.setCostPrice(orderProduct.getNewCostPrice());
-                    cmChangePayShopProduct.setSingleShouldPayTotalTax(orderProduct.getSingleShouldPayTotalTax());
-                    cmChangePayShopProductService.save(cmChangePayShopProduct);
-                }
-
-                orderProduct.setCostPrice(costPrice);
-                orderProduct.setOrganizeCostPrice(organizeCostPrice);
-                orderProduct.setCmCostPrice(cmCostPrice);
-                // 同步使用机构税率 作为供应商税率
-                orderProduct.setSupplierTaxRate(supplierTaxRate);
-                orderProduct.setTaxRate(product.getTaxRate());
-                orderProduct.setSingleShouldPayTotalTax(singleShouldPayTotalTax);
-                orderProducts.add(orderProduct);
-                int num = orderProduct.getNum() == null ? 0 : orderProduct.getNum();
-                int presentNum = orderProduct.getPresentNum() == null ? 0 : orderProduct.getPresentNum();
-                totalCostFee += (num + presentNum - returnNum) * costPrice;
-                orderProduct.setShouldPayTotalTax(singleShouldPayTotalTax * (num + presentNum - returnNum));
-                totalTaxesFee += singleShouldPayTotalTax * (num + presentNum - returnNum);
-                // 修改后
+        // List<CmReturnedPurchaseProduct> rL = cmReturnedPurchaseProductService.findReturnedByShopOrderID(Integer.parseInt(shopOrderID));
+        for (NewOrderProduct product : newOrderProducts) {
+            Integer orderProductID = product.getOrderProductID();
+            Double costPrice = product.getCostPrice() == null ? 0d : product.getCostPrice();
+            Double organizeCostPrice = product.getOrganizeCostPrice() == null ? 0d : product.getOrganizeCostPrice();
+            Double cmCostPrice = product.getCmCostPrice() == null ? 0d : product.getCmCostPrice();
+            if (soZeroCostFlag && costPrice > 0) {
+                soZeroCostFlag = false;
+            }
+            // 在订单商品含税的情况下, 成本计算税费
+            if ("0".equals(product.getIncludedTax()) && null != product.getSupplierTaxRate() && product.getSupplierTaxRate() > 0d) {
+                costPrice = MathUtil.add(costPrice, MathUtil.div(MathUtil.mul(costPrice, product.getSupplierTaxRate()), 100)).doubleValue();
+            }
+            // product.setSingleShouldPayTotalTax(MathUtil.div(MathUtil.mul(MathUtil.div(product.getCostPrice(), MathUtil.div(MathUtil.add(product.getTaxRate(), 100),100)), product.getSupplierTaxRate()), 100).doubleValue());
+            Double singleShouldPayTotalTax = product.getSingleShouldPayTotalTax() == null ? 0d : product.getSingleShouldPayTotalTax();
+            Double supplierTaxRate = product.getSupplierTaxRate() == null ? 0d : product.getSupplierTaxRate();
+            // 获取已被退款的商品数量
+            Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(Integer.parseInt(shopOrderID), orderProductID);
+            returnNum = returnNum == null ? 0 : returnNum;
+            NewOrderProduct orderProduct = newOrderProductService.get(String.valueOf(orderProductID));
+            // 修改前
+            if (StringUtils.isEmpty(dbcostType)) {
                 CmChangePayShopProduct cmChangePayShopProduct = new CmChangePayShopProduct();
-                cmChangePayShopProduct.setRecondType("2");
-                cmChangePayShopProduct.setChangeType(costType);
-                cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId2));
+                cmChangePayShopProduct.setRecondType("1");
+                cmChangePayShopProduct.setChangeType("1");
+                cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId));
                 cmChangePayShopProduct.setOrderProductId(orderProductID);
                 cmChangePayShopProduct.setOrderProductName(product.getName());
-                cmChangePayShopProduct.setSupplierTaxRate(supplierTaxRate);
-                cmChangePayShopProduct.setCostPrice(product.getCostPrice());
-                cmChangePayShopProduct.setSingleShouldPayTotalTax(product.getSingleShouldPayTotalTax());
+                // 同步使用机构税率 作为供应商税率
+                cmChangePayShopProduct.setSupplierTaxRate(product.getTaxRate());
+                cmChangePayShopProduct.setCostPrice(orderProduct.getNewCostPrice());
+                cmChangePayShopProduct.setSingleShouldPayTotalTax(orderProduct.getSingleShouldPayTotalTax());
                 cmChangePayShopProductService.save(cmChangePayShopProduct);
             }
-            //总税费
-            shopOrder.setShopTaxFee(totalTaxesFee);
-            //商品费
-            shopOrder.setShopProductAmount(totalCostFee);
+
+            orderProduct.setCostPrice(costPrice);
+            orderProduct.setOrganizeCostPrice(organizeCostPrice);
+            orderProduct.setCmCostPrice(cmCostPrice);
+            // 同步使用机构税率 作为供应商税率
+            orderProduct.setSupplierTaxRate(supplierTaxRate);
+            orderProduct.setTaxRate(product.getTaxRate());
+            orderProduct.setSingleShouldPayTotalTax(singleShouldPayTotalTax);
+            orderProducts.add(orderProduct);
+            int num = orderProduct.getNum() == null ? 0 : orderProduct.getNum();
+            int presentNum = orderProduct.getPresentNum() == null ? 0 : orderProduct.getPresentNum();
+            totalCostFee += (num + presentNum - returnNum) * costPrice;
+            orderProduct.setShouldPayTotalTax(singleShouldPayTotalTax * (num + presentNum - returnNum));
+            totalTaxesFee += singleShouldPayTotalTax * (num + presentNum - returnNum);
+            // 修改后
+            CmChangePayShopProduct cmChangePayShopProduct = new CmChangePayShopProduct();
+            cmChangePayShopProduct.setRecondType("2");
+            cmChangePayShopProduct.setChangeType(costType);
+            cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId2));
+            cmChangePayShopProduct.setOrderProductId(orderProductID);
+            cmChangePayShopProduct.setOrderProductName(product.getName());
+            cmChangePayShopProduct.setSupplierTaxRate(supplierTaxRate);
+            cmChangePayShopProduct.setCostPrice(product.getCostPrice());
+            cmChangePayShopProduct.setSingleShouldPayTotalTax(product.getSingleShouldPayTotalTax());
+            cmChangePayShopProductService.save(cmChangePayShopProduct);
+        }
+        //总税费
+        shopOrder.setShopTaxFee(totalTaxesFee);
+        //商品费
+        shopOrder.setShopProductAmount(totalCostFee);
         //}
         // 比例成本
         /*if ("2".equals(costType)) {
@@ -482,40 +482,40 @@ public class CmPayShopController extends BaseController {
         }*/
         shopOrder.setPayStatus(soZeroCostFlag ? "3" : "1");
         shopOrder.setZeroCostFlag(soZeroCostFlag ? 1 : 0);
-        //当子订单0成本时,若主订单中其他子订单(除了运费子订单)都为0成本,设主订单为已付款,否则设为部分付款
-        NewOrder newOrder = newOrderService.get(shopOrder.getOrderID().toString());
-        if (soZeroCostFlag) {
-            AtomicReference<Boolean> zeroCostFlag = new AtomicReference<>(true);
-            AtomicReference<Boolean> freightFlag = new AtomicReference<>(false);
-            newOrder.getNewShopOrders().forEach(item -> {
-                if (item.getShopID().equals(998)) {
-                    freightFlag.set(true);
-                } else if (!item.getShopOrderID().equals(shopOrder.getShopOrderID()) && 0 == item.getZeroCostFlag()) {
-                    zeroCostFlag.set(false);
-                }
-            });
-            //如果含有运费子订单且其他子订单都为0成本,将运费子订单置为已付款
-            if (freightFlag.get() && zeroCostFlag.get()) {
-                newOrder.getNewShopOrders().forEach(item -> {
-                    if (item.getShopID().equals(998)) {
-                        item.setPayStatus("3");
-                        //更新运费子订单
-                        newShopOrderService.updatePayStatus(item);
-                        cmPayShopService.payFreightShopOrder(item);
-
-                    }
-                });
-            }
-            if (zeroCostFlag.get()) {
-                newOrder.setPayStatus("3");
-                newOrder.setZeroCostFlag(1);
-            } else {
-                newOrder.setPayStatus("2");
-                newOrder.setZeroCostFlag(0);
-            }
-            newOrderService.updatePayStatus(newOrder);
-        }
-        shopOrder.setShopPostFee(freight); //运费
+//        //当子订单0成本时,若主订单中其他子订单(除了运费子订单)都为0成本,设主订单为已付款,否则设为部分付款
+//        NewOrder newOrder = newOrderService.get(shopOrder.getOrderID().toString());
+//        if (soZeroCostFlag) {
+//            AtomicReference<Boolean> zeroCostFlag = new AtomicReference<>(true);
+//            AtomicReference<Boolean> freightFlag = new AtomicReference<>(false);
+//            newOrder.getNewShopOrders().forEach(item -> {
+//                if (item.getShopID().equals(998)) {
+//                    freightFlag.set(true);
+//                } else if (!item.getShopOrderID().equals(shopOrder.getShopOrderID()) && 0 == item.getZeroCostFlag()) {
+//                    zeroCostFlag.set(false);
+//                }
+//            });
+//            //如果含有运费子订单且其他子订单都为0成本,将运费子订单置为已付款
+//            if (freightFlag.get() && zeroCostFlag.get()) {
+//                newOrder.getNewShopOrders().forEach(item -> {
+//                    if (item.getShopID().equals(998)) {
+//                        item.setPayStatus("3");
+//                        //更新运费子订单
+//                        newShopOrderService.updatePayStatus(item);
+//                        cmPayShopService.payFreightShopOrder(item);
+//
+//                    }
+//                });
+//            }
+//            if (zeroCostFlag.get()) {
+//                newOrder.setPayStatus("3");
+//                newOrder.setZeroCostFlag(1);
+//            } else {
+//                newOrder.setPayStatus("2");
+//                newOrder.setZeroCostFlag(0);
+//            }
+//            newOrderService.updatePayStatus(newOrder);
+//        }
+        shopOrder.setSupplierFreight(freight); //运费
         shopOrder.setShopOtherFee(thirdPartyFee); //付第三方
         shopOrder.setCostType(costType);
         shopOrder.setModifyShouldPayNote(modifyShouldPayNote);  //备注
@@ -526,7 +526,7 @@ public class CmPayShopController extends BaseController {
             shopOrder.setPayStatus("3");
         }
         // 付供应商 - 优惠券 - 促销满减优惠
-        shopOrder.setShouldPayShopAmount(MathUtil.sub(shouldPayShopAmount , MathUtil.add(shopOrder.getCouponAmount(), shopOrder.getPromotionFullReduction())).doubleValue());
+        shopOrder.setShouldPayShopAmount(MathUtil.sub(shouldPayShopAmount, MathUtil.add(shopOrder.getCouponAmount(), shopOrder.getPromotionFullReduction())).doubleValue());
         newShopOrderService.modifyPayShopAmount(shopOrder, orderProducts);
         return "redirect:" + Global.getAdminPath() + "/shopOrder/payOrderList";
     }
@@ -633,22 +633,32 @@ public class CmPayShopController extends BaseController {
                     orderProduct.setShouldPayTotalTax(singleShouldPayTotalTax * (num + presentNum - returnNum));
                     totalTaxesFee += singleShouldPayTotalTax * (num + presentNum - returnNum);
                 }
-                shopOrder.setShopTaxFee(totalTaxesFee); //总税费
-                shopOrder.setShopProductAmount(totalCostFee); //商品费
+                //总税费
+                shopOrder.setShopTaxFee(totalTaxesFee);
+                //商品费
+                shopOrder.setShopProductAmount(totalCostFee);
             }
             // 比列成本
             if ("2".equals(costType)) {
                 shopOrder.setProportional(proportional);
-                shopOrder.setShopTaxFee(0D); //总税费
-                Double productAmount = shopOrder.getProductAmount();//子订单金额
-                shopOrder.setShopProductAmount(productAmount * proportional / 100); //商品费
+                //总税费
+                shopOrder.setShopTaxFee(0D);
+                //子订单金额
+                Double productAmount = shopOrder.getProductAmount();
+                //商品费
+                shopOrder.setShopProductAmount(productAmount * proportional / 100);
             }
-            shopOrder.setShopPostFee(freight); //运费
-            shopOrder.setShopOtherFee(thirdPartyFee); //付第三方
+            //运费
+            shopOrder.setShopPostFee(freight);
+            //付第三方
+            shopOrder.setShopOtherFee(thirdPartyFee);
             shopOrder.setCostType(costType);
-            shopOrder.setModifyShouldPayNote(modifyShouldPayNote);  //备注
-            shopOrder.setModifyShouldPayUserID(UserUtils.getUser().getId());  //修改人的用户id
-            shopOrder.setModifyShouldPayDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));  //修改时间
+            //备注
+            shopOrder.setModifyShouldPayNote(modifyShouldPayNote);
+            //修改人的用户id
+            shopOrder.setModifyShouldPayUserID(UserUtils.getUser().getId());
+            //修改时间
+            shopOrder.setModifyShouldPayDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
 
             double shouldPayShopAmount = shopOrder.getShopProductAmount() + shopOrder.getShopPostFee() + shopOrder.getShopTaxFee();
             if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount < shopOrder.getPayedShopAmount()) {
@@ -656,8 +666,9 @@ public class CmPayShopController extends BaseController {
                 res.put("msg", "付供应商的金额不能小于已付款金额");
                 return res;
             } else {
-                if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount())
+                if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount()) {
                     shopOrder.setPayStatus("3");
+                }
                 shopOrder.setShouldPayShopAmount(shouldPayShopAmount);
             }
             newShopOrderService.modifyPayShopAmount(shopOrder, orderProducts);
@@ -681,7 +692,7 @@ public class CmPayShopController extends BaseController {
         int weekIdx = instance.get(Calendar.DAY_OF_WEEK) - 1;
         String format = new SimpleDateFormat("HH:mm:ss").format(new Date());
         Integer substring = Integer.valueOf(format.substring(0, 2));
-        ids.forEach(i->{
+        ids.forEach(i -> {
             //当前时间周五下午到周日都返回1不能结算,其他时间看够不够24小时
             if ((5 == weekIdx && substring > 14) || 6 == weekIdx || 7 == weekIdx) {
                 flag.set(1);
@@ -747,16 +758,13 @@ public class CmPayShopController extends BaseController {
     @RequiresPermissions("order:cmPayShop:edit")
     @RequestMapping("applyCompile")
     public String applyCompile(CmPayShop cmPayShop, Model model) {
-        try {
-            cmPayShopService.applyDetail(cmPayShop);
-            // 获取线下收款账号下拉列表
-            List<CmOfflineCollection> offlineCollections = cmOfflineCollectionService.downListData();
-            model.addAttribute("offlineCollections", offlineCollections);
-            model.addAttribute("cmPayShop", cmPayShop);
-        } catch (Exception e) {
-            logger.info(e.getMessage());
-            e.printStackTrace();
-        }
+        cmPayShopService.applyDetail(cmPayShop);
+        // 获取线下收款账号下拉列表
+        List<CmOfflineCollection> offlineCollections = cmOfflineCollectionService.downListData();
+        model.addAttribute("offlineCollections", offlineCollections);
+        model.addAttribute("cmPayShop", cmPayShop);
+        OtherFeeDto otherFeeDto = newOrderService.getOtherFeeDto(cmPayShop.getShopOrders().get(0).getShopOrderID());
+        model.addAttribute("otherFee", otherFeeDto);
         if (3 == cmPayShop.getPaymentType()) {
             return "modules/order/cmPayShopOtherEdit";
         }
@@ -786,13 +794,8 @@ public class CmPayShopController extends BaseController {
     @RequiresPermissions("order:cmPayShop:detail")
     @RequestMapping("applyDetail")
     public String applyDetail(CmPayShop cmPayShop, Model model) {
-        try {
-            cmPayShopService.applyDetail(cmPayShop);
-            model.addAttribute("cmPayShop", cmPayShop);
-        } catch (Exception e) {
-            logger.info(e.getMessage());
-            e.printStackTrace();
-        }
+        cmPayShopService.applyDetail(cmPayShop);
+        model.addAttribute("cmPayShop", cmPayShop);
         if (3 == cmPayShop.getPaymentType()) {
             return "modules/order/cmPayShopOtherPrintDetail";
         }
@@ -832,16 +835,11 @@ public class CmPayShopController extends BaseController {
     @RequiresPermissions("order:cmPayShop:check")
     @RequestMapping("toCheck")
     public String toCheck(CmPayShop cmPayShop, Model model) {
-        try {
-            cmPayShopService.applyDetail(cmPayShop);
-            // 获取线下收款账号下拉列表
-            List<CmOfflineCollection> offlineCollections = cmOfflineCollectionService.downListData();
-            model.addAttribute("offlineCollections", offlineCollections);
-            model.addAttribute("cmPayShop", cmPayShop);
-        } catch (Exception e) {
-            logger.info(e.getMessage());
-            e.printStackTrace();
-        }
+        cmPayShopService.applyDetail(cmPayShop);
+        // 获取线下收款账号下拉列表
+        List<CmOfflineCollection> offlineCollections = cmOfflineCollectionService.downListData();
+        model.addAttribute("offlineCollections", offlineCollections);
+        model.addAttribute("cmPayShop", cmPayShop);
         if (3 == cmPayShop.getPaymentType()) {
             return "modules/order/cmPayShopOtherCheck";
         }
@@ -1016,7 +1014,7 @@ public class CmPayShopController extends BaseController {
      * 付第三方数据回显
      */
     @RequestMapping("shopOtherFeeForm")
-    public String shopOtherFeeForm(Integer shopOrderId,Integer payType, Model model) {
+    public String shopOtherFeeForm(Integer shopOrderId, Integer payType, Model model) {
         ChangePayShopOther payShopOther = cmPayShopService.shopOtherFeeForm(shopOrderId);
         payShopOther.setShopOrderId(shopOrderId);
         NewShopOrder shopOrder = newShopOrderService.findByShopOrderID(shopOrderId);
@@ -1024,6 +1022,13 @@ public class CmPayShopController extends BaseController {
         payShopOther.setShopOtherFee(BigDecimal.valueOf(ShopOtherFee));
         Double brokerage = shopOrder.getBrokerage();
         brokerage = brokerage == null ? 0d : brokerage;
+        /**
+         * 子订单onlinePayWays为空且cmAccountType为1,且子订单利润>0
+         * 1. 当该订单为采美私账订单时,若存在子订单利润(不为0)申请第三方页面(包括部分付款子订单申请和已付款子订单申请)
+         * 2. 金额直接展示子订单利润
+         */
+        OtherFeeDto otherFeeDto = newOrderService.getOtherFeeDto(shopOrderId);
+        model.addAttribute("otherFee", otherFeeDto);
         model.addAttribute("brokerage", brokerage);
         model.addAttribute("payShopOther", payShopOther);
         model.addAttribute("payType", payType);
@@ -1037,7 +1042,7 @@ public class CmPayShopController extends BaseController {
     public String saveShopOtherFee(ChangePayShopOther payShopOther, RedirectAttributes redirectAttributes) {
         cmPayShopService.saveShopOtherFee(payShopOther);
         addMessage(redirectAttributes, "保存成功");
-        if ((null != payShopOther.getPayType() && 2 == payShopOther.getPayType()) || 2 == payShopOther.getRedirectType() ) {
+        if ((null != payShopOther.getPayType() && 2 == payShopOther.getPayType()) || 2 == payShopOther.getRedirectType()) {
             return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/payList?repage";
         }
         return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/?repage";
@@ -1083,6 +1088,8 @@ public class CmPayShopController extends BaseController {
     @RequestMapping("shopOtherApplyEdit")
     public String shopOtherApplyEdit(Integer payShopId, Model model) {
         ChangePayShopOther payShopOther = cmPayShopService.shopOtherApplyEdit(payShopId);
+        OtherFeeDto otherFeeDto = newOrderService.getOtherFeeDto(payShopOther.getShopOrderId());
+        model.addAttribute("otherFee", otherFeeDto);
         model.addAttribute("payShopOther", payShopOther);
         return "modules/order/cmPayShopOtherForm";
     }

+ 25 - 4
src/main/resources/mappings/modules/order/CmPayShopMapper.xml

@@ -10,7 +10,7 @@
 		a.bankAccount AS "bankAccount",
 		a.bankName AS "bankName",
 		a.type AS "type",
-		a.totalAmount AS "totalAmount",
+		ifnull(a.totalAmount,0) AS "totalAmount",
 		a.balancePayFee AS "balancePayFee",
 		a.transferPayFee AS "transferPayFee",
 		a.payType AS "payType",
@@ -34,6 +34,7 @@
 		u1.name AS applicantName,
 		u2.name AS reviewerName,
 		s.name AS shopName,
+		ifnull(a.payCmAmount,0) as cmShopOtherFee,
 		s.ableRebateAmount AS ableRebateAmount,
 		s.rebateAmount AS rebateAmount,
 		(SELECT paymentType FROM cm_pay_shop_record WHERE payShopID = a.id LIMIT 1) AS paymentType
@@ -62,6 +63,11 @@
 		u1.name AS applicantName,
 		u2.name AS reviewerName,
 		s.name AS shopName,
+		a.otherFeeFlag,
+		a.cmBankAccountName,
+		a.cmBankAccount,
+		a.cmBankName,
+		ifnull(psr.payCmAmount,0) as cmShopOtherFee,
 		(SELECT paymentType FROM cm_pay_shop_record WHERE payShopID = a.id LIMIT 1) AS paymentType
 		FROM cm_pay_shop a
 		left join sys_user u1 on u1.id = a.applicant
@@ -261,7 +267,12 @@
 			payTime,
 			status,
 			reason,
-			delFlag
+			delFlag,
+		    otherFeeFlag,
+		    cmType,
+		    cmBankAccountName,
+		    cmBankAccount,
+			cmBankName
 		) VALUES (
 			#{shopID},
 			#{name},
@@ -284,7 +295,12 @@
 			#{payTime},
 			#{status},
 			#{reason},
-			#{delFlag}
+			#{delFlag},
+			#{otherFeeFlag},
+		    #{cmType},
+			#{cmBankAccountName},
+		    #{cmBankAccount},
+		    #{cmBankName}
 		)
 	</insert>
 
@@ -311,7 +327,12 @@
 			payTime = #{payTime},
 			status = #{status},
 			reason = #{reason},
-			delFlag = #{delFlag}
+			delFlag = #{delFlag},
+			otherFeeFlag = ifnull(#{otherFeeFlag},0),
+			cmType = #{cmType},
+			cmBankAccountName = #{cmBankAccountName},
+			cmBankAccount = #{cmBankAccount},
+			cmBankName = #{cmBankName}
 		WHERE id = #{id}
 	</update>
 

+ 318 - 290
src/main/resources/mappings/modules/order/CmPayShopRecordMapper.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.order.dao.CmPayShopRecordDao">
 
-	<sql id="cmPayShopRecordColumns">
-		a.id AS "id",
+    <sql id="cmPayShopRecordColumns">
+        a.id AS "id",
 		a.shopID AS "shopID",
 		a.shopOrderID AS "shopOrderID",
 		a.shopOrderNo AS "shopOrderNo",
@@ -16,303 +16,331 @@
 		a.payShopID AS "payShopID",
 		a.status AS "status",
 		a.delFlag AS "delFlag"
-	</sql>
-
+    </sql>
+
+
+    <select id="get" resultType="CmPayShopRecord">
+        SELECT
+        <include refid="cmPayShopRecordColumns"/>
+        FROM cm_pay_shop_record a
+        WHERE a.id = #{id}
+    </select>
+
+    <select id="findByOrderIDsGroupBy" resultType="CmPayShopRecord">
+        select
+        sum(payAmount) as "payAmount",
+        sum(wipePayment) AS "wipePayment",
+        a.id AS "id",
+        a.shopID AS "shopID",
+        a.shopOrderID AS "shopOrderID",
+        a.shopOrderNo AS "shopOrderNo",
+        a.payType AS "payType",
+        a.payTime AS "payTime",
+        a.wipeTime AS "wipeTime",
+        a.payShopID AS "payShopID",
+        a.status AS "status",
+        a.delFlag AS "delFlag"
+        from cm_pay_shop_record a
+        where a.shopOrderID in
+        <foreach collection="param1" item="orderIDs" index="index" open="(" separator="," close=")">
+            #{orderIDs}
+        </foreach>
+        AND a.delFlag = '0'
+        AND a.status = '1'
+        GROUP BY a.payType
+    </select>
+
+
+    <select id="findList" resultType="CmPayShopRecord">
+        SELECT
+        <include refid="cmPayShopRecordColumns"/>
+        FROM cm_pay_shop_record a
+        <where>
+
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+            </otherwise>
+        </choose>
+    </select>
+
+    <select id="findAllList" resultType="CmPayShopRecord">
+        SELECT
+        <include refid="cmPayShopRecordColumns"/>
+        FROM cm_pay_shop_record a
+        <where>
+
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+            </otherwise>
+        </choose>
+    </select>
+
+    <insert id="insert" parameterType="CmPayShopRecord" keyProperty="id" useGeneratedKeys="true">
+        INSERT INTO cm_pay_shop_record(id,
+                                       shopID,
+                                       shopOrderID,
+                                       shopOrderNo,
+                                       payAmount,
+                                       wipePayment,
+                                       paymentType,
+                                       payType,
+                                       payTime,
+                                       wipeTime,
+                                       payShopID,
+                                       status,
+                                       payCmAmount,
+                                       delFlag)
+        VALUES (#{id},
+                #{shopID},
+                #{shopOrderID},
+                #{shopOrderNo},
+                #{payAmount},
+                #{wipePayment},
+                #{paymentType},
+                #{payType},
+                #{payTime},
+                #{wipeTime},
+                #{payShopID},
+                #{status},
+                #{payCmAmount},
+                #{delFlag})
+    </insert>
+
+    <update id="update">
+        UPDATE cm_pay_shop_record
+        SET shopID      = #{shopID},
+            shopOrderID = #{shopOrderID},
+            shopOrderNo = #{shopOrderNo},
+            payAmount   = #{payAmount},
+            wipePayment = #{wipePayment},
+            payType     = #{payType},
+            payTime     = #{payTime},
+            wipeTime    = #{wipeTime},
+            payShopID   = #{payShopID},
+            status      = #{status},
+            payCmAmount = #{payCmAmount},
+            delFlag     = #{delFlag}
+        WHERE id = #{id}
+    </update>
 
-	<select id="get" resultType="CmPayShopRecord">
-		SELECT
-			<include refid="cmPayShopRecordColumns"/>
-		FROM cm_pay_shop_record a
-		WHERE a.id = #{id}
-	</select>
+    <delete id="delete">
+        DELETE
+        FROM cm_pay_shop_record
+        WHERE id = #{id}
+    </delete>
+
+    <select id="findByPayShopID" resultType="CmPayShopRecord">
+        SELECT
+        f.bankAccount AS "bankNameType",
+        <include refid="cmPayShopRecordColumns"/>
+        FROM cm_pay_shop_record a
+        LEFT JOIN cm_offline_collection f ON a.payType = f.type
+        WHERE a.payShopID = #{payShopID}
+    </select>
+
+    <update id="checkNotPass">
+        update cm_pay_shop_record
+        set status = '2'
+        where payShopID = #{payShopID}
+    </update>
 
-	<select id="findByOrderIDsGroupBy" resultType="CmPayShopRecord">
-		select
-		sum(payAmount) as "payAmount",
-		sum(wipePayment) AS "wipePayment",
-		a.id AS "id",
-		a.shopID AS "shopID",
-		a.shopOrderID AS "shopOrderID",
-		a.shopOrderNo AS "shopOrderNo",
-		a.payType AS "payType",
-		a.payTime AS "payTime",
-		a.wipeTime AS "wipeTime",
-		a.payShopID AS "payShopID",
-		a.status AS "status",
-		a.delFlag AS "delFlag"
-		from  cm_pay_shop_record a
-		where a.shopOrderID in
-		<foreach collection="param1" item="orderIDs" index="index" open="(" separator="," close=")">
-			#{orderIDs}
-		</foreach>
-		AND a.delFlag = '0'
-		AND a.status =  '1'
-		GROUP BY a.payType
-	</select>
-
-
-	<select id="findList" resultType="CmPayShopRecord">
-		SELECT
-			<include refid="cmPayShopRecordColumns"/>
-		FROM cm_pay_shop_record a
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="CmPayShopRecord">
-		SELECT
-			<include refid="cmPayShopRecordColumns"/>
-		FROM cm_pay_shop_record a
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="CmPayShopRecord"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_pay_shop_record(
-			id,
-			shopID,
-			shopOrderID,
-			shopOrderNo,
-			payAmount,
-			wipePayment,
-			paymentType,
-			payType,
-			payTime,
-			wipeTime,
-			payShopID,
-			status,
-			delFlag
-		) VALUES (
-			#{id},
-			#{shopID},
-			#{shopOrderID},
-			#{shopOrderNo},
-			#{payAmount},
-			#{wipePayment},
-			#{paymentType},
-			#{payType},
-			#{payTime},
-			#{wipeTime},
-			#{payShopID},
-			#{status},
-			#{delFlag}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE cm_pay_shop_record SET
-			shopID = #{shopID},
-			shopOrderID = #{shopOrderID},
-			shopOrderNo = #{shopOrderNo},
-			payAmount = #{payAmount},
-			wipePayment = #{wipePayment},
-			payType = #{payType},
-			payTime = #{payTime},
-			wipeTime = #{wipeTime},
-			payShopID = #{payShopID},
-			status = #{status},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM cm_pay_shop_record
-		WHERE id = #{id}
-	</delete>
-
-	<select id="findByPayShopID" resultType="CmPayShopRecord">
-		SELECT
-		f.bankAccount AS "bankNameType",
-		<include refid="cmPayShopRecordColumns"/>
-		FROM cm_pay_shop_record a
-		LEFT JOIN cm_offline_collection f ON a.payType = f.type
-		WHERE a.payShopID = #{payShopID}
-	</select>
-
-	<update id="checkNotPass">
-		update cm_pay_shop_record set status = '2' where payShopID = #{payShopID}
-	</update>
-
-	<update id="updateByID">
-		update cm_pay_shop_record set payAmount = #{payAmount}, wipePayment = #{wipePayment}
-		where payShopID = #{payShopID} and  shopOrderID = #{shopOrderID}
-	</update>
+    <update id="updateByID">
+        update cm_pay_shop_record
+        set payAmount   = #{payAmount},
+            wipePayment = #{wipePayment}
+        where payShopID = #{payShopID}
+          and shopOrderID = #{shopOrderID}
+    </update>
 
     <update id="updateWipePayment">
-		update cm_pay_shop_record set wipePayment = #{wipePayment}, wipeTime = #{wipeTime}
-		where id = #{id}
+        update cm_pay_shop_record
+        set wipePayment = #{wipePayment},
+            wipeTime    = #{wipeTime}
+        where id = #{id}
     </update>
 
-	<update id="cancelRecordWipePayment">
-		update cm_pay_shop_record set wipePayment = 0.00, wipeTime = NOW()
-		where shopOrderID = #{shopOrderID}
-	</update>
-
-	<update id="deleteByFlag">
-		update cm_pay_shop_record set delFlag = '1'
-		where id in
-		<foreach collection="ids" separator="," item="id" open="(" close=")">
-			#{id}
-		</foreach>
-	</update>
-
-	<update id="updateStatusByPayShopID">
-		update cm_pay_shop_record set status = #{status}
-		where payShopID = #{payShopID}
-	</update>
-
-	<select id="getPayedRecords" resultType="CmPayShopRecord">
-		SELECT
-		f.bankAccount as bankNameType,
-		<include refid="cmPayShopRecordColumns"/>
-		FROM cm_pay_shop_record a
-		LEFT JOIN cm_offline_collection f ON a.payType = f.type
-		WHERE a.shopOrderID = #{shopOrderID} and a.delFlag = '0' and a.status = '1'
-		ORDER BY a.payTime DESC
-	</select>
-
-	<select id="getPayedRecordsGroupBy" resultType="CmPayShopRecord">
-		SELECT
-		a.id AS "id",
-		a.shopID AS "shopID",
-		a.shopOrderID AS "shopOrderID",
-		a.shopOrderNo AS "shopOrderNo",
-		SUM(a.payAmount) AS "payAmount",
-		SUM(a.wipePayment) AS "wipePayment",
-		a.payType AS "payType",
-		DATE_FORMAT(a.payTime,"%Y年%m月%d日")  AS "payTime",
-		DATE_FORMAT(a.wipeTime,"%Y年%m月%d日")  AS "wipeTime",
-		a.payShopID AS "payShopID",
-		a.status AS "status",
-		a.delFlag AS "delFlag"
-		FROM cm_pay_shop_record a
-		WHERE a.shopOrderID = #{shopOrderID} and a.delFlag = '0' and a.status = '1'
-		GROUP BY payType ,DATE_FORMAT(payTime,"%Y年%m月%d日")
-	</select>
+    <update id="cancelRecordWipePayment">
+        update cm_pay_shop_record
+        set wipePayment = 0.00,
+            wipeTime    = NOW()
+        where shopOrderID = #{shopOrderID}
+    </update>
+
+    <update id="deleteByFlag">
+        update cm_pay_shop_record set delFlag = '1'
+        where id in
+        <foreach collection="ids" separator="," item="id" open="(" close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <update id="updateStatusByPayShopID">
+        update cm_pay_shop_record
+        set status = #{status}
+        where payShopID = #{payShopID}
+    </update>
 
-	<select id="sumByShopOrderID"  resultType="double">
-		select SUM(payAmount) from cm_pay_shop_record where shopOrderID = #{shopOrderID} and status = '1' and delFlag = '0'
-	</select>
+    <select id="getPayedRecords" resultType="CmPayShopRecord">
+        SELECT
+        f.bankAccount as bankNameType,
+        <include refid="cmPayShopRecordColumns"/>
+        FROM cm_pay_shop_record a
+        LEFT JOIN cm_offline_collection f ON a.payType = f.type
+        WHERE a.shopOrderID = #{shopOrderID} and a.delFlag = '0' and a.status = '1'
+        ORDER BY a.payTime DESC
+    </select>
+
+    <select id="getPayedRecordsGroupBy" resultType="CmPayShopRecord">
+        SELECT a.id                                 AS "id",
+               a.shopID                             AS "shopID",
+               a.shopOrderID                        AS "shopOrderID",
+               a.shopOrderNo                        AS "shopOrderNo",
+               SUM(a.payAmount)                     AS "payAmount",
+               SUM(a.wipePayment)                   AS "wipePayment",
+               a.payType                            AS "payType",
+               DATE_FORMAT(a.payTime, "%Y年%m月%d日")  AS "payTime",
+               DATE_FORMAT(a.wipeTime, "%Y年%m月%d日") AS "wipeTime",
+               a.payShopID                          AS "payShopID",
+               a.status                             AS "status",
+               a.delFlag                            AS "delFlag"
+        FROM cm_pay_shop_record a
+        WHERE a.shopOrderID = #{shopOrderID}
+          and a.delFlag = '0'
+          and a.status = '1'
+        GROUP BY payType, DATE_FORMAT(payTime, "%Y年%m月%d日")
+    </select>
+
+    <select id="sumByShopOrderID" resultType="double">
+        select SUM(payAmount)
+        from cm_pay_shop_record
+        where shopOrderID = #{shopOrderID}
+          and status = '1'
+          and delFlag = '0'
+    </select>
 
     <select id="sumWipePayment" resultType="java.lang.Double">
-		select SUM(wipePayment) from cm_pay_shop_record where shopOrderID = #{shopOrderID} and status = '1' and delFlag = '0'
-	</select>
+        select SUM(wipePayment)
+        from cm_pay_shop_record
+        where shopOrderID = #{shopOrderID}
+          and status = '1'
+          and delFlag = '0'
+    </select>
 
     <select id="sumWipePaymentNoStatus" resultType="java.lang.Double">
-		select SUM(wipePayment) from cm_pay_shop_record where shopOrderID = #{shopOrderID} and delFlag = '0'
-	</select>
-
-	<select id="findMaxPayShopId" resultType="java.lang.Integer">
-		select MAX(payShopID) from cm_pay_shop_record where shopOrderID = #{shopOrderID} and status = '1' and delFlag = '0'
-	</select>
-
-	<select id="findMaxPayShopRecordId" resultType="java.lang.Integer">
-		select MAX(id) from cm_pay_shop_record where payShopID = #{payShopID} and status = '1' and delFlag = '0'
-	</select>
-
-	<update id="applyCompileSave" parameterType="com.caimei.modules.order.entity.CmPayShop">
-		UPDATE cm_pay_shop SET payType = #{payType},payTime = #{payTime} WHERE id = #{id}
-	</update>
-
-	<update id="applyCompileRecordSave">
-		update cm_pay_shop_record SET payType = #{payType},payTime = #{payTime} WHERE payShopID = #{id}
-	</update>
-
-	<select id="findShopOtherFee" resultType="com.caimei.modules.order.entity.ChangePayShopOther">
-		SELECT
-		  `id`,
-		  `shopOrderId`,
-		  `shopOtherFee`,
-		  modifyUserId,
-		  name,
-		  `bankAccountName`,
-		  `bankAccount`,
-		  `bankName`,
-		  `type`,
-		  `remark`,
-		  `remarkImage`,
-		  `updateTime`
-		FROM
-		  `cm_change_pay_shop_other`
-		WHERE
-		  shopOrderId = #{shopOrderId}
-		ORDER BY
-		  updateTime DESC
-	</select>
-
-	<insert id="insertShopOtherFee">
-		INSERT INTO `cm_change_pay_shop_other` (
-		  `shopOrderId`, `shopOtherFee`, `bankAccountName`,
-		  `bankAccount`, `bankName`, `type`, modifyUserId,
-		  `remark`, `remarkImage`, `updateTime`, name
-		)
-		VALUES
-		  (
-			#{shopOrderId}, #{shopOtherFee}, #{bankAccountName},
-			#{bankAccount}, #{bankName}, #{type}, #{modifyUserId},
-			#{remark}, #{remarkImage}, NOW(), #{name}
-		  )
-	</insert>
-
-	<insert id="insertDifference">
-		INSERT INTO `cm_change_pay_shop_difference` (
-		  `shopOrderId`, `modifyUserId`, `refundShopId`,
-		  `differencePrice`, `type`, `remark`,
-		  `remarkImage`, `updateTime`, payShopId
-		)
-		VALUES
-		  (
-			#{shopOrderId}, #{modifyUserId}, #{refundShopId},
-			#{differencePrice}, #{type}, #{remark},
-			#{remarkImage}, NOW(), #{payShopId}
-		  )
-	</insert>
-
-	<select id="findShopDifference" resultType="com.caimei.modules.order.entity.ChangePayShopDifference">
-		SELECT
-		  `id`,
-		  `shopOrderId`,
-		  `modifyUserId`,
-		  payShopId,
-		  `refundShopId`,
-		  `differencePrice`,
-		  `type`,
-		  `remark`,
-		  `remarkImage`,
-		  `updateTime`
-		FROM
-		  `cm_change_pay_shop_difference`
-		WHERE
-		  shopOrderId = #{shopOrderId}
-		ORDER BY
-		  updateTime DESC
-	</select>
-
-	<select id="findPayShopOtherFee" resultType="java.math.BigDecimal">
-		SELECT
-		  SUM(payAmount)
-		FROM
-		  cm_pay_shop_record
-		WHERE
-		  delFlag = 0
-		  AND status = 1
-		  AND paymentType = 3
-		  AND shopOrderID =	#{shopOrderId}
-	</select>
+        select SUM(wipePayment)
+        from cm_pay_shop_record
+        where shopOrderID = #{shopOrderID}
+          and delFlag = '0'
+    </select>
+
+    <select id="findMaxPayShopId" resultType="java.lang.Integer">
+        select MAX(payShopID)
+        from cm_pay_shop_record
+        where shopOrderID = #{shopOrderID}
+          and status = '1'
+          and delFlag = '0'
+    </select>
+
+    <select id="findMaxPayShopRecordId" resultType="java.lang.Integer">
+        select MAX(id)
+        from cm_pay_shop_record
+        where payShopID = #{payShopID}
+          and status = '1'
+          and delFlag = '0'
+    </select>
+
+    <update id="applyCompileSave" parameterType="com.caimei.modules.order.entity.CmPayShop">
+        UPDATE cm_pay_shop
+        SET payType        = #{payType},
+            payTime        = #{payTime},
+            cmOtherPayType = #{cmOtherPayType},
+            cmOtherPayTime = #{cmOtherPayTime}
+        WHERE id = #{id}
+    </update>
+
+    <update id="applyCompileRecordSave">
+        update cm_pay_shop_record
+        SET payType = #{payType},
+            payTime = #{payTime},
+            cmOtherPayType = #{cmOtherPayType},
+            cmOtherPayTime = #{cmOtherPayTime}
+        WHERE payShopID = #{id}
+    </update>
+
+    <select id="findShopOtherFee" resultType="com.caimei.modules.order.entity.ChangePayShopOther">
+        SELECT `id`,
+               `shopOrderId`,
+               `shopOtherFee`,
+               otherFeeFlag,
+               cmShopOtherFee,
+               modifyUserId,
+               name,
+               cmBankName,
+               cmBankAccount,
+               cmBankAccountName,
+               cmType,
+               `bankAccountName`,
+               `bankAccount`,
+               `bankName`,
+               `type`,
+               `remark`,
+               `remarkImage`,
+               `updateTime`
+        FROM `cm_change_pay_shop_other`
+        WHERE shopOrderId = #{shopOrderId}
+        ORDER BY updateTime DESC
+    </select>
+
+    <insert id="insertShopOtherFee">
+        INSERT INTO `cm_change_pay_shop_other` (`shopOrderId`, `shopOtherFee`, `bankAccountName`,
+                                                `bankAccount`, `bankName`, `type`, modifyUserId,
+                                                `remark`, `remarkImage`, `updateTime`, name,
+                                                cmShopOtherFee, cmBankAccount, cmBankName, cmBankAccountName, cmType)
+        VALUES (#{shopOrderId}, #{shopOtherFee}, #{bankAccountName},
+                #{bankAccount}, #{bankName}, #{type}, #{modifyUserId},
+                #{remark}, #{remarkImage}, NOW(), #{name}, #{cmShopOtherFee},
+                #{cmBankAccount}, #{cmBankName}, #{cmBankAccountName}, #{cmType})
+    </insert>
+
+    <insert id="insertDifference">
+        INSERT INTO `cm_change_pay_shop_difference` (`shopOrderId`, `modifyUserId`, `refundShopId`,
+                                                     `differencePrice`, `type`, `remark`,
+                                                     `remarkImage`, `updateTime`, payShopId)
+        VALUES (#{shopOrderId}, #{modifyUserId}, #{refundShopId},
+                #{differencePrice}, #{type}, #{remark},
+                #{remarkImage}, NOW(), #{payShopId})
+    </insert>
+
+    <select id="findShopDifference" resultType="com.caimei.modules.order.entity.ChangePayShopDifference">
+        SELECT `id`,
+               `shopOrderId`,
+               `modifyUserId`,
+               payShopId,
+               `refundShopId`,
+               `differencePrice`,
+               `type`,
+               `remark`,
+               `remarkImage`,
+               `updateTime`
+        FROM `cm_change_pay_shop_difference`
+        WHERE shopOrderId = #{shopOrderId}
+        ORDER BY updateTime DESC
+    </select>
+
+    <select id="findPayShopOtherFee" resultType="java.math.BigDecimal">
+        SELECT SUM(payAmount)
+        FROM cm_pay_shop_record
+        WHERE delFlag = 0
+          AND status = 1
+          AND paymentType = 3
+          AND shopOrderID = #{shopOrderId}
+    </select>
 </mapper>

+ 48 - 2
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -545,6 +545,12 @@
             <if test="splitCode != null">
                 splitCode = #{splitCode},
             </if>
+            <if test="supplierFreight != null">
+                supplierFreight = #{supplierFreight},
+            </if>
+            <if test="rebateOrder != null">
+                rebateOrder = #{rebateOrder},
+            </if>
         </set>
         <where>
             <if test="shopOrderID != null and shopOrderID != ''">
@@ -740,9 +746,13 @@
     <select id="findPayOrderList" resultType="newShopOrder">
         select<include refid="shopOrderColumns"/>,
         co.payTotalFee AS payTotalFee,
+        a.supplierFreight as supplierFreight,
+        a.rebateOrder as rebateOrder,
         bou.name AS buyer,
         s.name AS shopName,
         c.name AS clubName,
+        a.onlinePayWays,
+        ifnull(a.cmAccountType,0) as cmAccountType,
         cdr.payWay AS payWay
         from cm_shop_order a
         left join cm_pay_shop_record cpsr on a.shopOrderID = cpsr.shopOrderID
@@ -909,6 +919,9 @@
         s.name AS shopName,
         c.name AS clubName,
         cdr.payWay AS payWay,
+        a.onlinePayWays,
+        ifnull(cmAccountType,0) as cmAccountType,
+        ifnull(cmShopOtherFee,0) as cmShopOtherFee,
         (select sum((num+presentNum)*cmCostPrice) from cm_order_product where shopOrderId = a.shopOrderId) as
         allServeAmount
         from cm_shop_order a
@@ -1097,6 +1110,9 @@
         select distinct<include refid="shopOrderColumns"/>,
         co.payTotalFee AS payTotalFee,
         co.promotionFullReduction AS promotionFullReduction,
+        a.onlinePayWays,
+        ifnull(a.cmAccountType,0) as cmAccountType,
+        ifnull(a.cmShopOtherFee,0) as cmShopOtherFee,
         bou.name AS buyer,
         s.name AS shopName,
         c.name AS clubName
@@ -1305,7 +1321,10 @@
                co.status                  AS STATUS,
                bou.name                   AS buyer,
                s.name                     AS shopName,
-               c.name                     AS clubName
+               c.name                     AS clubName,
+               a.onlinePayWays,
+               ifnull(a.cmShopOtherFee,0) as cmShopOtherFee,
+               ifnull(a.cmAccountType,0) as cmAccountType
         FROM cm_shop_order a
                  LEFT JOIN cm_pay_shop_record cpsr ON a.shopOrderID = cpsr.shopOrderID
                  LEFT JOIN bp_order_userinfo bou ON bou.orderId = a.orderID
@@ -1448,7 +1467,10 @@
         co.status AS STATUS,
         bou.name AS buyer,
         s.name AS shopName,
-        c.name AS clubName
+        c.name AS clubName,
+        a.onlinePayWays,
+        ifnull(a.cmAccountType,0) as cmAccountType,
+        ifnull(a.a.cmShopOtherFee,0) as cmShopOtherFee
         FROM cm_shop_order a
         LEFT JOIN cm_pay_shop_record cpsr ON a.shopOrderID = cpsr.shopOrderID
         LEFT JOIN bp_order_userinfo bou ON bou.orderId = a.orderID
@@ -2511,6 +2533,30 @@
         ORDER BY cso.shopOrderID DESC
     </select>
 
+    <select id="findCmProfit" resultType="com.caimei.modules.order.entity.OtherFeeDto">
+       select IF((SELECT SUM(cdr.receiptAmount)
+            FROM cm_discern_receipt cdr
+                     LEFT JOIN cm_receipt_order_relation cror ON cdr.id = cror.receiptId
+            WHERE cdr.receiptType IN (10, 11)
+              AND cdr.receiptStatus NOT IN (1, 4, 5)
+              AND cdr.delflag = 0
+              AND cror.shopOrderId = acso.shopOrderId) > 0, 0,
+            (SELECT acso.needpayAmount
+            - SUM(IFNULL(op.costprice, 0) * (IFNULL(op.num, 0) + IFNULL(op.presentNum, 0)))
+            - SUM(IFNULL(op.organizeCostPrice, 0) * (IFNULL(op.num, 0) + IFNULL(op.presentNum, 0)))
+            - SUM(IFNULL(op.cmCostPrice, 0) * (IFNULL(op.num, 0) + IFNULL(op.presentNum, 0)))
+            - (IFNULL(SUM(acso.shopPostFee +
+            IF(acso.differenceType = 1, acso.differencePrice, 0) -
+            IF(acso.differenceType = 2, acso.differencePrice, 0)),
+            0))
+            FROM cm_order_product op
+            WHERE op.shopOrderId = acso.shopOrderId)) as cmProfit,
+           acso.onlinePayWays,
+           ifnull(acso.cmAccountType,0) as cmAccountType
+        from cm_shop_order acso
+        where acso.shopOrderId = #{shopOrderId}
+    </select>
+
     <insert id="addCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder" useGeneratedKeys="true"
             keyProperty="shopOrderID">
         insert into cm_shop_order

+ 326 - 251
src/main/webapp/WEB-INF/views/modules/order/cmPayFormList.jsp

@@ -1,266 +1,341 @@
 <%@ page contentType="text/html;charset=UTF-8" %>
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<%@ 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}
-		#searchForm{white-space:nowrap}
-		.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:80%}
-		.td-a{width:100%;float:left;display:block;text-align:center}
-		@media screen and (max-width:1300px){#searchForm{width:1460px !important}
-		.nav-tabs,#contentTable{width:1490px !important}
-		}
-		.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">
-		$(document).ready(function() {
+    <title>付款管理</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        #searchForm {
+            white-space: nowrap
+        }
+
+        .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
+        }
 
-		});
-		function page(n,s){
-			$("#pageNo").val(n);
-			$("#pageSize").val(s);
-			$("#searchForm").submit();
-        	return false;
+        #btnSubmit {
+            width: 128px;
+            margin-left: 80%
         }
-		$(function () {
-			$('#export').click(function () {
-				var formData = $('#searchForm').serialize();
-				window.location.href = "${ctx}/order/cmPayShop/export?" + formData;
-			});
-		})
-	</script>
+
+        .td-a {
+            width: 100%;
+            float: left;
+            display: block;
+            text-align: center
+        }
+
+        @media screen and (max-width: 1300px) {
+            #searchForm {
+                width: 1460px !important
+            }
+
+            .nav-tabs, #contentTable {
+                width: 1490px !important
+            }
+        }
+
+        .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">
+        $(document).ready(function () {
+
+        });
+
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+
+        $(function () {
+            $('#export').click(function () {
+                var formData = $('#searchForm').serialize();
+                window.location.href = "${ctx}/order/cmPayShop/export?" + formData;
+            });
+        })
+    </script>
 </head>
 <body>
-	<ul class="nav nav-tabs">
-		<li class="active"><a href="${ctx}/order/cmPayShop/">付款列表</a></li>
-		<%--<shiro:hasPermission name="order:cmPayShop:view">
-            <li onclick="sessionStorage.removeItem('checkedIndexArr')"><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
-			<li onclick="sessionStorage.removeItem('checkedIndexArr')"><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
-		</shiro:hasPermission>
-		<shiro:hasPermission name="order:cmPayShop:split">
-			<li><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
-		</shiro:hasPermission>
-		<li><a href="${ctx}/shopOrder/settlement">子订单手动结算</a></li>--%>
-	</ul>
-	<form:form id="searchForm" modelAttribute="cmPayShop" action="${ctx}/order/cmPayShop/" 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="ul-form">
-			<div>
-				<label>子订单ID:</label>
-				<form:input path="shopOrderID" htmlEscape="false" maxlength="20" class="input-medium"/>
-				<label>子订单编号:</label>
-				<form:input path="shopOrderNo" htmlEscape="false" maxlength="20" class="input-medium"/>
-				<label>订单ID:</label>
-				<form:input path="orderID" htmlEscape="false" maxlength="20" class="input-medium"/>
-				<label>订单编号:</label>
-				<form:input path="orderNo" htmlEscape="false" maxlength="20" class="input-medium"/>
-			</div>
-			<div>
-				<label>付款单ID:</label>
-				<form:input path="id" htmlEscape="false" maxlength="50" class="input-medium"/>
-				<label>供应商:</label>
-				<form:input path="shopName" htmlEscape="false" maxlength="50" class="input-medium"/>
+<ul class="nav nav-tabs">
+    <li class="active"><a href="${ctx}/order/cmPayShop/">付款列表</a></li>
+    <%--<shiro:hasPermission name="order:cmPayShop:view">
+        <li onclick="sessionStorage.removeItem('checkedIndexArr')"><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+        <li onclick="sessionStorage.removeItem('checkedIndexArr')"><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
+    </shiro:hasPermission>
+    <shiro:hasPermission name="order:cmPayShop:split">
+        <li><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
+    </shiro:hasPermission>
+    <li><a href="${ctx}/shopOrder/settlement">子订单手动结算</a></li>--%>
+</ul>
+<form:form id="searchForm" modelAttribute="cmPayShop" action="${ctx}/order/cmPayShop/" 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="ul-form">
+        <div>
+            <label>子订单ID:</label>
+            <form:input path="shopOrderID" htmlEscape="false" maxlength="20" class="input-medium"/>
+            <label>子订单编号:</label>
+            <form:input path="shopOrderNo" htmlEscape="false" maxlength="20" class="input-medium"/>
+            <label>订单ID:</label>
+            <form:input path="orderID" htmlEscape="false" maxlength="20" class="input-medium"/>
+            <label>订单编号:</label>
+            <form:input path="orderNo" htmlEscape="false" maxlength="20" class="input-medium"/>
+        </div>
+        <div>
+            <label>付款单ID:</label>
+            <form:input path="id" htmlEscape="false" maxlength="50" class="input-medium"/>
+            <label>供应商:</label>
+            <form:input path="shopName" htmlEscape="false" maxlength="50" class="input-medium"/>
 
-				<label>付款单名称:</label>
-				<form:input path="name" htmlEscape="false" maxlength="250" class="input-medium"/>
-				<label>付款审核状态:</label>
-				<form:select path="status" class="input-medium">
-					<form:option value="" label="所有"/>
-					<form:options items="${fns:getDictList('pay_shop_status')}" itemLabel="label" itemValue="value"
-								  htmlEscape="false"/>
-				</form:select>&nbsp;&nbsp;&nbsp;&nbsp;
+            <label>付款单名称:</label>
+            <form:input path="name" htmlEscape="false" maxlength="250" class="input-medium"/>
+            <label>付款审核状态:</label>
+            <form:select path="status" class="input-medium">
+                <form:option value="" label="所有"/>
+                <form:options items="${fns:getDictList('pay_shop_status')}" itemLabel="label" itemValue="value"
+                              htmlEscape="false"/>
+            </form:select>&nbsp;&nbsp;&nbsp;&nbsp;
 
-			</div>
-			<div>
-				<label>申请时间:</label>
-				<form:input path="startTime" type="text" maxlength="20" class="input-medium Wdate" value="${startTime}"
-							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
-				<span class="time-space-symbols">至</span>
-				<form:input path="endTime" type="text" maxlength="20" class="input-medium Wdate" value="${endTime}"
-							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
-				<label>付款时间:</label>
-				<form:input path="startTime2" type="text" maxlength="20" class="input-medium Wdate" value="${startTime2}"
-							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
-				<span class="time-space-symbols">至</span>
-				<form:input path="endTime2" type="text" maxlength="20" class="input-medium Wdate" value="${endTime2}"
-							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
-			</div>
-			<div>
-				<label>组织:</label>
-				<form:select path="organizeID" class="input-medium">
-					<form:option value="" label="请选择"/>
-					<form:option value="0" label="采美"/>
-					<form:option value="9999" label="呵呵商城"/>
-					<c:forEach items="${cmUserOrganizeList}" var="organize">
-						<c:if test="${organize.id!=4}">
-							<form:option value="${organize.id}" label="${organize.organizeName}"/>
-						</c:if>
-					</c:forEach>
-<%--					<form:options items="${cmUserOrganizeList}" itemLabel="organizeName" itemValue="id"--%>
-<%--								  htmlEscape="false"/>--%>
-				</form:select>&nbsp;&nbsp;&nbsp;&nbsp;
-				<label>付款类型:</label>
-				<form:select path="paymentType" class="input-medium">
-					<form:option value="" label="请选择"/>
-					<form:option value="1" label="付款子订单"/>
-					<form:option value="2" label="供应商差价"/>
-					<form:option value="3" label="付第三方"/>
-				</form:select>
-				<label><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label><input id="export" class="btn btn-primary" value="导出筛选结果"/></label>
-			</div>
+        </div>
+        <div>
+            <label>申请时间:</label>
+            <form:input path="startTime" type="text" maxlength="20" class="input-medium Wdate" value="${startTime}"
+                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+            <span class="time-space-symbols">至</span>
+            <form:input path="endTime" type="text" maxlength="20" class="input-medium Wdate" value="${endTime}"
+                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+            <label>付款时间:</label>
+            <form:input path="startTime2" type="text" maxlength="20" class="input-medium Wdate" value="${startTime2}"
+                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+            <span class="time-space-symbols">至</span>
+            <form:input path="endTime2" type="text" maxlength="20" class="input-medium Wdate" value="${endTime2}"
+                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+        </div>
+        <div>
+            <label>组织:</label>
+            <form:select path="organizeID" class="input-medium">
+                <form:option value="" label="请选择"/>
+                <form:option value="0" label="采美"/>
+                <form:option value="9999" label="呵呵商城"/>
+                <c:forEach items="${cmUserOrganizeList}" var="organize">
+                    <c:if test="${organize.id!=4}">
+                        <form:option value="${organize.id}" label="${organize.organizeName}"/>
+                    </c:if>
+                </c:forEach>
+                <%--					<form:options items="${cmUserOrganizeList}" itemLabel="organizeName" itemValue="id"--%>
+                <%--								  htmlEscape="false"/>--%>
+            </form:select>&nbsp;&nbsp;&nbsp;&nbsp;
+            <label>付款类型:</label>
+            <form:select path="paymentType" class="input-medium">
+                <form:option value="" label="请选择"/>
+                <form:option value="1" label="付款子订单"/>
+                <form:option value="2" label="供应商差价"/>
+                <form:option value="3" label="付第三方"/>
+            </form:select>
+            <label><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label><input
+                id="export" class="btn btn-primary" value="导出筛选结果"/></label>
+        </div>
 
 
-			<div class="clearfix"></div>
-		</div>
-	</form:form>
-	<sys:message content="${message}"/>
-	<table id="contentTable" class="table table-striped table-bordered table-condensed">
-		<thead>
-			<tr style="width:30%">
-				<th>付款单ID</th>
-				<th style="width:150px">付款单名称</th>
-				<th>付款类型</th>
-				<th>供应商</th>
-				<th>付款金额</th>
-				<th>子订单编号(ID)</th>
-				<th>订单编号(ID)</th>
-				<th>机构</th>
-				<th>申请人</th>
-				<th>申请日期</th>
-				<th>审核人</th>
-				<th>审核时间</th>
-				<th>付款审核状态</th>
-				<shiro:hasPermission name="order:cmPayShop:edit"><th>操作</th></shiro:hasPermission>
-			</tr>
-		</thead>
-		<tbody>
-		<c:forEach items="${page.list}" var="cmPayShop">
-			<tr>
-				<td>${cmPayShop.id}</td>
-				<td>${cmPayShop.name}</td>
-				<td>
-					${cmPayShop.paymentType eq 2 ? "供应商差价":(cmPayShop.paymentType eq 3 ? "付第三方":"子订单付款")}
-				</td>
-				<td>${cmPayShop.shopName}</td>
-				<td>
-					<fmt:formatNumber value="${cmPayShop.totalAmount}" type="number" pattern="#,##0.00"/>
-					<c:if test="${cmPayShop.wipePayment > 0}">
-						<br><font color="red">付款抹平¥<fmt:formatNumber value="${cmPayShop.wipePayment}" type="number" pattern="#,##0.00"/></font>
-					</c:if>
-				</td>
-				<td>
-					<c:forEach items="${cmPayShop.shopOrders}" var="shopOrder">
-						<a href="${ctx}/order/detail?id=${shopOrder.orderID}">${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})</a><br>
-					</c:forEach>
-				</td>
-				<td>
-					<c:forEach items="${cmPayShop.shopOrders}" var="shopOrder">
-						<a href="${ctx}/order/detail?id=${shopOrder.orderID}">${shopOrder.orderNo}(${shopOrder.orderID})</a><br>
-					</c:forEach>
-				</td>
-				<td>
-					<c:forEach items="${cmPayShop.shopOrders}" var="shopOrder">
-						<c:if test="${shopOrder.organizeID eq 1}">
-							<span class="org-note">星范</span>
-						</c:if>
-						${shopOrder.clubName}
-						<c:if test="${shopOrder.orderType eq 2}">
-							<span><font color="red">(呵呵商城)</font></span>
-						</c:if>
-						<c:if test="${shopOrder.organizeID == 3}">
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<table id="contentTable" class="table table-striped table-bordered table-condensed">
+    <thead>
+    <tr style="width:30%">
+        <th>付款单ID</th>
+        <th style="width:150px">付款单名称</th>
+        <th>付款类型</th>
+        <th>供应商</th>
+        <th>付款金额</th>
+        <th>子订单编号(ID)</th>
+        <th>订单编号(ID)</th>
+        <th>机构</th>
+        <th>申请人</th>
+        <th>申请日期</th>
+        <th>审核人</th>
+        <th>审核时间</th>
+        <th>付款审核状态</th>
+        <shiro:hasPermission name="order:cmPayShop:edit">
+            <th>操作</th>
+        </shiro:hasPermission>
+    </tr>
+    </thead>
+    <tbody>
+    <c:forEach items="${page.list}" var="cmPayShop">
+        <tr>
+            <td>${cmPayShop.id}</td>
+            <td>${cmPayShop.name}</td>
+            <td>
+                    ${cmPayShop.paymentType eq 2 ? "供应商差价":(cmPayShop.paymentType eq 3 ? "付第三方":"子订单付款")}
+            </td>
+            <td>${cmPayShop.shopName}</td>
+            <td>
+                <c:choose>
+                    <c:when test="${cmPayShop.paymentType eq 3}">
+                        ${cmPayShop.cmShopOtherFee + cmPayShop.totalAmount}
+                        <font color="red">
+                            <c:if test="${not empty cmPayShop.cmShopOtherFee and cmPayShop.cmShopOtherFee > 0 and not empty cmPayShop.totalAmount and cmPayShop.totalAmount > 0}">
+                                (采美中介费¥${cmPayShop.cmShopOtherFee},第三方中介费¥${cmPayShop.totalAmount})
+                            </c:if>
+                            <c:if test="${(empty cmPayShop.cmShopOtherFee or cmPayShop.cmShopOtherFee eq 0) and not empty cmPayShop.totalAmount and cmPayShop.totalAmount > 0}">
+                                (第三方中介费¥${cmPayShop.totalAmount})
+                            </c:if>
+                            <c:if test="${(not empty cmPayShop.cmShopOtherFee and cmPayShop.cmShopOtherFee > 0) and (empty cmPayShop.totalAmount or cmPayShop.totalAmount eq 0)}">
+                                (采美中介费¥${cmPayShop.cmShopOtherFee})
+                            </c:if>
+                        </font>
+                    </c:when>
+                    <c:otherwise>
+                        <fmt:formatNumber value="${cmPayShop.totalAmount}" type="number" pattern="#,##0.00"/>
+                        <c:if test="${cmPayShop.wipePayment > 0}">
+                            <br><font color="red">付款抹平¥<fmt:formatNumber value="${cmPayShop.wipePayment}" type="number"
+                                                                         pattern="#,##0.00"/></font>
+                        </c:if>
+                    </c:otherwise>
+                </c:choose>
+            </td>
+            <td>
+                <c:forEach items="${cmPayShop.shopOrders}" var="shopOrder">
+                    <a href="${ctx}/order/detail?id=${shopOrder.orderID}">${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})</a><br>
+                </c:forEach>
+            </td>
+            <td>
+                <c:forEach items="${cmPayShop.shopOrders}" var="shopOrder">
+                    <a href="${ctx}/order/detail?id=${shopOrder.orderID}">${shopOrder.orderNo}(${shopOrder.orderID})</a><br>
+                </c:forEach>
+            </td>
+            <td>
+                <c:forEach items="${cmPayShop.shopOrders}" var="shopOrder">
+                    <c:if test="${shopOrder.organizeID eq 1}">
+                        <span class="org-note">星范</span>
+                    </c:if>
+                    ${shopOrder.clubName}
+                    <c:if test="${shopOrder.orderType eq 2}">
+                        <span><font color="red">(呵呵商城)</font></span>
+                    </c:if>
+                    <c:if test="${shopOrder.organizeID == 3}">
 
-						</c:if><br>
-					</c:forEach>
-				</td>
+                    </c:if><br>
+                </c:forEach>
+            </td>
 
-				<td>
-						${cmPayShop.payType eq '6'? '系统自动':cmPayShop.applicantName}
-				</td>
-				<td>${cmPayShop.applyTime}</td>
-				<td>
-						${cmPayShop.payType eq '6'? '系统自动':cmPayShop.reviewerName}
-				</td>
-				<td>${cmPayShop.reviewTime}</td>
-				<td>
-					<c:if test="${cmPayShop.status == '0'}">
-						<font color="red">
-							<strong>待审核</strong>
-						</font>
-					</c:if>
-					<c:if test="${cmPayShop.status == '1'}">
-						审核通过
-					</c:if>
-					<c:if test="${cmPayShop.status == '2'}">
-						审核不通过<br><font color="red">原因: ${cmPayShop.reason}</font>
-					</c:if>
-				</td>
-				<td>
-					<c:if test="${cmPayShop.payType ne '6' && cmPayShop.status == '1'}">
-						<shiro:hasPermission name="order:cmPayShop:check">
-							<a class="td-a" href="${ctx}/order/cmPayShop/applyCompile?id=${cmPayShop.id}">编辑</a>
-						</shiro:hasPermission>
-					</c:if>
-					<shiro:hasPermission name="order:cmPayShop:detail">
-						<a class="td-a" href="${ctx}/order/cmPayShop/applyDetail?id=${cmPayShop.id}">查看详情</a>
-					</shiro:hasPermission>
-					<c:if test="${cmPayShop.status == '0'}">
-						<shiro:hasPermission name="order:cmPayShop:apply">
-							<c:if test="${cmPayShop.paymentType ne 3 && cmPayShop.paymentType ne 2}">
-								<a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">申请付款</a>
-							</c:if>
-							<c:if test="${cmPayShop.paymentType eq 3 && cmPayShop.paymentType ne 2}">
-								<a class="td-a" href="${ctx}/order/cmPayShop/shopOtherApplyEdit?payShopId=${cmPayShop.id}">申请付款</a>
-							</c:if>
-						</shiro:hasPermission>
-						<shiro:hasPermission name="order:cmPayShop:cancel">
-							<a class="td-a" href="${ctx}/order/cmPayShop/cancel?id=${cmPayShop.id}"
-							   onclick="return confirmx('确定要取消此次付款申请吗?', this.href)">取消付款</a>
-						</shiro:hasPermission>
-						<shiro:hasPermission name="order:cmPayShop:check">
-							<a class="td-a" href="${ctx}/order/cmPayShop/toCheck?id=${cmPayShop.id}">付款审核</a>
-						</shiro:hasPermission>
-					</c:if>
-					<c:if test="${cmPayShop.payType ne '6' && cmPayShop.status == '1'}">
-						<shiro:hasPermission name="order:cmPayShop:rollBack">
-							<a class="td-a" href="${ctx}/order/cmPayShop/rollBackApply?id=${cmPayShop.id}&redirectType=1"
-							   onclick="return confirmx('确定要撤销审核流程,重新来过吗?', this.href)">撤销重来</a>
-						</shiro:hasPermission>
-					</c:if>
-					<c:if test="${cmPayShop.status == '2'}">
-						<shiro:hasPermission name="order:cmPayShop:apply">
-							<c:if test="${cmPayShop.rePayment == '1' && cmPayShop.paymentType ne 2}">
-								<c:if test="${cmPayShop.paymentType ne 3}">
-									<a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">重申付款</a>
-								</c:if>
-								<c:if test="${cmPayShop.paymentType eq 3}">
-									<a class="td-a" href="${ctx}/order/cmPayShop/shopOtherApplyEdit?payShopId=${cmPayShop.id}">重申付款</a>
-								</c:if>
-							</c:if>
-							<c:if test="${cmPayShop.rePayment == '2'}">重申付款</c:if>
-						</shiro:hasPermission>
-						<shiro:hasPermission name="order:cmPayShop:cancel">
-							<a class="td-a" href="${ctx}/order/cmPayShop/cancel?id=${cmPayShop.id}"
-							   onclick="return confirmx('确定要取消此次付款申请吗?', this.href)">取消付款</a>
-						</shiro:hasPermission>
-					</c:if>
-					<c:if test="${cmPayShop.status == '1'}">
-						<shiro:hasPermission name="order:cmPayShop:detail">
-							<a class="td-a" href="${ctx}/order/cmPayShop/printDetail?id=${cmPayShop.id}">打印</a>
-						</shiro:hasPermission>
-					</c:if>
-				</td>
-			</tr>
-		</c:forEach>
-		</tbody>
-	</table>
-	<div class="pagination">${page}</div>
+            <td>
+                    ${cmPayShop.payType eq '6'? '系统自动':cmPayShop.applicantName}
+            </td>
+            <td>${cmPayShop.applyTime}</td>
+            <td>
+                    ${cmPayShop.payType eq '6'? '系统自动':cmPayShop.reviewerName}
+            </td>
+            <td>${cmPayShop.reviewTime}</td>
+            <td>
+                <c:if test="${cmPayShop.status == '0'}">
+                    <font color="red">
+                        <strong>待审核</strong>
+                    </font>
+                </c:if>
+                <c:if test="${cmPayShop.status == '1'}">
+                    审核通过
+                </c:if>
+                <c:if test="${cmPayShop.status == '2'}">
+                    审核不通过<br><font color="red">原因: ${cmPayShop.reason}</font>
+                </c:if>
+            </td>
+            <td>
+                <c:if test="${cmPayShop.payType ne '6' && cmPayShop.status == '1'}">
+                    <shiro:hasPermission name="order:cmPayShop:check">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/applyCompile?id=${cmPayShop.id}">编辑</a>
+                    </shiro:hasPermission>
+                </c:if>
+                <shiro:hasPermission name="order:cmPayShop:detail">
+                    <a class="td-a" href="${ctx}/order/cmPayShop/applyDetail?id=${cmPayShop.id}">查看详情</a>
+                </shiro:hasPermission>
+                <c:if test="${cmPayShop.status == '0'}">
+                    <shiro:hasPermission name="order:cmPayShop:apply">
+                        <c:if test="${cmPayShop.paymentType ne 3 && cmPayShop.paymentType ne 2}">
+                            <a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">申请付款</a>
+                        </c:if>
+                        <c:if test="${cmPayShop.paymentType eq 3 && cmPayShop.paymentType ne 2}">
+                            <a class="td-a" href="${ctx}/order/cmPayShop/shopOtherApplyEdit?payShopId=${cmPayShop.id}">申请付款</a>
+                        </c:if>
+                    </shiro:hasPermission>
+                    <shiro:hasPermission name="order:cmPayShop:cancel">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/cancel?id=${cmPayShop.id}"
+                           onclick="return confirmx('确定要取消此次付款申请吗?', this.href)">取消付款</a>
+                    </shiro:hasPermission>
+                    <shiro:hasPermission name="order:cmPayShop:check">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/toCheck?id=${cmPayShop.id}">付款审核</a>
+                    </shiro:hasPermission>
+                </c:if>
+                <c:if test="${cmPayShop.payType ne '6' && cmPayShop.status == '1'}">
+                    <shiro:hasPermission name="order:cmPayShop:rollBack">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/rollBackApply?id=${cmPayShop.id}&redirectType=1"
+                           onclick="return confirmx('确定要撤销审核流程,重新来过吗?', this.href)">撤销重来</a>
+                    </shiro:hasPermission>
+                </c:if>
+                <c:if test="${cmPayShop.status == '2'}">
+                    <shiro:hasPermission name="order:cmPayShop:apply">
+                        <c:if test="${cmPayShop.rePayment == '1' && cmPayShop.paymentType ne 2}">
+                            <c:if test="${cmPayShop.paymentType ne 3}">
+                                <a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">重申付款</a>
+                            </c:if>
+                            <c:if test="${cmPayShop.paymentType eq 3}">
+                                <a class="td-a"
+                                   href="${ctx}/order/cmPayShop/shopOtherApplyEdit?payShopId=${cmPayShop.id}">重申付款</a>
+                            </c:if>
+                        </c:if>
+                        <c:if test="${cmPayShop.rePayment == '2'}">重申付款</c:if>
+                    </shiro:hasPermission>
+                    <shiro:hasPermission name="order:cmPayShop:cancel">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/cancel?id=${cmPayShop.id}"
+                           onclick="return confirmx('确定要取消此次付款申请吗?', this.href)">取消付款</a>
+                    </shiro:hasPermission>
+                </c:if>
+                <c:if test="${cmPayShop.status == '1'}">
+                    <shiro:hasPermission name="order:cmPayShop:detail">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/printDetail?id=${cmPayShop.id}">打印</a>
+                    </shiro:hasPermission>
+                </c:if>
+            </td>
+        </tr>
+    </c:forEach>
+    </tbody>
+</table>
+<div class="pagination">${page}</div>
 </body>
 </html>

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

@@ -294,8 +294,8 @@
             <table>
                 <tr>
                     <td>
-                        <b>供应商运费:</b><input type="number" id="shopPostFee" name="shopPostFee"
-                                            onchange="changeShouldPay(this)" value="${newShopOrder.shopPostFee}"
+                        <b>供应商运费:</b><input type="number" id="shopPostFee" name="supplierFreight"
+                                            onchange="changeShouldPay(this)" value="${newShopOrder.supplierFreight}"
                                             style="margin-left: 20px"/>
                     </td>
                     <td>
@@ -308,10 +308,18 @@
                     <td>
                         <font color="red">*</font>
                         是否为返佣订单:
-                        <form:select path="" class="input-medium">
+                        <c:if test="${0 eq newShopOrder.rebateOrder}">
+                        <form:select path="rebateOrder" class="input-medium">
                             <form:option value="0" label="否"/>
                             <form:option value="1" label="是"/>
                         </form:select>
+                        </c:if>
+                        <c:if test="${1 eq newShopOrder.rebateOrder}">
+                            <form:select path="rebateOrder" class="input-medium">
+                                <form:option value="1" label="是"/>
+                                <form:option value="0" label="否"/>
+                            </form:select>
+                        </c:if>
                         <br/>
                         <font color="red">(若确定为返佣订单,则供应商运费,促销金额(平台类)和优惠券金额(平台类)都由平台服务费承担)</font>
                     </td>

+ 15 - 89
src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp

@@ -339,37 +339,22 @@
             <table class="table table-striped table-bordered table-condensed pay-table">
                 <tr>
                     <th>子订单编号(ID)</th>
-                        <%--                        <th colspan="3">客户</th>--%>
                     <th colspan="3">下单时间</th>
                     <th colspan="2">子订单金额</th>
-                        <%--                        <th colspan="3">所有子订单</th>--%>
-                        <%--                        <th>订单总佣金</th>--%>
                     <th colspan="4">采美平台服务费</th>
                     <th>采美自营订单利润</th>
                     <th>采美总利润</th>
-                        <%--                        <th>机构运费</th>--%>
                     <th colspan="2">收款状态</th>
                     <th colspan="3">收款金额</th>
                     <th colspan="2">促销满减</th>
                     <th colspan="2">优惠券</th>
                 <tr/>
                 <tr>
-                        <%--                        <td> ${s.orderNo}(${s.orderID})</td>--%>
-                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-                        <%--                        <td colspan="3"> ${s.buyer}</td>--%>
+                    <td>${s.shopOrderNo}(${s.shopOrderID})
+                        <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font
+                                color="red">(采美私账订单)</font></c:if></td>
                     <td colspan="3"> ${s.orderTime}</td>
                     <td colspan="2">${s.totalAmount}</td>
-                        <%--                        <td colspan="3">--%>
-                        <%--                        <c:forEach items="${s.shopOrderNos}" var="cs">--%>
-                        <%--                            ${cs}<br/>--%>
-                        <%--                        </c:forEach>--%>
-                        <%--                        </td>--%>
-                        <%--                        <td>--%>
-                        <%--                                ${s.income}--%>
-                        <%--                            <c:if test="${not empty s.rebateFee}">--%>
-                        <%--                                    <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>--%>
-                        <%--                            </c:if>--%>
-                        <%--                        </td>--%>
                     <td colspan="4">${s.allServeAmount}</td>
                     <c:if test="${empty s.brokerage}">
                     <td class="payCm-t"></td>
@@ -405,80 +390,17 @@
                                               pattern="#,##0.00"/>
                         </c:if>
                     </td>
-                        <%--<td>
-                            <label class="clubFreight"  style="display: none">
-                                <c:choose>
-                                    <c:when test="${s.freight != -1 && s.freight != 0 && s.freight != -2 && s.returnedFreightFlag ne true}">
-                                        <fmt:formatNumber value="${s.freight}"/>
-                                    </c:when>
-                                    <c:otherwise>
-                                        <fmt:formatNumber value="0"/>
-                                    </c:otherwise>
-                                </c:choose>
-                            </label>
-                            <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 gt 0}">
-                                (采美豆抵用${s.userBeans})
-                            </c:if>
-                        </td>--%>
                     <td colspan="2">
-                            <%--<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
-                               style="text-decoration: underline">
-                                </a>--%>
                         <c:if test="${s.shopReceiptStatus == 1}"><font color="red">待收款</font></c:if>
                         <c:if test="${s.shopReceiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
                         <c:if test="${s.shopReceiptStatus == 3}"><font color="green">已收款</font></c:if>
                     </td>
                     <td colspan="3">
-                            <%--<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline"></a>--%>
                             ${s.receiptAmount}
                         <c:if test="${s.accountAmount>0}">(余额抵扣 ¥${s.accountAmount})</c:if>
                     </td>
                     <td colspan="2">
                         <fmt:formatNumber value="${s.promotionFullReduction}" type="number" pattern="#,##0.00"/>
-                            <%--<label class="discountFee">
-                                <c:choose>
-                                    <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
-                                        <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
-                                    </c:when>
-                                    <c:otherwise>
-                                        0
-                                    </c:otherwise>
-                                </c:choose>
-                            </label>
-                            <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 class="couponAmount" colspan="2">${s.couponAmount} </td>
                     <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
@@ -493,7 +415,6 @@
                     <th>付款状态</th>
                     <th colspan="3">付供应商</th>
                     <th colspan="2">付第三方</th>
-                        <%--<th>成本类型</th>--%>
                 </tr>
                 <tr>
                     <td> ${s.buyer}</td>
@@ -568,13 +489,18 @@
                         <label class="wipeBtn"><input class="wipeFee" type="checkbox" value="0"><span>付款抹平:<em
                                 class="red wipeText">¥0.00</em></span></label>
                     </td>
-
-                    <td colspan="2" class="third-party-fee">${s.shopOtherFee}</td>
-
-                        <%--<td>
-                            <c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if>
-                            <c:if test="${s.costType == '2'}">比例成本</c:if>
-                        </td>--%>
+                    <td colspan="2" class="third-party-fee">
+                            ${s.shopOtherFee + s.cmShopOtherFee}
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee},第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee eq 0}">
+                            <font color="red">(第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee eq 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee})</font>
+                        </c:if>
+                    </td>
                 </tr>
                 <tr>
                     <th>商品名</th>

+ 4 - 2
src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp

@@ -414,7 +414,9 @@
 <%--                    <th>成本类型</th>--%>
                 </tr>
                 <tr>
-                    <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></td>
+                    <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a>
+                        <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font color="red">(采美私账订单)</font></c:if>
+                    </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.totalAmount}" type="number" pattern="#,##0.00"/></td>
                     <td colspan="3">${s.orderTime}</td>
@@ -494,7 +496,7 @@
                             <br><font color="red">(采美豆抵用:${s.userBeans})</font>
                         </c:if>
                     </td>
-                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                    <td class="freight"><fmt:formatNumber value="${s.supplierFreight}" type="number"
                                                           pattern="#,##0.00"/></td>
                     <td colspan="3" class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number"
                                                                           pattern="#,##0.00"/></td>

+ 422 - 146
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp

@@ -252,70 +252,297 @@
 <%--</html>--%>
 
 <%@ page contentType="text/html;charset=UTF-8" %>
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
 <html>
 <head>
     <title>付款单表管理</title>
     <meta name="decorator" content="default"/>
     <style>
-        .table th{text-align:center}
-        .table td{text-align:center}
-        .payment-form h4{width:96%;margin-left:2%;padding-bottom:20px;text-align:center;border-bottom:1px slid #eee}
-        .required{color:red}
-        .payment-form label{width:100px;text-align:right;vertical-align:middle;font-weight:600}
-        .payment-form-top{padding:10px 0}
-        .payment-form-top>div,.payment-form-bottom>div{width:94%;margin-left:3%;height:50px;line-height:50px;border-bottom:1px slid #eee;white-space:nowrap}
-        .payment-form-top input{vertical-align:baseline}
-        .payment-form-top>div:last-child span{margin-left:15px}
-        .payment-form-top>div:last-child span:nth-of-type(1){margin-left:0}
-        .pay-list-item{margin-bottom:30px}
-        .pay-table{width:96%;margin-left:2%;margin-bottom:10px}
-        .pay-table th{background:#f9f9f9}
-        .pay-table tr:first-child th{background:#eee !important}
-        .pay-table td{background:#fff !important}
-        .supplier-fee{text-align:left !important;padding-top:20px !important;padding-left:20px !important}
-        .need-to-pay{width:90px}
-        .payment-form-bottom label{width:140px}
-        .used-amount{width:80px;margin-top:6px}
-        .process-details span{width:140px;margin-left:50px;font-weight:600}
-        .process-for-label{margin-left:0 !important}
-        .process-details div{display:inline-block}
-        .check-btn{width:96%;margin-left:2%;text-align:center;height:60px;line-height:60px;margin-top:30px}
-        .check-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px slid #ddd}
-        .check-cfm-btn{background:#3daae9;color:#fff}
-        .cfm-btn:active,.return-btn:active{background:#ddd;color:#fff}
-        .mask{width:100%;height:100%;position:fixed;top:0;background:rgba(0,0,0,0.7);display:none}
-        .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%)}
-        .tips-popup-content div{width:100%;text-align:center}
-        .tips-popup-content{width:30%}
-        .tips-popup-content p{text-align:center;padding:80px;font-size:20px}
-        .tips-popup-content h4{padding-left:10px;height:40px;line-height:40px;border-bottom:1px slid #eee;margin-bottom:20px}
-        .tips-cfm-btn,.tips-cancel-btn,.check-blue-btn,.check-grey-btn{width:100px;height:40px;margin:auto;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;background:#3daae9;color:#fff;border:none}
-        .refuse-btn{margin-left:50px}
-        .return-btn,.tips-cancel-btn,.check-grey-btn{background:#fff;color:#555;margin-left:50px}
-        .tips-cancel-btn,.check-grey-btn{border:1px slid #ddd;margin-left:20px;display:none}
-        #close-btn1{top:8px;right:10px;width:18px;position:absolute;cursr:pointer}
-        .tips-popup-reasn .tips-popup-content{height:250px}
-        .tips-popup-reasn .tips-popup-content div{position:absolute;bottom:15px}
-        .tips-popup-reasn .check-grey-btn{display:inline-block}
-        #refuse-reasn{width:80%;height:48%;left:8%;position:absolute;resize:none}
-        .tips-popup-reasn h5{color:#555;padding-left:8%;margin-bottom:4px;margin-top:-12px}
-        .red{color:red;}
-        .payment-form-bottom .wipeImgs{height:auto;padding:8px 0;}
-        .wipeImgs img{width:120px;height:90px;background-color:#eee;margin-right:15px;}
-        .weishaIcon {background:darkorange;color:white;margin:0 0px;padding:0 3px;font-style:normal;font-size: 12px; display:inline-block;border-radius:2px}
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        .payment-form h4 {
+            width: 96%;
+            margin-left: 2%;
+            padding-bottom: 20px;
+            text-align: center;
+            border-bottom: 1px slid #eee
+        }
+
+        .required {
+            color: red
+        }
+
+        .payment-form label {
+            width: 100px;
+            text-align: right;
+            vertical-align: middle;
+            font-weight: 600
+        }
+
+        .payment-form-top {
+            padding: 10px 0
+        }
+
+        .payment-form-top > div, .payment-form-bottom > div {
+            width: 94%;
+            margin-left: 3%;
+            height: 50px;
+            line-height: 50px;
+            border-bottom: 1px slid #eee;
+            white-space: nowrap
+        }
+
+        .payment-form-top input {
+            vertical-align: baseline
+        }
+
+        .payment-form-top > div:last-child span {
+            margin-left: 15px
+        }
+
+        .payment-form-top > div:last-child span:nth-of-type(1) {
+            margin-left: 0
+        }
+
+        .pay-list-item {
+            margin-bottom: 30px
+        }
+
+        .pay-table {
+            width: 96%;
+            margin-left: 2%;
+            margin-bottom: 10px
+        }
+
+        .pay-table th {
+            background: #f9f9f9
+        }
+
+        .pay-table tr:first-child th {
+            background: #eee !important
+        }
+
+        .pay-table td {
+            background: #fff !important
+        }
+
+        .supplier-fee {
+            text-align: left !important;
+            padding-top: 20px !important;
+            padding-left: 20px !important
+        }
+
+        .need-to-pay {
+            width: 90px
+        }
+
+        .payment-form-bottom label {
+            width: 140px
+        }
+
+        .used-amount {
+            width: 80px;
+            margin-top: 6px
+        }
+
+        .process-details span {
+            width: 140px;
+            margin-left: 50px;
+            font-weight: 600
+        }
+
+        .process-for-label {
+            margin-left: 0 !important
+        }
+
+        .process-details div {
+            display: inline-block
+        }
+
+        .check-btn {
+            width: 96%;
+            margin-left: 2%;
+            text-align: center;
+            height: 60px;
+            line-height: 60px;
+            margin-top: 30px
+        }
+
+        .check-btn button {
+            width: 100px;
+            height: 35px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            border: none;
+            border: 1px slid #ddd
+        }
+
+        .check-cfm-btn {
+            background: #3daae9;
+            color: #fff
+        }
+
+        .cfm-btn:active, .return-btn:active {
+            background: #ddd;
+            color: #fff
+        }
+
+        .mask {
+            width: 100%;
+            height: 100%;
+            position: fixed;
+            top: 0;
+            background: rgba(0, 0, 0, 0.7);
+            display: none
+        }
+
+        .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%)
+        }
+
+        .tips-popup-content div {
+            width: 100%;
+            text-align: center
+        }
+
+        .tips-popup-content {
+            width: 30%
+        }
+
+        .tips-popup-content p {
+            text-align: center;
+            padding: 80px;
+            font-size: 20px
+        }
+
+        .tips-popup-content h4 {
+            padding-left: 10px;
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px slid #eee;
+            margin-bottom: 20px
+        }
+
+        .tips-cfm-btn, .tips-cancel-btn, .check-blue-btn, .check-grey-btn {
+            width: 100px;
+            height: 40px;
+            margin: auto;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            background: #3daae9;
+            color: #fff;
+            border: none
+        }
+
+        .refuse-btn {
+            margin-left: 50px
+        }
+
+        .return-btn, .tips-cancel-btn, .check-grey-btn {
+            background: #fff;
+            color: #555;
+            margin-left: 50px
+        }
+
+        .tips-cancel-btn, .check-grey-btn {
+            border: 1px slid #ddd;
+            margin-left: 20px;
+            display: none
+        }
+
+        #close-btn1 {
+            top: 8px;
+            right: 10px;
+            width: 18px;
+            position: absolute;
+            cursr: pointer
+        }
+
+        .tips-popup-reasn .tips-popup-content {
+            height: 250px
+        }
+
+        .tips-popup-reasn .tips-popup-content div {
+            position: absolute;
+            bottom: 15px
+        }
+
+        .tips-popup-reasn .check-grey-btn {
+            display: inline-block
+        }
+
+        #refuse-reasn {
+            width: 80%;
+            height: 48%;
+            left: 8%;
+            position: absolute;
+            resize: none
+        }
+
+        .tips-popup-reasn h5 {
+            color: #555;
+            padding-left: 8%;
+            margin-bottom: 4px;
+            margin-top: -12px
+        }
+
+        .red {
+            color: red;
+        }
+
+        .payment-form-bottom .wipeImgs {
+            height: auto;
+            padding: 8px 0;
+        }
+
+        .wipeImgs img {
+            width: 120px;
+            height: 90px;
+            background-color: #eee;
+            margin-right: 15px;
+        }
+
+        .weishaIcon {
+            background: darkorange;
+            color: white;
+            margin: 0 0px;
+            padding: 0 3px;
+            font-style: normal;
+            font-size: 12px;
+            display: inline-block;
+            border-radius: 2px
+        }
     </style>
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <c:if test="${cmPayShop.redirectType == 2}" >
+    <c:if test="${cmPayShop.redirectType == 2}">
         <li><a href="${ctx}/order/cmPayShop/payList">付款管理</a></li>
     </c:if>
-    <c:if test="${cmPayShop.redirectType != 2}" >
+    <c:if test="${cmPayShop.redirectType != 2}">
         <li><a href="${ctx}/order/cmPayShop/">付款管理</a></li>
     </c:if>
     <li class="active"><a href="${ctx}/order/cmPayShop/toCheck?id=${cmPayShop.id}">付款审核</a></li>
-</ul><br/>
+</ul>
+<br/>
 <div class="payment-form">
     <h4>付款单</h4>
     <div class="payment-form-top">
@@ -327,23 +554,13 @@
             <label>供应商名称:</label>
             <span>${cmPayShop.shopName}</span>
         </div>
-        <div>
-            <label><em class="required">* </em>付款账号:</label>
-            <span>户名:${cmPayShop.bankAccountName}</span>
-            <span>账号:${cmPayShop.bankAccount}</span>
-            <span>开户行:${cmPayShop.bankName}</span>
-            <span>账户类型:
-					<c:if test="${cmPayShop.type == '0'}">公帐</c:if>
-					<c:if test="${cmPayShop.type == '1'}">私帐</c:if>
-				</span>
-        </div>
     </div>
     <div class="payment-form-content">
         <c:forEach items="${cmPayShop.shopOrders}" var="s">
             <%--涛姐遍历下面这个table--%>
             <table class="table table-striped table-bordered table-condensed pay-table">
                 <tr>
-                    <th>订单编号(ID)</th>
+                    <th>子订单编号(ID)</th>
                     <th colspan="3">客户</th>
                     <th colspan="2">下单时间</th>
                     <th>订单金额</th>
@@ -356,7 +573,9 @@
                     <th>优惠券</th>
                 <tr/>
                 <tr>
-                    <td> ${s.orderNo}(${s.orderID})</td>
+                    <td>${s.shopOrderNo}(${s.shopOrderID})
+                        <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font
+                                color="red">(采美私账订单)</font></c:if></td>
                     <td colspan="3"> ${s.buyer}</td>
                     <td colspan="2"> ${s.orderTime}</td>
                     <td>${s.payTotalFee}</td>
@@ -367,7 +586,7 @@
                     </td>
                     <td>${s.income}</td>
                     <td>
-                        <label class="clubFreight"  style="display: none">
+                        <label class="clubFreight" style="display: none">
                             <c:choose>
                                 <c:when test="${s.freight != -1 && s.freight != 0 && s.freight != -2 && s.returnedFreightFlag ne true}">
                                     <fmt:formatNumber value="${s.freight}"/>
@@ -407,42 +626,42 @@
                     </td>
                     <td>
                         <fmt:formatNumber value="${s.promotionFullReduction}" type="number" pattern="#,##0.00"/>
-                        <%--<label class="discountFee"  style="display: none">
-                            <c:choose>
-                                <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
-                                    <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
-                                </c:when>
-                                <c:otherwise>
-                                    0
-                                </c:otherwise>
-                            </c:choose>
-                        </label>
-                        <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>
+                            <%--<label class="discountFee"  style="display: none">
+                                <c:choose>
+                                    <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
+                                        <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
+                                    </c:when>
+                                    <c:otherwise>
+                                        0
+                                    </c:otherwise>
+                                </c:choose>
+                            </label>
+                            <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>
-                        <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>--%>
+                            <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>--%>
                     </td>
                     <td>${s.couponAmount} </td>
                 <tr/>
                 <tr>
-                    <th>订单编号(ID)</th>
+                    <th>订单编号(ID)</th>
                     <th colspan="3"> 供应商</th>
                     <th colspan="3">子订单佣金</th>
                     <th colspan="3">商品费</th>
@@ -454,7 +673,7 @@
                     <th>成本类型</th>
                 </tr>
                 <tr>
-                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                    <td> ${s.orderNo}(${s.orderID})</td>
                     <td colspan="3">${s.shopName}</td>
                     <td colspan="3" class="payCm-t">子订单佣金</td>
                     <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
@@ -479,10 +698,12 @@
                                 应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
                             </c:if>
 							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount+s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
+                                <font color="black"><fmt:formatNumber
+                                        value="${s.shouldPayShopAmount+s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
                             </c:if>
 							<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount-s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
+                                <font color="black"><fmt:formatNumber
+                                        value="${s.shouldPayShopAmount-s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
                             </c:if>
 							,</span>
                             <span class="nowrap">已付:${s.payedShopAmount},</span></div>
@@ -498,7 +719,17 @@
                                 class="red wipeText">¥0.00</em></span></label>
                     </td>
 
-                    <td class="third-party-fee">${s.shopOtherFee}</td>
+                    <td class="third-party-fee">${s.shopOtherFee + s.cmShopOtherFee}
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee},第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee eq 0}">
+                            <font color="red">(第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee eq 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee})</font>
+                        </c:if>
+                    </td>
 
                     <td>
                         <c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if>
@@ -586,21 +817,17 @@
         </c:forEach>
     </div>
     <div class="payment-form-bottom">
-        <div>
-            <label>付第三方金额:</label>
-            <span>${cmPayShop.totalAmount}</span>
-        </div>
-
-        <div>
-            <label style="font-weight: bold; font-size:18px">转账支付:</label>
-            <span id="transferPayFee" style="font-weight: bold; font-size:18px"><fmt:formatNumber value="${cmPayShop.transferPayFee}" pattern="#,##0.00"/> </span>
-            <label>付款银行:</label><span>
-<%--                <select name="payType" class="input-medium" style="width: 200px">
-                    <option value="">请选择</option>
-                    <c:forEach items="${offlineCollections}" var="offlineCollections">
-                        <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
-                    </c:forEach>
-                </select>--%>
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;">
+            <div>
+                <label>第三方中介费:</label>
+                <span>${cmPayShop.totalAmount}</span>
+            </div>
+            <c:if test="${cmPayShop.payType ne '6'}">
+                <div>
+                    <label style="font-weight: bold; font-size:18px">转账支付:</label>
+                    <span id="transferPayFee" style="font-weight: bold; font-size:18px"><fmt:formatNumber
+                            value="${cmPayShop.transferPayFee + cmPayShop.cmShopOtherFee}" pattern="#,##0.00"/> </span>
+                    <label>付款银行:</label><span>
 					<select name="payType" style="width: 200px">
 						<option value="">请选择</option>
                         <c:forEach items="${offlineCollections}" var="offlineCollections">
@@ -608,24 +835,73 @@
                         </c:forEach>
 					</select>
 				</span>
-            <label>付款时间:</label>
-            <span>${cmPayShop.payTime}</span>
-            <input name="id" value="${cmPayShop.id}" id="id" type="hidden">
-        </div>
-        <div class="process-details">
-            <label>申请人:</label><div class="process-for-label">${cmPayShop.applicantName}</div>
-            <span>申请时间:</span><div>${cmPayShop.applyTime}</div>
-            <span>审核人:</span><div>
-            <c:if test="${cmPayShop.status == 1 || cmPayShop.status == 2}">
-                ${cmPayShop.reviewerName}
+
+                    <label>付款时间:</label>
+                    <span>${cmPayShop.payTime}</span>
+                </div>
             </c:if>
         </div>
-            <span>审核时间:</span><div>
-            <c:if test="${cmPayShop.status == 1 || cmPayShop.status == 2}">
-                ${cmPayShop.reviewTime}
+        <br/>
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;${empty cmPayShop.cmShopOtherFee or cmPayShop.cmShopOtherFee eq 0 ? 'display:none':''}">
+            <div>
+                <label>采美中介费:</label>
+                <span>${cmPayShop.cmShopOtherFee}</span>
+            </div>
+            <div>
+                <label><em class="required">* </em>付款账号:</label>
+                <c:if test="${cmPayShop.cmOtherPayType eq '6'}">
+                    无
+                </c:if>
+                <c:if test="${cmPayShop.cmOtherPayType ne '6'}">
+                    <span>户名:${cmPayShop.cmBankAccountName}</span>
+                    <span>账号:${cmPayShop.cmBankAccount}</span>
+                    <span>开户行:${cmPayShop.cmBankName}</span>
+                    <span>账户类型:
+        						<c:if test="${cmPayShop.cmType == '0'}">公帐</c:if>
+        						<c:if test="${cmPayShop.cmType == '1'}">私帐</c:if>
+        					</span>
+                </c:if>
+            </div>
+            <c:if test="${cmPayShop.cmOtherPayType ne '6'}">
+                <div>
+                    <label style="font-weight: bold; font-size:18px">转账支付:</label>
+                    <span id="transferAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber
+                            value="${cmPayShop.cmShopOtherFee + cmPayShop.totalAmount}" pattern="#,##0.00"/></span>
+                    <c:if test="${cmPayShop.status != '2'}">
+                        <c:if test="${not empty cmPayShop.cmOtherPayType }">
+                            <label>付款银行:</label>
+                            <span id="payType">
+                                    ${cmPayShop.cmBankNameType}
+                            </span>
+                        </c:if>
+                        <c:if test="${cmPayShop.status != '0'}">
+                            <label>付款时间:</label>
+                            <span>${cmPayShop.cmOtherPayTime}</span>
+                        </c:if>
+                    </c:if>
+                </div>
             </c:if>
         </div>
+        <br/>
+        <div class="process-details">
+            <label>申请人:</label>
+            <div class="process-for-label">${cmPayShop.applicantName}</div>
+            <span>申请时间:</span>
+            <div>${cmPayShop.applyTime}</div>
+            <span>审核人:</span>
+            <div>
+                <c:if test="${cmPayShop.status == 1 || cmPayShop.status == 2}">
+                    ${cmPayShop.reviewerName}
+                </c:if>
+            </div>
+            <span>审核时间:</span>
+            <div>
+                <c:if test="${cmPayShop.status == 1 || cmPayShop.status == 2}">
+                    ${cmPayShop.reviewTime}
+                </c:if>
+            </div>
         </div>
+        <input name="id" value="${cmPayShop.id}" id="id" type="hidden">
     </div>
     <div class="check-btn">
         <button class="check-cfm-btn" type="button">审核通过</button>
@@ -658,50 +934,50 @@
     </div>
 </div>
 <script>
-    (function(){
+    (function () {
         var payTableEle = $('.pay-table'),
             accessFlag = true,
             unaccessFlag = true,
             payProductEle = $('.pay-product-item');
-        payTableEle.each(function (i,l) {
+        payTableEle.each(function (i, l) {
             var productLength = $(this).find('.pay-product-item').length;
             // 商品列表合并单元格
             // $(this).find('.mergeRows').attr('rowspan',productLength);
         });
 
-        $('.pay-table').each(function(){
+        $('.pay-table').each(function () {
             var thisEle = $(this),
                 totalComissionVal = 0,
                 resVal = '';
             totalComissionEle = thisEle.find('.payCm'),
                 comissionEle = thisEle.find('.payCm-t'),
-                thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',',''),
-                freightVal = thisEle.find('.freight').text().replace(',','');
-            totalComissionEle.each(function(){
-                totalComissionVal += Number($(this).text().replace(',',''));
+                thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',', ''),
+                freightVal = thisEle.find('.freight').text().replace(',', '');
+            totalComissionEle.each(function () {
+                totalComissionVal += Number($(this).text().replace(',', ''));
             })
             resVal = (totalComissionVal - thirdPartyVal - freightVal).toFixed(2);
             comissionEle.text(resVal);
         })
 
-        $('.tips-cancel-btn, #close-btn1').on('click',function() {
+        $('.tips-cancel-btn, #close-btn1').on('click', function () {
             $('.mask').hide();
         })
-        $('.tips-cfm-directly').on('click',function() {
-            if($('.tips-cfm-btn').hasClass('tips-cfm-directly')) {
+        $('.tips-cfm-directly').on('click', function () {
+            if ($('.tips-cfm-btn').hasClass('tips-cfm-directly')) {
                 $('.tips-popup').hide();
             } else {
                 $('#form').submit();
             }
         })
-        $('.refuse-btn').on('click',function() {
+        $('.refuse-btn').on('click', function () {
             $('.tips-popup-reasn').show();
         })
-        $('.check-grey-btn').on('click',function() {
+        $('.check-grey-btn').on('click', function () {
             $('.tips-popup-reasn').hide();
         })
 
-        function showTips(title,text) {
+        function showTips(title, text) {
             $('.tips-popup h4').text(title);
             $('.tips-popup p').text(text);
             $('.tips-popup').show();
@@ -711,24 +987,24 @@
         function submitForm() {
             $('.tips-cfm-btn').removeClass('tips-cfm-directly').addClass('submit-now');
             $('.tips-cancel-btn').hide();
-            showTips('信息提示','审核通过');
+            showTips('信息提示', '审核通过');
         }
 
-        $('.check-cfm-btn').on('click',function(e) {
+        $('.check-cfm-btn').on('click', function (e) {
             var payType = $('select[name="payType"]').val(),
                 id = $('#id').val();
-            if($(this).hasClass('check-blue-btn')) {
+            if ($(this).hasClass('check-blue-btn')) {
                 var textareaVal = $('#refuse-reasn').val();
-                if(!textareaVal.trim()) {
-                    showTips('信息提示','审核原因不能为空');
+                if (!textareaVal.trim()) {
+                    showTips('信息提示', '审核原因不能为空');
                     return false;
                 }
-                if(unaccessFlag) {
+                if (unaccessFlag) {
                     window.location.href = '${ctx}/order/cmPayShop/checkNotPass?id=' + id + '&reasn=' + textareaVal;
                     unaccessFlag = false;
                 }
             } else {
-                if(accessFlag) {
+                if (accessFlag) {
                     window.location.href = '${ctx}/order/cmPayShop/checkPass?payType=' + payType + '&id=' + id;
                     accessFlag = false;
                 }

+ 266 - 102
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherEdit.jsp

@@ -1,117 +1,280 @@
 <%@ page contentType="text/html;charset=UTF-8" %>
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
 <html>
 <head>
     <title>付款单表管理</title>
     <meta name="decorator" content="default"/>
     <style>
-        .table th{text-align:center}
-        .table td{text-align:center}
-        .payment-form h4{width:96%;margin-left:2%;padding-bottom:20px;text-align:center;border-bottom:1px solid #eee}
-        .required{color:red}
-        .payment-form label{width:100px;text-align:right;vertical-align:middle;font-weight:600}
-        .payment-form-top{padding:10px 0}
-        .payment-form-top>div,.payment-form-bottom>div{width:94%;margin-left:3%;height:50px;line-height:50px;border-bottom:1px solid #eee;white-space:nowrap}
-        .payment-form-top input{vertical-align:baseline}
-        .payment-form-top>div:last-child span{margin-left:15px}
-        .payment-form-top>div:last-child span:nth-of-type(1){margin-left:0}
-        .pay-table th{background:#f9f9f9}
-        .pay-table tr:first-child th{background:#eee !important}
-        .pay-table td{background:#fff !important}
-        .check-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
-        .payment-form-bottom label{width:140px}
-        .process-details span{width:140px;margin-left:50px;font-weight:600}
-        .process-details div{display:inline-block}
-        .payment-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
-        .tips-popup-content div{width:100%;text-align:center}
-        .tips-popup-content p{text-align:center;padding:80px;font-size:20px}
-        .tips-popup-content h4{padding-left:10px;height:40px;line-height:40px;border-bottom:1px solid #eee;margin-bottom:20px}
-        .check-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        .payment-form h4 {
+            width: 96%;
+            margin-left: 2%;
+            padding-bottom: 20px;
+            text-align: center;
+            border-bottom: 1px solid #eee
+        }
+
+        .required {
+            color: red
+        }
+
+        .payment-form label {
+            width: 100px;
+            text-align: right;
+            vertical-align: middle;
+            font-weight: 600
+        }
+
+        .payment-form-top {
+            padding: 10px 0
+        }
+
+        .payment-form-top > div, .payment-form-bottom > div {
+            width: 94%;
+            margin-left: 3%;
+            height: 50px;
+            line-height: 50px;
+            border-bottom: 1px solid #eee;
+            white-space: nowrap
+        }
+
+        .payment-form-top input {
+            vertical-align: baseline
+        }
+
+        .payment-form-top > div:last-child span {
+            margin-left: 15px
+        }
+
+        .payment-form-top > div:last-child span:nth-of-type(1) {
+            margin-left: 0
+        }
+
+        .pay-table th {
+            background: #f9f9f9
+        }
+
+        .pay-table tr:first-child th {
+            background: #eee !important
+        }
+
+        .pay-table td {
+            background: #fff !important
+        }
+
+        .check-btn button {
+            width: 100px;
+            height: 35px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            border: none;
+            border: 1px solid #ddd
+        }
+
+        .payment-form-bottom label {
+            width: 140px
+        }
+
+        .process-details span {
+            width: 140px;
+            margin-left: 50px;
+            font-weight: 600
+        }
+
+        .process-details div {
+            display: inline-block
+        }
+
+        .payment-btn button {
+            width: 100px;
+            height: 35px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            border: none;
+            border: 1px solid #ddd
+        }
+
+        .tips-popup-content div {
+            width: 100%;
+            text-align: center
+        }
+
+        .tips-popup-content p {
+            text-align: center;
+            padding: 80px;
+            font-size: 20px
+        }
+
+        .tips-popup-content h4 {
+            padding-left: 10px;
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px solid #eee;
+            margin-bottom: 20px
+        }
+
+        .check-btn button {
+            width: 100px;
+            height: 35px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            border: none;
+            border: 1px solid #ddd
+        }
     </style>
     <style media="print">
-        .styleWidth{width:6%;word-break:break-all}
-        .styleWidth{}
-        .styleWidth3{width:10%;word-break:break-all}
-        .table{margin-left:0;margin-bottom:20px;padding-bottom:2px;border-bottom:1px solid #ddd;box-sizing:border-box}
-        .export{display:none}
+        .styleWidth {
+            width: 6%;
+            word-break: break-all
+        }
+
+        .styleWidth {
+        }
+
+        .styleWidth3 {
+            width: 10%;
+            word-break: break-all
+        }
+
+        .table {
+            margin-left: 0;
+            margin-bottom: 20px;
+            padding-bottom: 2px;
+            border-bottom: 1px solid #ddd;
+            box-sizing: border-box
+        }
+
+        .export {
+            display: none
+        }
     </style>
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <c:if test="${cmPayShop.redirectType == 2}" >
+    <c:if test="${cmPayShop.redirectType == 2}">
         <li><a href="${ctx}/order/cmPayShop/payList">付款管理</a></li>
     </c:if>
-    <c:if test="${cmPayShop.redirectType != 2}" >
+    <c:if test="${cmPayShop.redirectType != 2}">
         <li><a href="${ctx}/order/cmPayShop/">付款管理</a></li>
     </c:if>
     <li class="active"><a href="${ctx}/order/cmPayShop/applyCompile?id=${cmPayShop.id}">编辑</a></li>
-</ul><br/>
-<form:form id="inputForm" modelAttribute="cmPayShop" action="${ctx}/order/cmPayShop/applyCompileSave?id=${cmPayShop.id}" method="post" class="form-horizontal">
-<div class="payment-form">
-    <h4>付款单</h4>
-    <div class="payment-form-top">
-        <div>
-            <label>订单编号(ID):</label>&nbsp;&nbsp;
-            <span><a href="${ctx}/order/detail?id=${cmPayShop.shopOrders.get(0).orderID}">${cmPayShop.shopOrders.get(0).orderNo}(${cmPayShop.shopOrders.get(0).orderID})</a></span>
-        </div>
-        <div>
-            <label>子订单编号(ID):</label>&nbsp;&nbsp;&nbsp;&nbsp;
-            <span><a href="${ctx}/order/detail?id=${cmPayShop.shopOrders.get(0).orderID}">${cmPayShop.shopOrders.get(0).shopOrderNo}(${cmPayShop.shopOrders.get(0).shopOrderID})</a></span>
-        </div>
-        <div>
-            <label>付款单名称:</label>
-            <span>${cmPayShop.name}</span>
-        </div>
-        <div>
-            <label>付款账号:</label>
-            <c:if test="${cmPayShop.payType eq '6'}">
-                无
-            </c:if>
-            <c:if test="${cmPayShop.payType ne '6'}">
-                <span>户名:${cmPayShop.bankAccountName}</span>
-                <span>账号:${cmPayShop.bankAccount}</span>
-                <span>开户行:${cmPayShop.bankName}</span>
-                <span>账户类型:
-						<c:if test="${cmPayShop.type == '0'}">公帐</c:if>
-						<c:if test="${cmPayShop.type == '1'}">私帐</c:if>
-					</span>
-            </c:if>
-        </div>
-        <div>
-            <label>付第三方金额:</label>
-            <span>${cmPayShop.totalAmount}</span>
-        </div>
-        <div>
-            <label>付款银行:</label><span>
+</ul>
+<br/>
+<form:form id="inputForm" modelAttribute="cmPayShop" action="${ctx}/order/cmPayShop/applyCompileSave?id=${cmPayShop.id}"
+           method="post" class="form-horizontal">
+    <div class="payment-form">
+        <h4>付款单</h4>
+        <div class="payment-form-top">
+            <div>
+                <label>子订单编号(ID):</label>&nbsp;&nbsp;&nbsp;&nbsp;
+                <span><a
+                        href="${ctx}/order/detail?id=${cmPayShop.shopOrders.get(0).orderID}">${cmPayShop.shopOrders.get(0).shopOrderNo}(${cmPayShop.shopOrders.get(0).shopOrderID})</a></span>
+            </div>
+            <div>
+                <label>订单编号(ID):</label>&nbsp;&nbsp;
+                <span><a
+                        href="${ctx}/order/detail?id=${cmPayShop.shopOrders.get(0).orderID}">${cmPayShop.shopOrders.get(0).orderNo}(${cmPayShop.shopOrders.get(0).orderID})</a></span>
+            </div>
+            <div>
+                <label>付款单名称:</label>
+                <span>${cmPayShop.name}</span>
+            </div>
+            <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%">
+                <div>
+                    <label>付第三方中介费:</label>
+                    <span>${cmPayShop.totalAmount}</span>
+                </div>
+                <div>
+                    <label>付款账号:</label>
+                    <c:if test="${cmPayShop.payType eq '6'}">
+                        无
+                    </c:if>
+                    <c:if test="${cmPayShop.payType ne '6'}">
+                        <span>户名:${cmPayShop.bankAccountName}</span>
+                        <span>账号:${cmPayShop.bankAccount}</span>
+                        <span>开户行:${cmPayShop.bankName}</span>
+                        <span>账户类型:
+                						<c:if test="${cmPayShop.type == '0'}">公帐</c:if>
+                						<c:if test="${cmPayShop.type == '1'}">私帐</c:if>
+                					</span>
+                    </c:if>
+                </div>
+                <div>
+                    <label>付款银行:</label><span>
 					 <select name="payType" class="input-medium required" style="width: 200px">
                          <option value="">请选择</option>
-                         <c:forEach  items="${offlineCollections}" var="offlineCollections" varStatus="index">
+                         <c:forEach items="${offlineCollections}" var="offlineCollections" varStatus="index">
                              <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
                          </c:forEach>
                      </select>
-                         <%--<form:option value="" label="请选择"/>
-                         <form:option value="1" label="建设银行7297"/>
-                         <form:option value="2" label="中信银行0897"/>
-                         <form:option value="3" label="中信银行7172"/>
-                         <form:option value="4" label="广发银行0115"/>
-                         <form:option value="5" label="广发银行5461"/>
-                         <form:option value="7" label="华夏银行2400"/>
-                         <form:option value="8" label="中国银行9452"/>--%>
 				</span>
-            <label>付款时间:</label>
-            <span><form:input path="payTime" type="text" maxlength="20" class="input-medium Wdate" value="${cmPayShop.payTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/></span>
-        </div>
-        <div>
-            <label>申请人:</label>
-            <span>${cmPayShop.applicantName}</span>
-        </div>
-        <div>
-            <label>申请时间:</label>
-            <span>${cmPayShop.applyTime}</span>
-        </div>
-        <div>
-            <label>审核状态:</label>
-            <span>
+                </div>
+                <div>
+                    <label>付款时间:</label>
+                    <span><form:input path="payTime" type="text" maxlength="20" class="input-medium Wdate"
+                                      value="${cmPayShop.payTime}"
+                                      onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/></span>
+                </div>
+            </div>
+            <br/>
+            <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;${not empty otherFee.onlinePayWays or otherFee.cmAccountType ne 1?'display:none':''}">
+                <div>
+                    <label>采美中介费:</label>
+                    <span>${cmPayShop.cmShopOtherFee}</span>
+                </div>
+                <div>
+                    <label>付款账号:</label>
+                    <c:if test="${cmPayShop.cmOtherPayType eq '6'}">
+                        无
+                    </c:if>
+                    <c:if test="${cmPayShop.cmOtherPayType ne '6'}">
+                        <span>户名:${cmPayShop.cmBankAccountName}</span>
+                        <span>账号:${cmPayShop.cmBankAccount}</span>
+                        <span>开户行:${cmPayShop.cmBankName}</span>
+                        <span>账户类型:
+                			<c:if test="${cmPayShop.cmType == '0'}">公帐</c:if>
+                			<c:if test="${cmPayShop.cmType == '1'}">私帐</c:if>
+                		</span>
+                    </c:if>
+                </div>
+                <div>
+                    <label>付款银行:</label><span>
+					 <select name="cmOtherPayType" class="input-medium required" style="width: 200px">
+                         <option value="">请选择</option>
+                         <c:forEach items="${offlineCollections}" var="offlineCollections" varStatus="index">
+                             <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
+                         </c:forEach>
+                     </select>
+				</span>
+                </div>
+                <div>
+                    <label>付款时间:</label>
+                    <span><form:input path="cmOtherPayTime" type="text" maxlength="20" class="input-medium Wdate"
+                                      value="${cmPayShop.cmOtherPayTime}"
+                                      onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/></span>
+                </div>
+            </div>
+            <div>
+                <label>申请人:</label>
+                <span>${cmPayShop.applicantName}</span>
+            </div>
+            <div>
+                <label>申请时间:</label>
+                <span>${cmPayShop.applyTime}</span>
+            </div>
+            <div>
+                <label>审核状态:</label>
+                <span>
                 <c:if test="${cmPayShop.status == '0'}">
 						<font color="red">
 							<strong>待审核</strong>
@@ -124,19 +287,20 @@
                     审核不通过
                 </c:if>
             </span>
-        </div>
-        <c:if test="${cmPayShop.status == '2'}">
-            <div>
-                <label>原因:</label>
-                <span>${cmPayShop.reason}</span>
             </div>
-        </c:if>
-    </div>
-    <div class="form-actions">
-        <shiro:hasPermission name="order:cmPayShop:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="确  认"/>&nbsp;</shiro:hasPermission>
-        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+            <c:if test="${cmPayShop.status == '2'}">
+                <div>
+                    <label>原因:</label>
+                    <span>${cmPayShop.reason}</span>
+                </div>
+            </c:if>
+        </div>
+        <div class="form-actions">
+            <shiro:hasPermission name="order:cmPayShop:edit"><input id="btnSubmit" class="btn btn-primary" type="submit"
+                                                                    value="确  认"/>&nbsp;</shiro:hasPermission>
+            <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+        </div>
     </div>
-</div>
 </form:form>
 </body>
 </html>

+ 168 - 76
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherForm.jsp

@@ -123,20 +123,25 @@
         .pay-status label:first-child {
             margin-left: 10px
         }
-        .controls{
+
+        .controls {
             font-size: 0;
         }
-        .controls .conList{
+
+        .controls .conList {
             display: inline-block;
             margin-right: 15px;
         }
-        .conList .btn:nth-of-type(1){
+
+        .conList .btn:nth-of-type(1) {
             margin-left: 25px;
         }
+
         .upload-content {
             margin-top: -70px;
             display: inline-block;
         }
+
         .upload-content .conList .btn:nth-of-type(1) {
             width: 90px;
             height: 100px;
@@ -144,19 +149,23 @@
             background: #fff;
             position: relative;
         }
-        .upload-content .conList .btn:nth-of-type(1)>div {
+
+        .upload-content .conList .btn:nth-of-type(1) > div {
             position: absolute;
             top: 50%;
             left: 50%;
             transform: translate(-50%, -50%);
             color: #666;
         }
+
         .upload-content .conList .btn:nth-of-type(1) span {
             font-size: 35px;
         }
+
         .upload-content .conList .btn:nth-of-type(1) h5 {
             color: #666;
         }
+
         .cancel-upload {
             background: transparent;
             border: none;
@@ -167,6 +176,7 @@
             cursor: pointer;
             z-index: 100;
         }
+
         .upload-content .conList ol li {
             width: 114px;
             min-height: 80px;
@@ -176,21 +186,23 @@
             top: 120px;
             margin-left: 2px;
         }
+
         .hide-pic {
             display: none !important;
         }
 
-        .payment-form h4{
-            width:96%;
-            margin-left:2%;
-            padding-bottom:20px;
-            text-align:center;
-            border-bottom:1px solid #eee}
+        .payment-form h4 {
+            width: 96%;
+            margin-left: 2%;
+            padding-bottom: 20px;
+            text-align: center;
+            border-bottom: 1px solid #eee
+        }
     </style>
     <script type="text/javascript">
-        $(document).ready(function() {
+        $(document).ready(function () {
             $("#inputForm").validate({
-                ignore:"",
+                ignore: "",
                 submitHandler: function (form) {
                     var shopPostFee = $("#shopPostFee").val();
                     var brokerage = ${brokerage};
@@ -208,9 +220,9 @@
                     }
                 },
                 errorContainer: "#messageBox",
-                errorPlacement: function(error, element) {
+                errorPlacement: function (error, element) {
                     $("#messageBox").text("输入有误,请先更正。");
-                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
                         error.appendTo(element.parent().parent());
                     } else {
                         error.insertAfter(element);
@@ -222,20 +234,23 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <c:if test="${cmPayShop.redirectType == 2}" >
+    <c:if test="${cmPayShop.redirectType == 2}">
         <li><a href="${ctx}/order/cmPayShop/payList">付款管理</a></li>
     </c:if>
-    <c:if test="${cmPayShop.redirectType != 2}" >
+    <c:if test="${cmPayShop.redirectType != 2}">
         <li><a href="${ctx}/order/cmPayShop/">付款管理</a></li>
     </c:if>
     <li class="active"><a>提交付款单</a></li>
 </ul>
-<form:form id="inputForm" modelAttribute="payShopOther" action="${ctx}/order/cmPayShop/saveShopOtherFee?payType=1&redirectType=1" method="post" class="form-horizontal">
+<form:form id="inputForm" modelAttribute="payShopOther"
+           action="${ctx}/order/cmPayShop/saveShopOtherFee?payType=1&redirectType=1" method="post"
+           class="form-horizontal">
     <form:hidden path="shopOrderId"/>
     <form:hidden path="payShopId"/>
     <div class="payment-form">
         <h4>付款单${payShopOther.payShopId}</h4>
-    </div><br>
+    </div>
+    <br>
     <div class="control-group">
         <label class="control-label"><font color='red'>*</font>订单编号(ID):</label>&nbsp;&nbsp;
         <a href="${ctx}/order/detail?id=${payShopOther.orderId}">${payShopOther.orderNo}(${payShopOther.orderId})</a>
@@ -250,75 +265,141 @@
             <form:input path="name" htmlEscape="false" maxlength="250" class="input-xlarge required"/>
         </div>
     </div>
-    <div class="control-group">
-        <label class="control-label"><font color='red'>*</font>付第三方金额:</label>
-        <div class="controls">
-            <input type="number" id="shopOtherFee" required name="shopOtherFee" value="${payShopOther.shopOtherFee}" onchange="changeShouldPay(this)"/>
+    <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%">
+        <div class="control-group">
+            <label class="control-label"><font color='red'>*</font>付第三方中介费:</label>
+            <div class="controls">
+                <input type="number" id="shopOtherFee" required name="shopOtherFee"
+                       value="${payShopOther.shopOtherFee}" onchange="changeShouldPay(this)"/>
+            </div>
+        </div>
+        <div class="control-group">
+            <label class="control-label"><font color='red'>*</font>开户名:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+            <form:input path="bankAccountName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
+            <label><font color='red'>*</font>账号:</label>
+            <form:input path="bankAccount" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
+        </div>
+        <div class="control-group">
+            <label class="control-label"><font color='red'>*</font>开户行:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+            <form:input path="bankName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
+            <label><font color='red'>*</font>账户类型:</label>
+            <form:select path="type" class="select-ele input-xlarge required">
+                <form:option value="0" label="公账"/>
+                <form:option value="1" label="私账"/>
+            </form:select>
         </div>
     </div>
-    <div class="control-group">
-        <label class="control-label"><font color='red'>*</font>开户名:</label>&nbsp;&nbsp;&nbsp;&nbsp;
-        <form:input path="bankAccountName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
-        <label><font color='red'>*</font>账号:</label>
-        <form:input path="bankAccount" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
-    </div>
-    <div class="control-group">
-        <label class="control-label"><font color='red'>*</font>开户行:</label>&nbsp;&nbsp;&nbsp;&nbsp;
-        <form:input path="bankName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
-        <label><font color='red'>*</font>账户类型:</label>
-        <form:select path="type" class="select-ele input-xlarge required">
-            <form:option value="0" label="公账"/>
-            <form:option value="1" label="私账"/>
-        </form:select>
+    <br/>
+    <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;${not empty otherFee.onlinePayWays or otherFee.cmAccountType ne 1?'display:none':''}">
+        <div class="control-group">
+            <input style="display: none" value="${otherFee.cmProfit}" name="cmShopOtherFee">
+            <div>
+                <label class="control-label"><font
+                        color='red'>*</font>采美中介费:${empty otherFee.cmProfit ? 0 : otherFee.cmProfit}</label>
+            </div>
+            <div style="display: inline-block;">
+                <label class="control-label">不申请此费用:</label>
+                <c:choose>
+                    <c:when test="${not empty payShopOther.otherFeeFlag and payShopOther.otherFeeFlag eq 1}">
+                        <div class="controls">
+                            <input id="otherFeeFlag" name="otherFeeFlag" type="checkbox" onchange="checkFlag(this)">
+                        </div>
+                    </c:when>
+                    <c:otherwise>
+                        <div class="controls">
+                            <input id="otherFeeFlag" name="otherFeeFlag" type="checkbox" checked
+                                   onchange="checkFlag(this)">
+                        </div>
+                    </c:otherwise>
+                </c:choose>
+            </div>
+        </div>
+        <div class="control-group">
+            <label class="control-label"><font color='red'>*</font>开户名:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+            <form:input path="cmBankAccountName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
+            <label><font color='red'>*</font>账号:</label>
+            <form:input path="cmBankAccount" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
+        </div>
+        <div class="control-group">
+            <label class="control-label"><font color='red'>*</font>开户行:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+            <form:input path="cmBankName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
+            <label><font color='red'>*</font>账户类型:</label>
+            <form:select path="cmType" class="select-ele input-xlarge required">
+                <form:option value="0" label="公账"/>
+                <form:option value="1" label="私账"/>
+            </form:select>
+        </div>
     </div>
+    <br/>
     <div class="control-group">
         <label class="control-label"><font color='red'>*</font>备注内容:</label>
         <div class="controls">
-            <textarea type="text" name="remark" placeholder="请详细说明修改的原因,不超过500字" style="position: relative;height: 100px; width: 450px;" maxlength="500" required >${payShopOther.remark}</textarea>
+            <textarea type="text" name="remark" placeholder="请详细说明修改的原因,不超过500字"
+                      style="position: relative;height: 100px; width: 450px;" maxlength="500"
+                      required>${payShopOther.remark}</textarea>
         </div>
     </div>
     <div class="control-group">
         <label class="control-label">图片:</label>
         <div class="controls upload-content" style="margin: -91px 0px 0px 16px;" id="remarkImageBox">
             <div class="conList">
-                <form:hidden id="remarkImage1" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                <sys:ckfinder input="remarkImage1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                <form:hidden id="remarkImage1" path="remarkImages" htmlEscape="false" maxlength="255"
+                             class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage1" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
             </div>
             <div class="conList hide-pic">
-                <form:hidden id="remarkImage2" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                <sys:ckfinder input="remarkImage2" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                <form:hidden id="remarkImage2" path="remarkImages" htmlEscape="false" maxlength="255"
+                             class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage2" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
             </div>
             <div class="conList hide-pic">
-                <form:hidden id="remarkImage3" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                <sys:ckfinder input="remarkImage3" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                <form:hidden id="remarkImage3" path="remarkImages" htmlEscape="false" maxlength="255"
+                             class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage3" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
             </div>
             <div class="conList hide-pic">
                 <form:hidden id="remarkImage4" path="" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                <sys:ckfinder input="remarkImage4" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                <sys:ckfinder input="remarkImage4" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
             </div>
             <div class="conList hide-pic">
-                <form:hidden id="remarkImage5" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                <sys:ckfinder input="remarkImage5" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                <form:hidden id="remarkImage5" path="remarkImages" htmlEscape="false" maxlength="255"
+                             class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage5" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
             </div>
             <div class="conList hide-pic">
-                <form:hidden id="remarkImage6" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                <sys:ckfinder input="remarkImage6" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                <form:hidden id="remarkImage6" path="remarkImages" htmlEscape="false" maxlength="255"
+                             class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage6" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
             </div>
             <div class="conList hide-pic">
-                <form:hidden id="remarkImage7" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                <sys:ckfinder input="remarkImage7" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                <form:hidden id="remarkImage7" path="remarkImages" htmlEscape="false" maxlength="255"
+                             class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage7" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
             </div>
             <div class="conList hide-pic">
-                <form:hidden id="remarkImage8" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                <sys:ckfinder input="remarkImage8" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                <form:hidden id="remarkImage8" path="remarkImages" htmlEscape="false" maxlength="255"
+                             class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage8" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
             </div>
             <div class="conList  hide-pic">
-                <form:hidden id="remarkImage9" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                <sys:ckfinder input="remarkImage9" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                <form:hidden id="remarkImage9" path="remarkImages" htmlEscape="false" maxlength="255"
+                             class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage9" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
             </div>
             <div class="conList  hide-pic">
-                <form:hidden id="remarkImage10" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                <sys:ckfinder input="remarkImage10" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                <form:hidden id="remarkImage10" path="remarkImages" htmlEscape="false" maxlength="255"
+                             class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage10" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
             </div>
         </div>
     </div>
@@ -332,66 +413,69 @@
 
     //图片初始化
     $(function () {
+        var feeFlag = document.getElementById('otherFeeFlag');
+        checkFlag(feeFlag);
+
         $('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
         $('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
         $('.upload-content .conList').find('.cancel-upload').hide();
         var observeEle = document.getElementsByClassName('upload-content')[0];
         var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
-        var MutationObserverConfig={
+        var MutationObserverConfig = {
             childList: true,
             subtree: true,
             characterData: true
         };
-        var observer = new MutationObserver(function(mutations){
-            $.each(mutations, function(index,item) {
+        var observer = new MutationObserver(function (mutations) {
+            $.each(mutations, function (index, item) {
                 if (item.type === 'childList') {
                     // 在创建新的 element 时调用
                     var target = $(item.target),
                         thisWrapper = target.closest('.conList'),
                         nextEle = thisWrapper.next();
-                    thisWrapper.find('li').css('z-index',99);
+                    thisWrapper.find('li').css('z-index', 99);
                     thisWrapper.find('.cancel-upload').show();
-                    if(nextEle.hasClass('hide-pic')) {
+                    if (nextEle.hasClass('hide-pic')) {
                         nextEle.removeClass('hide-pic');
                     }
                 }
             })
         });
-        observer.observe(observeEle,MutationObserverConfig);
+        observer.observe(observeEle, MutationObserverConfig);
 
-        $('body').on('click','.upload-content li',function() {
+        $('body').on('click', '.upload-content li', function () {
             var index = $(this).closest('.conList').index() + 1,
-                str = 'remarkImage'+index+'FinderOpen';
-            eval(str+'()');
+                str = 'remarkImage' + index + 'FinderOpen';
+            eval(str + '()');
         });
-        $('body').on('click', '.cancel-upload',function() {
+        $('body').on('click', '.cancel-upload', function () {
             var wrapper = $(this).closest('.conList');
-            wrapper.find('li').css('z-index','-1');
+            wrapper.find('li').css('z-index', '-1');
             wrapper.find('input').val('');
             $(this).hide();
             if ($('.cancel-upload:visible').length < 9) {
                 wrapper.addClass("hide-pic");
-            }else{
+            } else {
                 wrapper.removeClass("hide-pic");
             }
             wrapper.parent().append(wrapper.clone());
             wrapper.remove();
-            $(".conList").each(function(i,ele){
-                if($(ele).find("input.input-xlarge").val()){
+            $(".conList").each(function (i, ele) {
+                if ($(ele).find("input.input-xlarge").val()) {
                     $(ele).next().removeClass("hide-pic")
                 }
             })
         });
-        $(window).on("load", function(){
-            setTimeout(function(){
-                $("#remarkImageBox").find("input.input-xlarge").each(function(i,ele){
-                    if($(ele).val()){
-                        $(ele).next().find("li").css("z-index","99");
+        $(window).on("load", function () {
+            setTimeout(function () {
+                $("#remarkImageBox").find("input.input-xlarge").each(function (i, ele) {
+                    if ($(ele).val()) {
+                        $(ele).next().find("li").css("z-index", "99");
                         $(ele).parents(".conList").find(".cancel-upload").show();
                         $(ele).parents(".conList").next().removeClass("hide-pic")
                     }
                 })
-            },500);
+            }, 500);
         });
     });
 
@@ -402,6 +486,14 @@
     function onlynum(obj) {
         obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
     }
+
+    function checkFlag(el) {
+        if (el.checked) {
+            el.value = 0;
+        } else {
+            el.value = 1;
+        }
+    }
 </script>
 </body>
 </html>

+ 102 - 92
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetail.jsp

@@ -452,10 +452,10 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <c:if test="${cmPayShop.redirectType == 2}" >
+    <c:if test="${cmPayShop.redirectType == 2}">
         <li><a href="${ctx}/order/cmPayShop/payList">付款管理</a></li>
     </c:if>
-    <c:if test="${cmPayShop.redirectType != 2}" >
+    <c:if test="${cmPayShop.redirectType != 2}">
         <li><a href="${ctx}/order/cmPayShop/">付款管理</a></li>
     </c:if>
     <li class="active"><a href="${ctx}/order/cmPayShop/applyDetail?id=${cmPayShop.id}">付款单详情</a></li>
@@ -472,21 +472,6 @@
             <label>供应商名称:</label>
             <span>${cmPayShop.shopName}</span>
         </div>
-        <div>
-            <label><em class="required">* </em>付款账号:</label>
-            <c:if test="${cmPayShop.payType eq '6'}">
-                无
-            </c:if>
-            <c:if test="${cmPayShop.payType ne '6'}">
-                <span>户名:${cmPayShop.bankAccountName}</span>
-                <span>账号:${cmPayShop.bankAccount}</span>
-                <span>开户行:${cmPayShop.bankName}</span>
-                <span>账户类型:
-						<c:if test="${cmPayShop.type == '0'}">公帐</c:if>
-						<c:if test="${cmPayShop.type == '1'}">私帐</c:if>
-					</span>
-            </c:if>
-        </div>
     </div>
     <div class="payment-form-content">
         <%--涛姐遍历下面这个table--%>
@@ -494,20 +479,19 @@
             <table class="table table-striped table-bordered table-condensed pay-table">
                 <tr>
                     <th>子订单编号(ID)</th>
-                        <%--                        <th colspan="3">客户</th>--%>
                     <th colspan="3">下单时间</th>
                     <th colspan="2">子订单金额</th>
-                        <%--                        <th colspan="3">所有子订单</th>--%>
-                        <%--                        <th>订单总佣金</th>--%>
                     <th colspan="4">总平台服务费</th>
-                        <%--                        <th>机构运费</th>--%>
                     <th colspan="2">收款状态</th>
                     <th colspan="3">收款金额</th>
                     <th colspan="2">促销满减</th>
                     <th colspan="2">付第三方</th>
                 </tr>
                 <tr>
-                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                    <td>${s.shopOrderNo}(${s.shopOrderID})
+                        <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font
+                                color="red">(采美私账订单)</font></c:if>
+                    </td>
                     <td colspan="3"> ${s.orderTime}</td>
                     <td colspan="2">${s.totalAmount}</td>
                     <td colspan="4">${s.allServeAmount}</td>
@@ -522,37 +506,19 @@
                     </td>
                     <td colspan="2">
                         <fmt:formatNumber value="${s.promotionFullReduction}" type="number" pattern="#,##0.00"/>
-                        <%--<label class="discountFee">
-                            <c:choose>
-                                <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
-                                    <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
-                                </c:when>
-                            </c:choose>
-                        </label>
-                        <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>
+                    </td>
+                    <td colspan="2" class="third-party-fee">
+                        <fmt:formatNumber value="${s.shopOtherFee}" type="number" pattern="#,##0.00"/>
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee},第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee > 0 and (s.cmShopOtherFee eq 0 or empty s.cmShopOtherFee)}">
+                            <font color="red">(第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${(s.shopOtherFee eq 0 or empty s.shopOtherFee) and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee})</font>
                         </c:if>
-                        <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>--%>
                     </td>
-                    <td colspan="2" class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number"
-                                                                              pattern="#,##0.00"/></td>
                 </tr>
                 <tr>
                     <th>供应商</th>
@@ -573,7 +539,7 @@
                         <c:if test="${s.organizeID == 3}"></c:if>
                     </td>
                     <td>
-                        <label class="clubFreight"  style="display: none">
+                        <label class="clubFreight" style="display: none">
                             <c:choose>
                                 <c:when test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2 && s.returnedFreightFlag ne true}">
                                     <fmt:formatNumber value="${s.shopPostFee}"/>
@@ -618,10 +584,14 @@
                                     value="${s.shouldPayShopAmount-s.shopOtherFee}" type="number" pattern="#,##0.00"/>
                             </c:if>
                             <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount+s.differencePrice-s.shopOtherFee}"/></font><font color="red">(原应付:${s.shouldPayShopAmount-s.shopOtherFee},已补差价:${s.differencePrice})</font>
+                                <font color="black"><fmt:formatNumber
+                                        value="${s.shouldPayShopAmount+s.differencePrice-s.shopOtherFee}"/></font><font
+                                    color="red">(原应付:${s.shouldPayShopAmount-s.shopOtherFee},已补差价:${s.differencePrice})</font>
                             </c:if>
                             <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount-s.differencePrice-s.shopOtherFee}"/></font><font color="red">(原应付:${s.shouldPayShopAmount-s.shopOtherFee},已退差价:${s.differencePrice})</font>
+                                <font color="black"><fmt:formatNumber
+                                        value="${s.shouldPayShopAmount-s.differencePrice-s.shopOtherFee}"/></font><font
+                                    color="red">(原应付:${s.shouldPayShopAmount-s.shopOtherFee},已退差价:${s.differencePrice})</font>
                             </c:if>,
                             已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
                         </div>
@@ -730,48 +700,88 @@
         </c:forEach>
     </div>
     <div class="payment-form-bottom">
-        <div>
-            <label>付第三方金额:</label>
-            <span>${cmPayShop.totalAmount}</span>
-        </div>
-
-        <c:if test="${cmPayShop.payType ne '6'}">
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;">
             <div>
-                <label style="font-weight: bold; font-size:18px">转账支付:</label>
-                <span id="transferAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber
-                        value="${cmPayShop.transferPayFee}" pattern="#,##0.00"/></span>
-                <c:if test="${cmPayShop.status != '2'}">
-                    <c:if test="${not empty cmPayShop.payType }">
-                        <label>付款银行:</label>
-                        <span id="payType">
-                            ${cmPayShop.bankNameType}
-							<%--<c:if test="${cmPayShop.payType eq 1}">
-                                建设银行7297
-                            </c:if>
-							<c:if test="${cmPayShop.payType eq 2}">
-                                中信银行0897
-                            </c:if>
-							<c:if test="${cmPayShop.payType eq 3}">
-                                中信银行7172
-                            </c:if>
-							<c:if test="${cmPayShop.payType eq 4}">
-                                广发银行0115
-                            </c:if>
-							<c:if test="${cmPayShop.payType eq 5}">
-                                广发银行5461
-                            </c:if>
-							<c:if test="${cmPayShop.payType eq 7}">
-                                华夏银行2400
-                            </c:if>--%>
-						</span>
-                    </c:if>
-                    <c:if test="${cmPayShop.status != '0'}">
-                        <label>付款时间:</label>
-                        <span>${cmPayShop.payTime}</span>
+                <label>第三方中介费:</label>
+                <span>${cmPayShop.totalAmount}</span>
+            </div>
+            <div>
+                <label><em class="required">* </em>付款账号:</label>
+                <c:if test="${cmPayShop.payType eq '6'}">
+                    无
+                </c:if>
+                <c:if test="${cmPayShop.payType ne '6'}">
+                    <span>户名:${cmPayShop.bankAccountName}</span>
+                    <span>账号:${cmPayShop.bankAccount}</span>
+                    <span>开户行:${cmPayShop.bankName}</span>
+                    <span>账户类型:
+        						<c:if test="${cmPayShop.type == '0'}">公帐</c:if>
+        						<c:if test="${cmPayShop.type == '1'}">私帐</c:if>
+        					</span>
+                </c:if>
+            </div>
+            <c:if test="${cmPayShop.payType ne '6'}">
+                <div>
+                    <label style="font-weight: bold; font-size:18px">转账支付:</label>
+                    <span id="transferAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber
+                            value="${cmPayShop.transferPayFee}" pattern="#,##0.00"/></span>
+                    <c:if test="${cmPayShop.status != '2'}">
+                        <c:if test="${not empty cmPayShop.payType }">
+                            <label>付款银行:</label>
+                            <span id="payType">
+                                    ${cmPayShop.bankNameType}
+                            </span>
+                        </c:if>
+                        <c:if test="${cmPayShop.status != '0'}">
+                            <label>付款时间:</label>
+                            <span>${cmPayShop.payTime}</span>
+                        </c:if>
                     </c:if>
+                </div>
+            </c:if>
+        </div>
+        <br/>
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;${empty cmPayShop.cmShopOtherFee or cmPayShop.cmShopOtherFee eq 0 ? 'display:none':''}">
+            <div>
+                <label>采美中介费:</label>
+                <span>${cmPayShop.cmShopOtherFee}</span>
+            </div>
+            <div>
+                <label><em class="required">* </em>付款账号:</label>
+                <c:if test="${cmPayShop.cmOtherPayType eq '6'}">
+                    无
+                </c:if>
+                <c:if test="${cmPayShop.cmOtherPayType ne '6'}">
+                    <span>户名:${cmPayShop.cmBankAccountName}</span>
+                    <span>账号:${cmPayShop.cmBankAccount}</span>
+                    <span>开户行:${cmPayShop.cmBankName}</span>
+                    <span>账户类型:
+        						<c:if test="${cmPayShop.cmType == '0'}">公帐</c:if>
+        						<c:if test="${cmPayShop.cmType == '1'}">私帐</c:if>
+        					</span>
                 </c:if>
             </div>
-        </c:if>
+            <c:if test="${cmPayShop.cmOtherPayType ne '6'}">
+                <div>
+                    <label style="font-weight: bold; font-size:18px">转账支付:</label>
+                    <span id="transferAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber
+                            value="${cmPayShop.cmShopOtherFee + cmPayShop.totalAmount}" pattern="#,##0.00"/></span>
+                    <c:if test="${cmPayShop.status != '2'}">
+                        <c:if test="${not empty cmPayShop.cmOtherPayType }">
+                            <label>付款银行:</label>
+                            <span id="payType">
+                                    ${cmPayShop.cmBankNameType}
+                            </span>
+                        </c:if>
+                        <c:if test="${cmPayShop.status != '0'}">
+                            <label>付款时间:</label>
+                            <span>${cmPayShop.cmOtherPayTime}</span>
+                        </c:if>
+                    </c:if>
+                </div>
+            </c:if>
+        </div>
+
         <div class="process-details">
             <label>申请人:</label>
             <div class="process-for-label">${cmPayShop.payType eq '6'? '系统自动':cmPayShop.applicantName}</div>

+ 82 - 40
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetails.jsp

@@ -340,7 +340,9 @@
                     <th>付第三方</th>
                 </tr>
                 <tr>
-                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                    <td>${s.shopOrderNo}(${s.shopOrderID})
+                        <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font
+                                color="red">(采美私账订单)</font></c:if></td>
                     <td colspan="3">${s.orderNo}(${s.orderID})</td>
                     <td>${s.payTotalFee}</td>
                     <td>${s.orderTime}</td>
@@ -369,8 +371,19 @@
                     </td>
                     <td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
                             test="${s.costType == '2'}">比例成本</c:if></td>
-                    <td class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number"
-                                                                  pattern="#,##0.00"/></td>
+                    <td class="third-party-fee">
+                        <fmt:formatNumber value="${s.shopOtherFee + s.cmShopOtherFee}" type="number"
+                                          pattern="#,##0.00"/>
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee},第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee > 0 and (s.cmShopOtherFee eq 0 or empty s.cmShopOtherFee)}">
+                            <font color="red">(第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${(s.shopOtherFee eq 0 or empty s.shopOtherFee) and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee})</font>
+                        </c:if>
+                    </td>
                 </tr>
                 <tr>
                     <th>供应商</th>
@@ -386,7 +399,7 @@
                     <td>${s.shopName}</td>
                     <td colspan="3">${s.buyer}<c:if test="${s.organizeID == 3}"></c:if></td>
                     <td>
-                        <label class="clubFreight"  style="display: none">
+                        <label class="clubFreight" style="display: none">
                             <c:choose>
                                 <c:when test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2 && s.returnedFreightFlag ne true}">
                                     <fmt:formatNumber value="${s.shopPostFee}"/>
@@ -427,10 +440,14 @@
                                     value="${s.shouldPayShopAmount-s.shopOtherFee}" type="number" pattern="#,##0.00"/>
                             </c:if>
                             <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount+s.differencePrice-s.shopOtherFee}"/></font><font color="red">(原应付:${s.shouldPayShopAmount-s.shopOtherFee},已补差价:${s.differencePrice})</font>
+                                <font color="black"><fmt:formatNumber
+                                        value="${s.shouldPayShopAmount+s.differencePrice-s.shopOtherFee}"/></font><font
+                                    color="red">(原应付:${s.shouldPayShopAmount-s.shopOtherFee},已补差价:${s.differencePrice})</font>
                             </c:if>
                             <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount-s.differencePrice-s.shopOtherFee}"/></font><font color="red">(原应付:${s.shouldPayShopAmount-s.shopOtherFee},已退差价:${s.differencePrice})</font>
+                                <font color="black"><fmt:formatNumber
+                                        value="${s.shouldPayShopAmount-s.differencePrice-s.shopOtherFee}"/></font><font
+                                    color="red">(原应付:${s.shouldPayShopAmount-s.shopOtherFee},已退差价:${s.differencePrice})</font>
                             </c:if>,
                             已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
                         </div>
@@ -496,44 +513,69 @@
         </c:forEach>
     </div>
     <div class="payment-form-bottom">
-        <div>
-            <label>付第三方金额:</label>
-            <span>${cmPayShop.totalAmount}</span>
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;">
+            <div>
+                <label>第三方中介费:</label>
+                <span>${cmPayShop.totalAmount}</span>
+            </div>
+            <c:if test="${cmPayShop.payType ne '6'}">
+                <div>
+                    <label style="font-weight: bold; font-size:18px">转账支付:</label>
+                    <span id="transferAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber
+                            value="${cmPayShop.transferPayFee}" pattern="#,##0.00"/> </span>
+                    <c:if test="${not empty cmPayShop.payType }">
+                        <label>付款银行:</label>
+                        <span id="payType">
+                                ${cmPayShop.bankNameType}
+                        </span>
+                    </c:if>
+                    <label>付款时间:</label>
+                    <span>${cmPayShop.payTime}</span>
+                </div>
+            </c:if>
         </div>
-
-        <c:if test="${cmPayShop.payType ne '6'}">
+        <br/>
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;${empty cmPayShop.cmShopOtherFee or cmPayShop.cmShopOtherFee eq 0 ? 'display:none':''}">
             <div>
-                <label style="font-weight: bold; font-size:18px">转账支付:</label>
-                <span id="transferAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber
-                        value="${cmPayShop.transferPayFee}" pattern="#,##0.00"/> </span>
-                <c:if test="${not empty cmPayShop.payType }">
-                    <label>付款银行:</label>
-                    <span id="payType">
-                        ${cmPayShop.bankNameType}
-						<%--<c:if test="${cmPayShop.payType eq 1}">
-                            建设银行7297
-                        </c:if>
-						<c:if test="${cmPayShop.payType eq 2}">
-                            中信银行0897
-                        </c:if>
-						<c:if test="${cmPayShop.payType eq 3}">
-                            中信银行7172
-                        </c:if>
-						<c:if test="${cmPayShop.payType eq 4}">
-                            广发银行0115
-                        </c:if>
-						<c:if test="${cmPayShop.payType eq 5}">
-                            广发银行5461
-                        </c:if>
-                        <c:if test="${cmPayShop.payType eq 7}">
-                            华夏银行2400
-                        </c:if>--%>
-					</span>
+                <label>采美中介费:</label>
+                <span>${cmPayShop.cmShopOtherFee}</span>
+            </div>
+            <div>
+                <label><em class="required">* </em>付款账号:</label>
+                <c:if test="${cmPayShop.cmOtherPayType eq '6'}">
+                    无
+                </c:if>
+                <c:if test="${cmPayShop.cmOtherPayType ne '6'}">
+                    <span>户名:${cmPayShop.cmBankAccountName}</span>
+                    <span>账号:${cmPayShop.cmBankAccount}</span>
+                    <span>开户行:${cmPayShop.cmBankName}</span>
+                    <span>账户类型:
+        						<c:if test="${cmPayShop.cmType == '0'}">公帐</c:if>
+        						<c:if test="${cmPayShop.cmType == '1'}">私帐</c:if>
+        					</span>
                 </c:if>
-                <label>付款时间:</label>
-                <span>${cmPayShop.payTime}</span>
             </div>
-        </c:if>
+            <c:if test="${cmPayShop.cmOtherPayType ne '6'}">
+                <div>
+                    <label style="font-weight: bold; font-size:18px">转账支付:</label>
+                    <span id="transferAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber
+                            value="${cmPayShop.cmShopOtherFee + cmPayShop.totalAmount}" pattern="#,##0.00"/></span>
+                    <c:if test="${cmPayShop.status != '2'}">
+                        <c:if test="${not empty cmPayShop.cmOtherPayType }">
+                            <label>付款银行:</label>
+                            <span id="payType">
+                                    ${cmPayShop.cmBankNameType}
+                            </span>
+                        </c:if>
+                        <c:if test="${cmPayShop.status != '0'}">
+                            <label>付款时间:</label>
+                            <span>${cmPayShop.cmOtherPayTime}</span>
+                        </c:if>
+                    </c:if>
+                </div>
+            </c:if>
+        </div>
+
         <div class="process-details">
             <label>申请人:</label>
             <div class="process-for-label">${cmPayShop.payType eq '6'? '系统自动':cmPayShop.applicantName}</div>

+ 59 - 37
src/main/webapp/WEB-INF/views/modules/order/cmSettlementList.jsp

@@ -278,7 +278,16 @@
             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}
+        .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">
@@ -292,14 +301,6 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/order/cmPayShop/payList">付款列表</a></li>
-    <%--<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><a href="${ctx}/shopOrder/payThirdParties">申请付第三方</a></li>
-    <shiro:hasPermission name="order:cmPayShop:split">
-        <li><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
-    </shiro:hasPermission>
     <li class="active tab-li"><a href="${ctx}/shopOrder/settlement">子订单手动结算</a></li>
 </ul>
 <form:form id="searchForm" onsubmit="submitFunc()" modelAttribute="newShopOrder"
@@ -326,13 +327,13 @@
         <form:input path="endTime" type="text" maxlength="10" class="input-medium Wdate" value="${endTime}"
                     onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
         <div class="pay-status">
-<%--            <form>--%>
-<%--                <label>结算状态:</label>--%>
-<%--                <label><input name="payStatus" type="checkbox" class="pay-other-status pay-checkbox" value="1"/>未结算--%>
-<%--                </label>--%>
-<%--                <label><input name="payStatus" type="checkbox" class="pay-other-status pay-checkbox" value="2"/>部分结算--%>
-<%--                </label>--%>
-<%--            </form>--%>
+                <%--            <form>--%>
+                <%--                <label>结算状态:</label>--%>
+                <%--                <label><input name="payStatus" type="checkbox" class="pay-other-status pay-checkbox" value="1"/>未结算--%>
+                <%--                </label>--%>
+                <%--                <label><input name="payStatus" type="checkbox" class="pay-other-status pay-checkbox" value="2"/>部分结算--%>
+                <%--                </label>--%>
+                <%--            </form>--%>
             <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
         </div>
         <div class="clearfix"></div>
@@ -346,7 +347,9 @@
             <table class="table table-striped table-bordered table-condensed pay-table">
                 <tr>
                     <th style="width:20px;">
-                        <input type="checkbox" class="checkShop" data-shoporderid="${s.shopOrderID}" data-shopid="${s.shopID}" data-isPayShopOtherFee="${s.payShopOtherFee}" onclick="changeCheck(this)"/>
+                        <input type="checkbox" class="checkShop" data-shoporderid="${s.shopOrderID}"
+                               data-shopid="${s.shopID}" data-isPayShopOtherFee="${s.payShopOtherFee}"
+                               onclick="changeCheck(this)"/>
                     </th>
                     <th>子订单编号(ID)</th>
                     <th colspan="3">订单编号(ID)</th>
@@ -364,12 +367,14 @@
                     <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">
+                    <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><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}">
@@ -443,18 +448,24 @@
                     <td colspan="2"><c:if test="${s.settleStatus == 1}"><font
                             color="red">待结算</font></c:if>
                         <c:if test="${s.settleStatus == 2}"><font color="#ff8c00">部分结算</font></c:if>
-                        <c:if test="${s.settleStatus == 3 || empty s.settleStatus}"><font color="green">已结算</font></c:if></td>
+                        <c:if test="${s.settleStatus == 3 || empty s.settleStatus}"><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-s.shopOtherFee}" type="number" pattern="#,##0.00"/></font>
+                            <font color="#E15616"><fmt:formatNumber value="${s.shouldPayShopAmount-s.shopOtherFee}"
+                                                                    type="number" pattern="#,##0.00"/></font>
                         </c:if>
                         <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                            <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount+s.differencePrice-s.shopOtherFee}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
+                            <font color="black"><fmt:formatNumber
+                                    value="${s.shouldPayShopAmount+s.differencePrice-s.shopOtherFee}"/></font><font
+                                color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
                         </c:if>
                         <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                            <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount-s.differencePrice-s.shopOtherFee}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
+                            <font color="black"><fmt:formatNumber
+                                    value="${s.shouldPayShopAmount-s.differencePrice-s.shopOtherFee}"/></font><font
+                                color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
                         </c:if>
                     </td>
                     <input type="hidden" class="payedShopAmount" value="${s.payedShopAmount}">
@@ -462,8 +473,18 @@
                     <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>
+                    <td class="third-party-fee">
+                        <fmt:formatNumber value="${s.shopOtherFee + s.cmShopOtherFee}" type="number" pattern="#,##0.00"/>
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee},第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee eq 0}">
+                            <font color="red">(第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee eq 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee})</font>
+                        </c:if>
+                    </td>
                 </tr>
                 <tr>
                     <th>商品名</th>
@@ -537,9 +558,9 @@
                     </tr>
                 </c:forEach>
             </table>
-<%--            <div class="pay-more-func">--%>
-<%--                <a href="${ctx}/shopOrder/settleRecord?shopOrderID=${s.shopOrderID}">结算记录</a>--%>
-<%--            </div>--%>
+                <%--            <div class="pay-more-func">--%>
+                <%--                <a href="${ctx}/shopOrder/settleRecord?shopOrderID=${s.shopOrderID}">结算记录</a>--%>
+                <%--            </div>--%>
         </div>
     </c:forEach>
 </div>
@@ -625,15 +646,16 @@
 <div class="pagination">${page}</div>
 
 <script>
-    function changeCheck(el){
+    function changeCheck(el) {
         var checked = $('input[type=checkbox]:checked');
         if (checked.length > 1) {
             // $(".checkShop").attr('disabled','true');
             alertx("请最多选择一个子订单进行结算");
-            $(el).prop('checked',false);
+            $(el).prop('checked', false);
             return false;
         }
     }
+
     (function () {
         var payTableEle = $('.pay-table'),
             payProductEle = $('.pay-product-item');
@@ -822,7 +844,7 @@
         });
 
         $('#apply').on('click', function () {
-            var shopOrderId='';
+            var shopOrderId = '';
             var checked = $('.pay-wrapper input[type=checkbox]:checked'), params = '?';
             for (var i = 0; i < checked.length; i++) {
                 shopOrderId = $(checked[i]).attr('data-shoporderid');
@@ -836,22 +858,22 @@
             //     alertx('每次只能选择一个子订单进行结算申请');
             //     return false;
             // }
-            var flag=0;
+            var flag = 0;
             debugger;
             $.ajax({
                 url: "${ctx}/order/cmPayShop/settleTime",
-                data: {"shopOrderIds":shopOrderId},
+                data: {"shopOrderIds": shopOrderId},
                 type: "POST",
                 async: false,
-                success: function(data){
-                    flag=data.flag;
+                success: function (data) {
+                    flag = data.flag;
                 }
             });
-            if(flag===1){
+            if (flag === 1) {
                 alertx('该子订单暂未到结算时间,请于T+1后的工作日再申请结算(T指子订单分账时间)');
                 return false;
             }
-            window.location.href = '${ctx}/order/cmPayShop/settlement'+ params;
+            window.location.href = '${ctx}/order/cmPayShop/settlement' + params;
             <%--window.location.href = '${ctx}/order/cmPayShop/settleEdit' + params;--%>
         });
 

+ 12 - 8
src/main/webapp/WEB-INF/views/modules/order/cmSplitAccountList.jsp

@@ -292,15 +292,9 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/order/cmPayShop/payList">付款列表</a></li>
-     <%--<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><a href="${ctx}/shopOrder/payThirdParties">申请付第三方</a></li>
      <shiro:hasPermission name="order:cmPayShop:split">
          <li class="active tab-li"><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
      </shiro:hasPermission>
-     <li><a href="${ctx}/shopOrder/settlement">子订单手动结算</a></li>
 </ul>
 <form:form id="searchForm"
            action="${ctx}/splitAccount/split" method="post" class="breadcrumb form-search">
@@ -435,8 +429,18 @@
                     <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>
+                    <td class="third-party-fee">
+                        <fmt:formatNumber value="${s.shopOtherFee + s.cmShopOtherFee}" type="number" pattern="#,##0.00"/>
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee},第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee eq 0}">
+                            <font color="red">(第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee eq 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee})</font>
+                        </c:if>
+                    </td>
                 </tr>
                 <tr>
                     <th>商品名</th>

+ 58 - 43
src/main/webapp/WEB-INF/views/modules/order/payedAndRefundRecordList.jsp

@@ -116,7 +116,8 @@
         <th>付第三方</th>
     </tr>
     <tr>
-        <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></td>
+        <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a>
+            <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font color="red">(采美私账订单)</font></c:if></td>
         <td colspan="3"><a href="${ctx}/order/detail?id=${s.orderID}">${s.orderNo}(${s.orderID})</a></td>
         <td colspan="2">${s.payTotalFee}</td>
         <td colspan="3">${s.orderTime}</td>
@@ -154,7 +155,18 @@
         </td>
         <td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
                 test="${s.costType == '2'}">比例成本</c:if></td>
-        <td class="third-party-fee">${s.shopOtherFee}</td>
+        <td class="third-party-fee">
+            ${s.shopOtherFee + s.cmShopOtherFee}
+            <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee > 0}">
+                <font color="red">(采美中介费¥${s.cmShopOtherFee},第三方中介费¥${s.shopOtherFee})</font>
+            </c:if>
+            <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee eq 0}">
+                <font color="red">(第三方中介费¥${s.shopOtherFee})</font>
+            </c:if>
+            <c:if test="${s.shopOtherFee eq 0 and s.cmShopOtherFee > 0}">
+                <font color="red">(采美中介费¥${s.cmShopOtherFee})</font>
+            </c:if>
+        </td>
     </tr>
     <tr>
         <th>供应商</th>
@@ -206,14 +218,17 @@
         </td>
         <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
         <td colspan="2" 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 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"><fmt:formatNumber value="${s.shouldPayShopAmount+s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
+                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount+s.differencePrice}"/></font><font
+                    color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
             </c:if>
             <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount-s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
+                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount-s.differencePrice}"/></font><font
+                    color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
             </c:if>
         </td>
     </tr>
@@ -305,24 +320,24 @@
             <td><a href="${ctx}/order/cmPayShop/applyDetail?id=${p.payShopID}">${p.payShopID}</a></td>
             <td>${p.payTime}</td>
             <td>${p.bankNameType}
-                <%--<c:if test="${p.payType == '1'}">
-                    建设银行7297
-                </c:if>
-                <c:if test="${p.payType == '2'}">
-                    中信银行0897
-                </c:if>
-                <c:if test="${p.payType == '3'}">
-                    中信银行7172
-                </c:if>
-                <c:if test="${p.payType == '4'}">
-                    广发银行0115
-                </c:if>
-                <c:if test="${p.payType == '5'}">
-                    广发银行5461
-                </c:if>
-                <c:if test="${p.payType == '7'}">
-                    华夏银行2400
-                </c:if>--%>
+                    <%--<c:if test="${p.payType == '1'}">
+                        建设银行7297
+                    </c:if>
+                    <c:if test="${p.payType == '2'}">
+                        中信银行0897
+                    </c:if>
+                    <c:if test="${p.payType == '3'}">
+                        中信银行7172
+                    </c:if>
+                    <c:if test="${p.payType == '4'}">
+                        广发银行0115
+                    </c:if>
+                    <c:if test="${p.payType == '5'}">
+                        广发银行5461
+                    </c:if>
+                    <c:if test="${p.payType == '7'}">
+                        华夏银行2400
+                    </c:if>--%>
             </td>
             <td>${p.payAmount}</td>
         </tr>
@@ -350,24 +365,24 @@
             <td>
                 <div class="text-left">
                     线下转账: ${r.bankNameType}
-                    <%--<c:if test="${r.payType == '1'}">
-                        建设银行7297
-                    </c:if>
-                    <c:if test="${r.payType == '2'}">
-                        中信银行0897
-                    </c:if>
-                    <c:if test="${r.payType == '3'}">
-                        中信银行7172
-                    </c:if>
-                    <c:if test="${r.payType == '4'}">
-                        广发银行0115
-                    </c:if>
-                    <c:if test="${r.payType == '5'}">
-                        广发银行5461
-                    </c:if>
-                    <c:if test="${r.payType == '7'}">
-                        华夏银行2400
-                    </c:if>--%>
+                        <%--<c:if test="${r.payType == '1'}">
+                            建设银行7297
+                        </c:if>
+                        <c:if test="${r.payType == '2'}">
+                            中信银行0897
+                        </c:if>
+                        <c:if test="${r.payType == '3'}">
+                            中信银行7172
+                        </c:if>
+                        <c:if test="${r.payType == '4'}">
+                            广发银行0115
+                        </c:if>
+                        <c:if test="${r.payType == '5'}">
+                            广发银行5461
+                        </c:if>
+                        <c:if test="${r.payType == '7'}">
+                            华夏银行2400
+                        </c:if>--%>
                     &nbsp&nbsp
                     ¥${r.receiptAmount}<br>
                 </div>

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

@@ -230,9 +230,11 @@
     <%--<li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>--%>
     <li class="active"><a
-            href="${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=${payShopOther.shopOrderId}&payType=${payType}">付第三方</a></li>
+            href="${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=${payShopOther.shopOrderId}&payType=${payType}">付第三方</a>
+    </li>
 </ul>
-<form:form id="inputForm" modelAttribute="payShopOther" action="${ctx}/order/cmPayShop/saveShopOtherFee?payType=${payType}&redirectType=1" method="post"
+<form:form id="inputForm" modelAttribute="payShopOther"
+           action="${ctx}/order/cmPayShop/saveShopOtherFee?payType=${payType}&redirectType=1" method="post"
            class="form-horizontal">
     <form:hidden path="shopOrderId"/>
     <input style="display: none" name="payType" value="${payType}"/>
@@ -242,30 +244,76 @@
             <form:input path="name" htmlEscape="false" maxlength="250" class="input-xlarge required"/>
         </div>
     </div>
-    <div class="control-group">
-        <label class="control-label"><font color='red'>*</font>付第三方金额:</label>
-        <div class="controls">
-            <input type="number" id="shopOtherFee" required name="shopOtherFee" min="0"
-                   value="${payShopOther.shopOtherFee}" onchange="changeShouldPay(this)"/>
-        </div>
-    </div>
-    <c:if test="${payType ne 2}">
+    <div style=" ${not empty otherFee.onlinePayWays or otherFee.cmAccountType ne 1? '':'border:solid 1px black;padding: 10px'}">
         <div class="control-group">
-            <label class="control-label"><font color='red'>*</font>开户名:</label>&nbsp;&nbsp;&nbsp;&nbsp;
-            <form:input path="bankAccountName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
-            <label><font color='red'>*</font>账号:</label>
-            <form:input path="bankAccount" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
+            <label class="control-label"><font color='red'>*</font>第三方中介费:</label>
+            <div class="controls">
+                <input type="number" id="shopOtherFee" required name="shopOtherFee" min="0"
+                       value="${payShopOther.shopOtherFee}" onchange="changeShouldPay(this)"/>
+            </div>
         </div>
+        <c:if test="${payType ne 2}">
+            <div class="control-group">
+                <label class="control-label"><font color='red'>*</font>开户名:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+                <form:input path="bankAccountName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
+                <label><font color='red'>*</font>账号:</label>
+                <form:input path="bankAccount" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
+            </div>
+            <div class="control-group">
+                <label class="control-label"><font color='red'>*</font>开户行:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+                <form:input path="bankName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
+                <label><font color='red'>*</font>账户类型:</label>
+                <form:select path="type" class="select-ele input-xlarge required">
+                    <form:option value="0" label="公账"/>
+                    <form:option value="1" label="私账"/>
+                </form:select>
+            </div>
+        </c:if>
+    </div>
+    <br/>
+    <div style="border:solid 1px black;padding: 10px;" ${not empty otherFee.onlinePayWays or otherFee.cmAccountType ne 1?'hidden':''}>
         <div class="control-group">
-            <label class="control-label"><font color='red'>*</font>开户行:</label>&nbsp;&nbsp;&nbsp;&nbsp;
-            <form:input path="bankName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
-            <label><font color='red'>*</font>账户类型:</label>
-            <form:select path="type" class="select-ele input-xlarge required">
-                <form:option value="0" label="公账"/>
-                <form:option value="1" label="私账"/>
-            </form:select>
+            <input style="display: none" value="${otherFee.cmProfit}" name="cmShopOtherFee">
+            <div>
+                <label class="control-label"><font
+                        color='red'>*</font>采美中介费:${empty otherFee.cmProfit ? 0 : otherFee.cmProfit}</label>
+            </div>
+            <div style="display: inline-block;">
+                <label class="control-label">不申请此费用:</label>
+                <c:choose>
+                    <c:when test="${not empty payShopOther.otherFeeFlag and payShopOther.otherFeeFlag eq 1}">
+                        <div class="controls">
+                            <input id="otherFeeFlag" name="otherFeeFlag" type="checkbox" onchange="checkFlag(this)">
+                        </div>
+                    </c:when>
+                    <c:otherwise>
+                        <div class="controls">
+                            <input id="otherFeeFlag" name="otherFeeFlag" type="checkbox" checked
+                                   onchange="checkFlag(this)">
+                        </div>
+                    </c:otherwise>
+                </c:choose>
+            </div>
         </div>
-    </c:if>
+        <c:if test="${payType ne 2}">
+            <div class="control-group">
+                <label class="control-label"><font color='red'>*</font>开户名:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+                <form:input path="cmBankAccountName" htmlEscape="false" maxlength="100" class="input-xlarge"/>&nbsp;&nbsp;&nbsp;&nbsp;
+                <label><font color='red'>*</font>账号:</label>
+                <form:input path="cmBankAccount" htmlEscape="false" maxlength="100" class="input-xlarge"/>
+            </div>
+            <div class="control-group">
+                <label class="control-label"><font color='red'>*</font>开户行:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+                <form:input path="cmBankName" htmlEscape="false" maxlength="100" class="input-xlarge"/>&nbsp;&nbsp;&nbsp;&nbsp;
+                <label><font color='red'>*</font>账户类型:</label>
+                <form:select path="cmType" class="select-ele input-xlarge">
+                    <form:option value="0" label="公账"/>
+                    <form:option value="1" label="私账"/>
+                </form:select>
+            </div>
+        </c:if>
+    </div>
+    <br/>
     <div class="control-group">
         <label class="control-label"><font color='red'>*</font>备注内容:</label>
         <div class="controls">
@@ -348,6 +396,8 @@
 
     //图片初始化
     $(function () {
+        var feeFlag = document.getElementById('otherFeeFlag');
+        checkFlag(feeFlag);
         $('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
         $('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
         $('.upload-content .conList').find('.cancel-upload').hide();
@@ -418,6 +468,14 @@
     function onlynum(obj) {
         obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
     }
+
+    function checkFlag(el) {
+        if (el.checked) {
+            el.value = 0;
+        } else {
+            el.value = 1;
+        }
+    }
 </script>
 </body>
 </html>