Browse Source

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

zhijiezhao 1 year ago
parent
commit
5512d27d86
27 changed files with 3938 additions and 2216 deletions
  1. 81 8
      src/main/java/com/caimei/modules/bulkpurchase/web/CmRefundsProductController.java
  2. 4 0
      src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java
  3. 0 1
      src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java
  4. 37 1291
      src/main/java/com/caimei/modules/order/entity/NewShopOrder.java
  5. 105 36
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  6. 54 28
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  7. 3 39
      src/main/java/com/caimei/modules/order/web/CmPayShopController.java
  8. 32 9
      src/main/java/com/caimei/modules/order/web/CmShopOrderController.java
  9. 32 27
      src/main/java/com/caimei/modules/order/web/NewOrderController.java
  10. 181 22
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  11. 11 11
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/addOrderRemarksForm.jsp
  12. 4 22
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderConfirmReturnRecord.jsp
  13. 295 0
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/shopOrderRefundRecord.jsp
  14. 529 0
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/shopOrderReturnRecord.jsp
  15. 39 6
      src/main/webapp/WEB-INF/views/modules/order/checkPaymentOrder.jsp
  16. 11 11
      src/main/webapp/WEB-INF/views/modules/order/cmOrderRemarksFormNew.jsp
  17. 51 6
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopChange.jsp
  18. 96 86
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp
  19. 289 261
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp
  20. 44 24
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopEdit.jsp
  21. 163 133
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp
  22. 44 30
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopPrintDetail.jsp
  23. 138 114
      src/main/webapp/WEB-INF/views/modules/order/cmRefundShopDetail.jsp
  24. 59 43
      src/main/webapp/WEB-INF/views/modules/order/newOrderList.jsp
  25. 41 8
      src/main/webapp/WEB-INF/views/modules/order/refundRecord.jsp
  26. 1073 0
      src/main/webapp/WEB-INF/views/modules/order/shopOrderDetail.jsp
  27. 522 0
      src/main/webapp/static/modules/order/order-details.css

+ 81 - 8
src/main/java/com/caimei/modules/bulkpurchase/web/CmRefundsProductController.java

@@ -553,6 +553,43 @@ public class CmRefundsProductController extends BaseController {
         return "";
     }
 
+    @RequestMapping(value = "toRecturnRecordByShopOrder")
+    public String toRecturnRecordByShopOrder(CmReturnedPurchase cmReturnedPurchase, String from, HttpServletRequest request, HttpServletResponse response, Model model) {
+        NewShopOrder byShopOrder = newShopOrderService.findByShopOrderID(cmReturnedPurchase.getShopOrderID());
+        List<CmReturnedPurchase> dataList = cmReturnedPurchaseService.getReturnedPurchaseList(cmReturnedPurchase);
+        for (CmReturnedPurchase returnedPurchase : dataList) {
+            if (null != cmReturnedPurchase.getShopOrderID()) {
+                List<ShopOrderReturned> shopOrderReturneds = returnedPurchase.getShopOrderReturnedList().stream().filter(newShopOrder -> newShopOrder.getShopOrderID().equals(cmReturnedPurchase.getShopOrderID())).collect(Collectors.toList());
+                returnedPurchase.setShopOrderReturnedList(shopOrderReturneds);
+            }
+        }
+        //退款(退货)总金额
+        Double returnedPurchaseFee = 0D;
+        //退款总额(给买家)
+        Double refundFee = 0D;
+        for (CmReturnedPurchase bean : dataList) {
+            if (!bean.getStatus().equals("3")) {
+                returnedPurchaseFee += bean.getReturnedPurchaseFee();
+                refundFee += bean.getRefundFee();
+            }
+        }
+
+        BpClause bpClause = new BpClause();
+        bpClause.setEnabledStatus("1");
+        List<BpClause> bpClauses = bpClauseService.findList(bpClause);
+
+        model.addAttribute("from", from);
+        model.addAttribute("bpClauses", bpClauses);
+        model.addAttribute("cmReturnedPurchaseList", dataList);
+        model.addAttribute("order", byShopOrder);
+        model.addAttribute("orderType", cmReturnedPurchase.getOrderType());
+        model.addAttribute("returnedPurchaseFee", returnedPurchaseFee);
+        model.addAttribute("refundFee", refundFee);
+        model.addAttribute("cmReturnedPurchase", cmReturnedPurchase);
+        return "modules/bulkpurchase/shopOrderReturnRecord";
+    }
+
+
     /**
      * @return
      * @Author ye.qin
@@ -564,11 +601,11 @@ public class CmRefundsProductController extends BaseController {
     public String toRecturnRecordByOrderID(CmReturnedPurchase cmReturnedPurchase, String from, HttpServletRequest request, HttpServletResponse response, Model model) {
         try {
             NewOrder newOrder = newOrderService.get(cmReturnedPurchase.getOrderID().toString());
-           if(null!= cmReturnedPurchase.getShopOrderID()){
-               //过滤子订单
-               List<NewShopOrder>  newShopOrders= newOrder.getNewShopOrders().stream().filter(newShopOrder -> newShopOrder.getShopOrderID().equals(cmReturnedPurchase.getShopOrderID())).collect(Collectors.toList());
-               newOrder.setNewShopOrders(newShopOrders);
-               cmReturnedPurchase.setOrderType(Integer.valueOf(newOrder.getOrderType()));
+            if (null != cmReturnedPurchase.getShopOrderID()) {
+                //过滤子订单
+                List<NewShopOrder> newShopOrders = newOrder.getNewShopOrders().stream().filter(newShopOrder -> newShopOrder.getShopOrderID().equals(cmReturnedPurchase.getShopOrderID())).collect(Collectors.toList());
+                newOrder.setNewShopOrders(newShopOrders);
+                cmReturnedPurchase.setOrderType(Integer.valueOf(newOrder.getOrderType()));
             }
 
             List<CmReturnedPurchase> dataList = cmReturnedPurchaseService.getReturnedPurchaseList(cmReturnedPurchase);
@@ -623,9 +660,7 @@ public class CmRefundsProductController extends BaseController {
             NewOrder order = newOrderService.get(cmReturnedPurchase.getOrderID().toString());
             if (null != cmReturnedPurchase.getShopOrderID()) {
                 //过滤子订单
-                List<NewShopOrder> newShopOrders = order.getNewShopOrders().stream().filter(s ->
-                        s.getShopOrderID().equals(cmReturnedPurchase.getShopOrderID()))
-                        .collect(Collectors.toList());
+                List<NewShopOrder> newShopOrders = order.getNewShopOrders().stream().filter(s -> s.getShopOrderID().equals(cmReturnedPurchase.getShopOrderID())).collect(Collectors.toList());
                 order.setNewShopOrders(newShopOrders);
             }
 
@@ -708,6 +743,44 @@ public class CmRefundsProductController extends BaseController {
         return "modules/bulkpurchase/orderReviewReturnRecord";
     }
 
+    /**
+     * 根据子订单Id查看收付款记录
+     *
+     * @param cmReturnedPurchase
+     * @param from
+     * @param request
+     * @param response
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "toShopOrderRefundRecord")
+    public String getReturnByShopOrder(CmReturnedPurchase cmReturnedPurchase, String from, HttpServletRequest request, HttpServletResponse response, Model model) {
+        NewShopOrder newOrder = newShopOrderService.findByShopOrderID(cmReturnedPurchase.getShopOrderID());
+        List<CmReceiptOrderRelation> listRelation = cmReceiptOrderRelationService.findByShopOrderIds(Arrays.asList(cmReturnedPurchase.getShopOrderID()));
+        List<CmReturnedPurchase> dataList = cmReturnedPurchaseService.getReturnedPurchaseList(cmReturnedPurchase);
+        Double refundFee = 0D;  //退款总额
+        for (CmReturnedPurchase bean : dataList) {
+            for (ShopOrderReturned shopOrderReturned : bean.getShopOrderReturnedList()) {
+                if (shopOrderReturned.getShopOrderID().equals(cmReturnedPurchase.getShopOrderID())) {
+                    if (!bean.getStatus().equals("3")) {
+                        refundFee += bean.getRefundFee();
+                    }
+                }
+            }
+        }
+        List<CmPayShopRecord> pr = newShopOrderService.getPayedRecords(cmReturnedPurchase.getShopOrderID().toString());
+        model.addAttribute("pr", pr);
+        model.addAttribute("cmReturnedPurchaseList", dataList);
+        model.addAttribute("order", newOrder);
+        model.addAttribute("receipt", listRelation);
+        model.addAttribute("refundFee", refundFee);
+        model.addAttribute("from", from);
+        model.addAttribute("orderID", cmReturnedPurchase.getOrderID().toString());
+        model.addAttribute("orderType", cmReturnedPurchase.getOrderType());
+
+        return "modules/bulkpurchase/shopOrderRefundRecord";
+    }
+
     /**
      * @return
      * @Author ye.qin

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

@@ -193,4 +193,8 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
      * @return 结果
      */
     public int updateDelCmShopOrderByShopOrderIDs(@Param("shopOrderIDs") String[] shopOrderIDs,@Param("delFlag") Integer delFlag);
+
+    List<NewShopOrder> getShopOrderlist(NewShopOrder newShopOrder);
+
+    void updateStatus(NewShopOrder shopOrder);
 }

+ 0 - 1
src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java

@@ -384,7 +384,6 @@ public class    CmDiscernReceipt extends DataEntity<CmDiscernReceipt> {
         this.problem = problem;
     }
 
-    @Length(min = 0, max = 100, message = "非订单款说明(适用协销确认的时候区分订单和非订单款)长度必须介于 0 和 100 之间")
     public String getNoOrderReason() {
         return noOrderReason;
     }

+ 37 - 1291
src/main/java/com/caimei/modules/order/entity/NewShopOrder.java

@@ -1,7 +1,9 @@
 package com.caimei.modules.order.entity;
 
+import com.caimei.modules.bulkpurchase.entity.OrderInvoice;
 import com.caimei.modules.product.entity.CmPromotion;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
+import lombok.Data;
 
 import java.beans.Transient;
 import java.math.BigDecimal;
@@ -13,7 +15,22 @@ import java.util.List;
  * @date 2018-07-24
  * @description 子订单表
  */
+@Data
 public class NewShopOrder extends DataEntity<NewShopOrder> {
+
+    private OrderUserInfo bpOrderUserinfo;
+    private String closeReason;
+    private Integer orderSeen;
+    private OrderInvoice orderInvoice;
+    private Integer clauseID;
+    private String mobile;
+    private Integer serviceProviderId;
+    private String startConfirmTime;
+    private String endConfirmTime;
+    private String spName;
+    private Integer shopStatus;
+    private Integer returnedPurchaseStatus;//待审核退款 1审核中,0不是审核中
+    private Integer rebateFlag; // 主订单返佣订单标记 0非返佣订单,1返佣订单
     private Integer onlineFlag;    //是否线上支付过1是,0否
     private Double couponAmount;   //子订单使用优惠券金额
     private Integer shopOrderID;//        int(11) not null auto_increment comment '子订单ID',
@@ -75,7 +92,6 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private Double allServeAmount;   // 总平台服务费
 
 
-
     private String rebateOrder;  //是不是返佣订单 是的1,  不是的0
     private Integer splitCount; //分账记录数
     private Integer settleRecordNum;   //佣金结算数量
@@ -158,24 +174,34 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private String rebateFee; //主订单返佣服务费
     private String shopPostFlag; //免邮标志 运费:2到付,0包邮,1需要运费,-2仪器到付其它包邮
     private String postageInfo; //运费字符串
-
-    /**  */
+    private String clauseName;
+    /**
+     *
+     */
     private Integer returnGoodsStatus;
 
-    /** 二手商品订单标识  0非二手商品订单、 1二手商品订单 */
+    /**
+     * 二手商品订单标识  0非二手商品订单、 1二手商品订单
+     */
     private String secondHandOrderFlag;
-    /** 外部商城付采美佣金 */
+    /**
+     * 外部商城付采美佣金
+     */
     private BigDecimal payCmAmount;
-    /**  */
+    /**
+     *
+     */
     private String receiptedFlag;
 
-    /**  */
+    /**
+     *
+     */
     private String receiptedType;
-    /** 子订单已支付成功次数统计 */
+    /**
+     * 子订单已支付成功次数统计
+     */
     private Integer paySuccessCounter;
 
-
-
     private List<CmOrderPaymentVoucherVo> voucherVo; //支付凭证
 
     // 备注图片
@@ -190,1289 +216,9 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private String remarkImage9;
     private String remarkImage10;
 
-    public Integer getReturnGoodsStatus() {
-        return returnGoodsStatus;
-    }
-
-    public void setReturnGoodsStatus(Integer returnGoodsStatus) {
-        this.returnGoodsStatus = returnGoodsStatus;
-    }
-
-    public String getSecondHandOrderFlag() {
-        return secondHandOrderFlag;
-    }
-
-    public void setSecondHandOrderFlag(String secondHandOrderFlag) {
-        this.secondHandOrderFlag = secondHandOrderFlag;
-    }
-
-    public BigDecimal getPayCmAmount() {
-        return payCmAmount;
-    }
-
-    public void setPayCmAmount(BigDecimal payCmAmount) {
-        this.payCmAmount = payCmAmount;
-    }
-
-    public String getReceiptedFlag() {
-        return receiptedFlag;
-    }
-
-    public void setReceiptedFlag(String receiptedFlag) {
-        this.receiptedFlag = receiptedFlag;
-    }
-
-    public String getReceiptedType() {
-        return receiptedType;
-    }
-
-    public void setReceiptedType(String receiptedType) {
-        this.receiptedType = receiptedType;
-    }
-
-    public Integer getPaySuccessCounter() {
-        return paySuccessCounter;
-    }
-
-    public void setPaySuccessCounter(Integer paySuccessCounter) {
-        this.paySuccessCounter = paySuccessCounter;
-    }
-
-
-    public String getShopPostFlag() {
-        return shopPostFlag;
-    }
-
-    public void setShopPostFlag(String shopPostFlag) {
-        this.shopPostFlag = shopPostFlag;
-    }
-    public List<CmOrderPaymentVoucherVo> getVoucherVo() {
-        return voucherVo;
-    }
-
-    public void setVoucherVo(List<CmOrderPaymentVoucherVo> voucherVo) {
-        this.voucherVo = voucherVo;
-    }
-    public String getPostageInfo() {
-        return postageInfo;
-    }
-
-    public void setPostageInfo(String postageInfo) {
-        this.postageInfo = postageInfo;
-    }
-
     private boolean modifyPayable = false; //是否线上支付
 
     private boolean payShopOtherFee = true; //是否可以付第三方申请
 
-    public String getOnlinePayWays() {
-        return onlinePayWays;
-    }
-
-    public void setOnlinePayWays(String onlinePayWays) {
-        this.onlinePayWays = onlinePayWays;
-    }
-
-    public String getRebateFee() {
-        return rebateFee;
-    }
-
-    public void setRebateFee(String rebateFee) {
-        this.rebateFee = rebateFee;
-    }
-
-    public Integer getSettleStatus() {
-        return settleStatus;
-    }
-
-    public void setSettleStatus(Integer settleStatus) {
-        this.settleStatus = settleStatus;
-    }
-
-    public Double getSettleAmount() {
-        return settleAmount;
-    }
-
-    public void setSettleAmount(Double settleAmount) {
-        this.settleAmount = settleAmount;
-    }
-
-    public Integer getPayWay() {
-        return payWay;
-    }
-
-    public void setPayWay(Integer payWay) {
-        this.payWay = payWay;
-    }
-
-    public Double getIncome() {
-        return income;
-    }
-
-    public void setIncome(Double income) {
-        this.income = income;
-    }
-
-    public Integer getOnlineFlag() {
-        return onlineFlag;
-    }
-
-    public void setOnlineFlag(Integer onlineFlag) {
-        this.onlineFlag = onlineFlag;
-    }
-
-    public List<String> getShopOrderNos() {
-        return shopOrderNos;
-    }
-
-    public void setShopOrderNos(List<String> shopOrderNos) {
-        this.shopOrderNos = shopOrderNos;
-    }
-
-    public Double getCouponAmount() {
-        return couponAmount;
-    }
-
-    public void setCouponAmount(Double couponAmount) {
-        this.couponAmount = couponAmount;
-    }
-
-    public Integer getOrderPromotionsId() {
-        return orderPromotionsId;
-    }
-
-    public void setOrderPromotionsId(Integer orderPromotionsId) {
-        this.orderPromotionsId = orderPromotionsId;
-    }
-
-    public Double getPromotionFullReduction() {
-        return promotionFullReduction;
-    }
-
-    public void setPromotionFullReduction(Double promotionFullReduction) {
-        this.promotionFullReduction = promotionFullReduction;
-    }
-
-    public String getRebateOrder() {
-        return rebateOrder;
-    }
-
-    public void setRebateOrder(String rebateOrder) {
-        this.rebateOrder = rebateOrder;
-    }
-
-    public Integer getSplitCount() {
-        return splitCount;
-    }
-
-    public void setSplitCount(Integer splitCount) {
-        this.splitCount = splitCount;
-    }
-
-    public Integer getSettleRecordNum() {
-        return settleRecordNum;
-    }
-
-    public void setSettleRecordNum(Integer settleRecordNum) {
-        this.settleRecordNum = settleRecordNum;
-    }
-
-    public Integer getIsColdChina() {
-        return isColdChina;
-    }
-
-    public void setIsColdChina(Integer isColdChina) {
-        this.isColdChina = isColdChina;
-    }
-    public String getClubName() {
-        return clubName;
-    }
-
-    public void setClubName(String clubName) {
-        this.clubName = clubName;
-    }
-
-    public String getReceiptStatus() {
-        return receiptStatus;
-    }
-
-    public void setReceiptStatus(String receiptStatus) {
-        this.receiptStatus = receiptStatus;
-    }
-
-    public Double getReceiptTotalFee() {
-        return receiptTotalFee;
-    }
-
-    public void setReceiptTotalFee(Double receiptTotalFee) {
-        this.receiptTotalFee = receiptTotalFee;
-    }
-
-    public Double getShouldPayProduct() {
-        return shouldPayProduct;
-    }
-
-    public void setShouldPayProduct(Double shouldPayProduct) {
-        this.shouldPayProduct = shouldPayProduct;
-    }
-
-    public Integer getShopOrderID() {
-        return shopOrderID;
-    }
-
-    public void setShopOrderID(Integer shopOrderID) {
-        this.shopOrderID = shopOrderID;
-    }
-
-    public String getShopOrderNo() {
-        return shopOrderNo;
-    }
-
-    public void setShopOrderNo(String shopOrderNo) {
-        this.shopOrderNo = shopOrderNo;
-    }
-
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
-    }
-
-    public Integer getUserID() {
-        return userID;
-    }
-
-    public void setUserID(Integer userID) {
-        this.userID = userID;
-    }
-
-    public Integer getShopID() {
-        return shopID;
-    }
-
-    public void setShopID(Integer shopID) {
-        this.shopID = shopID;
-    }
-
-    public Integer getItemCount() {
-        return itemCount;
-    }
-
-    public void setItemCount(Integer itemCount) {
-        this.itemCount = itemCount;
-    }
-
-    public Integer getTownID() {
-        return townID;
-    }
-
-    public void setTownID(Integer townID) {
-        this.townID = townID;
-    }
-
-    public Double getProductAmount() {
-        return productAmount;
-    }
-
-    public void setProductAmount(Double productAmount) {
-        this.productAmount = productAmount;
-    }
-
-    public Double getFee() {
-        return fee;
-    }
-
-    public void setFee(Double fee) {
-        this.fee = fee;
-    }
-
-    public Double getDiscountAmount() {
-        return discountAmount;
-    }
-
-    public void setDiscountAmount(Double discountAmount) {
-        this.discountAmount = discountAmount;
-    }
-
-    public Double getAccountAmount() {
-        return accountAmount;
-    }
-
-    public void setAccountAmount(Double accountAmount) {
-        this.accountAmount = accountAmount;
-    }
-
-    public Double getTotalAmount() {
-        return totalAmount;
-    }
-
-    public void setTotalAmount(Double totalAmount) {
-        this.totalAmount = totalAmount;
-    }
-
-    public String getPayFlag() {
-        return payFlag;
-    }
-
-    public void setPayFlag(String payFlag) {
-        this.payFlag = payFlag;
-    }
-
-    public String getPayTime() {
-        return payTime;
-    }
-
-    public void setPayTime(String payTime) {
-        this.payTime = payTime;
-    }
-
-    public String getFinishTime() {
-        return finishTime;
-    }
-
-    public void setFinishTime(String finishTime) {
-        this.finishTime = finishTime;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    public Integer getRefundStatus() {
-        return refundStatus;
-    }
-
-    public void setRefundStatus(Integer refundStatus) {
-        this.refundStatus = refundStatus;
-    }
-
-    public Double getNeedPayAmount() {
-        return needPayAmount;
-    }
-
-    public void setNeedPayAmount(Double needPayAmount) {
-        this.needPayAmount = needPayAmount;
-    }
-
-    public Double getCanRefundAmount() {
-        return canRefundAmount;
-    }
-
-    public void setCanRefundAmount(Double canRefundAmount) {
-        this.canRefundAmount = canRefundAmount;
-    }
-
-    public Double getRefundAmount() {
-        return refundAmount;
-    }
-
-    public void setRefundAmount(Double refundAmount) {
-        this.refundAmount = refundAmount;
-    }
-
-    public Integer getClubID() {
-        return clubID;
-    }
-
-    public void setClubID(Integer clubID) {
-        this.clubID = clubID;
-    }
-
-    public Integer getSpID() {
-        return spID;
-    }
-
-    public void setSpID(Integer spID) {
-        this.spID = spID;
-    }
-
-    public Integer getMainSpID() {
-        return mainSpID;
-    }
-
-    public void setMainSpID(Integer mainSpID) {
-        this.mainSpID = mainSpID;
-    }
-
-    public Integer getOrderBeanAmount() {
-        return orderBeanAmount;
-    }
-
-    public void setOrderBeanAmount(Integer orderBeanAmount) {
-        this.orderBeanAmount = orderBeanAmount;
-    }
-
-    public Integer getUseBeanAmount() {
-        return useBeanAmount;
-    }
-
-    public void setUseBeanAmount(Integer useBeanAmount) {
-        this.useBeanAmount = useBeanAmount;
-    }
-
-    public Integer getUseBeanFlag() {
-        return useBeanFlag;
-    }
-
-    public void setUseBeanFlag(Integer useBeanFlag) {
-        this.useBeanFlag = useBeanFlag;
-    }
-
-    public Integer getCanRefundFlag() {
-        return canRefundFlag;
-    }
-
-    public void setCanRefundFlag(Integer canRefundFlag) {
-        this.canRefundFlag = canRefundFlag;
-    }
-
-    public Integer getUseBalanceFlag() {
-        return useBalanceFlag;
-    }
-
-    public void setUseBalanceFlag(Integer useBalanceFlag) {
-        this.useBalanceFlag = useBalanceFlag;
-    }
-
-    public Integer getCanRefundBeans() {
-        return canRefundBeans;
-    }
-
-    public void setCanRefundBeans(Integer canRefundBeans) {
-        this.canRefundBeans = canRefundBeans;
-    }
-
-    public Integer getOrderDeliveryID() {
-        return orderDeliveryID;
-    }
-
-    public void setOrderDeliveryID(Integer orderDeliveryID) {
-        this.orderDeliveryID = orderDeliveryID;
-    }
-
-    public Double getFreePostageFee() {
-        return freePostageFee;
-    }
-
-    public void setFreePostageFee(Double freePostageFee) {
-        this.freePostageFee = freePostageFee;
-    }
-
-    public String getAssociationType() {
-        return associationType;
-    }
-
-    public void setAssociationType(String associationType) {
-        this.associationType = associationType;
-    }
-
-    public String getConfirmType() {
-        return confirmType;
-    }
-
-    public void setConfirmType(String confirmType) {
-        this.confirmType = confirmType;
-    }
-
-    public String getConfirmTime() {
-        return confirmTime;
-    }
-
-    public void setConfirmTime(String confirmTime) {
-        this.confirmTime = confirmTime;
-    }
-
-    public boolean isReceiptOrderFlag() {
-        return receiptOrderFlag;
-    }
-
-    public void setReceiptOrderFlag(boolean receiptOrderFlag) {
-        this.receiptOrderFlag = receiptOrderFlag;
-    }
-
-    public Double getOrderReceivedAmount() {
-        return orderReceivedAmount;
-    }
-
-    public void setOrderReceivedAmount(Double orderReceivedAmount) {
-        this.orderReceivedAmount = orderReceivedAmount;
-    }
-
-    public Double getReturnBalanceAmount() {
-        return returnBalanceAmount;
-    }
-
-    public void setReturnBalanceAmount(Double returnBalanceAmount) {
-        this.returnBalanceAmount = returnBalanceAmount;
-    }
-
-    public Double getAllServeAmount() {
-        return allServeAmount;
-    }
-
-    public void setAllServeAmount(Double allServeAmount) {
-        this.allServeAmount = allServeAmount;
-    }
-
-    public Integer getFreePostageTicketID() {
-        return freePostageTicketID;
-    }
-
-    public void setFreePostageTicketID(Integer freePostageTicketID) {
-        this.freePostageTicketID = freePostageTicketID;
-    }
-
-    public Double getBrokerage() {
-        return brokerage;
-    }
-
-    public void setBrokerage(Double brokerage) {
-        this.brokerage = brokerage;
-    }
-
-    @Override
-    public String getDelFlag() {
-        return delFlag;
-    }
-
-    @Override
-    public void setDelFlag(String delFlag) {
-        this.delFlag = delFlag;
-    }
-
-    public Double getRefundsAmount() {
-        return refundsAmount;
-    }
-
-    public void setRefundsAmount(Double refundsAmount) {
-        this.refundsAmount = refundsAmount;
-    }
-
-    public String getOrderStatusFlag() {
-        return orderStatusFlag;
-    }
-
-    public void setOrderStatusFlag(String orderStatusFlag) {
-        this.orderStatusFlag = orderStatusFlag;
-    }
-
-    public String getBuyStatus() {
-        return buyStatus;
-    }
-
-    public void setBuyStatus(String buyStatus) {
-        this.buyStatus = buyStatus;
-    }
-
-    public NewOrder getOrder() {
-        return order;
-    }
-
-    public void setOrder(NewOrder order) {
-        this.order = order;
-    }
-
-    public List<NewOrderProduct> getNewOrderProducts() {
-        return newOrderProducts;
-    }
-
-    public void setNewOrderProducts(List<NewOrderProduct> newOrderProducts) {
-        this.newOrderProducts = newOrderProducts;
-    }
-
-    public Integer getOrderID() {
-        return orderID;
-    }
-
-    public void setOrderID(Integer orderID) {
-        this.orderID = orderID;
-    }
-
-    public Integer getOrderType() {
-        return orderType;
-    }
-
-    public void setOrderType(Integer orderType) {
-        this.orderType = orderType;
-    }
-
-    @Transient
-    public String getShopName() {
-        return shopName;
-    }
-
-    public void setShopName(String shopName) {
-        this.shopName = shopName;
-    }
-
-
-    public String getContactName() {
-        return contactName;
-    }
-
-    public void setContactName(String contactName) {
-        this.contactName = contactName;
-    }
-
-    public String getDockingPeopleName() {
-        return dockingPeopleName;
-    }
-
-    public void setDockingPeopleName(String dockingPeopleName) {
-        this.dockingPeopleName = dockingPeopleName;
-    }
-
-    @Transient
-    public String getReceiver() {
-        return receiver;
-    }
-
-    public void setReceiver(String receiver) {
-        this.receiver = receiver;
-    }
-
-    @Transient
-    public String getBuyer() {
-        return buyer;
-    }
-
-    public void setBuyer(String buyer) {
-        this.buyer = buyer;
-    }
-
-    @Transient
-    public String getOrderSource() {
-        return orderSource;
-    }
-
-    public void setOrderSource(String orderSource) {
-        this.orderSource = orderSource;
-    }
-
-    public String getOrderTime() {
-        return orderTime;
-    }
-
-    public void setOrderTime(String orderTime) {
-        this.orderTime = orderTime;
-    }
-
-    @Transient
-    public String getAlreadyReceipt() {
-        return alreadyReceipt;
-    }
-
-    public void setAlreadyReceipt(String alreadyReceipt) {
-        this.alreadyReceipt = alreadyReceipt;
-    }
-
-    @Transient
-    public String getUnReceipt() {
-        return unReceipt;
-    }
-
-    public void setUnReceipt(String unReceipt) {
-        this.unReceipt = unReceipt;
-    }
-
-    @Transient
-    public String getPaid() {
-        return paid;
-    }
-
-    public void setPaid(String paid) {
-        this.paid = paid;
-    }
-
-    @Transient
-    public String getUnpaid() {
-        return unpaid;
-    }
-
-    public void setUnpaid(String unpaid) {
-        this.unpaid = unpaid;
-    }
-
-    public Double getPreferential() {
-        return preferential;
-    }
-
-    public void setPreferential(Double preferential) {
-        this.preferential = preferential;
-    }
-
-    public Integer getOrderSubmitType() {
-        return orderSubmitType;
-    }
-
-    public void setOrderSubmitType(Integer orderSubmitType) {
-        this.orderSubmitType = orderSubmitType;
-    }
-
-    public BigInteger getDeliveryTimeMills() {
-        return deliveryTimeMills;
-    }
-
-    public void setDeliveryTimeMills(BigInteger deliveryTimeMills) {
-        this.deliveryTimeMills = deliveryTimeMills;
-    }
-
-    public Integer getPresentNum() {
-        return presentNum;
-    }
-
-    public void setPresentNum(Integer presentNum) {
-        this.presentNum = presentNum;
-    }
-
-    public Integer getOutStoreNum() {
-        return outStoreNum;
-    }
-
-    public void setOutStoreNum(Integer outStoreNum) {
-        this.outStoreNum = outStoreNum;
-    }
-
-    public Integer getOutStoreTimes() {
-        return outStoreTimes;
-    }
-
-    public void setOutStoreTimes(Integer outStoreTimes) {
-        this.outStoreTimes = outStoreTimes;
-    }
-
-    public Double getTotalAddedValueTax() {
-        return totalAddedValueTax;
-    }
-
-    public void setTotalAddedValueTax(Double totalAddedValueTax) {
-        this.totalAddedValueTax = totalAddedValueTax;
-    }
-
-    @Transient
-    public String getSplitFlag() {
-        return splitFlag;
-    }
-
-    public void setSplitFlag(String splitFlag) {
-        this.splitFlag = splitFlag;
-    }
-
-    public Double getDiscountFee() {
-        return discountFee;
-    }
-
-    public void setDiscountFee(Double discountFee) {
-        this.discountFee = discountFee;
-    }
-
-    public Long getAutoReceiveTimeMills() {
-        return autoReceiveTimeMills;
-    }
-
-    public void setAutoReceiveTimeMills(Long autoReceiveTimeMills) {
-        this.autoReceiveTimeMills = autoReceiveTimeMills;
-    }
-
-    public Long getAutoOverTimeMills() {
-        return autoOverTimeMills;
-    }
-
-    public void setAutoOverTimeMills(Long autoOverTimeMills) {
-        this.autoOverTimeMills = autoOverTimeMills;
-    }
-
-    public String getReceiveGoodsTime() {
-        return receiveGoodsTime;
-    }
-
-    public void setReceiveGoodsTime(String receiveGoodsTime) {
-        this.receiveGoodsTime = receiveGoodsTime;
-    }
-
-    public String getNote() {
-        return note;
-    }
-
-    public void setNote(String note) {
-        this.note = note;
-    }
-
-    public List<NewOrderProduct> getSnOrderProducts() {
-        return snOrderProducts;
-    }
-
-    public void setSnOrderProducts(List<NewOrderProduct> snOrderProducts) {
-        this.snOrderProducts = snOrderProducts;
-    }
-
-    public String getPayStatus() {
-        return payStatus;
-    }
-
-    public void setPayStatus(String payStatus) {
-        this.payStatus = payStatus;
-    }
-
-    public String getSendOutStatus() {
-        return sendOutStatus;
-    }
-
-    public void setSendOutStatus(String sendOutStatus) {
-        this.sendOutStatus = sendOutStatus;
-    }
-
-    public String getPostFeeCos() {
-        return postFeeCos;
-    }
-
-    public void setPostFeeCos(String postFeeCos) {
-        this.postFeeCos = postFeeCos;
-    }
-
-    public Boolean getDefaultStatus() {
-        return defaultStatus;
-    }
-
-    public void setDefaultStatus(Boolean defaultStatus) {
-        this.defaultStatus = defaultStatus;
-    }
-
-    public String getPaying() {
-        return paying;
-    }
-
-    public void setPaying(String paying) {
-        this.paying = paying;
-    }
-
-    @Transient
-    public Double getPayTotalFee() {
-        return payTotalFee;
-    }
-
-    public void setPayTotalFee(Double payTotalFee) {
-        this.payTotalFee = payTotalFee;
-    }
-
-    public Double getShopProductAmount() {
-        return shopProductAmount;
-    }
-
-    public void setShopProductAmount(Double shopProductAmount) {
-        this.shopProductAmount = shopProductAmount;
-    }
-
-    public Double getShopPostFee() {
-        return shopPostFee;
-    }
-
-    public void setShopPostFee(Double shopPostFee) {
-        this.shopPostFee = shopPostFee;
-    }
-
-    public Double getShopTaxFee() {
-        return shopTaxFee;
-    }
-
-    public void setShopTaxFee(Double shopTaxFee) {
-        this.shopTaxFee = shopTaxFee;
-    }
-
-    public Double getShouldPayShopAmount() {
-        return shouldPayShopAmount;
-    }
-
-    public void setShouldPayShopAmount(Double shouldPayShopAmount) {
-        this.shouldPayShopAmount = shouldPayShopAmount;
-    }
-
-    public Double getPayedShopAmount() {
-        return payedShopAmount;
-    }
-
-    public void setPayedShopAmount(Double payedShopAmount) {
-        this.payedShopAmount = payedShopAmount;
-    }
-
-    public Double getShopOtherFee() {
-        return shopOtherFee;
-    }
-
-    public void setShopOtherFee(Double shopOtherFee) {
-        this.shopOtherFee = shopOtherFee;
-    }
-
-    @Transient
-    public String getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(String startTime) {
-        this.startTime = startTime;
-    }
-
-    @Transient
-    public String getEndTime() {
-        return endTime;
-    }
-
-    public void setEndTime(String endTime) {
-        this.endTime = endTime;
-    }
-
-    @Transient
-    public Double getWaitPayShop() {
-        return waitPayShop;
-    }
-
-    public void setWaitPayShop(Double waitPayShop) {
-        this.waitPayShop = waitPayShop;
-    }
-
-    @Transient
-    public Double getWipePayment() {
-        return wipePayment;
-    }
-
-    public void setWipePayment(Double wipePayment) {
-        this.wipePayment = wipePayment;
-    }
-
-    @Transient
-    public String getRefunding() {
-        return refunding;
-    }
-
-    public void setRefunding(String refunding) {
-        this.refunding = refunding;
-    }
-
-    @Transient
-    public String getOperatingMode() {
-        return operatingMode;
-    }
-
-    public void setOperatingMode(String operatingMode) {
-        this.operatingMode = operatingMode;
-    }
-
-    public String getCostType() {
-        return costType;
-    }
-
-    public void setCostType(String costType) {
-        this.costType = costType;
-    }
-
-    public Double getProportional() {
-        return proportional;
-    }
-
-    public void setProportional(Double proportional) {
-        this.proportional = proportional;
-    }
-
-    public String[] getPs() {
-        return ps;
-    }
-
-    public void setPs(String[] ps) {
-        this.ps = ps;
-    }
-
-    public String getModifyShouldPayNote() {
-        return modifyShouldPayNote;
-    }
-
-    public void setModifyShouldPayNote(String modifyShouldPayNote) {
-        this.modifyShouldPayNote = modifyShouldPayNote;
-    }
-
-    public String getModifyShouldPayUserID() {
-        return modifyShouldPayUserID;
-    }
-
-    public void setModifyShouldPayUserID(String modifyShouldPayUserID) {
-        this.modifyShouldPayUserID = modifyShouldPayUserID;
-    }
-
-    public String getModifyShouldPayDate() {
-        return modifyShouldPayDate;
-    }
-
-    public void setModifyShouldPayDate(String modifyShouldPayDate) {
-        this.modifyShouldPayDate = modifyShouldPayDate;
-    }
-
-    @Transient
-    public Double getPayed() {
-        return payed;
-    }
-
-    public void setPayed(Double payed) {
-        this.payed = payed;
-    }
-
-    public Integer getOrganizeID() {
-        return organizeID;
-    }
-
-    public void setOrganizeID(Integer organizeID) {
-        this.organizeID = organizeID;
-    }
-
-    public String getRemarkImage1() {
-        return remarkImage1;
-    }
-
-    public void setRemarkImage1(String remarkImage1) {
-        this.remarkImage1 = remarkImage1;
-    }
-
-    public String getRemarkImage2() {
-        return remarkImage2;
-    }
-
-    public void setRemarkImage2(String remarkImage2) {
-        this.remarkImage2 = remarkImage2;
-    }
-
-    public String getRemarkImage3() {
-        return remarkImage3;
-    }
-
-    public void setRemarkImage3(String remarkImage3) {
-        this.remarkImage3 = remarkImage3;
-    }
-
-    public String getRemarkImage4() {
-        return remarkImage4;
-    }
-
-    public void setRemarkImage4(String remarkImage4) {
-        this.remarkImage4 = remarkImage4;
-    }
-
-    public String getRemarkImage5() {
-        return remarkImage5;
-    }
-
-    public void setRemarkImage5(String remarkImage5) {
-        this.remarkImage5 = remarkImage5;
-    }
-
-    public String getRemarkImage6() {
-        return remarkImage6;
-    }
-
-    public void setRemarkImage6(String remarkImage6) {
-        this.remarkImage6 = remarkImage6;
-    }
-
-    public String getRemarkImage7() {
-        return remarkImage7;
-    }
-
-    public void setRemarkImage7(String remarkImage7) {
-        this.remarkImage7 = remarkImage7;
-    }
-
-    public String getRemarkImage8() {
-        return remarkImage8;
-    }
-
-    public void setRemarkImage8(String remarkImage8) {
-        this.remarkImage8 = remarkImage8;
-    }
-
-    public String getRemarkImage9() {
-        return remarkImage9;
-    }
-
-    public void setRemarkImage9(String remarkImage9) {
-        this.remarkImage9 = remarkImage9;
-    }
-
-    public String getRemarkImage10() {
-        return remarkImage10;
-    }
-
-    public void setRemarkImage10(String remarkImage10) {
-        this.remarkImage10 = remarkImage10;
-    }
-
-    public CmPromotion getShopPromotion() {
-        return shopPromotion;
-    }
-
-    public void setShopPromotion(CmPromotion shopPromotion) {
-        this.shopPromotion = shopPromotion;
-    }
-
-    public Integer getZeroCostFlag() {
-        return zeroCostFlag;
-    }
-
-    public void setZeroCostFlag(Integer zeroCostFlag) {
-        this.zeroCostFlag = zeroCostFlag;
-    }
-
-    public Double getReturnedPurchaseTotalFee() {
-        return returnedPurchaseTotalFee;
-    }
-
-    public void setReturnedPurchaseTotalFee(Double returnedPurchaseTotalFee) {
-        this.returnedPurchaseTotalFee = returnedPurchaseTotalFee;
-    }
-
-    public Double getDiscountTotalFee() {
-        return discountTotalFee;
-    }
-
-    public void setDiscountTotalFee(Double discountTotalFee) {
-        this.discountTotalFee = discountTotalFee;
-    }
-
-    public Double getFreight() {
-        return freight;
-    }
-
-    public void setFreight(Double freight) {
-        this.freight = freight;
-    }
-
-    public Boolean getReturnedFreightFlag() {
-        return returnedFreightFlag;
-    }
-
-    public void setReturnedFreightFlag(Boolean returnedFreightFlag) {
-        this.returnedFreightFlag = returnedFreightFlag;
-    }
-
-    public boolean isModifyPayable() {
-        return modifyPayable;
-    }
-
-    public void setModifyPayable(boolean modifyPayable) {
-        this.modifyPayable = modifyPayable;
-    }
-
-    public String getCommercialCode() {
-        return commercialCode;
-    }
-
-    public void setCommercialCode(String commercialCode) {
-        this.commercialCode = commercialCode;
-    }
-
-    public Integer getDifferenceType() {
-        return differenceType;
-    }
-
-    public void setDifferenceType(Integer differenceType) {
-        this.differenceType = differenceType;
-    }
-
-    public BigDecimal getDifferencePrice() {
-        return differencePrice;
-    }
-
-    public void setDifferencePrice(BigDecimal differencePrice) {
-        this.differencePrice = differencePrice;
-    }
-
-    public Integer getUserBeans() {
-        return userBeans;
-    }
-
-    public void setUserBeans(Integer userBeans) {
-        this.userBeans = userBeans;
-    }
-
-    public boolean getPayShopOtherFee() {
-        return payShopOtherFee;
-    }
-
-    public void setPayShopOtherFee(boolean payShopOtherFee) {
-        this.payShopOtherFee = payShopOtherFee;
-    }
-
-    public Integer getOrderArchiveId() {
-        return orderArchiveId;
-    }
-
-    public void setOrderArchiveId(Integer orderArchiveId) {
-        this.orderArchiveId = orderArchiveId;
-    }
-
-    public Double getSvipShopReduction() {
-        return svipShopReduction;
-    }
-
-    public void setSvipShopReduction(Double svipShopReduction) {
-        this.svipShopReduction = svipShopReduction;
-    }
-
-    public Double getRealPay() {
-        return realPay;
-    }
-
-    public void setRealPay(Double realPay) {
-        this.realPay = realPay;
-    }
-
-    public Double getEachDiscount() {
-        return eachDiscount;
-    }
-
-    public void setEachDiscount(Double eachDiscount) {
-        this.eachDiscount = eachDiscount;
-    }
-
-    public Double getReceiptAmount() {
-        return receiptAmount;
-    }
-
-    public void setReceiptAmount(Double receiptAmount) {
-        this.receiptAmount = receiptAmount;
-    }
-
-    public Double getRestAmount() {
-        return restAmount;
-    }
-
-    public void setRestAmount(Double restAmount) {
-        this.restAmount = restAmount;
-    }
-
-    public Double getPayShopAmount() {
-        return payShopAmount;
-    }
-
-    public void setPayShopAmount(Double payShopAmount) {
-        this.payShopAmount = payShopAmount;
-    }
-
-    public Integer getShopReceiptStatus() {
-        return shopReceiptStatus;
-    }
-
-    public void setShopReceiptStatus(Integer shopReceiptStatus) {
-        this.shopReceiptStatus = shopReceiptStatus;
-    }
-
-    public String getSplitCode() {
-        return splitCode;
-    }
-
-    public void setSplitCode(String splitCode) {
-        this.splitCode = splitCode;
-    }
+    private String productName;
 }

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

@@ -131,10 +131,10 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
     private MessageCenterDao messageCenterDao;
 
 
-    public List<CmOrderPaymentVoucherVo> findVoucherVoOrderID( Integer shopOrderId){
+    public List<CmOrderPaymentVoucherVo> findVoucherVoOrderID(Integer shopOrderId) {
         List<CmOrderPaymentVoucherVo> voucherVo = newOrderDao.findVoucherVoOrderID(shopOrderId);
-        if (null != voucherVo &&voucherVo.size() > 0) {
-            for(CmOrderPaymentVoucherVo vou : voucherVo) {
+        if (null != voucherVo && voucherVo.size() > 0) {
+            for (CmOrderPaymentVoucherVo vou : voucherVo) {
                 if (vou.getRemarks().length() > 100) {
                     String start = vou.getRemarks().substring(0, 100);
                     String end = vou.getRemarks().substring(100, vou.getRemarks().length());
@@ -968,6 +968,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         newOrderDao.insertShortLink(markId, shortLink, url);
         return shortLink;
     }
+
     @Transactional(readOnly = false)
     public boolean getSendSms(int markId, String mobile, String content) throws Exception {
         String config = Global.getConfig("cm.config");
@@ -1308,12 +1309,12 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             if (count > 1) {
                 newOrder.setRechargeGoods(3);
             }
-            BigDecimal payTotalFee=new BigDecimal(0);
+            BigDecimal payTotalFee = new BigDecimal(0);
             if (CollectionUtils.isNotEmpty(shopOrders)) {
                 for (NewShopOrder shopOrder : shopOrders) {
-                     payTotalFee = MathUtil.add(payTotalFee,shopOrder.getRealPay() != null ? shopOrder.getRealPay() : shopOrder.getNeedPayAmount());
+                    payTotalFee = MathUtil.add(payTotalFee, shopOrder.getRealPay() != null ? shopOrder.getRealPay() : shopOrder.getNeedPayAmount());
 
-                    BigDecimal add = MathUtil.add(shopOrder.getReceiptAmount(),cmDiscernReceiptService.findShoOrderIDReceipt(shopOrder.getShopOrderID()));
+                    BigDecimal add = MathUtil.add(shopOrder.getReceiptAmount(), cmDiscernReceiptService.findShoOrderIDReceipt(shopOrder.getShopOrderID()));
                     shopOrder.setReceiptAmount(add.doubleValue());
                     BigDecimal sub = MathUtil.sub((shopOrder.getRealPay() != null ? shopOrder.getRealPay() : shopOrder.getNeedPayAmount()).doubleValue()
                             , shopOrder.getReceiptAmount().doubleValue());
@@ -1341,13 +1342,13 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                         }
                     }
                     //拼接运费
-                    String shopPostFlag = shopOrder.getShopPostFlag()!=null?shopOrder.getShopPostFlag():"0";
+                    String shopPostFlag = shopOrder.getShopPostFlag() != null ? shopOrder.getShopPostFlag() : "0";
                     String PostageInfo = null;
 
                     PostageInfo = shopPostFlag.equals("2") ? "到付" : shopPostFlag.equals("0") ? "包邮" : "¥" + shopOrder.getShopPostFee();
 
                     //支付凭证
-                    List<CmOrderPaymentVoucherVo> voucherVo = newOrderService.findVoucherVoOrderID(shopOrder.getShopOrderID() );
+                    List<CmOrderPaymentVoucherVo> voucherVo = newOrderService.findVoucherVoOrderID(shopOrder.getShopOrderID());
                     shopOrder.setPostageInfo(PostageInfo);
                     shopOrder.setVoucherVo(voucherVo);
                     List<String> code = newShopOrderDao.findCommercialCode(shopOrder.getOrderID());
@@ -1456,8 +1457,8 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                      */
                     if ((1161 != shopOrder.getShopID() && 2 != shopOrder.getOrderType() && !flag &&
                             (!"E1807059160".equals(shopOrder.getSplitCode()) && null != discernPayWay && 1 != discernPayWay))) {
-                                // 订单下线收款, 付款状态与收款状态同步显示
-                                shopOrder.setPayStatus(shopOrder.getReceiptStatus());
+                        // 订单下线收款, 付款状态与收款状态同步显示
+                        shopOrder.setPayStatus(shopOrder.getReceiptStatus());
                     }
                     // 订单已收款才会出现抹平或者多收退余额,(已收再退款或者撤销退款订单即使存在抹平也需要当未抹平重新计算付款)
                     String receiptStatus = shopOrder.getReceiptStatus();
@@ -1626,7 +1627,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
     public void confirmOrder(Integer orderID, Integer shopOrderID) {
         NewOrder order = get(orderID.toString());
         order.setConfirmFlag("1");//确认订单标识 后台确认 1
-        if (order.getNewShopOrders().stream().filter(newShopOrder -> newShopOrder.getStatus().equals(0)).collect(Collectors.toList()).size()==1) {
+        if (order.getNewShopOrders().stream().filter(newShopOrder -> newShopOrder.getStatus().equals(0)).collect(Collectors.toList()).size() == 1) {
             order.setStatus("11");//订单状态变成 ==> 待收款待付款 11
         }
         //过滤子订单
@@ -1649,12 +1650,12 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         //        order.getBalancePayFee()
         Double balancePayFee = order.getNewShopOrders().get(0).getAccountAmount();
         //修改子订单状态(余额抵扣)
-        if (order.getNewShopOrders().get(0).getUseBalanceFlag() !=null&&order.getNewShopOrders().get(0).getUseBalanceFlag() == 1) {
-            if ( balancePayFee != null && balancePayFee .equals(order.getNewShopOrders().get(0).getRealPay())) {
+        if (order.getNewShopOrders().get(0).getUseBalanceFlag() != null && order.getNewShopOrders().get(0).getUseBalanceFlag() == 1) {
+            if (balancePayFee != null && balancePayFee.equals(order.getNewShopOrders().get(0).getRealPay())) {
                 order.getNewShopOrders().get(0).setReceiptStatus("3");
-            } else if ( balancePayFee != null && balancePayFee <order.getNewShopOrders().get(0).getRealPay()) {
+            } else if (balancePayFee != null && balancePayFee < order.getNewShopOrders().get(0).getRealPay()) {
                 order.getNewShopOrders().get(0).setReceiptStatus("2");
-          }
+            }
         }
         Date date = new Date();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -1774,25 +1775,6 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             int userBeans = user.getUserBeans() + order.getUserBeans();
             cmUserDao.updateUserBeans(order.getUserID(), userBeans);
         }
-
-//        if (order.getPayTotalFee() != null && order.getPayTotalFee() < 1000) {
-//            //查本单是否扣豆子,有就返回
-//            UserBeansHistory bean = newCmClubDao.findLowOrder(order.getOrderID());
-//            if (bean != null) {
-//                //有扣豆子记录
-//                UserBeansHistory beansHistory = new UserBeansHistory();
-//                beansHistory.setUserId(order.getUserID());
-//                beansHistory.setOrderId(order.getOrderID());
-//                beansHistory.setBeansType(16);
-//                beansHistory.setType(1);
-//                beansHistory.setNum(500);
-//                beansHistory.setPushStatus(0);
-//                beansHistory.setAddTime(new Date());
-//                newCmClubDao.insertBeansHistory(beansHistory);
-//                int beans = cmUserDao.findUserBeans(order.getUserID()) + 500;
-//                cmUserDao.updateUserBeans(order.getUserID(), beans);
-//            }
-//        }
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String current = dateFormat.format(new Date());
         MessageCenter messageCenter = new MessageCenter();
@@ -1853,6 +1835,30 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         cmUserDao.updateMoney(user);
     }
 
+    @Transactional(readOnly = false)
+    public void setShopOrderBalance(CmUser user, Double amount, NewShopOrder order) {
+        if (UserType.isMaker(Integer.parseInt(user.getRegisterUserTypeID()))) {
+            return;
+        }
+        //0待确认
+        Integer status = order.getStatus();
+        logger.info("----------------------->原余额:" + user.getUserMoney() + "==原可用余额:" + user.getAbleUserMoney());
+        //减操作不更新可用余额
+        if (amount < 0d) {
+            if (!"0".equals(status)) {//待确认状态不需要修改余额,因为本身存在冻结余额不需要重复退回
+                user.setUserMoney(user.getUserMoney() + amount);
+            }
+        } else {
+            if (!"0".equals(status)) {//待确认状态不需要修改余额,因为本身存在冻结余额不需要重复退回
+                user.setUserMoney(user.getUserMoney() + amount);
+            }
+            user.setAbleUserMoney(user.getAbleUserMoney() + amount);
+        }
+        logger.info("----------------------->设置余额:" + amount);
+        logger.info("----------------------->当前余额:" + user.getUserMoney() + "==当前可用余额:" + user.getAbleUserMoney());
+        cmUserDao.updateMoney(user);
+    }
+
     /**
      * 发货
      *
@@ -2385,7 +2391,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                 //通过子订单ID查询子订单信息
                 NewShopOrder newShopOrder = newShopOrderDao.get(String.valueOf(shopOrderID));
                 if (null != newShopOrder) {
-                    shopOrderNoAndId += "<b style=\"font-size: 15px;\">"+newShopOrder.getShopOrderID()+"</b>"+"("+newShopOrder.getShopOrderNo()+")<br>";
+                    shopOrderNoAndId += "<b style=\"font-size: 15px;\">" + newShopOrder.getShopOrderID() + "</b>" + "(" + newShopOrder.getShopOrderNo() + ")<br>";
                     shopOrder.setFee(newShopOrder.getFee());
                     shopOrder.setShouldPayProduct(newShopOrder.getShouldPayProduct());
                     List<NewOrderProduct> pList = newOrderProductDao.findListByShopOrderID(shopOrderID);
@@ -2873,7 +2879,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         return newOrderDao.getSplitRecord(orderID);
     }
 
-    public String productDataVerification(Integer orderID,String firstClubType) {
+    public String productDataVerification(Integer orderID, String firstClubType) {
         String mes = null;
         List<NewOrderProduct> productList = newOrderProductDao.findListProductOrderID(orderID);
         if (!"1".equals(firstClubType)) {
@@ -2887,4 +2893,67 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         }
         return null;
     }
+
+    @Transactional(readOnly = false)
+    public void cancelShopOrder(NewShopOrder shopOrder) {
+        //余额退回原账户
+        CmUser user = cmUserDao.get(shopOrder.getUserID().toString());
+        if (shopOrder.getAccountAmount() > 0) {
+            setShopOrderBalance(user, shopOrder.getAccountAmount(), shopOrder);
+            //取消收支记录
+            CmUserBalanceRecord cmUserBalanceRecord = new CmUserBalanceRecord();
+            cmUserBalanceRecord.setUserId(shopOrder.getUserID());
+            cmUserBalanceRecord.setOrderId(shopOrder.getOrderID());
+            cmUserBalanceRecord.setRemark("取消订单,余额记录无效-后台");
+            cmUserBalanceRecord.setDelFlag("1");
+            cmUserBalanceRecordService.updateBalanceRecord(cmUserBalanceRecord);
+        }
+        shopOrder.setStatus(4);//订单状态变成交易关闭 6
+        shopOrder.setCloseReason("后台手动关闭");//   订单取消原因
+        newShopOrderDao.updateStatus(shopOrder);
+
+        //todo 采美豆退回,当前版本采美豆暂时无效,先不处理
+//        if (shopOrder.getUserBeans() != null && order.getUserBeans() > 0) {
+//            UserBeansHistory beansHistory = new UserBeansHistory();
+//            beansHistory.setUserId(order.getUserID());
+//            beansHistory.setOrderId(order.getOrderID());
+//            beansHistory.setBeansType(9);
+//            beansHistory.setType(1);
+//            beansHistory.setNum(order.getUserBeans());
+//            beansHistory.setPushStatus(0);
+//            beansHistory.setAddTime(new Date());
+//            newCmClubDao.insertBeansHistory(beansHistory);
+//            int userBeans = user.getUserBeans() + order.getUserBeans();
+//            cmUserDao.updateUserBeans(order.getUserID(), userBeans);
+//        }
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String current = dateFormat.format(new Date());
+        MessageCenter messageCenter = new MessageCenter();
+        messageCenter.setShopId(null);
+        messageCenter.setClubId(shopOrder.getClubID());
+        messageCenter.setUserType(1);
+        messageCenter.setMessageType(1);
+        messageCenter.setOrderMessageType(4);
+        messageCenter.setContent("您的订单已成功取消!");
+        messageCenter.setOrderId(shopOrder.getOrderID());
+        messageCenter.setTime(current);
+        messageCenterDao.addMessageCenter(messageCenter);
+
+        //优惠券退回
+        if (shopOrder.getCouponAmount() > 0 && 0 != shopOrder.getStatus()) {
+            CmCouponOrderRecord couponRecord = newOrderDao.findOrderCouponRecord(shopOrder.getOrderID());
+            if (couponRecord != null) {
+                CmCouponClub couponClub = cmCouponClubDao.get(couponRecord.getClubCouponId().toString());
+                couponClub.setOrderId(null);
+                couponClub.setReturnedId(0);
+                couponClub.setSource("3");
+                couponClub.setStatus("1");
+                couponClub.setCreateDate(new Date());
+                couponClub.setUseDate(null);
+                couponClub.setDelFlag("0");
+                cmCouponClubDao.insert(couponClub);
+            }
+        }
+    }
+
 }

+ 54 - 28
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -1,14 +1,8 @@
 package com.caimei.modules.order.service;
 
-
-import com.caimei.modules.bulkpurchase.entity.BpOrderUserinfo;
-import com.caimei.modules.bulkpurchase.entity.OrderInvoice;
-import com.caimei.modules.coupon.entity.CmCouponOrderRecord;
 import com.caimei.modules.hehe.dao.HeHeNewOrderDao;
-import com.caimei.modules.hehe.entity.CmHeheCouponOrderRecord;
 import com.caimei.modules.order.dao.*;
 import com.caimei.modules.order.entity.*;
-import com.caimei.modules.order.utils.NewOrderStatus;
 import com.caimei.modules.product.dao.CmPromotionDao;
 import com.caimei.modules.product.dao.CmSecondHandDetailDao;
 import com.caimei.modules.product.dao.ProductDao;
@@ -16,9 +10,8 @@ import com.caimei.modules.product.entity.CmPromotion;
 import com.caimei.modules.product.entity.CmSecondHandDetail;
 import com.caimei.modules.product.entity.CmSku;
 import com.caimei.modules.product.entity.OrderProductLadderPrice;
-import com.caimei.modules.user.entity.CmUser;
+import com.caimei.modules.user.dao.NewCmClubDao;
 import com.caimei.modules.user.entity.NewCmClub;
-import com.caimei.po.neworder.CmShopOrder;
 import com.caimei.utils.AppKeys;
 import com.caimei.utils.AppUtils;
 import com.caimei.utils.MathUtil;
@@ -71,10 +64,6 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
     @Resource
     private CmRefundShopDao cmRefundShopDao;
     @Resource
-    private CmDiscernReceiptDao cmDiscernReceiptDao;
-    @Resource
-    private CmReturnedPurchaseDao cmReturnedPurchaseDao;
-    @Resource
     private CmPromotionDao cmPromotionDao;
     @Resource
     private HeHeNewOrderDao heHeNewOrderDao;
@@ -87,13 +76,45 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
     @Resource
     private NewOrderService newOrderService;
 
+    @Resource
+    private OrderUserInfoService orderUserInfoService;
+
+    @Resource
+    private NewCmClubDao newCmClubDao;
     public NewShopOrder findByShopOrderID(Integer shopOrderID) {
         NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderID);
+        String PostageInfo = null;
+        Double ColdChina = 700d;
+        String shopPostFlag = shopOrder.getShopPostFlag() != null ? shopOrder.getShopPostFlag() : "0";
+        if (null != shopOrder.getIsColdChina() && shopOrder.getIsColdChina() == 1) {
+            if ("2" == shopOrder.getShopPostFlag()) {
+                // 到付
+                PostageInfo = "¥" + ColdChina + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: 到付)";
+            } else if ("0" == shopOrder.getShopPostFlag()) {
+                // 包邮
+                PostageInfo = "¥" + ColdChina + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: 包邮)";
+            } else {
+                // 有运费
+                PostageInfo = "¥" + MathUtil.add(shopOrder.getShopPostFee(), ColdChina) + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: ¥" + shopOrder.getShopPostFee() + ")";
+            }
+        } else {
+            PostageInfo = shopPostFlag.equals("2") ? "到付" : shopPostFlag.equals("0") ? "包邮" : "¥" + shopOrder.getShopPostFee();
+        }
+        shopOrder.setPostageInfo(PostageInfo);
+        OrderUserInfo orderUserInfo = orderUserInfoService.findByOrderID(shopOrder.getOrderID());
+        NewCmClub club = newCmClubDao.getclubByUserId(shopOrder.getUserID());
+        if (null != orderUserInfo) {
+            shopOrder.setBpOrderUserinfo(orderUserInfo);
+            if (club != null) {
+                //使用机构名称
+                orderUserInfo.setName(club.getName());
+                orderUserInfo.setFirstClubType(club.getFirstClubType());
+            }
+        }
         List<NewOrderProduct> list = newOrderProductDao.findListByShopOrderID(shopOrder.getShopOrderID());
         List<NewOrderProduct> listAll = new ArrayList<NewOrderProduct>();
         if (null != list && list.size() > 0) {
             for (NewOrderProduct bean : list) {
-                Integer productID = bean.getProductID();
                 //单品优惠
                 if (bean.getOrderPromotionsId() != null) {
                     CmPromotion promotions = cmPromotionDao.findOrderPromotions(bean.getOrderPromotionsId());
@@ -187,13 +208,13 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
      *
      * @param orderID
      */
-    public List<LogisticsInfoVo> logisticsDetails(Integer orderID,Integer shopOrderID ,String logisticsBatchID) {
+    public List<LogisticsInfoVo> logisticsDetails(Integer orderID, Integer shopOrderID, String logisticsBatchID) {
         List<LogisticsInfoVo> result = new ArrayList<>();
         //查询这个子订单所有的发货批次记录
         List<LogisticsBatch> lbs = logisticsBatchDao.findBatch(orderID, logisticsBatchID);
-        if(null!=shopOrderID){
+        if (null != shopOrderID) {
             //过滤子订单
-            lbs=lbs.stream().filter(s -> s.getShopOrderID().equals(shopOrderID)).collect(Collectors.toList());
+            lbs = lbs.stream().filter(s -> s.getShopOrderID().equals(shopOrderID)).collect(Collectors.toList());
         }
 
         for (LogisticsBatch l : lbs) {
@@ -335,9 +356,9 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
             if (null != discernPayWay && 1 != discernPayWay) {
                 // 线下收款,结算金额设置为已付金额
                 so.setSettleAmount(shopAmountShopOrderId);
-                if ( so.getSettleAmount() > 0 && (MathUtil.sub(so.getShouldPayShopAmount(), so.getShopOtherFee()).doubleValue()) == so.getSettleAmount()) {
+                if (so.getSettleAmount() > 0 && (MathUtil.sub(so.getShouldPayShopAmount(), so.getShopOtherFee()).doubleValue()) == so.getSettleAmount()) {
                     so.setSettleStatus(3);
-                } else if(so.getSettleAmount() > 0 &&  (MathUtil.sub(so.getShouldPayShopAmount(), so.getShopOtherFee()).doubleValue()) > so.getSettleAmount()) {
+                } else if (so.getSettleAmount() > 0 && (MathUtil.sub(so.getShouldPayShopAmount(), so.getShopOtherFee()).doubleValue()) > so.getSettleAmount()) {
                     so.setSettleStatus(2);
                 } else {
                     so.setSettleStatus(1);
@@ -356,20 +377,18 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
                 }
             }
             List<NewOrderProduct> orderProductList = newOrderProductDao.findByShopOrderID(so.getShopOrderID());
+            double lr = 0d;
+            double allBrokerage = 0d;
             for (NewOrderProduct p : orderProductList) {
+                allBrokerage += p.getNum() * p.getBrokerage();
+                lr += p.getNum() * p.getCmCostPrice();
                 Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(so.getShopOrderID(), p.getOrderProductID());
                 returnNum = returnNum == null ? 0 : returnNum;
                 p.setReturnedNum(returnNum);
-                // 还原下单时商品成本
-                /*Double newCostPrice = 0d;
-                newCostPrice = p.getCostPrice();
-                p.setCostPrice(MathUtil.div(p.getCostPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100),100)).doubleValue());
-                p.setNewCostPrice(newCostPrice);*/
                 p.setOldDiscountPrice(p.getDiscountPrice());
-                /*if ("0".equals(p.getIncludedTax()) && null != p.getTaxRate() && p.getTaxRate() > 0d) {
-                    p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
-                }*/
             }
+            so.setBrokerage(allBrokerage);
+            so.setAllServeAmount(lr);
             if (so.getShopPostFee() == null) so.setShopPostFee(0D);
             if (so.getShopTaxFee() == null) so.setShopTaxFee(0D);
             if (so.getShopOtherFee() == null) so.setShopOtherFee(0D);
@@ -384,7 +403,7 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
             if ("1".equals(newOrder.getFreePostFlag())) {
                 so.setFreight(newOrder.getFreight());
             } else {
-                so.setFreight(Double.valueOf(newOrder.getFreePostFlag()!=null ?newOrder.getFreePostFlag():"-2"));
+                so.setFreight(Double.valueOf(newOrder.getFreePostFlag() != null ? newOrder.getFreePostFlag() : "-2"));
             }
             //订单采美豆
             so.setUserBeans(newOrder.getUserBeans());
@@ -997,7 +1016,7 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
             initCmOrderProduct(orderProduct);
         });
         shopOrder.setNewOrderProducts(pList);
-        if (pList.stream().anyMatch(p -> p.getProductID().intValue() == 999)){
+        if (pList.stream().anyMatch(p -> p.getProductID().intValue() == 999)) {
             shopOrder.setPostFeeCos("1");
         }
         Double payed = cmPayShopRecordDao.sumByShopOrderID(shopOrder.getShopOrderID());
@@ -1071,4 +1090,11 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
             }
         }
     }
+
+    public Page<NewShopOrder> findShopOrderPage(Page<NewShopOrder> page, NewShopOrder newShopOrder) {
+        newShopOrder.setPage(page);
+        List<NewShopOrder> shopOrders = newShopOrderDao.getShopOrderlist(newShopOrder);
+        page.setList(shopOrders);
+        return page;
+    }
 }

+ 3 - 39
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -340,17 +340,10 @@ public class CmPayShopController extends BaseController {
                 }
                 // product.setSingleShouldPayTotalTax(MathUtil.div(MathUtil.mul(MathUtil.div(product.getCostPrice(), MathUtil.div(MathUtil.add(product.getTaxRate(), 100),100)), product.getSupplierTaxRate()), 100).doubleValue());
                 Double singleShouldPayTotalTax = product.getSingleShouldPayTotalTax() == null ? 0d : product.getSingleShouldPayTotalTax();
-                Double supplierTaxRate = product.getTaxRate() == null ? 0d : product.getTaxRate();
+                Double supplierTaxRate = product.getSupplierTaxRate() == null ? 0d : product.getSupplierTaxRate();
                 // 获取已被退款的商品数量
                 Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(Integer.parseInt(shopOrderID), orderProductID);
                 returnNum = returnNum == null ? 0 : returnNum;
-//                List<CmReturnedPurchaseProduct> o = rL.stream().
-//                        filter(r -> r.getOrderProductID().equals(orderProductID));
-//                CmReturnedPurchaseProduct b = o.isPresent() ? o.get() : null;
-//                int returnNum = 0;
-//                if (b != null)
-//                    returnNum = (b.getActualReturnedNum() == null ? 0 : b.getActualReturnedNum())
-//                            + (b.getActualCancelNum() == null ? 0 : b.getActualCancelNum());
                 NewOrderProduct orderProduct = newOrderProductService.get(String.valueOf(orderProductID));
                 // 修改前
                 if (StringUtils.isEmpty(dbcostType)) {
@@ -492,10 +485,8 @@ public class CmPayShopController extends BaseController {
         //当子订单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);
@@ -524,8 +515,6 @@ public class CmPayShopController extends BaseController {
             }
             newOrderService.updatePayStatus(newOrder);
         }
-
-
         shopOrder.setShopPostFee(freight); //运费
         shopOrder.setShopOtherFee(thirdPartyFee); //付第三方
         shopOrder.setCostType(costType);
@@ -533,37 +522,12 @@ public class CmPayShopController extends BaseController {
         shopOrder.setModifyShouldPayUserID(UserUtils.getUser().getId());  //修改人的用户id
         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())
+        if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount()) {
             shopOrder.setPayStatus("3");
+        }
         // 付供应商 - 优惠券 - 促销满减优惠
         shopOrder.setShouldPayShopAmount(MathUtil.sub(shouldPayShopAmount , MathUtil.add(shopOrder.getCouponAmount(), shopOrder.getPromotionFullReduction())).doubleValue());
         newShopOrderService.modifyPayShopAmount(shopOrder, orderProducts);
-
-        /*if(shopOrder.getShopReceiptStatus()==1){
-            System.out.println(shopOrder.getShopReceiptStatus());
-            logger.info("未付款子订单进了成本修改"+shopOrder.getShouldPayShopAmount()+"-----"+shopOrder.getShopOtherFee());
-            double mum= newShopOrder.getProductAmount();
-            mum-= shopOrder.getShopOtherFee()+shopOrder.getShouldPayShopAmount();
-            //因为成本上升,子订单佣金下降。当成本上升到子订单佣金不大于线上支付最大手续费时不能进行线上支付所以减了第三方
-            System.out.println(">>>>>>>>子订单佣金"+mum+"----"+shopOrder.getBrokerage());
-            double fee=0.0;
-            if(shopOrder.getShopOtherFee()>=1000.01){
-                //手续费 =子订单金额*默认代理费率
-                 fee=shopOrder.getProductAmount()*0.0065;
-                if(mum<fee){
-                    newOrderDao.updateOnlinePayFlag(1,shopOrder.getOrderID());
-                }
-            }else if(shopOrder.getShopOtherFee()<=1000.01){
-                 fee=shopOrder.getProductAmount()*0.0025;
-                if(mum<fee){
-                    newOrderDao.updateOnlinePayFlag(1,shopOrder.getOrderID());
-                }
-            }
-            if(mum>fee){
-                newOrderDao.updateOnlinePayFlag(0,shopOrder.getOrderID());
-            }
-        }*/
-
         return "redirect:" + Global.getAdminPath() + "/shopOrder/payOrderList";
     }
 

+ 32 - 9
src/main/java/com/caimei/modules/order/web/CmShopOrderController.java

@@ -1,14 +1,18 @@
 package com.caimei.modules.order.web;
 
+import com.caimei.modules.bulkpurchase.dao.OrderInvoiceDao;
+import com.caimei.modules.bulkpurchase.entity.BpClause;
+import com.caimei.modules.bulkpurchase.entity.OrderInvoice;
+import com.caimei.modules.bulkpurchase.service.BpClauseService;
 import com.caimei.modules.order.dao.CmPayShopRecordDao;
 import com.caimei.modules.order.entity.*;
 import com.caimei.modules.order.service.CmChangePayShopProductService;
 import com.caimei.modules.order.service.CmChangePayShopRecondService;
+import com.caimei.modules.order.service.CmOrderRemarkService;
 import com.caimei.modules.order.service.NewShopOrderService;
 import com.caimei.modules.user.entity.CmUserOrganize;
 import com.caimei.modules.user.service.CmUserOrganizeService;
 import com.caimei.utils.MathUtil;
-import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.common.web.BaseController;
@@ -48,8 +52,10 @@ public class CmShopOrderController extends BaseController {
     private CmChangePayShopProductService cmChangePayShopProductService;
     @Resource
     private CmPayShopRecordDao cmPayShopRecordDao;
-
-
+    @Resource
+    private BpClauseService bpClauseService;
+    @Resource
+    private OrderInvoiceDao orderInvoiceDao;
 
     @ModelAttribute
     public NewShopOrder get(@RequestParam(required = false) String id) {
@@ -63,6 +69,22 @@ public class CmShopOrderController extends BaseController {
         return entity;
     }
 
+    @RequestMapping("detail")
+    public String detail(NewShopOrder newShopOrder, HttpServletRequest request, HttpServletResponse response, Model model) {
+        newShopOrder = newShopOrderService.findByShopOrderID(newShopOrder.getShopOrderID());
+        model.addAttribute("order", newShopOrder);
+        BpClause bpClause = new BpClause();
+        bpClause.setEnabledStatus("1");
+        List<BpClause> bpClauses = bpClauseService.findList(bpClause);
+        model.addAttribute("bpClauses", bpClauses);
+        //获取订单发票
+        OrderInvoice orderInvoice = orderInvoiceDao.getWithorderId(newShopOrder.getOrderID().toString());
+        if (null != orderInvoice) {
+            newShopOrder.setOrderInvoice(orderInvoice);
+        }
+        return "modules/order/shopOrderDetail";
+    }
+
     @RequiresPermissions("order:cmPayShop:view")
     @RequestMapping("payOrderList")
     public String payOrderList(NewShopOrder newShopOrder, HttpServletRequest request, HttpServletResponse response, Model model) {
@@ -91,6 +113,7 @@ public class CmShopOrderController extends BaseController {
 
     /**
      * 申请付第三方
+     *
      * @param newShopOrder
      * @param request
      * @param response
@@ -282,12 +305,12 @@ public class CmShopOrderController extends BaseController {
         List<CmRefundShopRecord> rr = new ArrayList<>();
         List<CmDiscernReceipt> receipts = new ArrayList<>();
         // for (Integer shopOrderID : shopOrderIDs) {
-            List<CmPayShopRecord> payShopRecordList = newShopOrderService.getPayedRecords(shopOrderId.toString());
-            pr.addAll(payShopRecordList);
-            List<CmRefundShopRecord> refundShopRecordList = newShopOrderService.getRefundedRecords(shopOrderId.toString());
-            rr.addAll(refundShopRecordList);
-            List<CmDiscernReceipt> receiptList = newShopOrderService.getDiscernReceipts(shopOrderId);
-            receipts.addAll(receiptList);
+        List<CmPayShopRecord> payShopRecordList = newShopOrderService.getPayedRecords(shopOrderId.toString());
+        pr.addAll(payShopRecordList);
+        List<CmRefundShopRecord> refundShopRecordList = newShopOrderService.getRefundedRecords(shopOrderId.toString());
+        rr.addAll(refundShopRecordList);
+        List<CmDiscernReceipt> receiptList = newShopOrderService.getDiscernReceipts(shopOrderId);
+        receipts.addAll(receiptList);
         // }
         model.addAttribute("pr", pr);
         model.addAttribute("rr", rr);

+ 32 - 27
src/main/java/com/caimei/modules/order/web/NewOrderController.java

@@ -144,40 +144,31 @@ public class NewOrderController extends BaseController {
 
     @RequiresPermissions("order:order:view")
     @RequestMapping("orderList")
-    public String orderList(NewOrder order, HttpServletRequest request, HttpServletResponse response, Model model) {
-        if (null != order.getStartTime() && !"".equals(order.getStartTime()) && !order.getStartTime().endsWith("00:00:00")) {
-            model.addAttribute("startTime", order.getStartTime());
-            order.setStartTime(order.getStartTime().trim() + " 00:00:00");
+    public String orderList(NewShopOrder newShopOrder, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if (null != newShopOrder.getStartTime() && !"".equals(newShopOrder.getStartTime()) && !newShopOrder.getStartTime().endsWith("00:00:00")) {
+            model.addAttribute("startTime", newShopOrder.getStartTime());
+            newShopOrder.setStartTime(newShopOrder.getStartTime().trim() + " 00:00:00");
         }
-        if (null != order.getEndTime() && !"".equals(order.getEndTime()) && !order.getEndTime().endsWith("23:59:59")) {
-            model.addAttribute("endTime", order.getEndTime());
-            order.setEndTime(order.getEndTime().trim() + " 23:59:59");
+        if (null != newShopOrder.getEndTime() && !"".equals(newShopOrder.getEndTime()) && !newShopOrder.getEndTime().endsWith("23:59:59")) {
+            model.addAttribute("endTime", newShopOrder.getEndTime());
+            newShopOrder.setEndTime(newShopOrder.getEndTime().trim() + " 23:59:59");
         }
-        if (null != order.getStartConfirmTime() && !"".equals(order.getStartConfirmTime()) && !order.getStartConfirmTime().endsWith("00:00:00")) {
-            model.addAttribute("startConfirmTime", order.getStartConfirmTime());
-            order.setStartConfirmTime(order.getStartConfirmTime().trim() + " 00:00:00");
+        if (null != newShopOrder.getStartConfirmTime() && !"".equals(newShopOrder.getStartConfirmTime()) && !newShopOrder.getStartConfirmTime().endsWith("00:00:00")) {
+            model.addAttribute("startConfirmTime", newShopOrder.getStartConfirmTime());
+            newShopOrder.setStartConfirmTime(newShopOrder.getStartConfirmTime().trim() + " 00:00:00");
         }
-        if (null != order.getEndConfirmTime() && !"".equals(order.getEndConfirmTime()) && !order.getEndConfirmTime().endsWith("23:59:59")) {
-            model.addAttribute("endConfirmTime", order.getEndConfirmTime());
-            order.setEndConfirmTime(order.getEndConfirmTime().trim() + " 23:59:59");
+        if (null != newShopOrder.getEndConfirmTime() && !"".equals(newShopOrder.getEndConfirmTime()) && !newShopOrder.getEndConfirmTime().endsWith("23:59:59")) {
+            model.addAttribute("endConfirmTime", newShopOrder.getEndConfirmTime());
+            newShopOrder.setEndConfirmTime(newShopOrder.getEndConfirmTime().trim() + " 23:59:59");
         }
-        if (null != order.getStartRefundTime() && !"".equals(order.getStartRefundTime()) && !order.getStartRefundTime().endsWith("00:00:00")) {
-            model.addAttribute("startRefundTime", order.getStartRefundTime());
-            order.setStartRefundTime(order.getStartRefundTime().trim() + " 00:00:00");
+        if (null != newShopOrder.getBuyer()) {
+            newShopOrder.setBuyer(newShopOrder.getBuyer().trim());
         }
-        if (null != order.getEndRefundTime() && !"".equals(order.getEndRefundTime()) && !order.getEndRefundTime().endsWith("23:59:59")) {
-            model.addAttribute("endRefundTime", order.getEndRefundTime());
-            order.setEndRefundTime(order.getEndRefundTime().trim() + " 23:59:59");
-        }
-        model.addAttribute("orderRefundType", order.getOrderRefundType());
-        if (null != order.getBuyer()) {
-            order.setBuyer(order.getBuyer().trim());
-        }
-        if (null != order.getReceiver()) {
-            order.setReceiver(order.getReceiver().trim());
+        if (null != newShopOrder.getReceiver()) {
+            newShopOrder.setReceiver(newShopOrder.getReceiver().trim());
         }
         //查询内部处理了已收,未付统计(包含运费)
-        Page<NewOrder> page = newOrderService.findPage(new Page<>(request, response, 20), order);
+        Page<NewShopOrder> page = newShopOrderService.findShopOrderPage(new Page<>(request, response, 20), newShopOrder);
         //获取组织列表
         List<CmUserOrganize> cmUserOrganizeList = cmUserOrganizeService.findOrganize();
         model.addAttribute("cmUserOrganizeList", cmUserOrganizeList);
@@ -755,6 +746,20 @@ public class NewOrderController extends BaseController {
         return "redirect:" + Global.getAdminPath() + "/order/detail/?id=" + orderID;
     }
 
+    @RequiresPermissions("order:order:edit")
+    @RequestMapping("cancelShopOrder")
+    public String cancelShopOrder(Integer shopOrderId, RedirectAttributes redirectAttributes) {
+        NewShopOrder shopOrder = newShopOrderService.get(shopOrderId.toString());
+        boolean cancelFlag = (null != shopOrder && (0 == shopOrder.getStatus() || (1 == shopOrder.getStatus() && "1".equals(shopOrder.getReceiptStatus()))));
+        if (!cancelFlag) {
+            // 非待确认(或待收待发)订单
+            addMessage(redirectAttributes, "订单状态不符");
+            return "redirect:" + Global.getAdminPath() + "/shopOrder/detail/?id=" + shopOrderId;
+        }
+        newOrderService.cancelShopOrder(shopOrder);
+        addMessage(redirectAttributes, "取消订单成功");
+        return "redirect:" + Global.getAdminPath() + "/shopOrder/detail/?id=" + shopOrderId;
+    }
 
     /**
      * 确认收货

+ 181 - 22
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -29,8 +29,18 @@
             a.splitCode,
             ifnull(a.realPay, a.needPayAmount) AS realPay,
             a.eachDiscount AS eachDiscount,
-            ifnull(a.receiptAmount,0) AS receiptAmount,
-            (ifnull(a.realPay,0) - ifnull(a.receiptAmount,0)) as restAmount,
+            IFNULL((SELECT SUM(cror.associateAmount)
+                                     FROM cm_receipt_order_relation cror
+                                              LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
+                                     WHERE cror.shopOrderId = a.shopOrderId
+                                       AND cror.relationType = '2'
+                                       AND cdr.receiptType = 1
+                                       AND cdr.delFlag = 0
+                                       AND cror.delFlag = 0
+                                       AND cdr.receiptStatus IN (2, 3)
+                                       AND cdr.payWay != 3)
+                     , 0) AS receiptAmount,
+            (ifnull(a.realPay,a.needPayAmount) - ifnull(a.receiptAmount,0)) as restAmount,
             a.receiptStatus as shopReceiptStatus,
             a.receiptStatus as ReceiptStatus,
 			a.canRefundAmount AS  canRefundAmount,
@@ -220,15 +230,26 @@
     <select id="findByShopOrderID" resultType="newShopOrder">
         select
         <include refid="shopOrderColumns"/>
+        ,bou.shouHuoRen as receiver,
+        bou.mobile,
+        bou.name as buyer,
+        ifnull(co.orderSeen,1) as orderSeen,
+        co.orderSource,
+        co.rebateFlag as rebateOrder,
+        co.clauseID,
+        co.clauseName,
+        s.name as shopName
         from cm_shop_order a
         left join cm_order co on co.orderID = a.orderID
+        left join bp_order_userinfo bou on bou.orderId = a.orderID
+        left join shop s on a.shopId = s.shopId
         where a.shopOrderID = #{shopOrderID}
     </select>
 
     <select id="findByPayShopID" resultType="java.lang.Double">
         SELECT SUM(cpsr.payAmount)
         FROM cm_pay_shop cps
-        LEFT JOIN cm_pay_shop_record cpsr ON cpsr.payShopID = cps.id
+                 LEFT JOIN cm_pay_shop_record cpsr ON cpsr.payShopID = cps.id
         WHERE cpsr.delFlag = 0
           AND cps.delFlag = 0
           AND cpsr.shopOrderId = #{shopOrderID}
@@ -285,11 +306,14 @@
         FROM cm_freight_rule cfr
                  LEFT JOIN cm_freight_template cft ON cft.id = cfr.freightId
                  LEFT JOIN product p ON p.freightTemplateId = cft.id
-        WHERE productId = #{productId} and cft.delFlag = 0
+        WHERE productId = #{productId}
+          and cft.delFlag = 0
     </select>
 
     <select id="getShopOrderId" resultType="com.caimei.modules.product.entity.Shop">
-        select shopId, AccountOwnership, bankAccount from shop where shopId = #{shopId}
+        select shopId, AccountOwnership, bankAccount
+        from shop
+        where shopId = #{shopId}
     </select>
 
     <select id="findCommercialCode" resultType="String">
@@ -716,7 +740,6 @@
     <select id="findPayOrderList" resultType="newShopOrder">
         select<include refid="shopOrderColumns"/>,
         co.payTotalFee AS payTotalFee,
-
         bou.name AS buyer,
         s.name AS shopName,
         c.name AS clubName,
@@ -865,7 +888,7 @@
                 and a.payStatus = 3 and co.status NOT IN (6,7)
             </if>
             and co.delFlag = 0
-            --              and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
+            -- and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
             and a.delFlag = 0
             and (a.organizeID!=4 or a.organizeID is null)
             and a.shopID != 998
@@ -884,7 +907,9 @@
         bou.name AS buyer,
         s.name AS shopName,
         c.name AS clubName,
-        cdr.payWay AS payWay
+        cdr.payWay AS payWay,
+        (select sum((num+presentNum)*cmCostPrice) from cm_order_product where shopOrderId = a.shopOrderId) as
+        allServeAmount
         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
@@ -944,7 +969,7 @@
                 AND a.shopOrderNo like concat('%', #{shopOrderNo} ,'%')
             </if>
             and co.delFlag = 0
-            --              and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
+            -- and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
             and a.delFlag = 0
             and (a.organizeID!=4 or a.organizeID is null)
             and a.shopID != 998
@@ -961,7 +986,8 @@
         SELECT IFNULL(SUM(cpsr.payAmount), 0)
         FROM cm_pay_shop cps
                  LEFT JOIN cm_pay_shop_record cpsr ON cps.id = cpsr.payShopID
-        WHERE cps.delFlag = 0 AND cpsr.delFlag = 0
+        WHERE cps.delFlag = 0
+          AND cpsr.delFlag = 0
           AND cpsr.shopOrderID = #{shopOrderId}
     </select>
 
@@ -975,15 +1001,16 @@
         SELECT IFNULL(SUM(cpsr.payCmAmount), 0)
         FROM cm_pay_shop cps
                  LEFT JOIN cm_pay_shop_record cpsr ON cps.id = cpsr.payShopID
-        WHERE cpsr.delFlag = 0 AND cpsr.shopOrderID = 29478
+        WHERE cpsr.delFlag = 0
+          AND cpsr.shopOrderID = 29478
     </select>
 
     <select id="returnedPurchaseFeeByShopOrderId" resultType="java.lang.Double">
-        SELECT
-            IFNULL(SUM(crp.returnedPurchaseFee), 0)
+        SELECT IFNULL(SUM(crp.returnedPurchaseFee), 0)
         FROM cm_returned_purchase crp
                  LEFT JOIN cm_returned_purchase_product crpp ON crp.id = crpp.returnedID
-        WHERE crp.delFlag = 0 AND crp.status = 2
+        WHERE crp.delFlag = 0
+          AND crp.status = 2
           AND crp.shopOrderId = #{shopOrderId}
     </select>
     <select id="findSplitCount" resultType="java.lang.Integer">
@@ -996,7 +1023,9 @@
         co.payTotalFee AS payTotalFee,
         co.promotionFullReduction,
         bou.name AS buyer,
-        s.name AS shopName
+        s.name AS shopName,
+        (select sum((num+presentNum)*cmCostPrice) from cm_order_product where shopOrderId = a.shopOrderId) as
+        allServeAmount
         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
@@ -1277,13 +1306,13 @@
                s.name                     AS shopName,
                c.name                     AS clubName
         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
-        LEFT JOIN cm_order co ON co.orderID = a.orderID
-        LEFT JOIN cm_receipt_order_relation cror ON cror.orderId = co.orderId
-        LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
-        LEFT JOIN shop s ON s.shopID = a.shopID
-        LEFT JOIN club c ON c.userID = a.userID
+                 LEFT JOIN cm_pay_shop_record cpsr ON a.shopOrderID = cpsr.shopOrderID
+                 LEFT JOIN bp_order_userinfo bou ON bou.orderId = a.orderID
+                 LEFT JOIN cm_order co ON co.orderID = a.orderID
+                 LEFT JOIN cm_receipt_order_relation cror ON cror.orderId = co.orderId
+                 LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
+                 LEFT JOIN shop s ON s.shopID = a.shopID
+                 LEFT JOIN club c ON c.userID = a.userID
         WHERE co.organizeID = 0
           AND a.refundStatus = 1
           AND co.delFlag = 0
@@ -2356,6 +2385,128 @@
         limit 0,1
     </select>
 
+    <select id="getShopOrderlist" resultType="com.caimei.modules.order.entity.NewShopOrder">
+        select cso.shopOrderID,
+        cso.shopOrderNo,
+        cso.orderId,
+        cso.orderNo,
+        cso.organizeID,
+        cso.userID,
+        cso.orderType,
+        bou.shouHuoRen AS receiver,
+        co.orderSource,
+        cso.needPayAmount,
+        cso.orderTime,
+        cso.confirmTime,
+        cso.payStatus,
+        cso.sendOutStatus,
+        cso.receiptStatus,
+        cso.refundStatus,
+        cso.shopStatus,
+        u.name AS buyer,
+        (case when co.orderType = '0' then
+        (select case status when 91 then '采美默认协销经理(官方账号)' else linkMan end from serviceprovider where serviceProviderID
+        = co.spID)
+        else
+        ''
+        end) AS spName,
+        co.rebateFlag,
+        cso.closeTime,
+        (SELECT COUNT(*) FROM cm_returned_purchase
+        WHERE shopOrderId = cso.shopOrderId AND status =1 AND delFLag = 0) AS returnedPurchaseStatus,
+        co.closeReason AS closeReason
+        from cm_shop_order cso
+        left join cm_order co on cso.orderId = co.orderId
+        left join bp_order_userinfo bou on bou.orderId = cso.orderId
+        <if test="productName != null and productName != ''">
+            LEFT JOIN cm_order_product cop ON co.orderID = cop.orderID
+            LEFT JOIN product p ON cop.productID = p.productID
+        </if>
+        LEFT JOIN user u ON u.userID = cso.userID
+        <where>
+            cso.orderType != 2
+            <if test="serviceProviderId != null and serviceProviderId != 0">
+                and cso.orderType = 0
+                and co.spID = #{serviceProviderId}
+            </if>
+            <if test="shopOrderNo != null and shopOrderNo != ''">
+                AND cso.shopOrderNo = #{shopOrderNo}
+            </if>
+            <if test="shopOrderID != null and shopOrderID != ''">
+                AND cso.shopOrderID = #{shopOrderID}
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                AND cso.orderNo = #{orderNo}
+            </if>
+            <if test="orderID != null and orderID != ''">
+                AND cso.orderID = #{orderID}
+            </if>
+            <if test="buyer != null and buyer != ''">
+                AND u.name LIKE concat('%',#{buyer},'%')
+            </if>
+            <if test="status != null">
+                AND cso.shopStatus = #{status}
+            </if>
+            <if test="productName != null and productName != ''">
+                and p.name like CONCAT('%',#{productName},'%')
+            </if>
+            <if test="receiptStatus != null and receiptStatus != ''">
+                AND cso.receiptStatus = #{receiptStatus}
+            </if>
+            <if test="sendOutStatus != null and sendOutStatus != ''">
+                AND cso.sendOutStatus = #{sendOutStatus}
+            </if>
+            <if test="payStatus != null and payStatus != ''">
+                AND cso.payStatus = #{payStatus}
+            </if>
+            <if test="refundStatus != null and refundStatus != ''">
+                AND cso.refundStatus = #{refundStatus}
+            </if>
+            <if test="orderType != null">
+                AND cso.orderType = #{orderType}
+            </if>
+            <if test="spID != null  and spID != ''">
+                AND co.spId = #{spID}
+            </if>
+            <if test="rebateFlag != null  and rebateFlag != ''">
+                AND co.rebateFlag = #{rebateFlag}
+            </if>
+            <if test="orderSource != null  and orderSource != ''">
+                AND co.orderSource = #{orderSource}
+            </if>
+            <if test="organizeID != null and organizeID != ''">
+                AND cso.organizeID = #{organizeID}
+            </if>
+            <if test="receiver != null and receiver != ''">
+                AND bou.shouHuoRen LIKE concat('%',#{receiver},'%')
+            </if>
+            <if test="startTime != null and startTime != ''">
+                AND cso.orderTime <![CDATA[  >=  ]]> #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND cso.orderTime <![CDATA[   <=  ]]> #{endTime}
+            </if>
+            <if test="startConfirmTime != null and startConfirmTime != ''">
+                AND cso.confirmTime <![CDATA[  >=  ]]> #{startConfirmTime}
+            </if>
+            <if test="endConfirmTime != null and endConfirmTime != ''">
+                AND cso.confirmTime <![CDATA[   <=  ]]> #{endConfirmTime}
+            </if>
+            <if test="returnedPurchaseStatus != null and returnedPurchaseStatus != ''">
+                AND
+                <if test="returnedPurchaseStatus == 1">
+                    exists
+                </if>
+                <if test="returnedPurchaseStatus == 0">
+                    not exists
+                </if>
+                (select 1 from cm_returned_purchase
+                where status = 1 and shopOrderId = cso.shopOrderId and delFlag= 0)
+            </if>
+        </where>
+        ORDER BY cso.shopOrderID DESC
+    </select>
+
     <insert id="addCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder" useGeneratedKeys="true"
             keyProperty="shopOrderID">
         insert into cm_shop_order
@@ -2639,6 +2790,14 @@
         </foreach>
     </update>
 
+    <update id="updateStatus">
+        UPDATE cm_shop_order
+        SET shopStatus  = #{status},
+            closeTime   = NOW(),
+            closeReason = #{closeReason}
+        WHERE shopOrderID = #{shopOrderID}
+    </update>
+
     <delete id="delCmShopOrderByShopOrderID" parameterType="String">
         delete
         from cm_shop_order

+ 11 - 11
src/main/webapp/WEB-INF/views/modules/bulkpurchase/addOrderRemarksForm.jsp

@@ -117,17 +117,17 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-		<c:if test="${source eq 1 or empty source}">
-            <c:if test="${orderType eq 2}">
-                <li><a href="${ctx}/hehe/new/order/orderList">订单列表</a></li>
-            </c:if>
-            <c:if test="${orderType ne 2}">
-                <li><a href="${ctx}/order/orderList">订单列表</a></li>
-            </c:if>
-		</c:if>
-		<c:if test="${source eq 2}">
-			<li><a href="${ctx}/order/detail?id=${orderID}">订单详情</a></li>
-		</c:if>
+<%--		<c:if test="${source eq 1 or empty source}">--%>
+<%--            <c:if test="${orderType eq 2}">--%>
+<%--                <li><a href="${ctx}/hehe/new/order/orderList">订单列表</a></li>--%>
+<%--            </c:if>--%>
+<%--            <c:if test="${orderType ne 2}">--%>
+<%--                <li><a href="${ctx}/order/orderList">订单列表</a></li>--%>
+<%--            </c:if>--%>
+<%--		</c:if>--%>
+<%--		<c:if test="${source eq 2}">--%>
+<%--			<li><a href="${ctx}/order/detail?id=${orderID}">订单详情</a></li>--%>
+<%--		</c:if>--%>
 		<li><a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${orderID}&source=${source}&orderType=${orderType}">订单备注</a></li>
 		<li  class="active"><a href="${ctx}/order/cmOrderRemark/toAddRemarksViewNew.rpc?orderID=${orderID}&source=${source}&orderType=${orderType}">添加订单备注</a></li>
 	</ul><br/>

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

@@ -186,31 +186,13 @@
                     <br>
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
-<%--                        采美退款银行:${cmReturnedPurchase.bankNameType}--%>
-<%--                        <c:if test="${cmReturnedPurchase.payType == '1'}">--%>
-<%--                            建设银行7297--%>
-<%--                        </c:if>--%>
-<%--                        <c:if test="${cmReturnedPurchase.payType == '2'}">--%>
-<%--                            中信银行0897--%>
-<%--                        </c:if>--%>
-<%--                        <c:if test="${cmReturnedPurchase.payType == '3'}">--%>
-<%--                            中信银行7172--%>
-<%--                        </c:if>--%>
-<%--                        <c:if test="${cmReturnedPurchase.payType == '4'}">--%>
-<%--                            广发银行0115--%>
-<%--                        </c:if>--%>
-<%--                        <c:if test="${cmReturnedPurchase.payType == '5'}">--%>
-<%--                            广发银行5461--%>
-<%--                        </c:if>--%>
-<%--                        <c:if test="${cmReturnedPurchase.payType == '6'}">--%>
-<%--                            虚拟银行0000--%>
-<%--                        </c:if>--%>
-<%--                        <c:if test="${cmReturnedPurchase.payType == '7'}">--%>
-<%--                            华夏银行2400--%>
-<%--                        </c:if>--%>
                     <c:if test="${empty cmReturnedPurchase.refundFee or cmReturnedPurchase.refundFee eq 0}">
                         暂无支付方式
                     </c:if>
+                    <c:if test="${not empty cmReturnedPurchase.refundOfflineFee && cmReturnedPurchase.refundOfflineFee ne 0 }">
+                        线下转账:<fmt:formatNumber type="number" pattern="#,##0.00"
+                                               value="${cmReturnedPurchase.refundOfflineFee}"/>元&nbsp;&nbsp;&nbsp;&nbsp;
+                    </c:if>
                 </c:if>
                 <c:if test="${empty cmReturnedPurchase.returnedWay}">
                     <c:if test="${not empty cmReturnedPurchase.refundOfflineFee && cmReturnedPurchase.refundOfflineFee ne 0 }">

+ 295 - 0
src/main/webapp/WEB-INF/views/modules/bulkpurchase/shopOrderRefundRecord.jsp

@@ -0,0 +1,295 @@
+<%@ taglib prefix="from" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="input" uri="/struts-tags" %>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>收退款记录</title>
+    <meta name="decorator" content="default"/>
+    <style>
+        .form-horizontal .controls {
+            margin-left: 0;
+        }
+
+        .dateInput input {
+            width: 150px;
+        }
+
+        .clause span {
+            margin-left: 30px;
+        }
+
+        #productTable th {
+            text-align: center;
+            white-space: nowrap;
+        }
+
+        #productTable td {
+            text-align: center;
+            white-space: nowrap;
+        }
+
+        .controls {
+            font-size: 0;
+        }
+
+        .controls .conList {
+            display: inline-block;
+            margin-right: 15px;
+        }
+
+        .conList .btn:nth-of-type(1) {
+            margin-left: 25px;
+        }
+
+        #refundTable th, #cmReturnedPurchaseTable th {
+            width: 20%;
+        }
+
+        .record-title {
+            height: 30px;
+            line-height: 30px;
+            padding-left: 8px;
+        }
+        .zeroCost .message{
+            display:none;
+            position:absolute;
+            background:#FFF;
+            white-space:nowrap;
+            border:1px solid black;
+
+        }
+        .zeroCost:hover .message{
+            display: inline-block;
+            color: black;
+            padding: 5px;
+            margin-left: 10px;
+        }
+        .weishaIcon {background:darkorange;color:white;margin:0 0px;padding:0 3px;font-style:normal;font-size: 12px; display:inline-block;border-radius:2px}
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            $("#name").focus();
+            $("#inputForm").validate({
+                submitHandler: function (form) {
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function (error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+
+        });
+
+
+    </script>
+</head>
+<body>
+<%--<input type="hidden" id="product_index" value="${fn:length(order.orderProduct)}">--%>
+<input type="hidden" id="ctx" value="${ctx}">
+<ul class="nav nav-tabs">
+    <c:if test="${from eq '1' or from eq '2'}">
+        <c:if test="${orderType eq 2}">
+            <li><a href="${ctx}/hehe/new/order/orderList">订单列表</a></li>
+        </c:if>
+        <c:if test="${orderType ne 2}">
+            <li><a href="${ctx}/order/orderList">订单列表</a></li>
+        </c:if>
+    </c:if>
+    <c:if test="${from eq '2'}">
+        <li><a href="${ctx}${orderType == 2 ?'/hehe/new':''}/order/detail?id=${orderID}">订单详情</a></li>
+    </c:if>
+    <c:if test="${from eq '3'}">
+        <li><a href="${ctx}/shopOrder/checkPaymentOrder">订单财务信息</a></li>
+    </c:if>
+    <li class="active"><a href="#">收退款记录</a></li>
+</ul>
+<br/>
+<table id="orderTable" class="table table-striped table-bordered table-condensed">
+        <tr>
+            <td>
+                下单时间:${order.orderTime}
+            </td>
+            <td>
+                子订单号(ID):${order.shopOrderNo}(${order.shopOrderID})
+            </td>
+            <c:if test="${order.organizeID != 4}">
+                <td>
+                    <c:if test="${order.organizeID != 1}">
+                        订单类型:${fns:getDictLabel(order.orderType,'order_type' ,'' )}
+                    </c:if>
+                </td>
+            </c:if>
+            <td>
+                <c:if test="${order.organizeID != 1}">
+                    订单来源:${fns:getDictLabel(order.orderSource,'bp_orderSource' ,'' )}
+                </c:if>
+            </td>
+        </tr>
+        <tr>
+            <td>
+                子订单状态:
+                <c:if test="${ not empty order.status}">
+                    <c:if test="${order.status eq 0}">待确认</c:if>
+                    <c:if test="${order.status eq 1}">已确认</c:if>
+                    <c:if test="${order.status eq 2}">交易完成</c:if>
+                    <c:if test="${order.status eq 3}">订单完成</c:if>
+                    <c:if test="${order.status eq 4}">已关闭</c:if>
+                    <c:if test="${order.status eq 5}">交易全退</c:if>
+                </c:if>
+            </td>
+            <td>收款状态:
+                <c:if test="${order.receiptStatus == 1}">
+                    <font color="red">待收款</font>
+                </c:if>
+                <c:if test="${order.receiptStatus == 2}">
+                    <font color="#ff8c00">部分收款</font>
+                </c:if>
+                <c:if test="${order.receiptStatus == 3}">
+                    <font color="green">已收款</font>
+                </c:if>
+            </td>
+            <td>
+                付款状态:
+                <c:if test="${order.payStatus == 1}">
+                    <font color="red">待付款</font>
+                </c:if>
+                <c:if test="${order.payStatus == 2}">
+                    <font color="#ff8c00">部分付款</font>
+                </c:if>
+                <c:if test="${order.payStatus == 3}">
+                    <font color="green">已付款</font>
+                </c:if>
+            </td>
+            <td>
+                结算状态:
+                <c:if test="${order.settleStatus == 1}">
+                    <font color="red">待结算</font>
+                </c:if>
+                <c:if test="${order.settleStatus == 2}">
+                    <font color="#ff8c00">部分结算</font>
+                </c:if>
+                <c:if test="${order.settleStatus == 3}">
+                    <font color="green">已结算</font>
+                </c:if>
+            </td>
+            <td>
+            </td>
+        </tr>
+        <tr>
+            <td>
+                机构:${order.buyer}
+                <c:if test="${order.organizeID == 3}"></c:if>
+            </td>
+            <td>
+                收货人:${order.receiver}
+            </td>
+            <td>
+                手机:${order.mobile}
+            </td>
+            <td>
+<%--                地址:${order.bpOrderUserinfo.province}${order.bpOrderUserinfo.city}${order.bpOrderUserinfo.town}${order.bpOrderUserinfo.address}--%>
+            </td>
+        </tr>
+        <tr>
+            <td>
+                子订单金额:¥${order.needPayAmount}
+            </td>
+            <td>
+                应收总额:
+                <c:if test="${order.realPay!=null}"><fmt:formatNumber value="${order.realPay}"
+                                                                                  type="currency"/></c:if>
+                <c:if test="${order.realPay==null}"><fmt:formatNumber value="${order.needPayAmount}"
+                                                                          type="currency"/></c:if>
+            </td>
+        </tr>
+        <tr>
+            <td>退款总额:¥${refundFee}</td>
+            <td COLSPAN="3">
+        </tr>
+</table>
+<c:if test="${not empty receipt}">
+    <div class="record-title">收款记录:</div>
+    <table id="refundTable" class="table table-striped table-bordered table-condensed">
+        <tr>
+            <th class="table-order">序号</th>
+            <th class="table-id">收款ID</th>
+            <th class="table-cell3">收款方式</th>
+            <th class="table-cell4">金额</th>
+            <th class="table-cell5">收款时间</th>
+        </tr>
+        <c:forEach items="${receipt}" var="receipt" varStatus="s">
+            <tr>
+                <td>${s.index + 1}</td>
+                <td><a href="${ctx}/order/cmDiscernReceipt/detail?id=${receipt.receiptID}&shopOrderId=${receipt.shopOrderId}"
+                       style="cursor: pointer">${receipt.receiptID}</a></td>
+
+                <td>
+                    <c:if test="${receipt.payWay==1}">线上收款</c:if>
+                    <c:if test="${receipt.payWay==2}">线下收款</c:if>
+                    <c:if test="${receipt.payWay==3}">余额抵扣</c:if>
+                </td>
+                <td><fmt:formatNumber value="${receipt.associateAmount}" type="currency"/></td>
+                <td>${receipt.receiptDate}</td>
+            </tr>
+        </c:forEach>
+    </table>
+    <c:forEach items="${receipt}" var="receipt" varStatus="s">
+        <c:if test="${receipt.confirmType eq 1 || receipt.confirmType eq 2}">
+            <div class="record-title"><p>抹平收款备注:<br>
+                    ${receipt.balanceAccountsRemark}</p></div>
+        </c:if>
+    </c:forEach>
+</c:if>
+
+<c:if test="${empty pr}">
+    <div class="record-title">付款记录:无</div>
+</c:if>
+<c:if test="${not empty pr}">
+    <div class="record-title">付款记录:</div>
+    <table id="contentTable" class="table table-striped table-bordered table-condensed" width="70%" border="1">
+        <thead>
+        <tr>
+            <th>序号</th>
+            <th>付款单ID</th>
+            <th>付款时间</th>
+            <th>付款方式</th>
+            <th>付款金额</th>
+        </tr>
+        </thead>
+        <tbody>
+        <c:forEach items="${pr}" var="p" varStatus="pp">
+            <tr>
+                <td>${pp.index + 1}</td>
+                <td><a href="${ctx}/order/cmPayShop/applyDetail?id=${p.payShopID}">${p.payShopID}</a></td>
+                <td>${p.payTime}</td>
+                <td>${p.bankNameType}
+                </td>
+                <td>${p.payAmount}</td>
+            </tr>
+        </c:forEach>
+        </tbody>
+    </table>
+</c:if>
+    <br>
+
+
+
+<script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/loadAddress.js"></script>
+<script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/orderForm.js"></script>
+<script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/stages.js"></script>
+<script>
+    $(function () {
+
+    });
+
+</script>
+</body>
+</html>

+ 529 - 0
src/main/webapp/WEB-INF/views/modules/bulkpurchase/shopOrderReturnRecord.jsp

@@ -0,0 +1,529 @@
+<%@ taglib prefix="from" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="input" uri="/struts-tags" %>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>退款退货记录</title>
+    <meta name="decorator" content="default"/>
+    <style media="print">
+        @page {
+            size: landscape;
+        }
+
+        .refund-btn-top, .nav {
+            display: none;
+        }
+    </style>
+    <style>
+        .form-horizontal .controls {
+            margin-left: 0;
+        }
+
+        #increase, #decrease, .lineNum {
+            width: 30px;
+            height: 30px;
+        }
+
+        .lineNum {
+            text-align: center;
+        }
+
+        .dateInput input {
+            width: 150px;
+        }
+
+        .clause span {
+            margin-left: 30px;
+        }
+
+        #productTable th {
+            text-align: center;
+            white-space: nowrap;
+        }
+
+        #productTable td {
+            text-align: center;
+            white-space: nowrap;
+        }
+
+        .controls {
+            font-size: 0;
+        }
+
+        .controls .conList {
+            display: inline-block;
+            margin-right: 15px;
+        }
+
+        .conList .btn:nth-of-type(1) {
+            margin-left: 25px;
+        }
+
+        .refund-btn-top {
+            float: right;
+            margin-top: -18px;
+            margin-right: 10px;
+            height: 40px;
+        }
+
+        #enlarge-box {
+            position: fixed;
+            /*width: 325px;*/
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            border: 2px solid #eee;
+            background: #fff;
+            display: none;
+        }
+
+        .zeroCost .message {
+            display: none;
+            position: absolute;
+            background: #FFF;
+            white-space: nowrap;
+            border: 1px solid black;
+
+        }
+
+        .zeroCost:hover .message {
+            display: inline-block;
+            color: black;
+            padding: 5px;
+            margin-left: 10px;
+        }
+
+        .weishaIcon {
+            background: darkorange;
+            color: white;
+            margin: 0 0px;
+            padding: 0 3px;
+            font-style: normal;
+            font-size: 12px;
+            display: inline-block;
+            border-radius: 2px
+        }
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            $("#name").focus();
+            $("#inputForm").validate({
+                submitHandler: function (form) {
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function (error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+
+        });
+
+
+        function openClauseInfo(index) {
+            var content = $("#clauseContent" + index).val();
+            if (content == '') {
+                return false;
+            }
+            $.jBox(content, {
+                title: $("#clauseName" + index).val(),
+                width: $(top.document).width() - 440,
+                height: $(top.document).height() - 240,
+                buttons: {'关闭': true}
+            });
+        }
+    </script>
+</head>
+<body>
+<input type="hidden" id="ctx" value="${ctx}">
+<ul class="nav nav-tabs">
+    <c:if test="${from eq '3'}">
+        <li><a href="${ctx}/shopOrder/checkPaymentOrder">订单财务信息</a></li>
+    </c:if>
+    <li class="active"><a
+            href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByOrderID.rpc?orderID=${order.orderID}">退款退货详情</a>
+    </li>
+</ul>
+<br/>
+<div class="refund-btn-top">
+    <c:if test="${from ne '3'}">
+        <input type="button" class="btn btn-primary"
+               onclick="window.location.href='${ctx}${cmReturnedPurchase.orderType eq 2?'/hehe/new/order/orderList':'/order/orderList'}'"
+               value="返回">
+    </c:if>
+</div>
+<c:forEach items="${cmReturnedPurchaseList}" var="cmReturnedPurchase" varStatus="cmReturnedPurchaseStatus">
+    <form:form id="inputForm${cmReturnedPurchaseStatus.index}" modelAttribute="cmReturnedPurchase"
+               action="${ctx}/bulkpurchase/cmRefundsProduct/saveRefound" method="post"
+               class="form-horizontal">
+        <c:if test="${cmReturnedPurchaseStatus.index ne 0}">
+            <hr style="height:5px;border:none;border-top:5px ridge green;"/>
+        </c:if>
+
+        <div id="enlarge-box">
+            <img src="" alt="">
+        </div>
+
+        <table id="contentTable" class="table table-striped table-bordered table-condensed">
+            <tr>
+                <td><b>退款编号:</b>
+                        ${empty cmReturnedPurchase.returnedNo?'':(cmReturnedPurchase.returnedNo)}
+                </td>
+                <td><b>申请时间:</b>
+                        ${cmReturnedPurchase.returnTime}
+                </td>
+                <td><b>申请金额:</b>
+                    <span class="refundFee"><fmt:formatNumber
+                            value="${empty cmReturnedPurchase.refundFee?'0.00':(cmReturnedPurchase.refundFee)}"
+                            pattern="#0.00"/></span>元&nbsp;&nbsp;&nbsp;
+                    (账户余额抵扣:${order.accountAmount})
+                </td>
+            </tr>
+            <tr>
+                <td colspan="4">
+                    <b>退款方式:</b>
+                    <c:if test="${cmReturnedPurchase.returnedWay eq 4}">
+                        未支付无退款
+                    </c:if>
+                    <c:if test="${cmReturnedPurchase.returnedWay eq 1}">
+                        <c:if test="${not empty cmReturnedPurchase.refundBalanceFee && cmReturnedPurchase.refundBalanceFee ne 0 }">
+                            余额账户:<fmt:formatNumber type="number" pattern="#,##0.00"
+                                                   value="${cmReturnedPurchase.refundBalanceFee}"/>元&nbsp;&nbsp;&nbsp;&nbsp;
+                        </c:if>
+                        <c:if test="${not empty cmReturnedPurchase.refundOnlineFee && cmReturnedPurchase.refundOnlineFee ne 0 }">
+                            线上退回:<fmt:formatNumber type="number" pattern="#,##0.00"
+                                                   value="${cmReturnedPurchase.refundOnlineFee}"/>元&nbsp;&nbsp;&nbsp;&nbsp;
+                        </c:if>
+                        <br>
+                        <c:if test="${empty cmReturnedPurchase.refundFee or cmReturnedPurchase.refundFee eq 0}">
+                            暂无支付方式
+                        </c:if>
+                        <c:if test="${not empty cmReturnedPurchase.refundOfflineFee && cmReturnedPurchase.refundOfflineFee ne 0 }">
+                            线下转账:<fmt:formatNumber type="number" pattern="#,##0.00"
+                                                   value="${cmReturnedPurchase.refundOfflineFee}"/>元&nbsp;&nbsp;&nbsp;&nbsp;
+                        </c:if>
+                    </c:if>
+                    <c:if test="${empty cmReturnedPurchase.returnedWay}">
+                        线下退回:<fmt:formatNumber type="number" pattern="#,##0.00"
+                                               value="${cmReturnedPurchase.refundOfflineFee}"/>元&nbsp;&nbsp;
+                    </c:if>
+                        <%--存在线下打款才显示银行信息--%>
+                    <br>
+                </td>
+            </tr>
+        </table>
+
+        <%--单个订单汇总信息--%>
+        <table id="orderTable" class="table table-striped table-bordered table-condensed">
+            <thead>
+            </thead>
+            <tr>
+                <td>
+                    机构:${order.buyer}
+                    <c:if test="${order.organizeID == 3}"></c:if>
+                </td>
+                <td>
+                    收货人:${order.receiver}(${order.mobile})
+                </td>
+                <td colspan="2">
+                        <%--                    地址:${order.bpOrderUserinfo.province}${order.bpOrderUserinfo.city}${order.bpOrderUserinfo.town}${order.bpOrderUserinfo.address}--%>
+                </td>
+            </tr>
+        </table>
+
+        <%--单次退款商品信息汇总--%>
+
+        <table id="cmReturnedPurchaseTable" class="table table-striped table-bordered table-condensed">
+            <c:forEach items="${cmReturnedPurchase.shopOrderReturnedList}" var="shopOrderReturneds"
+                       varStatus="shopOrderReturnedStatus">
+                <tr>
+                    <td colspan="7">
+                        <table id="shopOrderReturnedTable${shopOrderReturnedStatus.index}"
+                               class="table table-striped table-bordered table-condensed">
+                            <tr>
+                                <td style="width: 300px;">
+                                    子订单编号(ID):${shopOrderReturneds.shopOrderNo}(${shopOrderReturneds.shopOrderID})
+                                </td>
+                                <td style="width: 250px;">子订单金额:${shopOrderReturneds.productAmount}</td>
+                                <td>
+                                    收款状态:
+                                    <c:if test="${shopOrderReturneds.shopReceiptStatus == 1}">
+                                        <font color="red">待收款</font>
+                                    </c:if>
+                                    <c:if test="${shopOrderReturneds.shopReceiptStatus == 2}">
+                                        <font color="#ff8c00">部分收款</font>
+                                    </c:if>
+                                    <c:if test="${shopOrderReturneds.shopReceiptStatus == 3}">
+                                        <font color="green">已收款</font>
+                                    </c:if>
+                                </td>
+                                <td>发货状态:
+                                    <c:if test="${shopOrderReturneds.sendOutStatus == 1}">
+                                        <font color="red">待发货</font>
+                                    </c:if>
+                                    <c:if test="${shopOrderReturneds.sendOutStatus == 2}">
+                                        <font color="#ff8c00">部分发货</font>
+                                    </c:if>
+                                    <c:if test="${shopOrderReturneds.sendOutStatus == 3}">
+                                        <font color="green">已发货</font>
+                                    </c:if>
+                                </td>
+                                <td>付款状态:
+                                    <c:if test="${shopOrderReturneds.payStatus == 1}">
+                                        <font color="red">待付款</font>
+                                    </c:if>
+                                    <c:if test="${shopOrderReturneds.payStatus == 2}">
+                                        <font color="#ff8c00">部分付款</font>
+                                    </c:if>
+                                    <c:if test="${shopOrderReturneds.payStatus == 3}">
+                                        <font color="green">已付款</font>
+                                    </c:if>
+                                </td>
+                                <td>
+                                    退款状态:
+                                    <c:if test="${order.refundStatus == 0}">
+                                        <font>无退款</font>
+                                    </c:if>
+                                    <c:if test="${order.refundStatus == 3}">
+                                        <font>有退款</font>
+                                    </c:if>
+                                </td>
+                                <td>供应商:${shopOrderReturneds.shopName}</td>
+                            </tr>
+
+                            <tr>
+                                <td>
+                                    商品总额:¥<fmt:formatNumber type="number"
+                                                            value="${shopOrderReturneds.needPayAmount}"
+                                                            pattern="0.00" maxFractionDigits="2"/>
+                                </td>
+                                <td>
+                                    优惠:¥<fmt:formatNumber type="number"
+                                                          value="${empty shopOrderReturneds.eachDiscount?0:shopOrderReturneds.eachDiscount}"
+                                                          pattern="0.00" maxFractionDigits="2"/>
+                                </td>
+                                <td>
+                                    应付金额:¥<fmt:formatNumber type="number" value="${shopOrderReturneds.realPay}"
+                                                            pattern="0.00" maxFractionDigits="2"/>
+                                </td>
+                                <td>
+                                    已付金额:¥<fmt:formatNumber type="number"
+                                                            value="${shopOrderReturneds.receiptAmount}"
+                                                            pattern="0.00" maxFractionDigits="2"/>
+                                </td>
+                                <td>
+                                    待付金额:¥<fmt:formatNumber type="number" value="${shopOrderReturneds.restAmount}"
+                                                            pattern="0.00" maxFractionDigits="2"/>
+                                </td>
+                            </tr>
+                            <c:forEach items="${shopOrderReturneds.cmReturnedPurchaseProductList}"
+                                       var="cmReturnedPurchaseProduct" varStatus="cmReturnedPurchaseProductStatus">
+                                <tr>
+                                    <td rowspan="4" style="width: 295px;height: 125px">
+                                        <img style="width: 100px;height: 100px"
+                                             src="${cmReturnedPurchaseProduct.mainImage}">
+                                        <font title="${cmReturnedPurchaseProduct.name}">${fns:abbr(cmReturnedPurchaseProduct.name,30)}</font>
+                                    </td>
+                                    <td>单价:¥${cmReturnedPurchaseProduct.price}
+                                        <c:if test="${order.organizeID != 4}">
+                                    <td>折扣:${cmReturnedPurchaseProduct.discount}</td>
+                                    <td>折后单价:¥${cmReturnedPurchaseProduct.discountPrice}</td>
+                                    </c:if>
+                                    <td>
+                                        购买数量(赠品数)X${cmReturnedPurchaseProduct.num}(${cmReturnedPurchaseProduct.presentNum})
+                                    </td>
+                                    <td>运费:${order.shopPostFee}</td>
+                                </tr>
+                                <tr>
+                                    <td>规格:${cmReturnedPurchaseProduct.unit}</td>
+                                    <c:if test="${order.organizeID != 4}">
+                                        <td>税率:${cmReturnedPurchaseProduct.taxRate}</td>
+                                        <td>税费:¥${cmReturnedPurchaseProduct.totalAddedValueTax}</td>
+                                    </c:if>
+                                    <td colspan="2">总额:¥${cmReturnedPurchaseProduct.totalFee}</td>
+                                </tr>
+                                <tr>
+                                    <td><font
+                                            color="red">已发货:${cmReturnedPurchaseProduct.num+cmReturnedPurchaseProduct.presentNum - cmReturnedPurchaseProduct.notOutStore}</font>
+                                    </td>
+                                    <td><font color="red">已退货:<span
+                                            id="applicationReturnedNum${shopOrderReturnedStatus.index}${cmReturnedPurchaseProductStatus.index}">${cmReturnedPurchaseProduct.returnedPurchaseProductNum}</span></font>
+                                    </td>
+                                    <td colspan="2"><font color="red">本次退货:
+                                            ${empty cmReturnedPurchaseProduct.actualReturnedNum ? 0 : cmReturnedPurchaseProduct.actualReturnedNum}
+                                    </font>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td><font
+                                            color="red">待发货:${cmReturnedPurchaseProduct.notOutStore }</font>
+                                    </td>
+                                    <td><font color="red">已取消:<span
+                                            id="applicationCancelNum${shopOrderReturnedStatus.index}${cmReturnedPurchaseProductStatus.index}">${cmReturnedPurchaseProduct.cancelProductNum}</span></font>
+                                    </td>
+                                    <td colspan="2"><font color="red">本次取消:
+                                            ${empty cmReturnedPurchaseProduct.actualCancelNum ? 0 : cmReturnedPurchaseProduct.actualCancelNum}
+                                    </font>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                        </table>
+                    </td>
+                </tr>
+            </c:forEach>
+
+        </table>
+    </form:form>
+</c:forEach>
+
+<c:if test="${empty cmReturnedPurchaseList}">
+    <p style="text-align: center;"><font color="#1e90ff">暂无退货退款详情记录.....</font></p>
+</c:if>
+<c:if test="${not empty cmReturnedPurchaseList and order.organizeID != 4}">
+    <table id="orderTable" class="table table-striped table-bordered table-condensed">
+        <tr>
+            <td>
+                <div class="order-rows">
+                    <label>发票信息:</label>
+                    <input id="invoice1" class="invoice1" name="invoice"
+                           type="radio" ${order.orderInvoice.type == 0 ? 'checked="checked"':''} disabled="disabled">
+                    <label for="invoice1">不需要发票</label>
+                    <input id="invoice2" name="invoice"
+                           type="radio" ${order.orderInvoice.type == 1 ? 'checked="checked"':''} disabled="disabled">
+                    <label for="invoice2">普通发票</label>
+                    <input id="invoice3" name="invoice"
+                           type="radio" ${order.orderInvoice.type == 2 ? 'checked="checked"':''} disabled="disabled">
+                    <label for="invoice3">增值税发票</label>
+                    <c:if test="${order.orderInvoice.type == 1}">
+                        <br>
+                        <div>
+                            <span>
+                    <c:if test="${order.orderInvoice.invoiceTitleType eq 0}">
+                        发票抬头:
+                        <span>${order.orderInvoice.invoiceTitle}</span>
+                    </c:if>
+                    <c:if test="${order.orderInvoice.invoiceTitleType eq 1}">
+                        发票抬头:
+                        <span>${order.orderInvoice.invoiceTitle}</span>
+                        &nbsp;&nbsp;&nbsp;&nbsp;
+                        纳税人识别号:
+                        <span>${order.orderInvoice.corporationTaxNum}</span>
+                    </c:if>
+                </span>
+                        </div>
+                    </c:if>
+                    <c:if test="${order.orderInvoice.type == 2}">
+                        <table>
+                            <tr>
+                                <td><span>单位名称:${order.orderInvoice.invoiceTitle}</span></td>
+                                <td><span>纳税人识别号:${order.orderInvoice.corporationTaxNum}</span></td>
+                                <td><span>注册地址:${order.orderInvoice.registeredAddress}</span></td>
+                            </tr>
+                            <tr>
+                                <td><span>注册电话:${order.orderInvoice.registeredPhone}</span></td>
+                                <td><span>开户银行:${order.orderInvoice.openBank}</span></td>
+                                <td><span>银行账号:${order.orderInvoice.bankAccountNo}</span></td>
+                            </tr>
+                        </table>
+                    </c:if>
+                </div>
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <div class="order-rows">
+                    <label>售后条款:</label>
+                    <c:forEach items="${bpClauses}" var="items" varStatus="index">
+                        <c:if test="${items.clauseType ne 0  }">
+                <span>
+                    <input id="clauseId${index.index+1}" class="clauseId" name="clauseID" type="radio"
+                           value="${items.id}"${(order.clauseID)==(items.id)?'checked="checked"':''}
+                           class="required" class="clauseId" disabled="disabled">
+                    <c:if test="${order.clauseID eq 1}">
+                        无条款
+                    </c:if>
+                    <c:if test="${order.clauseID ne 1}">
+                        <a href="javascript:void(0);"
+                           onclick="openClauseInfo(${index.index+1});"><label>${order.clauseName}</label></a>
+                    </c:if>
+                </span>
+                        </c:if>
+                    </c:forEach>
+                </div>
+            </td>
+        </tr>
+    </table>
+
+</c:if>
+
+
+<script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/loadAddress.js"></script>
+<script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/orderForm.js"></script>
+<script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/stages.js"></script>
+<script>
+    $(function () {
+        $('.print-now').on('click', function () {
+            window.print();
+        })
+    });
+
+    (function () {
+        $('body').click(function (e) {
+            var target = $(e.target),
+                $block = $('.operation-block');
+            if (target.is('.operation-btn')) {
+                if ($block.css('display') === 'none') {
+                    $block.show();
+                } else {
+                    $block.hide();
+                }
+            }
+            if (!target.is('.operation-block') && !target.is('.operation-btn')) {
+                $block.hide();
+            }
+        });
+
+        $('.clauseId').each(function () {
+            var self = $(this);
+            if (!self.prop("checked")) {
+                self.parent().hide();
+            } else {
+                self.hide();
+            }
+        });
+
+        $('#invoice1, #invoice2, #invoice3').each(function () {
+            var self = $(this);
+            if (!self.prop("checked")) {
+                self.next().remove();
+                self.remove();
+            } else {
+                self.remove();
+            }
+        })
+
+        $('body').on('mouseover', '.enlarge-pic', function () {
+            var thisSrc = $(this).attr('src'),
+                enlargeBox = $('#enlarge-box');
+            if (thisSrc) {
+                enlargeBox.show(50);
+                $('#enlarge-box').find('img').attr('src', thisSrc);
+            }
+        })
+
+        $('body').on('mouseout', '.enlarge-pic', function () {
+            var enlargeBox = $('#enlarge-box');
+            enlargeBox.hide();
+        })
+    })();
+
+</script>
+</body>
+</html>

+ 39 - 6
src/main/webapp/WEB-INF/views/modules/order/checkPaymentOrder.jsp

@@ -411,8 +411,7 @@
             <table class="table table-striped table-bordered table-condensed pay-table">
                 <tr class="t1">
                     <th class="item0">序号</th>
-                    <th colspan="2">子订单编号(ID)</th>
-                    <th colspan="2">母订单编号(ID)</th>
+                    <th>子订单编号(ID)</th>
                     <th>下单时间</th>
                     <th>订单金额</th>
                     <th>订单状态</th>
@@ -423,6 +422,9 @@
                     <th>应付金额</th>
                     <th>已付金额</th>
                     <th>结算状态</th>
+                    <th>采美平台服务费</th>
+                    <th>采美自营订单利润</th>
+                    <th>采美总利润</th>
                     <th>应结金额</th>
                     <th>已结金额</th>
                     <th>退款状态</th>
@@ -432,8 +434,7 @@
                 </tr>
                 <tr>
                     <td rowspan="0" class="item0">${(page.pageNo-1)*page.pageSize+sIndex.index+1}</td>
-                    <td colspan="2">${s.shopOrderNo}(${s.shopOrderID})</td>
-                    <td colspan="2">${s.orderNo}(${s.orderID})</td>
+                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
                     <td>${s.orderTime}</td>
                     <td><fmt:formatNumber value="${s.totalAmount}" type="number" pattern="#,##0.00"/></td>
                     <td>
@@ -481,6 +482,36 @@
                         <c:if test="${s.settleStatus  == 2}"><font color="green">部分结算</font></c:if>
                         <c:if test="${s.settleStatus == 3}"><font color="red">已结算</font></c:if>
                     </td>
+                    <td>${s.allServeAmount}</td>
+                    <td>
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                            <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                    </td>
+                    <td>
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount}" type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice}"
+                                              type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice}"
+                                              type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                    </td>
                     <td>
                         <fmt:formatNumber value="${s.shouldPayShopAmount-s.shopOtherFee}" type="number" pattern="#,##0.00"/>
                     </td>
@@ -502,6 +533,7 @@
                     <td><fmt:formatNumber value="${s.promotionFullReduction}" type="number" pattern="#,##0.00"/></td>
                 </tr>
                 <tr class="t2">
+                    <th>母订单编号(ID)</th>
                     <th colspan="3">机构</th>
                     <th colspan="3">供应商</th>
                     <th colspan="2">商品费</th>
@@ -514,6 +546,7 @@
                     <th colspan="2">付第三方</th>
                 </tr>
                 <tr class="t2">
+                    <td>${s.orderNo}(${s.orderID})</td>
                     <td colspan="3">
                         <c:if test="${s.organizeID eq 1}"><span class="org-note">星范</span></c:if>
                             ${s.clubName}
@@ -568,7 +601,7 @@
 
                 </tr>
                 <tr>
-                    <th colspan="3">商品名</th>
+                    <th colspan="4">商品名</th>
                     <th>规格</th>
                     <th>数量<%--(赠品)--%></th>
                     <th>退货</th>
@@ -582,7 +615,7 @@
                 <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
                     <tr class="pay-product-item">
                         <input type="hidden" class="p-copId" value="${p.orderProductID}">
-                        <td style="width:300px;" class="p-name" colspan="3">
+                        <td style="width:300px;" class="p-name" colspan="4">
                             <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
                             <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
                                 ${p.name}

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

@@ -27,17 +27,17 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<c:if test="${source eq 1 or empty source}">
-			<c:if test="${orderType eq 2}">
-				<li><a href="${ctx}/hehe/new/order/orderList">订单列表</a></li>
-			</c:if>
-			<c:if test="${orderType ne 2}">
-				<li><a href="${ctx}/order/orderList">订单列表</a></li>
-			</c:if>
-		</c:if>
-		<c:if test="${source eq 2}">
-			<li><a href="${ctx}${orderType == 2 ?'/hehe/new':''}/order/detail?id=${orderID}">订单详情</a></li>
-		</c:if>
+<%--		<c:if test="${source eq 1 or empty source}">--%>
+<%--			<c:if test="${orderType eq 2}">--%>
+<%--				<li><a href="${ctx}/hehe/new/order/orderList">订单列表</a></li>--%>
+<%--			</c:if>--%>
+<%--			<c:if test="${orderType ne 2}">--%>
+<%--				<li><a href="${ctx}/order/orderList">订单列表</a></li>--%>
+<%--			</c:if>--%>
+<%--		</c:if>--%>
+<%--		<c:if test="${source eq 2}">--%>
+<%--			<li><a href="${ctx}${orderType == 2 ?'/hehe/new':''}/order/detail?id=${orderID}">订单详情</a></li>--%>
+<%--		</c:if>--%>
 		<li class="active"><a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${orderID}&source=${source}&orderType=${orderType}">订单备注</a></li>
 		<li><a href="${ctx}/order/cmOrderRemark/toAddRemarksViewNew.rpc?orderID=${orderID}&shopOrderID=${shopOrderID}&source=${source}&orderType=${orderType}">添加订单备注</a></li>
 	</ul><br/>

+ 51 - 6
src/main/webapp/WEB-INF/views/modules/order/cmPayShopChange.jsp

@@ -211,7 +211,8 @@
                 <input id="orderID" type="hidden" name="orderID" value="${newShopOrder.orderID}">
                 <input id="productAmount" type="hidden" name="productAmount" value="${newShopOrder.productAmount}">
                 <input id="couponAmount" type="hidden" name="couponAmount" value="${newShopOrder.couponAmount}">
-                <input id="promotionFullReduction" type="hidden" name="promotionFullReduction" value="${newShopOrder.promotionFullReduction}">
+                <input id="promotionFullReduction" type="hidden" name="promotionFullReduction"
+                       value="${newShopOrder.promotionFullReduction}">
                 <label style="color:red">注意:计算成本时请注意,含税商品的成本包括税费,无需另外计算税费</label>
                 <table class="table table-striped table-bordered table-condensed" style="width: 70%">
                     <tr>
@@ -219,7 +220,7 @@
                         <td>供应商成本(单)</td>
                         <td>集团成本(单)</td>
                         <td>平台服务费</td>
-                        <td>机构税率</td>
+                        <td>供应商税率</td>
                         <td>供应商税费(单)</td>
                     </tr>
                     <c:forEach items="${newShopOrder.newOrderProducts}" var="product" varStatus="index">
@@ -256,13 +257,13 @@
                                        value="${product.cmCostPrice}"/></td>
                             <td width="20%">
                                 <c:choose>
-                                    <c:when test="${product.includedTax ne '' and product.includedTax eq 0 and product.invoiceType ne 1 and product.invoiceType ne 2}">
+                                    <c:when test="${product.includedTax ne '' and ((product.includedTax eq 0 and product.invoiceType ne 1 and product.invoiceType ne 2) or product.includedTax eq 1 )}">
                                         <label style="text-align: center">-----</label>
                                     </c:when>
                                     <c:otherwise>
                                         <input style="width: 120px;float: left" maxlength="5" id="supplierTaxRate"
-                                               name="newOrderProducts[${index.index}].taxRate"
-                                               value="${empty product.taxRate?0.0:product.taxRate}"
+                                               name="newOrderProducts[${index.index}].supplierTaxRate"
+                                               value="${empty product.supplierTaxRate?0.0:product.supplierTaxRate}"
                                                onchange="changeShouldPay(this)"/>%
                                     </c:otherwise>
                                 </c:choose>
@@ -460,6 +461,50 @@
                 })
             }, 500);
         });
+        var totalAmount = 0;
+        $(".orderProducts").each(function (i, ele) {
+            // 商品层信息
+            var num = $(ele).find('input[id=num]').val();
+            var presentNum = $(ele).find('input[id=presentNum]').val();
+            var costPrice = $(ele).find('input[id=costPrice]').val();
+            var supplierTaxRate = $(ele).find('input[id=supplierTaxRate]').val();
+            var singleShouldPayTotalTax = $(ele).find('label[id=singleShouldPayTotalTaxLabel]').text();// 单个供应商是税费
+
+            // 校验参数
+            if (null == num) num = 0;
+            if (null == presentNum) presentNum = 0;
+            if (null == costPrice) costPrice = 0;
+            if (null == supplierTaxRate || supplierTaxRate === undefined || supplierTaxRate.includes("-")) supplierTaxRate = 0;
+            if (null == singleShouldPayTotalTax || singleShouldPayTotalTax === undefined || singleShouldPayTotalTax.includes("-")) singleShouldPayTotalTax = 0;
+            console.log(num + " " + presentNum + " " + " " + costPrice + " " + supplierTaxRate + " " + singleShouldPayTotalTax)
+
+            var productNum = Number(num) + Number(presentNum);
+
+            if (singleShouldPayTotalTax == '-----') {
+                singleShouldPayTotalTax = 0;
+                $(ele).find('input[id=singleShouldPayTotalTax]').val(0);
+            } else {
+                //计算供应商税费(单)
+                singleShouldPayTotalTax = (costPrice * supplierTaxRate * 0.01).toFixed(2);
+                $(ele).find('label[id=singleShouldPayTotalTaxLabel]').text(singleShouldPayTotalTax);
+                $(ele).find('input[id=singleShouldPayTotalTax]').val(singleShouldPayTotalTax);
+            }
+            //计算应付供应商
+            totalAmount += ((Number(productNum) * Number(costPrice)) + (Number(productNum) * Number(singleShouldPayTotalTax)));
+        });
+        //获取供应商层信息
+        var shopPostFee = $("#shopPostFee").val();
+        var couponAmount = $("#couponAmount").val();
+        var promotionFullReduction = $("#promotionFullReduction").val();
+        if (null == shopPostFee) shopPostFee = 0;
+        var of = $("#shopOtherFee").val();
+        totalAmount += Number(shopPostFee);
+        totalAmount -= Number(of);
+        totalAmount -= Number(couponAmount);
+        totalAmount -= Number(promotionFullReduction);
+        // 四舍五入
+        var s = totalAmount.toFixed(2);
+        $("#div-supplier-fee").text(s);
     });
 
     // 输入框验证
@@ -589,7 +634,7 @@
                 $(ele).find('input[id=singleShouldPayTotalTax]').val(singleShouldPayTotalTax);
             }
             //计算应付供应商
-            totalAmount += ((Number(productNum) * Number(costPrice)) + (Number(productNum) * Number(singleShouldPayTotalTax))); /* + (Number(productNum) * Number(singleShouldPayTotalTax))*/
+            totalAmount += ((Number(productNum) * Number(costPrice)) + (Number(productNum) * Number(singleShouldPayTotalTax)));
         });
         var of = $("#shopOtherFee").val();
         totalAmount += Number(shopPostFee);

+ 96 - 86
src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp

@@ -325,78 +325,67 @@
             <%--涛姐遍历下面这个table--%>
             <table class="table table-striped table-bordered table-condensed pay-table">
                 <tr>
-                    <th>订单编号(ID)</th>
-                    <th colspan="3">客户</th>
-                    <th colspan="2">下单时间</th>
-                    <th>订单金额</th>
-                    <th colspan="3">所有子订单</th>
-                    <th>订单总佣金</th>
-                    <th>机构运费</th>
-                    <th>收款状态</th>
+                    <th>子订单编号(ID)</th>
+                    <th colspan="3">下单时间</th>
+                    <th colspan="2">子订单金额</th>
+                    <th colspan="4">采美平台服务费</th>
+                    <th>采美自营订单利润</th>
+                    <th>采美总利润</th>
+                    <th colspan="2">收款状态</th>
                     <th colspan="3">收款金额</th>
-                    <th>促销满减</th>
-                    <th>优惠券</th>
+                    <th colspan="2">经理折扣</th>
+                    <th colspan="2">优惠券</th>
                 <tr/>
                 <tr>
-                    <td> ${s.orderNo}(${s.orderID})</td>
-                    <td colspan="3"> ${s.buyer}</td>
-                    <td colspan="2"> ${s.orderTime}</td>
-                    <td>${s.payTotalFee}</td>
-                    <td colspan="3">
-                        <c:forEach items="${s.shopOrderNos}" var="cs">
-                            ${cs}<br/>
-                        </c:forEach>
-                    </td>
-                    <td>
-                        <c:if test="${empty s.brokerage}">0.00</c:if>
-                        <c:if test="${not empty s.brokerage}">${s.brokerage}</c:if>
-                         <%--   ${s.income}
-                        <c:if test="${not empty s.rebateFee}">
-                            <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>
-                        </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}">
-                            包邮
+                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                    <td colspan="3"> ${s.orderTime}</td>
+                    <td colspan="2">${s.totalAmount}</td>
+                    <td colspan="4">${s.allServeAmount}</td>
+                    <c:if test="${empty s.brokerage}">
+                    <td class="payCm-t"></td>
+                    </c:if>
+                    <c:if test="${not empty s.brokerage}">
+                    <td class="">
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                            <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
                         </c:if>
-                        <c:if test="${s.freight == -1}">
-                            到付
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
+                                              pattern="#,##0.00"/>
                         </c:if>
-                        <c:if test="${s.freight == -2}">
-                            仪器到付-产品包邮
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
+                                              pattern="#,##0.00"/>
                         </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>
+                    </td>
+                    </c:if>
+                    <td>
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount}" type="number"
+                                              pattern="#,##0.00"/>
                         </c:if>
-                        <c:if test="${s.userBeans gt 0}">
-                            (采美豆抵用${s.userBeans})
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice}"
+                                              type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice}"
+                                              type="number"
+                                              pattern="#,##0.00"/>
                         </c:if>
                     </td>
-                    <td>
-                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&shopOrderID=${s.shopOrderID}&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 colspan="2">
+                        <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}&shopOrderID=${s.shopOrderID}&from=1"
-                           style="text-decoration: underline">${s.receiptTotalFee}</a>
+                            ${s.receiptAmount}
+                        <c:if test="${s.accountAmount>0}">(余额抵扣 ¥${s.accountAmount})</c:if>
                     </td>
-                    <td>
-                        <fmt:formatNumber value="${s.promotionFullReduction}" type="number" pattern="#,##0.00"/>
-                        <%--<label class="discountFee" style="display: none">
+                    <td colspan="2">
+                        <label class="discountFee">
                             <c:choose>
                                 <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
                                     <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
@@ -426,33 +415,58 @@
                                 </span>
                             </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>
+                    <td class="couponAmount" colspan="2">${s.couponAmount} </td>
                     <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
                 <tr/>
                 <tr>
-                    <th>子订单编号(ID)</th>
-                    <th colspan="3"> 供应商</th>
-                    <th colspan="3">子订单佣金</th>
-                    <th colspan="3">商品费</th>
+                    <th>客户</th>
+                    <th colspan="6"> 供应商</th>
+                    <th colspan="5">商品费</th>
                     <th>应付税费</th>
+                    <th>机构运费</th>
                     <th>供应商运费</th>
                     <th>付款状态</th>
                     <th colspan="3">付供应商</th>
-                    <th>付第三方</th>
-                    <th>成本类型</th>
+                    <th colspan="2">付第三方</th>
                 </tr>
                 <tr>
-                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-                    <td colspan="3">${s.shopName}</td>
-                    <td colspan="3" class="payCm-t">子订单佣金</td>
-                    <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
-
+                    <td> ${s.buyer}</td>
+                    <td colspan="6">${s.shopName}</td>
+                        <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
+                    <td colspan="5" class="product-fee">${s.shopProductAmount}</td>
                     <td class="taxes">
                         <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
                     </td>
-
+                    <td>
+                        <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}"/>
+                                </c:when>
+                                <c:otherwise>
+                                    <fmt:formatNumber value="0"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </label>
+                        <c:if test="${s.shopPostFlag == 0}">
+                            包邮
+                        </c:if>
+                        <c:if test="${s.shopPostFlag == 2}">
+                            到付
+                        </c:if>
+                        <c:if test="${s.shopPostFlag == -2}">
+                            仪器到付-产品包邮
+                        </c:if>
+                        <c:if test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2}">
+                            <fmt:formatNumber value="${s.shopPostFee}" type="number" pattern="#,##0.00"/>
+                            <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 class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
                                                           pattern="#,##0.00"/></td>
 
@@ -469,10 +483,10 @@
                                 应付:<fmt:formatNumber 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}"/></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.shopOtherFee},已退差价:${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>
@@ -488,12 +502,7 @@
                                 class="red wipeText">¥0.00</em></span></label>
                     </td>
 
-                    <td 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}</td>
                 </tr>
                 <tr>
                     <th>商品名</th>
@@ -502,11 +511,12 @@
                     <th>退货</th>
                     <th colspan="3">单价</th>
                     <th colspan="3">机构税率 / 单税费 / 总税费</th>
-                    <th>总价</th>
+                    <th colspan="2">总价</th>
                     <th>利润(单)</th>
                     <th>利润(总)</th>
+                    <th>平台服务费(单)</th>
                     <th colspan="3">供应商税率 / 单税费 / 总税费</th>
-                    <th>成本(单)</th>
+                    <th>成本(单 + 税)</th>
                     <th>成本(总)</th>
                 </tr>
                 <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
@@ -543,7 +553,7 @@
                                         type="number" pattern="#,##0.00"/>
                             </c:otherwise>
                         </c:choose></td>
-                        <td><fmt:formatNumber
+                        <td colspan="2"><fmt:formatNumber
                                 value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
                                 type="number" pattern="#,##0.00"/></td>
                         <td>
@@ -563,7 +573,7 @@
                                 0.00
                             </c:if>
                         </td>
-
+                        <td><fmt:formatNumber value="${p.returnedNum == p.num ? 0.00 : p.cmCostPrice}" type="number" pattern="#,##0.00"/></td>
                         <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
                         <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
                         <td class="p-taxes-t"><c:choose>

+ 289 - 261
src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp

@@ -297,10 +297,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>
@@ -335,83 +335,119 @@
     </div>
     <div class="payment-form-content">
         <%--涛姐遍历下面这个table--%>
-            <c:forEach items="${cmPayShop.shopOrders}" var="s">
-                <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.orderNo}(${s.orderID})</td>--%>
-                        <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-                            <%--                        <td colspan="3"> ${s.buyer}</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>
-                            <%--<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">
+        <c:forEach items="${cmPayShop.shopOrders}" var="s">
+            <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 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>
+                    </c:if>
+                    <c:if test="${not empty s.brokerage}">
+                    <td class="">
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                            <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                    </td>
+                    </c:if>
+                    <td>
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount}" type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice}"
+                                              type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice}"
+                                              type="number"
+                                              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">
+                        <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"/>
+                            ${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}">
@@ -443,206 +479,198 @@
                                 </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>
-                    <tr/>
-                    <tr>
-                        <th>客户</th>
-                        <th colspan="3"> 供应商</th>
-                        <th colspan="3">子订单利润</th>
-                        <th colspan="3">商品费</th>
-                        <th>应付税费</th>
-                        <th>机构运费</th>
-                        <th>供应商运费</th>
-                        <th>付款状态</th>
-                        <th colspan="3">付供应商</th>
-                        <th colspan="2">付第三方</th>
+                    </td>
+                    <td class="couponAmount" colspan="2">${s.couponAmount} </td>
+                    <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
+                <tr/>
+                <tr>
+                    <th>客户</th>
+                    <th colspan="6"> 供应商</th>
+                    <th colspan="5">商品费</th>
+                    <th>应付税费</th>
+                    <th>机构运费</th>
+                    <th>供应商运费</th>
+                    <th>付款状态</th>
+                    <th colspan="3">付供应商</th>
+                    <th colspan="2">付第三方</th>
                         <%--<th>成本类型</th>--%>
-                    </tr>
-                    <tr>
-                        <td> ${s.buyer}</td>
-                        <td colspan="3">${s.shopName}</td>
-                        <c:if test="${empty s.brokerage}"><td colspan="3" class="payCm-t"></td></c:if>
-                        <c:if test="${not empty s.brokerage}">
-                            <td colspan="3" class="">
-                                <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                                    <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
-                                </c:if>
-                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                    <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number" pattern="#,##0.00"/>
-                                </c:if>
-                                <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                                    <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number" pattern="#,##0.00"/>
-                                </c:if>
-                            </td>
+                </tr>
+                <tr>
+                    <td> ${s.buyer}</td>
+                    <td colspan="6">${s.shopName}</td>
+                        <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
+                    <td colspan="5" class="product-fee">${s.shopProductAmount}</td>
+                    <td class="taxes">
+                        <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
+                    </td>
+                    <td>
+                        <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}"/>
+                                </c:when>
+                                <c:otherwise>
+                                    <fmt:formatNumber value="0"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </label>
+                        <c:if test="${s.shopPostFlag == 0}">
+                            包邮
                         </c:if>
-                            <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
-                        <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
-
-                        <td class="taxes">
-                            <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
-                        </td>
-                        <td>
-                            <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}"/>
-                                    </c:when>
-                                    <c:otherwise>
-                                        <fmt:formatNumber value="0"/>
-                                    </c:otherwise>
-                                </c:choose>
-                            </label>
-                            <c:if test="${s.shopPostFlag == 0}">
-                                包邮
-                            </c:if>
-                            <c:if test="${s.shopPostFlag == 2}">
-                                到付
-                            </c:if>
-                            <c:if test="${s.shopPostFlag == -2}">
-                                仪器到付-产品包邮
-                            </c:if>
-                            <c:if test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2}">
-                                <fmt:formatNumber value="${s.shopPostFee}" type="number" pattern="#,##0.00"/>
-                                <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 class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
-                                                              pattern="#,##0.00"/></td>
-
-                        <td>
-                            <c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
-                                    color="red">待付款</font></c:if>
-                            <c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
-                            <c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if>
-                        </td>
-
-                        <td colspan="3" class="supplier-fee">
-                            <div><span class="nowrap">
+                        <c:if test="${s.shopPostFlag == 2}">
+                            到付
+                        </c:if>
+                        <c:if test="${s.shopPostFlag == -2}">
+                            仪器到付-产品包邮
+                        </c:if>
+                        <c:if test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2}">
+                            <fmt:formatNumber value="${s.shopPostFee}" type="number" pattern="#,##0.00"/>
+                            <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 class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                                                          pattern="#,##0.00"/></td>
+
+                    <td>
+                        <c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
+                                color="red">待付款</font></c:if>
+                        <c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
+                        <c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if>
+                    </td>
+
+                    <td colspan="3" class="supplier-fee">
+                        <div><span class="nowrap">
                             <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                                应付:<fmt:formatNumber value="${s.shouldPayShopAmount-s.shopOtherFee}" type="number" pattern="#,##0.00"/>
+                                应付:<fmt:formatNumber 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}"/></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>
-                            <div><span class="nowrap">待付:<input type="number"
-                                                                value="<fmt:formatNumber value="${s.waitPayShop-s.shopOtherFee}" pattern="0.00"/>"
-                                                                class="need-to-pay" data-type="${s.differenceType}"
-                                                                data-difference="${s.differencePrice}"
-                                                                data-pay="${s.shouldPayShopAmount}"
-                                                                data-payed="${s.payedShopAmount}"></span></div>
-                            <input type="hidden" name="payInfo" class="payInfo" data-shoporderid="${s.shopOrderID}"
-                                   value="${s.shopOrderID}_${s.waitPayShop}_0">
-                            <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>
+                            <span class="nowrap">已付:${s.payedShopAmount},</span></div>
+                        <div><span class="nowrap">待付:<input type="number"
+                                                            value="<fmt:formatNumber value="${s.waitPayShop-s.shopOtherFee}" pattern="0.00"/>"
+                                                            class="need-to-pay" data-type="${s.differenceType}"
+                                                            data-difference="${s.differencePrice}"
+                                                            data-pay="${s.shouldPayShopAmount}"
+                                                            data-payed="${s.payedShopAmount}"></span></div>
+                        <input type="hidden" name="payInfo" class="payInfo" data-shoporderid="${s.shopOrderID}"
+                               value="${s.shopOrderID}_${s.waitPayShop}_0">
+                        <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>--%>
-                    </tr>
-                    <tr>
-                        <th>商品名</th>
-                        <th>规格</th>
-                        <th>数量<%--(赠品)--%></th>
-                        <th>退货</th>
-                        <th colspan="2">单价</th>
-                        <th colspan="3">机构税率 / 单税费 / 总税费</th>
-                        <th colspan="2">总价</th>
-                        <th>利润(单)</th>
-                        <th>利润(总)</th>
-                        <th>平台服务费(单)</th>
-                        <th colspan="3">供应商税率 / 单税费 / 总税费</th>
-                        <th>成本(单 + 税)</th>
-                        <th>成本(总)</th>
-                    </tr>
-                    <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
-                        <tr class="pay-product-item">
-                            <input type="hidden" class="p-copId" value="${p.orderProductID}">
-                            <td style="width:300px;" class="p-name">
-                                <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
-                                <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
-                                    ${p.name}
-                            </td>
-                            <td style="width:80px;">${p.unit}</td>
-                            <td class="p-num" data-num="${p.num + p.presentNum}">
-                                    ${p.num}
-                                <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
-                            </td>
-                            <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
-                            <td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
-                                                              type="number" pattern="#,##0.00"/>
-                                <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
-                                    <label style="color: red">
-                                        (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
-                                    </label>
-                                </c:if>
-                            </td>
-                            <td>${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.taxRate?0.0:p.taxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
-                            <td>${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.addedValueTax ?0.00:p.addedValueTax}</td>
-                            <td><c:choose>
-                                <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
-                                    ---
-                                </c:when>
-                                <c:otherwise>
-                                    <fmt:formatNumber
-                                            value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}"
-                                            type="number" pattern="#,##0.00"/>
-                                </c:otherwise>
-                            </c:choose></td>
-                            <td colspan="2"><fmt:formatNumber
-                                    value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
-                                    type="number" pattern="#,##0.00"/></td>
-                            <td>
-                                <c:if test="${p.productType == 0}">
-                                    <fmt:formatNumber value="${p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)}" pattern="#,##0.00"/>
-                                </c:if>
-                                <c:if test="${p.productType != 0}">
-                                    0.00
-                                </c:if>
-                            </td>
+                </tr>
+                <tr>
+                    <th>商品名</th>
+                    <th>规格</th>
+                    <th>数量<%--(赠品)--%></th>
+                    <th>退货</th>
+                    <th colspan="3">单价</th>
+                    <th colspan="3">机构税率 / 单税费 / 总税费</th>
+                    <th colspan="2">总价</th>
+                    <th>利润(单)</th>
+                    <th>利润(总)</th>
+                    <th>平台服务费(单)</th>
+                    <th colspan="3">供应商税率 / 单税费 / 总税费</th>
+                    <th>成本(单 + 税)</th>
+                    <th>成本(总)</th>
+                </tr>
+                <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
+                    <tr class="pay-product-item">
+                        <input type="hidden" class="p-copId" value="${p.orderProductID}">
+                        <td style="width:300px;" class="p-name">
+                            <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
+                            <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
+                                ${p.name}
+                        </td>
+                        <td style="width:80px;">${p.unit}</td>
+                        <td class="p-num" data-num="${p.num + p.presentNum}">
+                                ${p.num}
+                            <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
+                        </td>
+                        <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
+                        <td colspan="3"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                                                          type="number" pattern="#,##0.00"/>
+                            <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
+                                <label style="color: red">
+                                    (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+                                </label>
+                            </c:if>
+                        </td>
+                        <td>${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.taxRate?0.0:p.taxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
+                        <td>${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.addedValueTax ?0.00:p.addedValueTax}</td>
+                        <td><c:choose>
+                            <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
+                                ---
+                            </c:when>
+                            <c:otherwise>
+                                <fmt:formatNumber
+                                        value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}"
+                                        type="number" pattern="#,##0.00"/>
+                            </c:otherwise>
+                        </c:choose></td>
+                        <td colspan="2"><fmt:formatNumber
+                                value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
+                                type="number" pattern="#,##0.00"/></td>
+                        <td>
+                            <c:if test="${p.productType == 0}">
+                                <fmt:formatNumber
+                                        value="${p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)}"
+                                        pattern="#,##0.00"/>
+                            </c:if>
+                            <c:if test="${p.productType != 0}">
+                                0.00
+                            </c:if>
+                        </td>
 
-                            <td class="payCm">
-                                <c:if test="${p.productType == 0}">
-                                    <fmt:formatNumber value="${(p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)) * (p.num + p.presentNum - p.returnedNum)}" pattern="#,##0.00"/>
-                                </c:if>
-                                <c:if test="${p.productType != 0}">
-                                    0.00
-                                </c:if>
-                            </td>
-                            <td><fmt:formatNumber value="${p.returnedNum == p.num ? 0.00 : p.cmCostPrice}" type="number" pattern="#,##0.00"/></td>
-                            <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
-                            <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
-                            <td class="p-taxes-t"><c:choose>
-                                <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
-                                    ---
-                                </c:when>
-                                <c:otherwise>
-                                    <fmt:formatNumber
-                                            value="${empty p.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
-                                            type="number" pattern="#,##0.00"/>
-                                </c:otherwise>
-                            </c:choose></td>
-                            <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
-                                                                      pattern="#,##0.00"/></td>
-                            <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
-                                                  type="number" pattern="#,##0.00"/></td>
-                        </tr>
-                    </c:forEach>
-                </table>
-            </c:forEach>
+                        <td class="payCm">
+                            <c:if test="${p.productType == 0}">
+                                <fmt:formatNumber
+                                        value="${(p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)) * (p.num + p.presentNum - p.returnedNum)}"
+                                        pattern="#,##0.00"/>
+                            </c:if>
+                            <c:if test="${p.productType != 0}">
+                                0.00
+                            </c:if>
+                        </td>
+                        <td><fmt:formatNumber value="${p.returnedNum == p.num ? 0.00 : p.cmCostPrice}" type="number"
+                                              pattern="#,##0.00"/></td>
+                        <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
+                        <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
+                        <td class="p-taxes-t"><c:choose>
+                            <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
+                                ---
+                            </c:when>
+                            <c:otherwise>
+                                <fmt:formatNumber
+                                        value="${empty p.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
+                                        type="number" pattern="#,##0.00"/>
+                            </c:otherwise>
+                        </c:choose></td>
+                        <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
+                                                                  pattern="#,##0.00"/></td>
+                        <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
+                                              type="number" pattern="#,##0.00"/></td>
+                    </tr>
+                </c:forEach>
+            </table>
+        </c:forEach>
     </div>
     <div class="payment-form-bottom">
         <div>
@@ -687,7 +715,7 @@
                         <label>付款银行:</label>
                         <span id="payType">${cmPayShop.bankNameType}
 
-						</span>
+                        </span>
                     </c:if>
                     <c:if test="${cmPayShop.status != '0'}">
                         <label>付款时间:</label>

+ 44 - 24
src/main/webapp/WEB-INF/views/modules/order/cmPayShopEdit.jsp

@@ -94,7 +94,9 @@
                         <th colspan="2">子订单金额</th>
                             <%--                        <th colspan="3">所有子订单</th>--%>
                             <%--                        <th>订单总佣金</th>--%>
-                        <th colspan="4">总平台服务费</th>
+                        <th colspan="4">采美平台服务费</th>
+                        <th>采美自营订单利润</th>
+                        <th>采美总利润</th>
                             <%--                        <th>机构运费</th>--%>
                         <th colspan="2">收款状态</th>
                         <th colspan="3">收款金额</th>
@@ -118,7 +120,41 @@
                             <%--                                    <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>--%>
                             <%--                            </c:if>--%>
                             <%--                        </td>--%>
-                        <td colspan="4">${s.allServeAmount}</td>
+                                <td colspan="4">${s.allServeAmount}</td>
+                                <c:if test="${empty s.brokerage}">
+                                <td class="payCm-t"></td>
+                                </c:if>
+                                <c:if test="${not empty s.brokerage}">
+                                <td class="">
+                                    <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                                        <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
+                                    </c:if>
+                                    <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                                        <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
+                                                          pattern="#,##0.00"/>
+                                    </c:if>
+                                    <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                                        <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
+                                                          pattern="#,##0.00"/>
+                                    </c:if>
+                                </td>
+                                </c:if>
+                                <td>
+                                    <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                                        <fmt:formatNumber value="${s.brokerage + s.allServeAmount}" type="number"
+                                                          pattern="#,##0.00"/>
+                                    </c:if>
+                                    <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                                        <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice}"
+                                                          type="number"
+                                                          pattern="#,##0.00"/>
+                                    </c:if>
+                                    <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                                        <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice}"
+                                                          type="number"
+                                                          pattern="#,##0.00"/>
+                                    </c:if>
+                                </td>
                             <%--<td>
                                 <label class="clubFreight"  style="display: none">
                                     <c:choose>
@@ -199,9 +235,8 @@
                     <tr/>
                     <tr>
                         <th>客户</th>
-                        <th colspan="3"> 供应商</th>
-                        <th colspan="3">子订单利润</th>
-                        <th colspan="3">商品费</th>
+                        <th colspan="6"> 供应商</th>
+                        <th colspan="5">商品费</th>
                         <th>应付税费</th>
                         <th>机构运费</th>
                         <th>供应商运费</th>
@@ -212,24 +247,9 @@
                     </tr>
                     <tr>
                         <td> ${s.buyer}</td>
-                        <td colspan="3">${s.shopName}</td>
-                        <c:if test="${empty s.brokerage}"><td colspan="3" class="payCm-t"></td></c:if>
-                        <c:if test="${not empty s.brokerage}">
-                            <td colspan="3" class="">
-                                <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                                    <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
-                                </c:if>
-                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                    <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number" pattern="#,##0.00"/>
-                                </c:if>
-                                <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                                    <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number" pattern="#,##0.00"/>>
-                                </c:if>
-                            </td>
-                        </c:if>
+                        <td colspan="6">${s.shopName}</td>
                             <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
-                        <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
-
+                        <td colspan="5" class="product-fee">${s.shopProductAmount}</td>
                         <td class="taxes">
                             <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
                         </td>
@@ -308,7 +328,7 @@
                         <th>规格</th>
                         <th>数量<%--(赠品)--%></th>
                         <th>退货</th>
-                        <th colspan="2">单价</th>
+                        <th colspan="3">单价</th>
                         <th colspan="3">机构税率 / 单税费 / 总税费</th>
                         <th colspan="2">总价</th>
                         <th>利润(单)</th>
@@ -332,7 +352,7 @@
                                 <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
                             </td>
                             <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
-                            <td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                            <td colspan="3"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
                                                               type="number" pattern="#,##0.00"/>
                                 <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
                                     <label style="color: red">

+ 163 - 133
src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp

@@ -379,10 +379,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>提交付款单</a></li>
@@ -421,152 +421,173 @@
                 <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="3">下单时间</th>
                         <th colspan="2">子订单金额</th>
-<%--                        <th colspan="3">所有子订单</th>--%>
-<%--                        <th>订单总佣金</th>--%>
-                        <th colspan="4">总平台服务费</th>
-<%--                        <th>机构运费</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.orderNo}(${s.orderID})</td>--%>
                         <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-<%--                        <td colspan="3"> ${s.buyer}</td>--%>
+                            <%--                        <td colspan="3"> ${s.buyer}</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="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>
-                        <%--<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 test="${empty s.brokerage}">
+                        <td class="payCm-t"></td>
                             </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 test="${not empty s.brokerage}">
+                            <td class="">
+                                <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                                    <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
                                 </c:if>
-                                <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
-                                    ¥0.00
+                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                                    <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
+                                                      pattern="#,##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 test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                                    <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
+                                                      pattern="#,##0.00"/>
                                 </c:if>
+                            </td>
                             </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>
+                            <td>
+                                <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                                    <fmt:formatNumber value="${s.brokerage + s.allServeAmount}" type="number"
+                                                      pattern="#,##0.00"/>
+                                </c:if>
+                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                                    <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice}"
+                                                      type="number"
+                                                      pattern="#,##0.00"/>
+                                </c:if>
+                                <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                                    <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice}"
+                                                      type="number"
+                                                      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>
                     <tr/>
                     <tr>
                         <th>客户</th>
-                        <th colspan="3"> 供应商</th>
-                        <th colspan="3">子订单利润</th>
-                        <th colspan="3">商品费</th>
+                        <th colspan="6"> 供应商</th>
+                        <th colspan="5">商品费</th>
                         <th>应付税费</th>
                         <th>机构运费</th>
                         <th>供应商运费</th>
                         <th>付款状态</th>
                         <th colspan="3">付供应商</th>
                         <th colspan="2">付第三方</th>
-                        <%--<th>成本类型</th>--%>
+                            <%--<th>成本类型</th>--%>
                     </tr>
                     <tr>
                         <td> ${s.buyer}</td>
-                        <td colspan="3">${s.shopName}</td>
-                        <c:if test="${empty s.brokerage}"><td colspan="3" class="payCm-t"></td></c:if>
-                        <c:if test="${not empty s.brokerage}">
-                            <td colspan="3" class="">
-                                <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                                    <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
-                                </c:if>
-                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                    <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number" pattern="#,##0.00"/>
-                                </c:if>
-                                <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                                    <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number" pattern="#,##0.00"/>
-                                </c:if>
-                            </td>
-                        </c:if>
-                         <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
-                        <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
+                        <td colspan="6">${s.shopName}</td>
+                            <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
+                        <td colspan="5" class="product-fee">${s.shopProductAmount}</td>
 
                         <td class="taxes">
                             <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
                         </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}"/>
@@ -606,13 +627,16 @@
                         <td colspan="3" class="supplier-fee">
                             <div><span class="nowrap">
                             <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                                应付:<fmt:formatNumber value="${s.shouldPayShopAmount-s.shopOtherFee}" type="number" pattern="#,##0.00"/>
+                                应付:<fmt:formatNumber 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}"/></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>
@@ -630,17 +654,17 @@
 
                         <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>
+                                <c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if>
+                                <c:if test="${s.costType == '2'}">比例成本</c:if>
+                            </td>--%>
                     </tr>
                     <tr>
                         <th>商品名</th>
                         <th>规格</th>
                         <th>数量<%--(赠品)--%></th>
                         <th>退货</th>
-                        <th colspan="2">单价</th>
+                        <th colspan="3">单价</th>
                         <th colspan="3">机构税率 / 单税费 / 总税费</th>
                         <th colspan="2">总价</th>
                         <th>利润(单)</th>
@@ -664,8 +688,9 @@
                                 <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
                             </td>
                             <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
-                            <td colspan="2">
-                                <fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}" type="number" pattern="#,##0.00"/>
+                            <td colspan="3">
+                                <fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                                                  type="number" pattern="#,##0.00"/>
                                 <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
                                     <label style="color: red">
                                         (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
@@ -689,7 +714,9 @@
                                     type="number" pattern="#,##0.00"/></td>
                             <td>
                                 <c:if test="${p.productType == 0}">
-                                    <fmt:formatNumber value="${p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)}" pattern="#,##0.00"/>
+                                    <fmt:formatNumber
+                                            value="${p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)}"
+                                            pattern="#,##0.00"/>
                                 </c:if>
                                 <c:if test="${p.productType != 0}">
                                     0.00
@@ -698,13 +725,16 @@
 
                             <td class="payCm">
                                 <c:if test="${p.productType == 0}">
-                                    <fmt:formatNumber value="${(p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)) * (p.num + p.presentNum - p.returnedNum)}" pattern="#,##0.00"/>
+                                    <fmt:formatNumber
+                                            value="${(p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)) * (p.num + p.presentNum - p.returnedNum)}"
+                                            pattern="#,##0.00"/>
                                 </c:if>
                                 <c:if test="${p.productType != 0}">
                                     0.00
                                 </c:if>
                             </td>
-                            <td><fmt:formatNumber value="${p.returnedNum == p.num ? 0.00 : p.cmCostPrice}" type="number" pattern="#,##0.00"/></td>
+                            <td><fmt:formatNumber value="${p.returnedNum == p.num ? 0.00 : p.cmCostPrice}" type="number"
+                                                  pattern="#,##0.00"/></td>
                             <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
                             <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
                             <td class="p-taxes-t"><c:choose>
@@ -1010,12 +1040,12 @@
                 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(',', ''),//供应商运费
-            clubFreight = Number(thisEle.find('.clubFreight').text().replace(',', '')),//机构运费
-            discountFee = Number(thisEle.find('.discountFee').text().replace(',', '')),//经理折扣
-            eachDiscount = Number(thisEle.find('.eachDiscount').text().replace(',',''));//分摊优惠
+                comissionEle = thisEle.find('.payCm-t'),//子订单佣金
+                thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',', ''),//付第三方
+                freightVal = thisEle.find('.freight').text().replace(',', ''),//供应商运费
+                clubFreight = Number(thisEle.find('.clubFreight').text().replace(',', '')),//机构运费
+                discountFee = Number(thisEle.find('.discountFee').text().replace(',', '')),//经理折扣
+                eachDiscount = Number(thisEle.find('.eachDiscount').text().replace(',', ''));//分摊优惠
             totalComissionEle.each(function () {
                 totalComissionVal += Number($(this).text().replace(',', ''));
             })

+ 44 - 30
src/main/webapp/WEB-INF/views/modules/order/cmPayShopPrintDetail.jsp

@@ -102,7 +102,9 @@
 							<th colspan="2">子订单金额</th>
 								<%--                        <th colspan="3">所有子订单</th>--%>
 								<%--                        <th>订单总佣金</th>--%>
-							<th colspan="4">总平台服务费</th>
+							<th colspan="4">采美平台服务费</th>
+							<th>采美自营订单利润</th>
+							<th>采美总利润</th>
 								<%--                        <th>机构运费</th>--%>
 							<th colspan="2">收款状态</th>
 							<th colspan="3">收款金额</th>
@@ -126,7 +128,41 @@
 								<%--                                    <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>--%>
 								<%--                            </c:if>--%>
 								<%--                        </td>--%>
-							<td colspan="4">${s.allServeAmount}</td>
+									<td colspan="4">${s.allServeAmount}</td>
+									<c:if test="${empty s.brokerage}">
+									<td class="payCm-t"></td>
+									</c:if>
+									<c:if test="${not empty s.brokerage}">
+									<td class="">
+										<c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+											<fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
+										</c:if>
+										<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+											<fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
+															  pattern="#,##0.00"/>
+										</c:if>
+										<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+											<fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
+															  pattern="#,##0.00"/>
+										</c:if>
+									</td>
+									</c:if>
+									<td>
+										<c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+											<fmt:formatNumber value="${s.brokerage + s.allServeAmount}" type="number"
+															  pattern="#,##0.00"/>
+										</c:if>
+										<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+											<fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice}"
+															  type="number"
+															  pattern="#,##0.00"/>
+										</c:if>
+										<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+											<fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice}"
+															  type="number"
+															  pattern="#,##0.00"/>
+										</c:if>
+									</td>
 								<%--<td>
                                     <label class="clubFreight"  style="display: none">
                                         <c:choose>
@@ -207,37 +243,20 @@
 						<tr/>
 						<tr>
 							<th>客户</th>
-							<th colspan="3"> 供应商</th>
-							<th colspan="3">子订单利润</th>
-							<th colspan="3">商品费</th>
+							<th colspan="6"> 供应商</th>
+							<th colspan="5">商品费</th>
 							<th>应付税费</th>
 							<th>机构运费</th>
 							<th>供应商运费</th>
 							<th>付款状态</th>
 							<th colspan="3">付供应商</th>
 							<th colspan="2">付第三方</th>
-							<%--<th>成本类型</th>--%>
 						</tr>
 						<tr>
 							<td> ${s.buyer}</td>
-							<td colspan="3">${s.shopName}</td>
-							<c:if test="${empty s.brokerage}"><td colspan="3" class="payCm-t"></td></c:if>
-							<c:if test="${not empty s.brokerage}">
-								<td colspan="3" class="">
-									<c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-										<fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
-									</c:if>
-									<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-										<fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number" pattern="#,##0.00"/>
-									</c:if>
-									<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-										<fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number" pattern="#,##0.00"/>
-									</c:if>
-								</td>
-							</c:if>
+							<td colspan="6">${s.shopName}</td>
 								<%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
-							<td colspan="3" class="product-fee">${s.shopProductAmount}</td>
-
+							<td colspan="5" class="product-fee">${s.shopProductAmount}</td>
 							<td class="taxes">
 								<fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
 							</td>
@@ -305,18 +324,13 @@
 							</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>--%>
 						</tr>
 						<tr>
 							<th>商品名</th>
 							<th>规格</th>
 							<th>数量<%--(赠品)--%></th>
 							<th>退货</th>
-							<th colspan="2">单价</th>
+							<th colspan="3">单价</th>
 							<th colspan="3">机构税率 / 单税费 / 总税费</th>
 							<th colspan="2">总价</th>
 							<th>利润(单)</th>
@@ -340,7 +354,7 @@
 									<c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
 								</td>
 								<td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
-								<td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+								<td colspan="3"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
 																  type="number" pattern="#,##0.00"/>
 									<c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
 										<label style="color: red">

+ 138 - 114
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopDetail.jsp

@@ -85,132 +85,151 @@
         <c:forEach items="${cmRefundShop.shopOrders}" var="s">
             <table class="table table-striped table-bordered table-condensed pay-table">
                 <tr>
-                    <th>订单编号(ID)</th>
-                    <th colspan="3">客户</th>
-                    <th colspan="2">下单时间</th>
-                    <th>订单金额</th>
-                    <th colspan="3">所有子订单</th>
-                    <th>订单总佣金</th>
-                    <th>机构运费</th>
-                    <th>收款状态</th>
+                    <th>子订单编号(ID)</th>
+                    <th colspan="3">下单时间</th>
+                    <th colspan="2">子订单金额</th>
+                    <th colspan="4">采美平台服务费</th>
+                    <th>采美自营订单利润</th>
+                    <th>采美总利润</th>
+                    <th colspan="2">收款状态</th>
                     <th colspan="3">收款金额</th>
-                    <th>经理折扣</th>
-                    <th>优惠券</th>
+                    <th colspan="2">经理折扣</th>
+                    <th colspan="2">优惠券</th>
                 </tr>
                 <tr>
-                    <td> ${s.orderNo}(${s.orderID})</td>
-                    <td colspan="3"> ${s.buyer}</td>
-                    <td colspan="2"> ${s.orderTime}</td>
-                    <td>${s.payTotalFee}</td>
-                    <td colspan="3">
-                        <c:forEach items="${s.shopOrderNos}" var="cs">
-                            ${cs}<br/>
-                        </c:forEach>
+                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                    <td colspan="3"> ${s.orderTime}</td>
+                    <td colspan="2">${s.totalAmount}</td>
+                    <td colspan="4">${s.allServeAmount}</td>
+                    <c:if test="${empty s.brokerage}">
+                    <td class="payCm-t"></td>
+                    </c:if>
+                    <c:if test="${not empty s.brokerage}">
+                    <td class="">
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                            <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
                     </td>
+                    </c:if>
                     <td>
-                        <c:if test="${empty s.brokerage}">0.00</c:if>
-                        <c:if test="${not empty s.brokerage}">${s.brokerage}</c:if>
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount}" type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice}"
+                                              type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice}"
+                                              type="number"
+                                              pattern="#,##0.00"/>
+                        </c:if>
+                    </td>
+                    <td colspan="2">
+                        <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">
+                            ${s.receiptAmount}
+                        <c:if test="${s.accountAmount>0}">(余额抵扣 ¥${s.accountAmount})</c:if>
+                    </td>
+                    <td colspan="2" >
+                        0
+<%--                        <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 lt 0}">¥0.00</c:if>--%>
+                    </td>
+                    <td class="couponAmount" colspan="2">${s.couponAmount} </td>
+                    <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
+                <tr/>
+                <tr>
+                    <th>客户</th>
+                    <th colspan="6"> 供应商</th>
+                    <th colspan="5">商品费</th>
+                    <th>应付税费</th>
+                    <th>机构运费</th>
+                    <th>供应商运费</th>
+                    <th>付款状态</th>
+                    <th colspan="3">付供应商</th>
+                    <th colspan="2">付第三方</th>
+                </tr>
+                <tr>
+                    <td> ${s.buyer}</td>
+                    <td colspan="6">${s.shopName}</td>
+                        <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
+                    <td colspan="5" class="product-fee">${s.shopProductAmount}</td>
+                    <td class="taxes">
+                        <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
                     </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 test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2 && s.returnedFreightFlag ne true}">
+                                    <fmt:formatNumber value="${s.shopPostFee}"/>
                                 </c:when>
                                 <c:otherwise>
                                     <fmt:formatNumber value="0"/>
                                 </c:otherwise>
                             </c:choose>
                         </label>
-                        <c:if test="${s.freight == 0}">
+                        <c:if test="${s.shopPostFlag == 0}">
                             包邮
                         </c:if>
-                        <c:if test="${s.freight == -1}">
+                        <c:if test="${s.shopPostFlag == 2}">
                             到付
                         </c:if>
-                        <c:if test="${s.freight == -2}">
+                        <c:if test="${s.shopPostFlag == -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.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2}">
+                            <fmt:formatNumber value="${s.shopPostFee}" type="number" pattern="#,##0.00"/>
                             <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>
-                        <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 colspan="3">
-                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
-                           style="text-decoration: underline">${s.receiptTotalFee}</a>
-                    </td>
-                    <td>
-                        <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 test="${s.discountTotalFee le 0}">¥0.00</c:if>
-                    </td>
-                    <td>${s.couponAmount} </td>
-                    <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
-                <tr/>
-                <tr>
-                    <th>子订单编号(ID)</th>
-                    <th colspan="3"> 供应商</th>
-                    <th colspan="3">子订单佣金</th>
-                    <th colspan="3">商品费</th>
-                    <th>应付税费</th>
-                    <th>供应商运费</th>
-                    <th>付款状态</th>
-                    <th colspan="3">付供应商</th>
-                    <th>付第三方</th>
-                    <th>成本类型</th>
-                </tr>
-                <tr>
-                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-                    <td colspan="3">${s.shopName}</td>
-                    <c:if test="${empty s.brokerage}"><td colspan="3" class="">0.00</td></c:if>
-                    <c:if test="${not empty s.brokerage}"><td colspan="3" class="">${s.brokerage}</td></c:if>
-                    <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
-                    <td class="taxes">
-                        <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
-                    </td>
-
                     <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
                                                           pattern="#,##0.00"/></td>
-
                     <td>
                         <c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
                                 color="red">待付款</font></c:if>
@@ -223,11 +242,7 @@
                         </div>
                         <div>退款:${s.refundAmount}</div>
                     </td>
-                    <td 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}</td>
                 </tr>
                 <tr>
                     <th>商品名</th>
@@ -236,11 +251,12 @@
                     <th>退货</th>
                     <th colspan="3">单价</th>
                     <th colspan="3">机构税率 / 单税费 / 总税费</th>
-                    <th>总价</th>
+                    <th colspan="2">总价</th>
                     <th>利润(单)</th>
                     <th>利润(总)</th>
+                    <th>平台服务费(单)</th>
                     <th colspan="3">供应商税率 / 单税费 / 总税费</th>
-                    <th>成本(单)</th>
+                    <th>成本(单 + 税)</th>
                     <th>成本(总)</th>
                 </tr>
                 <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
@@ -257,7 +273,8 @@
                             <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
                         </td>
                         <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
-                        <td colspan="3">${empty p.touchPrice?p.discountPrice:p.touchPrice }
+                        <td colspan="3"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                                                          type="number" pattern="#,##0.00"/>
                             <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
                                 <label style="color: red">
                                     (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
@@ -271,14 +288,17 @@
                                 ---
                             </c:when>
                             <c:otherwise>
-                                <fmt:formatNumber value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}" type="number" pattern="#,##0.00"/>
+                                <fmt:formatNumber
+                                        value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}"
+                                        type="number" pattern="#,##0.00"/>
                             </c:otherwise>
                         </c:choose></td>
-                        <td><fmt:formatNumber value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}" type="number" pattern="#,##0.00"/></td>
-
+                        <td colspan="2"><fmt:formatNumber
+                                value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
+                                type="number" pattern="#,##0.00"/></td>
                         <td>
                             <c:if test="${p.productType == 0}">
-                                <fmt:formatNumber value="${(empty p.touchPrice?p.discountPrice:p.touchPrice) - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)}" pattern="#,##0.00"/>
+                                <fmt:formatNumber value="${p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)}" pattern="#,##0.00"/>
                             </c:if>
                             <c:if test="${p.productType != 0}">
                                 0.00
@@ -287,13 +307,13 @@
 
                         <td class="payCm">
                             <c:if test="${p.productType == 0}">
-                                <fmt:formatNumber value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)) * (p.num + p.presentNum - p.returnedNum)}" pattern="#,##0.00"/>
+                                <fmt:formatNumber value="${(p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)) * (p.num + p.presentNum - p.returnedNum)}" pattern="#,##0.00"/>
                             </c:if>
                             <c:if test="${p.productType != 0}">
                                 0.00
                             </c:if>
                         </td>
-
+                        <td><fmt:formatNumber value="${p.returnedNum == p.num ? 0.00 : p.cmCostPrice}" type="number" pattern="#,##0.00"/></td>
                         <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
                         <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
                         <td class="p-taxes-t"><c:choose>
@@ -301,11 +321,15 @@
                                 ---
                             </c:when>
                             <c:otherwise>
-                                <fmt:formatNumber value="${empty p.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}" type="number" pattern="#,##0.00"/>
+                                <fmt:formatNumber
+                                        value="${empty p.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
+                                        type="number" pattern="#,##0.00"/>
                             </c:otherwise>
                         </c:choose></td>
-                        <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number" pattern="#,##0.00"/></td>
-                        <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}" type="number" pattern="#,##0.00"/></td>
+                        <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
+                                                                  pattern="#,##0.00"/></td>
+                        <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
+                                              type="number" pattern="#,##0.00"/></td>
                     </tr>
                 </c:forEach>
             </table>

+ 59 - 43
src/main/webapp/WEB-INF/views/modules/order/newOrderList.jsp

@@ -66,27 +66,27 @@
 <%--    </shiro:hasPermission>--%>
 </ul>
 <sys:message content="${message}"/>
-<form:form id="searchForm" modelAttribute="newOrder" onsubmit="return checkfun()" action="${ctx}/order/orderList"
+<form:form id="searchForm" modelAttribute="newShopOrder" onsubmit="return checkfun()" action="${ctx}/order/orderList"
            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 class="flex-wrap">
             <div class="item">
-                <label>订单ID:</label>
-                <form:input path="orderID" id="orderID" htmlEscape="false" maxlength="30" class="input-medium"/>
+                <label>订单ID:</label>
+                <form:input path="shopOrderID" id="shipOrderID" htmlEscape="false" maxlength="30" class="input-medium" type="number"/>
             </div>
             <div class="item">
-                <label>订单号:</label>
-                <form:input path="orderNo" htmlEscape="false" maxlength="30" class="input-medium"/>
+                <label>订单号:</label>
+                <form:input path="shopOrderNo" htmlEscape="false" maxlength="30" class="input-medium"/>
             </div>
             <div class="item">
-                <label>订单ID:</label>
-                <form:input path="shopOrderID" id="shipOrderID" htmlEscape="false" maxlength="30" class="input-medium"/>
+                <label>订单ID:</label>
+                <form:input path="orderID" id="orderID" htmlEscape="false" maxlength="30" class="input-medium"/>
             </div>
             <div class="item">
-                <label>订单号:</label>
-                <form:input path="shopOrderNo" htmlEscape="false" maxlength="30" class="input-medium"/>
+                <label>订单号:</label>
+                <form:input path="orderNo" htmlEscape="false" maxlength="30" class="input-medium"/>
             </div>
             <div class="item">
                 <label>机构:</label>
@@ -101,10 +101,10 @@
                 <form:input path="productName" class="input-large"/>
             </div>
             <div class="item">
-                <label>订单状态:</label>
+                <label>订单状态:</label>
                 <form:select path="status" class="select-ele input-medium required">
                     <form:option value="" label="所有"/>
-                    <form:options items="${fns:getDictList('order_status')}" itemLabel="label" itemValue="value"
+                    <form:options items="${fns:getDictList('shopStatus')}" itemLabel="label" itemValue="value"
                                   htmlEscape="false"/>
                 </form:select>
             </div>
@@ -135,11 +135,10 @@
 
             <div class="item">
                 <label>退款状态:</label>
-                <form:select path="refundType" class="select-ele input-medium required">
+                <form:select path="refundStatus" class="select-ele input-medium required">
                     <form:option value="" label="所有"/>
-                    <form:option value="0" label="无退款"/>
-                    <form:option value="1" label="部分退款"/>
-                    <form:option value="2" label="已退款"/>
+                    <form:option value="1" label="无退款"/>
+                    <form:option value="3" label="有退款"/>
                 </form:select>
             </div>
             <div class="item">
@@ -176,7 +175,7 @@
             </div>
             <div class="item">
                 <label>返佣订单:</label>
-                <form:select path="rebateOrder" class="select-ele input-medium required">
+                <form:select path="rebateFlag" class="select-ele input-medium required">
                     <form:option value="" label="请选择"/>
                     <form:option value="1" label="是"/>
                     <form:option value="0" label="否"/>
@@ -229,8 +228,8 @@
 <fmt:formatDate value="<%=new Date()%>" var="monthFirst" pattern="yyyy-MM-01"/>
 <div class="data-title">
     <ul>
-        <li style="width: 190px; ">订单ID(订单编号)</li>
         <li style="width: 195px; ">子订单ID(子订单编号)</li>
+        <li style="width: 190px; ">订单ID(订单编号)</li>
         <li>订单类型</li>
         <li>返佣订单</li>
 <%--        <li>二手订单</li>--%>
@@ -238,13 +237,14 @@
         <li>收货人</li>
         <li>订单来源</li>
 <%--        <li>订单状态</li>--%>
+        <li>子订单状态</li>
         <li>收款状态</li>
         <li>付款状态</li>
         <li>发货状态</li>
         <li>退款状态</li>
         <li>待审核退款</li>
-        <li>订单金额</li>
-        <li>返佣服务费</li>
+        <li>订单金额</li>
+<%--        <li>返佣服务费</li>--%>
         <li>下单时间</li>
 <%--        <li>确认时间</li>--%>
         <li>操作</li>
@@ -252,8 +252,8 @@
     <c:forEach items="${page.list}" var="order">
         <%--颜色区分分期不分期订单以及终止订单--%>
         <ul class="spileOrder" data-id="${order.orderNo}">
+            <li style="position: relative"><b style="font-size: 15px;">${order.shopOrderID}</b>(${order.shopOrderNo})</li>
             <li><b style="font-size: 15px;">${order.orderID}</b>(${order.orderNo})</li>
-            <li style="position: relative">${order.shopOrderNoAndId}</li>
             <li>
                 <c:if test="${order.orderType == 1}">
                     自主订单
@@ -267,13 +267,12 @@
                 <c:if test="${order.orderType > 1}">
                     ---
                 </c:if>
-
             </li>
             <li>
-                <c:if test="${order.rebateOrder == '0'}">
+                <c:if test="${order.rebateFlag == 0}">
                 </c:if>
-                <c:if test="${order.rebateOrder ne '0'}">
+                <c:if test="${order.rebateFlag ne 0}">
                 </c:if>
             </li>
@@ -305,6 +304,26 @@
 <%--                </c:if>--%>
 <%--                <c:if test="${order.status eq 0 || order.status eq 4 || order.status eq 5 || order.status eq 6 || order.status eq 7}">${fns:getDictLabel(order.status,"order_detail_status","" )}</c:if>--%>
 <%--            </li>--%>
+            <li>
+                <c:if test="${order.shopStatus == 0}">
+                    <font color="red">待确认</font>
+                </c:if>
+                <c:if test="${order.shopStatus == 1}">
+                    <font color="green">交易中</font>
+                </c:if>
+                <c:if test="${order.shopStatus == 2}">
+                    <font color="green">交易完成</font>
+                </c:if>
+                <c:if test="${order.shopStatus == 3}">
+                    <font color="green">订单完成</font>
+                </c:if>
+                <c:if test="${order.shopStatus == 4}">
+                    <font color="red">已关闭</font>
+                </c:if>
+                <c:if test="${order.shopStatus == 5}">
+                    <font color="red">交易全退</font>
+                </c:if>
+            </li>
             <li>
                 <c:if test="${order.receiptStatus == 1}">
                     <font color="red">待收款</font>
@@ -321,7 +340,7 @@
                     <c:if test="${order.receiptOrderFlag}">
                         一款多单:少收抹平金额未知
                     </c:if>
-                    <c:if test="${!order.receiptOrderFlag}">
+                    <c:if test="${!order.receiptOrderFlag}">tui
                         <font>少收抹平:<br>
                             ¥<fmt:formatNumber
                                     value="${order.payableAmount - (empty order.orderReceivedAmount ? 0 : order.orderReceivedAmount)}"
@@ -377,19 +396,16 @@
                 </c:if>
             </li>
             <li>
-                <c:if test="${order.refundType == 1}">
-                      <font>部分退款</font>
-                </c:if>
-                <c:if test="${order.refundType == 2}">
-                      <font>已退款</font>
+                <c:if test="${order.refundStatus == 1}">
+                      <font>无退款</font>
                 </c:if>
-                <c:if test="${order.refundType ne 1 and order.refundType ne 2 }">
-                     <font>无退款</font>
+                <c:if test="${order.refundStatus == 3}">
+                      <font>有退款</font>
                 </c:if>
             </li>
             <li>
-                <c:if test="${order.returnedPurchaseStatus == 1}">
-                    <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByOrderID.rpc?orderID=${order.orderID}">
+                <c:if test="${order.returnedPurchaseStatus > 0}">
+                    <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecord.rpc?shopOrderID=${order.shopOrderID}&orderID=${order.orderID}">
                     </a>
                 </c:if>
@@ -398,16 +414,16 @@
                 </c:if>
             </li>
             <li>                    <%-- 订单金额 --%>
-                <fmt:formatNumber value="${order.payTotalFee}" type="currency"/>
-            </li>
-            <li>                    <%-- 返佣服务费 --%>
-                <c:if test="${not empty order.rebateFee}">
-                <fmt:formatNumber value="${order.rebateFee}" type="currency"/>
-                </c:if>
-                <c:if test="${empty order.rebateFee}">
-                    ---
-                </c:if>
+                <fmt:formatNumber value="${order.needPayAmount}" type="currency"/>
             </li>
+<%--            <li>                    &lt;%&ndash; 返佣服务费 &ndash;%&gt;--%>
+<%--                <c:if test="${not empty order.rebateFee}">--%>
+<%--                <fmt:formatNumber value="${order.rebateFee}" type="currency"/>--%>
+<%--                </c:if>--%>
+<%--                <c:if test="${empty order.rebateFee}">--%>
+<%--                    -----%>
+<%--                </c:if>--%>
+<%--            </li>--%>
             <li>${order.orderTime}</li>
 <%--            <li>--%>
 <%--                <c:if test="${empty order.confirmTime}">--%>
@@ -418,7 +434,7 @@
 <%--                </c:if>--%>
 <%--            </li>--%>
             <li class="operation-wrap">
-                <a href="${ctx}/order/detail?id=${order.orderID}&returnGoodsStutas=${order.returnGoodsStutas}">查看详情</a>
+                <a href="${ctx}/shopOrder/detail?id=${order.shopOrderID}">查看详情</a>
             </li>
         </ul>
     </c:forEach>

+ 41 - 8
src/main/webapp/WEB-INF/views/modules/order/refundRecord.jsp

@@ -95,8 +95,7 @@
     <div class="pay-list-item">
         <table class="table table-striped table-bordered table-condensed pay-table">
             <tr class="t1">
-                <th colspan="2">子订单编号(ID)</th>
-                <th colspan="2">母订单编号(ID)</th>
+                <th>子订单编号(ID)</th>
                 <th>下单时间</th>
                 <th>订单金额</th>
                 <th>订单状态</th>
@@ -107,16 +106,18 @@
                 <th>应付金额</th>
                 <th>已付金额</th>
                 <th>结算状态</th>
+                <th>采美平台服务费</th>
+                <th>采美自营订单利润</th>
+                <th>采美总利润</th>
                 <th>应结金额</th>
                 <th>已结金额</th>
                 <th>退款状态</th>
                 <th>退款金额</th>
                 <th>优惠券</th>
-                <th>经理折扣</th>
+                <th colspan="2">经理折扣</th>
             </tr>
             <tr>
-                <td colspan="2">${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})</td>
-                <td colspan="2">${shopOrder.orderNo}(${shopOrder.orderID})</td>
+                <td>${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})</td>
                 <td>${shopOrder.orderTime}</td>
                 <td><fmt:formatNumber value="${shopOrder.totalAmount}" type="number" pattern="#,##0.00"/></td>
                 <td>
@@ -164,6 +165,36 @@
                     <c:if test="${shopOrder.settleStatus  == 2}"><font color="green">部分结算</font></c:if>
                     <c:if test="${shopOrder.settleStatus == 3}"><font color="red">已结算</font></c:if>
                 </td>
+                <td>${shopOrder.allServeAmount}</td>
+                <td>
+                    <c:if test="${shopOrder.differenceType ne 1 && shopOrder.differenceType ne 2}">
+                        <fmt:formatNumber value="${shopOrder.brokerage}" type="number" pattern="#,##0.00"/>
+                    </c:if>
+                    <c:if test="${shopOrder.differenceType eq 1 && shopOrder.differencePrice > 0}">
+                        <fmt:formatNumber value="${shopOrder.brokerage-shopOrder.differencePrice}" type="number"
+                                          pattern="#,##0.00"/>
+                    </c:if>
+                    <c:if test="${shopOrder.differenceType eq 2 && shopOrder.differencePrice > 0}">
+                        <fmt:formatNumber value="${shopOrder.brokerage+shopOrder.differencePrice}" type="number"
+                                          pattern="#,##0.00"/>
+                    </c:if>
+                </td>
+                <td>
+                    <c:if test="${shopOrder.differenceType ne 1 && shopOrder.differenceType ne 2}">
+                        <fmt:formatNumber value="${shopOrder.brokerage + shopOrder.allServeAmount}" type="number"
+                                          pattern="#,##0.00"/>
+                    </c:if>
+                    <c:if test="${shopOrder.differenceType eq 1 && shopOrder.differencePrice > 0}">
+                        <fmt:formatNumber value="${shopOrder.brokerage + shopOrder.allServeAmount - shopOrder.differencePrice}"
+                                          type="number"
+                                          pattern="#,##0.00"/>
+                    </c:if>
+                    <c:if test="${shopOrder.differenceType eq 2 && shopOrder.differencePrice > 0}">
+                        <fmt:formatNumber value="${shopOrder.brokerage + shopOrder.allServeAmount + shopOrder.differencePrice}"
+                                          type="number"
+                                          pattern="#,##0.00"/>
+                    </c:if>
+                </td>
                 <td>
                     <fmt:formatNumber value="${shopOrder.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
                 </td>
@@ -182,9 +213,10 @@
                 <td>
                     <fmt:formatNumber value="${shopOrder.couponAmount}" type="number" pattern="#,##0.00"/>
                 </td>
-                <td><fmt:formatNumber value="${shopOrder.discountFee}" type="number" pattern="#,##0.00"/></td>
+                <td colspan="2"><fmt:formatNumber value="${shopOrder.discountFee}" type="number" pattern="#,##0.00"/></td>
             </tr>
             <tr class="t2">
+                <th>母订单编号(ID)</th>
                 <th colspan="3">机构</th>
                 <th colspan="3">供应商</th>
                 <th colspan="2">商品费</th>
@@ -198,6 +230,7 @@
                 <th colspan="2">成本类型</th>
             </tr>
             <tr class="t2">
+                <td>${shopOrder.orderNo}(${shopOrder.orderID})</td>
                 <td colspan="3">
                     <c:if test="${shopOrder.organizeID eq 1}"><span class="org-note">星范</span></c:if>
                     ${shopOrder.clubName}
@@ -253,7 +286,7 @@
                         test="${shopOrdercostType == '2'}">比例成本</c:if></td>
             </tr>
             <tr>
-                <th colspan="3">商品名</th>
+                <th colspan="4">商品名</th>
                 <th>规格</th>
                 <th>数量<%--(赠品)--%></th>
                 <th>退货</th>
@@ -267,7 +300,7 @@
             <c:forEach items="${shopOrder.newOrderProducts}" var="p" varStatus="pIndex">
                 <tr class="pay-product-item">
                     <input type="hidden" class="p-copId" value="${p.orderProductID}">
-                    <td style="width:300px;" class="p-name" colspan="3">
+                    <td style="width:300px;" class="p-name" colspan="4">
                         <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
                         <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
                             ${p.name}

+ 1073 - 0
src/main/webapp/WEB-INF/views/modules/order/shopOrderDetail.jsp

@@ -0,0 +1,1073 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<html>
+<head>
+    <title>订单列表</title>
+    <meta name="decorator" content="default"/>
+    <link href="${ctxStatic}/modules/order/order-details.css" rel="stylesheet">
+    <script type="text/javascript" src="${ctxStatic}/QRCode/jquery.qrcode.min.js"></script>
+    <script type="text/javascript" src="static/common/clipboard.min.js"></script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+
+    <li class="active"><a href="${ctx}/shopOrder/detail?id=${order.shopOrderID}">订单详情</a></li>
+    <shiro:hasPermission name="order:order:view">
+        <li><a href="${ctx}/order/orderList">订单列表</a></li>
+    </shiro:hasPermission>
+    <shiro:hasPermission name="order:order:secondhandOrder">
+        <li><a href="${ctx}/order/secondhandOrderList">二手订单列表</a></li>
+    </shiro:hasPermission>
+</ul>
+<sys:message content="${message}"/>
+<table class="order-details-heading">
+    <tr>
+        <td>下单时间: ${order.orderTime}</td>
+        <td>子订单ID(子订单编号): <b style="font-size: 15px;">${order.shopOrderID}</b>(${order.shopOrderNo})</td>
+        <td>订单ID(订单编号): <b style="font-size: 15px;">${order.orderID}</b>(${order.orderNo})</td>
+    </tr>
+
+    <tr>
+        <td>订单类型: <c:if test="${order.orderType == 1}">自主订单</c:if><c:if test="${order.orderType == 0}">协销订单</c:if></td>
+        <td>订单来源: ${fns:getDictLabel(order.orderSource,"bp_orderSource","" )}</td>
+        <td>返佣订单: ${(order.rebateOrder ne '0' || order.rebateFlag eq '1')?'是':'否'}</td>
+    </tr>
+
+    <tr>
+        <td>机构:${order.buyer}
+            <font id="svipFlagLabel" style="margin-left:0px" color="red">
+                <%--                <c:if test="${order.bpOrderUserinfo.firstClubType eq 1 and order.bpOrderUserinfo.svipFlag eq 1}">--%>
+                <%--                    (医美机构,超级会员)--%>
+                <%--                </c:if>--%>
+                <%--                <c:if test="${order.bpOrderUserinfo.firstClubType eq 1 and order.bpOrderUserinfo.svipFlag eq null}">--%>
+                <%--                    ${order.bpOrderUserinfo.firstClubType eq 1?'(医美机构)':''}--%>
+                <%--                </c:if>--%>
+                <%--                <c:if test="${order.bpOrderUserinfo.firstClubType eq null and order.bpOrderUserinfo.svipFlag eq 1}">--%>
+                <%--                    ${order.bpOrderUserinfo.svipFlag eq 1?'(超级会员)':''}--%>
+                <%--                </c:if>--%>
+                <c:if test="${order.organizeID == 4}">(联合丽格)</c:if>
+            </font>
+        </td>
+        <td>收货人: ${order.receiver}</td>
+        <td>手机: ${order.mobile}</td>
+    </tr>
+
+    <%--    <tr>--%>
+    <%--        <td>--%>
+    <%--            收款状态:--%>
+    <%--            <c:if test="${order.receiptStatus == 1}">--%>
+    <%--                <font color="red">待收款</font>--%>
+    <%--            </c:if>--%>
+    <%--            <c:if test="${order.receiptStatus == 2}">--%>
+    <%--                <font color="#ff8c00">部分收款</font>--%>
+    <%--            </c:if>--%>
+    <%--            <c:if test="${order.receiptStatus == 3}">--%>
+    <%--                <font color="green">已收款</font>--%>
+    <%--            </c:if>--%>
+    <%--        </td>--%>
+
+    <%--        <td>发货状态:--%>
+    <%--            <c:if test="${order.sendOutStatus == 1}">--%>
+    <%--                <font color="red">待发货</font>--%>
+    <%--            </c:if>--%>
+    <%--            <c:if test="${order.sendOutStatus == 2}">--%>
+    <%--                <font color="#ff8c00">部分发货</font>--%>
+    <%--            </c:if>--%>
+    <%--            <c:if test="${order.sendOutStatus == 3}">--%>
+    <%--                <font color="green">已发货</font>--%>
+    <%--            </c:if></td>--%>
+    <%--        <td>付款状态:--%>
+    <%--            <c:if test="${order.payStatus == 1}">--%>
+    <%--                <font color="red">待付款</font>--%>
+    <%--            </c:if>--%>
+    <%--            <c:if test="${order.payStatus == 2}">--%>
+    <%--                <font color="#ff8c00">部分付款</font>--%>
+    <%--            </c:if>--%>
+    <%--            <c:if test="${order.payStatus == 3}">--%>
+    <%--                <font color="green">已付款</font>--%>
+    <%--            </c:if></td>--%>
+    <%--        </td>--%>
+    <%--    </tr>--%>
+
+    <tr>
+        <td>
+            退款状态:
+            <c:if test="${order.refundStatus == 1}">
+                <font>无退款</font>
+            </c:if>
+            <c:if test="${order.refundStatus == 3}">
+                <font>有退款</font>
+            </c:if>
+        </td>
+        <td>机构:${order.buyer}
+            <font id="svipFlagLabel" style="margin-left:0px" color="red">
+                <%--                <c:if test="${order.bpOrderUserinfo.firstClubType eq 1 and order.bpOrderUserinfo.svipFlag eq 1}">--%>
+                <%--                    (医美机构,超级会员)--%>
+                <%--                </c:if>--%>
+                <%--                <c:if test="${order.bpOrderUserinfo.firstClubType eq 1 and order.bpOrderUserinfo.svipFlag eq null}">--%>
+                <%--                    ${order.bpOrderUserinfo.firstClubType eq 1?'(医美机构)':''}--%>
+                <%--                </c:if>--%>
+                <%--                <c:if test="${order.bpOrderUserinfo.firstClubType eq null and order.bpOrderUserinfo.svipFlag eq 1}">--%>
+                <%--                    ${order.bpOrderUserinfo.svipFlag eq 1?'(超级会员)':''}--%>
+                <%--                </c:if>--%>
+                <c:if test="${order.organizeID == 4}">(联合丽格)</c:if>
+            </font>
+        </td>
+    </tr>
+
+    <tr>
+        <td>
+            地址: ${fns:appendLast(fns:appendLast1(order.bpOrderUserinfo.province,order.bpOrderUserinfo.city,order.bpOrderUserinfo.town), order.bpOrderUserinfo.address)}
+        </td>
+        <td>订单可见度:${order.orderSeen eq 1 ? '对机构可见':'对机构不可见'}</td>
+        <td style="position: relative;"><a class="operation-btn btn"
+                                           onclick="operation(${order.shopOrderID})">功能</a>
+            <div style="position: absolute;">
+                <div class="operation-block ${order.shopOrderID}" style="position: sticky;">
+                    <shiro:hasPermission name="order:order:edit">
+                        <%--包含订单充值商品就不显示--%>
+                        <c:if test="${order.status == 0}">
+                            <a href="${ctx}/order/confirmOrder?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}"
+                               onclick="return confirmx('是否确认订单?', this.href)">确认订单</a>
+                        </c:if>
+                    </shiro:hasPermission>
+
+
+                    <shiro:hasPermission name="order:order:edit">
+                        <%--包含订单充值商品就不显示--%>
+                        <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}">发货记录</a>
+                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toShopOrderRefundRecord.rpc?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}&from=2">收付款记录</a>
+                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByShopOrder.rpc?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}">退款(退货)记录</a>
+                        <c:if test="${order.status != 4 and order.payStatus eq 1 and order.receiptStatus eq 1 and order.sendOutStatus eq 1}">
+                            <a href="${ctx}/order/cancelShopOrder?shopOrderId=${order.shopOrderID}"
+                               onclick="return confirmx('是否取消订单?', this.href)">取消订单</a>
+                        </c:if>
+<%--                                                <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2&shopOrderID=${order.shopOrderID}">订单备注</a>--%>
+                    </shiro:hasPermission>
+                </div>
+            </div>
+        </td>
+        <fmt:setLocale value="zh_CN" scope="session"/>
+    </tr>
+
+</table>
+<textarea id="copyValue" style="display: none"></textarea>
+<%--<div class="remarks">--%>
+<%--    <div class="remarkButton">--%>
+<%--        订单备注--%>
+<%--        <a onclick="hideRemarks();">收起</a>--%>
+<%--    </div>--%>
+<%--    <button id="addButton" class="btn btn-primary" onclick="">--%>
+<%--        添加备注--%>
+<%--        &lt;%&ndash;        <a class="jumpRemark"&ndash;%&gt;--%>
+<%--        &lt;%&ndash;           href="${ctx}/order/cmOrderRemark/toAddRemarksViewNew.rpc?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}&orderType=${order.orderType}">添加备注</a>&ndash;%&gt;--%>
+<%--    </button>--%>
+<%--    <c:if test="${not empty remarksList}">--%>
+<%--        <div style="overflow-x: hidden;word-break:break-all">--%>
+<%--            <c:forEach items="${remarksList}" var="list" varStatus="remark">--%>
+<%--                <div class="td clear">--%>
+<%--                    <div style="font-weight: bold;width: 100%;float: left;">--%>
+<%--                        <span style="float: left;">${list.sysUserName}[${list.no}]</span>--%>
+<%--                        <span style="float: left;margin-left:10px;"><fmt:formatDate value="${list.createDate}"--%>
+<%--                                                                                    pattern="yyyy-MM-dd HH:mm"/></span>--%>
+<%--                    </div>--%>
+<%--                    <div class="td-text" style="width: 100%;float: left;margin-top: 20px;">--%>
+<%--                        <div style="width: 100px;font-weight: bold;margin: 10px 0;float: left;text-align: right;margin-right: 10px;">--%>
+<%--                            备注内容:--%>
+<%--                        </div>--%>
+<%--                        <div style="width: 1000px;float: left;margin: 10px 0;">--%>
+<%--                                ${list.remarks}--%>
+<%--                        </div>--%>
+<%--                    </div>--%>
+<%--                    <div class="td-text"--%>
+<%--                         style="width: 100%;float: left;margin-top: 20px;border-bottom:1px dashed #999999;padding: 10px 0;">--%>
+<%--                        <c:if test="${not empty list.cmOrderRemarkImageList}">--%>
+<%--                            <div style="width: 100px;font-weight: bold;margin: 10px 0;float: left;text-align: right;margin-right: 10px;">--%>
+<%--                                图片:--%>
+<%--                            </div>--%>
+<%--                            <div style="width: 1000px;float: left;">--%>
+<%--                                <c:forEach items="${list.cmOrderRemarkImageList}" var="remarkImageList"--%>
+<%--                                           varStatus="remarkImage">--%>
+<%--                                    <a href="${remarkImageList.remarkImage}" target="_blank">--%>
+<%--                                        <img class="enlarge-pic" style="height: 150px;width: 150px;margin-top: 10px"--%>
+<%--                                             src="${remarkImageList.remarkImage}">&nbsp;--%>
+<%--                                    </a>--%>
+<%--                                </c:forEach>--%>
+<%--                            </div>--%>
+<%--                        </c:if>--%>
+<%--                    </div>--%>
+<%--                    <div class="td-text"--%>
+<%--                         style="width: 100%;float: left;margin-top: 20px;border-bottom:1px dashed #999999;padding: 10px 0;">--%>
+<%--                        <c:if test="${not empty list.remarkFileList}">--%>
+<%--                            <div style="width: 100px;font-weight: bold;margin: 10px 0;float: left;text-align: right;margin-right: 10px;">--%>
+<%--                                文件:--%>
+<%--                            </div>--%>
+<%--                            <div style="width: 1000px;float: left;margin: 10px 0;">--%>
+<%--                                <c:forEach items="${list.remarkFileList}" var="item" varStatus="remarkFile">--%>
+<%--                                    <p>${item.name}&nbsp;&nbsp;&nbsp;&nbsp;<a--%>
+<%--                                            href="${ctx}/order/cmOrderRemark/downFile?fileId=${item.id}">下载</a></p>--%>
+<%--                                </c:forEach>--%>
+<%--                            </div>--%>
+<%--                        </c:if>--%>
+<%--                    </div>--%>
+<%--                </div>--%>
+<%--            </c:forEach>--%>
+<%--        </div>--%>
+<%--    </c:if>--%>
+<%--    <c:if test="${empty remarksList}">--%>
+<%--        <font size="3" style="text-align: center;display: block;line-height: 80px;" color="#0066CC">暂无备注信息,有需要请您前往添加订单备注。</font>--%>
+<%--    </c:if>--%>
+<%--</div>--%>
+<div class="remarkShow">
+    <b>订单备注<a onclick="openRemarks(${order.orderID},${order.shopOrderID})" style="color: white">展开 《</a></b>
+</div>
+<div class="order-rows">
+    <div>
+        <span><label>子订单状态:</label>${fns:getDictLabel(order.status,"shopStatus","" )}</span>
+
+        <span>运费:${order.postageInfo}</span>
+
+        <span>子订单总额:<fmt:formatNumber value="${order.totalAmount}" type="currency"/></span>
+
+        <span>应收金额:
+            <c:if test="${order.realPay!=null}"><fmt:formatNumber value="${order.realPay}"
+                                                                  type="currency"/></c:if>
+            <c:if test="${order.realPay==null}"><fmt:formatNumber value="${order.needPayAmount}"
+                                                                  type="currency"/></c:if>
+        </span>
+
+        <span>
+                已收金额:<fmt:formatNumber value="${order.receiptAmount}" type="currency"/>
+                <c:if test="${order.useBalanceFlag eq 1 and order.accountAmount ne null}">(余额抵扣¥${order.accountAmount})</c:if>
+        </span>
+    </div>
+
+    <div>
+        <span>商品总额:<fmt:formatNumber value="${order.productAmount}" type="currency"/></span>
+        <span>
+                收款状态:
+                            <c:if test="${order.shopReceiptStatus == 1}">
+                                <font color="red">待收款</font>
+                            </c:if>
+                            <c:if test="${order.shopReceiptStatus == 2}">
+                                <font color="#ff8c00">部分收款</font>
+                            </c:if>
+                            <c:if test="${order.shopReceiptStatus == 3}">
+                                <font color="green">已收款</font>
+                            </c:if>
+                            <%--抹平明细--%>
+                            <c:if test="${order.confirmType eq 1}">
+                                <c:if test="${order.receiptOrderFlag}">
+                                    <font color="red">(一款多单:少收抹平金额未知)</font>
+                                </c:if>
+                                <c:if test="${!order.receiptOrderFlag}">
+                                    <font color="red">(少收抹平:
+                                        ¥<fmt:formatNumber
+                                                value="${order.needPayAmount - (empty order.orderReceivedAmount ? 0 : order.orderReceivedAmount)}"
+                                                pattern="#0.00"/>)
+                                    </font>
+                                </c:if>
+                            </c:if>
+                            <c:if test="${order.confirmType eq 2}">
+                                <c:if test="${order.receiptOrderFlag}">
+                                    <font color="red">(一款多单:多收抹平金额未知)</font>
+                                </c:if>
+                                <c:if test="${!order.receiptOrderFlag}">
+                                    <font color="red">(多收抹平:
+                                        ¥<fmt:formatNumber
+                                                value="${(empty order.receiptAmount ? 0 : order.orderReceivedAmount) - order.payableAmount}"
+                                                pattern="#0.00"/>)
+                                    </font>
+                                </c:if>
+                            </c:if>
+                            <c:if test="${order.confirmType eq 3}">
+                                <c:if test="${order.receiptOrderFlag}">
+                                    <font color="red">(一款多单:多收退余额)</font>
+                                </c:if>
+                                <c:if test="${!order.receiptOrderFlag}">
+                                    <font color="red">(多收退余额&nbsp;&nbsp;${order.associationType eq 2 ? "(自动)" : ""}:
+                                        ¥<fmt:formatNumber
+                                                value="${(empty order.returnBalanceAmount ? 0 : order.returnBalanceAmount)}"
+                                                pattern="#0.00"/>)
+                                    </font>
+                                </c:if>
+                            </c:if>
+        </span>
+
+        <span>发货状态:
+                            <c:if test="${order.sendOutStatus == 1}">
+                                <font color="red">待发货</font>
+                            </c:if>
+                            <c:if test="${order.sendOutStatus == 2}">
+                                <font color="#ff8c00">部分发货</font>
+                            </c:if>
+                            <c:if test="${order.sendOutStatus == 3}">
+                                <font color="green">已发货</font>
+                            </c:if>
+        </span>
+        <span>付款状态:
+                            <c:if test="${order.payStatus == 1}">
+                                <font color="red">待付款</font>
+                            </c:if>
+                            <c:if test="${order.payStatus == 2}">
+                                <font color="#ff8c00">部分付款</font>
+                            </c:if>
+                            <c:if test="${order.payStatus == 3}">
+                                <font color="green">已付款</font>
+                            </c:if>
+        </span>
+        <span>退款状态:
+                                <c:if test="${order.refundStatus == 1}">
+                                    <font>无退款</font>
+                                </c:if>
+                                <c:if test="${order.refundStatus == 3}">
+                                    <font>已退款</font>
+                                </c:if>
+        </span>
+    </div>
+
+    <div>
+        <span>待收金额:<fmt:formatNumber value="${order.restAmount}" type="currency"/></span>
+    </div>
+</div>
+<div class="order-rows">
+    <span><label>供应商:</label>${order.shopName}</span>
+    <c:if test="${order.contactName ne null}">
+        <span><label>供应商联系人:</label>${order.contactName}</span>
+    </c:if>
+    <c:if test="${order.dockingPeopleName ne null}">
+        <span><label>采美对接人:</label>${order.dockingPeopleName}</span>
+    </c:if>
+    <c:if test="${order.shopPromotion ne null && order.shopPromotion.type eq 3}">
+        <c:if test="${order.shopPromotion.mode eq 2}">
+                <span><label
+                        style="background-color: #F60;color: white">${order.shopPromotion.name}</label> 满<fmt:formatNumber
+                        value="${order.shopPromotion.touchPrice}" pattern="#,##0.00"
+                        maxFractionDigits="2"/>,减<fmt:formatNumber value="${order.shopPromotion.reducedPrice}"
+                                                                   pattern="#,##0.00" maxFractionDigits="2"/></span>
+        </c:if>
+        <c:if test="${order.shopPromotion.mode eq 3}">
+                <span><label
+                        style="background-color: purple;color: white">${order.shopPromotion.name}</label> 满<fmt:formatNumber
+                        value="${order.shopPromotion.touchPrice}" pattern="#,##0.00"
+                        maxFractionDigits="2"/>,赠送商品</span>
+        </c:if>
+    </c:if>
+    <div>
+        <c:forEach items="${order.newOrderProducts}" var="op" varStatus="varIndex">
+        <c class="supplier-product-item" style="z-index:${100000 - varIndex.index};position:relative;">
+                <%--二手订单详情--%>
+            <c:if test="${order.secondHandOrderFlag eq 1}">
+            <a href="${fns:getConfig('wwwServer')}flea-market-${op.productID}.html" target="_blank">
+                <img class="supplier-img" src="${op.image}" style="width: 100px"/>
+            </a>
+            </c:if>
+                <%--正常订单详情--%>
+            <c:if test="${order.secondHandOrderFlag ne 1}">
+            <a href="${fns:getConfig('wwwServer')}product-${op.productID}.html" target="_blank">
+                <img class="supplier-img" src="${op.image}" style="width: 100px"/>
+            </a>
+            </c:if>
+            <c:if test="${order.organizeID != 4}">
+            <div class="supplier-name">
+                <c:if test="${op.name eq op.aliasName || op.productID eq 6060}">
+                    <div class="supplier-product-name">${op.name}</div>
+                </c:if>
+                <c:if test="${op.name ne op.aliasName && op.productID ne 6060}">
+                    <div class="supplier-product-name">${op.name}</div>
+                    <div class="supplier-product-alias">${op.aliasName}</div>
+                </c:if>
+                <c:if test="${op.productType eq 1}">
+                    <div class="supplier-product-name"><label style="color: red">协商赠品</label></div>
+                </c:if>
+                <c:if test="${op.productType eq 2}">
+                    <div class="supplier-product-name"><label style="color: red">促销赠品</label></div>
+                </c:if>
+                <c:if test="${op.includedTax eq 1}">
+                    <div class="supplier-product-name"><label style="color: red">(含税)</label></div>
+                </c:if>
+                <c:if test="${op.includedTax ne '' and op.includedTax eq 0}">
+                    <c:if test="${op.invoiceType eq 3 }">
+                        <div class="supplier-product-name"><label style="color: red">(不含税-不能开票)</label></div>
+                    </c:if>
+                    <c:if test="${op.invoiceType eq 2 or op.invoiceType eq 1}">
+                        <div class="supplier-product-name"><label style="color: red">(不含税-能开票)</label></div>
+                    </c:if>
+                </c:if>
+                <c:if test="${op.machineType eq 3}">
+                    <div class="supplier-product-name"><font style="font-size: 16px" color="red">械字号三类</font></div>
+                </c:if>
+            </div>
+            </c:if>
+            <c:if test="${op.productID ne 999}">
+            <div class="supplier-product-info">
+                            <span>
+                                规格:
+                                <label>${op.unit}</label>
+                            </span>
+                <span>单价:
+                                <c:if test="${op.svipPriceFlag eq 1 or op.productPromotion.mode eq 1}">
+                                    <label style="text-decoration: line-through"><fmt:formatNumber value="${op.price}"
+                                                                                                   type="currency"/></label>
+                                </c:if>
+                                <c:if test="${op.svipPriceFlag ne 1 and op.productPromotion.mode ne 1}">
+                                    <fmt:formatNumber value="${op.price}" type="currency"/>
+                                </c:if>
+                                <c:if test="${op.svipPriceFlag eq 1}">
+                                    <label style="margin-left:5px"><fmt:formatNumber value="${op.discountPrice}"
+                                                                                     type="currency"/></label>
+                                    <font color="red">(超级会员价)</font></span>
+                </c:if>
+                <c:if test="${op.ladderPriceFlag eq 1 || op.isActProduct eq 2}">
+                    <a href="javascript:;" class="ladderPrice"><span> (阶梯价格)</span>
+                        <c:if test="${not empty op.orderProductLadderPriceList}">
+                            <div class="list">
+                                <p><span>起订量</span><span>价格</span></p>
+                                <c:forEach items="${op.orderProductLadderPriceList}" var="ladderPrice">
+                                    <p data-num="${ladderPrice.buyNum}">
+                                        <span>${ladderPrice.buyNumRangeShow}</span><span
+                                            class="price">${ladderPrice.buyPrice}</span></p>
+                                </c:forEach>
+                            </div>
+                        </c:if>
+                    </a>
+                </c:if>
+                </span>
+                <span>数量:  x${op.num}</span>
+
+                <br>
+                <c:if test="${order.organizeID != 4}">
+                    <span>税率:  ${(op.includedTax != '' and op.includedTax eq 0 and op.invoiceType eq 3)?'---': op.taxRate ne null?op.taxRate:0.0}%</span>
+                    <span>税费: ${(op.includedTax eq 1 or (op.includedTax != '' and op.includedTax eq 0 and op.invoiceType eq 3))?'---': empty op.totalAddedValueTax ?0.00:(op.totalAddedValueTax)}</span>
+                </c:if>
+                <span>总额:  <fmt:formatNumber value="${op.totalFee}" type="currency"/></span>
+                <c:if test="${order.sendOutStatus == 3}">
+                    <span>已发/已收  ${(op.num == null ? 0 : op.num)+ (op.presentNum == null ? 0 : op.presentNum)- (op.notOutStore == null ? 0 : op.notOutStore)}/${op.receivedNum}</span>
+                </c:if>
+                <c:if test="${order.refundStatus eq 3}">
+                    <span>退款(退货)中/已完成  ${op.returningNum}/${op.returnedNum}</span>
+                </c:if>
+            </div>
+            <c:if test="${op.productPromotion ne null}">
+            <c:if test="${op.productPromotion.type eq 2}">
+            <div class="supplier-product-promotionInfo">
+                <table>
+                    <tr>
+                        <td rowspan="2">
+                            <c:if test="${op.productPromotion.mode eq 2}">
+                                <label style="background-color: #F60;color: white"><label
+                                        class="promotionsName">${op.productPromotion.name}</label></label>
+                            </c:if>
+                            <c:if test="${op.productPromotion.mode eq 3}">
+                                <label style="background-color: purple;color: white"><label
+                                        class="promotionsName">${op.productPromotion.name}</label></label>
+                            </c:if>
+                        </td>
+                        <td>
+                            <span class="downSpan">${op.productPromotion.description}</span>
+                            <c:if test="${op.productPromotion.mode eq 2}">
+                                                    <span class="upSpan"> 满<fmt:formatNumber
+                                                            value="${op.productPromotion.touchPrice}" pattern="#,##0.00"
+                                                            maxFractionDigits="2"/>,减<fmt:formatNumber
+                                                            value="${op.productPromotion.reducedPrice}"
+                                                            pattern="#,##0.00" maxFractionDigits="2"/></span>
+                            </c:if>
+                            <c:if test="${op.productPromotion.mode eq 3}">
+                                                    <span class="upSpan"> 满<fmt:formatNumber
+                                                            value="${op.productPromotion.touchPrice}" pattern="#,##0.00"
+                                                            maxFractionDigits="2"/>,赠送商品</span>
+                            </c:if>
+                        </td>
+                    </tr>
+                </table>
+            </div>
+            </c:if>
+            <c:if test="${op.productPromotion.type eq 1}">
+            <div class="supplier-product-promotionInfo">
+                <table>
+                    <tr>
+                        <c:if test="${op.productPromotion.mode eq 1}">
+                            <td><label style="background-color: green;color: white"><label
+                                    class="promotionsName">${op.productPromotion.name}</label></label>
+                            </td>
+                            <td> 优惠价: <label style="color: red"><fmt:formatNumber
+                                    value="${op.productPromotion.touchPrice}" pattern="#,##0.00"
+                                    maxFractionDigits="2"/></label></td>
+                        </c:if>
+                        <c:if test="${op.productPromotion.mode eq 2}">
+                            <td><label style="background-color: #F60;color: white"><label
+                                    class="promotionsName">${op.productPromotion.name}</label></label>
+                            </td>
+                            <td> 满<fmt:formatNumber value="${op.productPromotion.touchPrice}"
+                                                    pattern="#,##0.00"
+                                                    maxFractionDigits="2"/>,减<fmt:formatNumber
+                                    value="${op.productPromotion.reducedPrice}" pattern="#,##0.00"
+                                    maxFractionDigits="2"/></td>
+                        </c:if>
+                        <c:if test="${op.productPromotion.mode eq 3}">
+                            <td><label style="background-color: purple;color: white"><label
+                                    class="promotionsName">${op.productPromotion.name}</label></label>
+                            </td>
+                            <td> 满<fmt:formatNumber value="${op.productPromotion.touchPrice}"
+                                                    pattern="#,##0.00" maxFractionDigits="2"/>,赠送商品
+                            </td>
+                        </c:if>
+                    </tr>
+                </table>
+            </div>
+            </c:if>
+            </c:if>
+            </c:if>
+            <c:if test="${op.productID eq 999}">
+            <span>数量:  x${op.num}</span>
+            </c:if>
+            <br>
+            </c:forEach>
+    </div>
+</div>
+<%--组织订单暂时不显示发票和条款信息--%>
+<%--<c:if test="${order.organizeID == 0}">--%>
+<c:if test="${order.organizeID != 4}">
+    <div class="order-rows">
+        <label>订单对机构是否可见:</label>
+        <c:if test="${order.orderSeen eq 1}">
+            <label>可见</label>
+        </c:if>
+        <c:if test="${order.orderSeen eq 2}">
+            <label>不可见</label>
+        </c:if>
+        <c:if test="${order.orderSeen ne 1 and order.orderSeen ne 2}">
+            <label>未定义</label>
+        </c:if>
+    </div>
+</c:if>
+<div class="order-rows">
+    <label>发票信息:</label>
+    <c:if test="${order.orderInvoice.type eq 0}">
+        <%--            <input name="invoice" type="radio" checked="checked">--%>
+        <label>不需要发票</label>
+    </c:if>
+    <c:if test="${order.orderInvoice.type eq 1}">
+        <%--            <input name="invoice" type="radio" checked="checked">--%>
+        <label>增值税普通发票</label>
+    </c:if>
+    <c:if test="${order.orderInvoice.type eq 2}">
+        <%--            <input name="invoice" type="radio" checked="checked">--%>
+        <label>增值税专用发票</label>
+    </c:if>
+    <c:if test="${order.orderInvoice.type eq null}">
+        <%--            <input name="invoice" type="radio" checked="checked">--%>
+        <label>不需要发票</label>
+    </c:if>
+    <c:if test="${order.orderInvoice.type == 1}">
+        <br>
+        <div>
+                    <span>
+                        <c:if test="${order.orderInvoice.invoiceTitleType eq 0}">
+                            个人抬头:
+                            <span>${order.orderInvoice.invoiceTitle}</span>
+                        </c:if>
+                        <c:if test="${order.orderInvoice.invoiceTitleType eq 1}">
+                            企业抬头:
+                            <span>${order.orderInvoice.invoiceTitle}</span>
+                            &nbsp;&nbsp;&nbsp;&nbsp;
+                            纳税人识别号:
+                            <span>${order.orderInvoice.corporationTaxNum}</span>
+                        </c:if>
+                    </span>
+        </div>
+    </c:if>
+    <c:if test="${order.orderInvoice.type == 2}">
+        <table>
+            <tr>
+                <td><span>单位名称:${order.orderInvoice.invoiceTitle}</span></td>
+                <td><span>纳税人识别号:${order.orderInvoice.corporationTaxNum}</span></td>
+                <td><span>注册地址:${order.orderInvoice.registeredAddress}</span></td>
+            </tr>
+            <tr>
+                <td><span>注册电话:${order.orderInvoice.registeredPhone}</span></td>
+                <td><span>开户银行:${order.orderInvoice.openBank}</span></td>
+                <td><span>银行账号:${order.orderInvoice.bankAccountNo}</span></td>
+            </tr>
+        </table>
+    </c:if>
+</div>
+<c:if test="${order.organizeID != 4}">
+    <div class="order-rows">
+        <label>售后条款:</label>
+        <c:forEach items="${bpClauses}" var="items" varStatus="index">
+            <c:if test="${items.clauseType ne 0  }">
+                            <span>
+                                <input id="clauseId${index.index+1}" class="clauseId" name="clauseID" type="radio"
+                                       value="${items.id}"${(order.clauseID)==(items.id)?'checked="checked"':''}
+                                       class="required" class="clauseId" disabled="disabled">
+                                <input type="hidden" class="clauseContent" id="clauseContent${index.index+1}"
+                                       value="${fns:escapeHtml(items.content)}">
+                                <input type="hidden" class="clauseName" id="clauseName${index.index+1}"
+                                       value="${items.name}">
+                                <a href="javascript:void(0);"
+                                   onclick="openClauseInfo(${index.index+1});"><label>${items.name}</label></a>
+                            </span>
+            </c:if>
+        </c:forEach>
+    </div>
+</c:if>
+<%-- 订单备注抽屉 --%>
+<%--<div class="remarks-drawer-content">--%>
+<%--    <div class="drawer-btn-main">--%>
+<%--        <p>订单备注</p >--%>
+<%--        <p class="drawer-close">收起》</p>--%>
+<%--        <p class="drawer-opens">展开《</p>--%>
+<%--    </div>--%>
+<%--    <div class="drawer-content">--%>
+<%--        <div class="drawer-content-btn">--%>
+<%--           <input id="btnSubmit" class="btn btn-primary" type="submit" value="添加备注">--%>
+<%--        </div>--%>
+<%--        <div class="drawer-content-none">--%>
+<%--            <p>暂无备注信息,有需要请您前往添加订单备注~</p>--%>
+<%--        </div>--%>
+<%--        <div class="drawer-content-mains">--%>
+<%--            <div class="drawer-list">--%>
+<%--                <div class="drawer-list-title">--%>
+<%--                    <span>赵智捷:2023-07-05 14:59</span>--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-text">--%>
+<%--                    <span>备注内容:</span>--%>
+<%--                    申请付款1260 一盒63申请付款1260 一盒63申请付款1260 一盒63申请付款1260 一盒63申请付款1260 一盒63--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-title">--%>
+<%--                    <span>图片</span>--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-image">--%>
+<%--                    <a href="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg">--%>
+<%--                        <img src="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg" alt="">--%>
+<%--                    </a >--%>
+<%--                    <a href="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg">--%>
+<%--                        <img src="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg" alt="">--%>
+<%--                    </a >--%>
+<%--                    <a href="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg">--%>
+<%--                        <img src="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg" alt="">--%>
+<%--                    </a >--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-title">--%>
+<%--                    <span>文件</span>--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-file">--%>
+<%--                    <p>奥斯卡级大叔大叔极度恐慌.pdf</p>--%>
+<%--                    <p>奥斯卡级大叔大叔极度恐慌.pdf</p>--%>
+<%--                    <p>奥斯卡级大叔大叔极度恐慌.pdf</p>--%>
+<%--                </div>--%>
+<%--            </div>--%>
+<%--            <div class="drawer-list">--%>
+<%--                <div class="drawer-list-title">--%>
+<%--                    <span>赵智捷:2023-07-05 14:59</span>--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-text">--%>
+<%--                    <span>备注内容:</span>--%>
+<%--                    申请付款1260 一盒63申请付款1260 一盒63申请付款1260 一盒63申请付款1260 一盒63申请付款1260 一盒63--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-title">--%>
+<%--                    <span>图片</span>--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-image">--%>
+<%--                    <a href="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg">--%>
+<%--                        <img src="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg" alt="">--%>
+<%--                    </a >--%>
+<%--                    <a href="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg">--%>
+<%--                        <img src="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg" alt="">--%>
+<%--                    </a >--%>
+<%--                    <a href="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg">--%>
+<%--                        <img src="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg" alt="">--%>
+<%--                    </a >--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-title">--%>
+<%--                    <span>文件</span>--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-file">--%>
+<%--                    <p>奥斯卡级大叔大叔极度恐慌.pdf</p>--%>
+<%--                    <p>奥斯卡级大叔大叔极度恐慌.pdf</p>--%>
+<%--                    <p>奥斯卡级大叔大叔极度恐慌.pdf</p>--%>
+<%--                </div>--%>
+<%--            </div>--%>
+<%--            <div class="drawer-list">--%>
+<%--                <div class="drawer-list-title">--%>
+<%--                    <span>赵智捷:2023-07-05 14:59</span>--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-text">--%>
+<%--                    <span>备注内容:</span>--%>
+<%--                    申请付款1260 一盒63申请付款1260 一盒63申请付款1260 一盒63申请付款1260 一盒63申请付款1260 一盒63--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-title">--%>
+<%--                    <span>图片</span>--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-image">--%>
+<%--                    <a href="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg">--%>
+<%--                        <img src="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg" alt="">--%>
+<%--                    </a >--%>
+<%--                    <a href="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg">--%>
+<%--                        <img src="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg" alt="">--%>
+<%--                    </a >--%>
+<%--                    <a href="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg">--%>
+<%--                        <img src="https://img.caimei365.com/group1/M00/00/41/rB-lF2LU3D2AODh6AAKqLkQtdyk410.jpg" alt="">--%>
+<%--                    </a >--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-title">--%>
+<%--                    <span>文件</span>--%>
+<%--                </div>--%>
+<%--                <div class="drawer-list-file">--%>
+<%--                    <p>奥斯卡级大叔大叔极度恐慌.pdf</p>--%>
+<%--                    <p>奥斯卡级大叔大叔极度恐慌.pdf</p>--%>
+<%--                    <p>奥斯卡级大叔大叔极度恐慌.pdf</p>--%>
+<%--                </div>--%>
+<%--            </div>--%>
+<%--    </div>--%>
+<%--</div>--%>
+<script type="text/javascript">
+
+    function openRemarks(orderId, shopOrderId) {
+        top.$.jBox("iframe:${ctx}/order/cmOrderRemark/remarksViewNew?orderID=" + orderId + "&shopOrderID=" + shopOrderId, {
+            iframeScrolling: 'yes',
+            top: 100,
+            width: 1200,
+            height: 800,
+            persistent: true,
+            title: "订单备注",
+            buttons: {"收起": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                return true;
+            }, closed: function () {/* 窗口关闭后执行的函数 */
+            }
+        });
+    }
+
+    (function () {
+
+        $('.clauseId').each(function () {
+            var self = $(this);
+            if (!self.prop("checked")) {
+                self.parent().hide();
+            } else {
+                self.hide();
+            }
+        });
+
+        $('#invoice1, #invoice2, #invoice3').each(function () {
+            var self = $(this);
+            if (!self.prop("checked")) {
+                self.next().remove();
+                self.remove();
+            } else {
+                self.remove();
+            }
+        })
+        // 订单备注抽屉显隐
+        $('.drawer-opens').click(function () {
+            $('.remarks-drawer-content').animate({
+                'right': '0px'
+            }, 300);
+            $(this).hide()
+            $('.drawer-close').show()
+        });
+        $('.drawer-close').click(function () {
+            $('.remarks-drawer-content').animate({
+                'right': '-580px'
+            }, 300);
+            $(this).hide()
+            $('.drawer-opens').show()
+        });
+    })();
+
+    function operation(shopOrderID) {
+        var operationBlok = $('.' + shopOrderID)
+        if (operationBlok.css('display') == 'none') {
+            $('.operation-block').hide()
+            operationBlok.show()
+        } else {
+            operationBlok.hide()
+        }
+    }
+
+    function showRemark() {
+        $(".remarks").show();
+    }
+
+    function hideRemarks() {
+        $(".remarks").hide();
+    }
+
+    function openClauseInfo(index) {
+        var content = $("#clauseContent" + index).val();
+        if (content == '') {
+            return false;
+        }
+        $.jBox(content, {
+            title: $("#clauseName" + index).val(),
+            width: $(top.document).width() - 440,
+            height: $(top.document).height() - 240,
+            buttons: {'关闭': true}
+        });
+    }
+
+    //编辑经理折扣
+    function modelShow(orderID) {
+        top.$.jBox("iframe:${ctx}/order/DiscountFee?orderID=" + orderID, {
+            iframeScrolling: 'yes',
+            top: 150,
+            width: 480,
+            height: 250,
+            persistent: true,
+            title: "编辑经理折扣",
+            buttons: {"确认": '1', "取消": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var rechargeInfo = $jboxFrame[0].contentWindow.submit();
+                    var split = rechargeInfo.split(",");
+                    var payTotalFee = split[0];
+                    var discountFee = split[1];
+                    //取值,然后调用后台接口传入参数,最后刷新页面
+                    if (payTotalFee <= 0) {
+                        return false;
+                    }
+                    $.post("${ctx}/order/saveDiscountFee", {
+                        'discountFee': discountFee,
+                        'orderID': orderID,
+                        'payTotalFee': payTotalFee
+                    }, function (data) {
+                        if (true == data.success) {
+                            refresh(data.msg);
+                        } else {
+                            alertx(data.msg, 1000);
+                        }
+                    }, "JSON");//这里返回的类型有:json,html,xml,text
+                }
+                return true;
+            }, closed: function () {/* 窗口关闭后执行的函数 */
+            }
+        });
+    }
+
+    function rebateFeeEdit(orderID) {
+        top.$.jBox("iframe:${ctx}/order/RebateFee?orderID=" + orderID, {
+            iframeScrolling: 'yes',
+            top: 150,
+            width: 480,
+            height: 250,
+            persistent: true,
+            title: "编辑返佣服务费",
+            buttons: {"确认": '1', "取消": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var rebateFee = $jboxFrame[0].contentWindow.submit();
+                    if (!rebateFee) {
+                        return false;
+                    }
+                    $.post("${ctx}/order/saveRebateFee", {
+                        'rebateFee': rebateFee,
+                        'orderID': orderID
+                    }, function (data) {
+                        if (true == data.success) {
+                            refresh(data.msg);
+                        } else {
+                            alertx(data.msg, 1000);
+                        }
+                    }, "JSON");//这里返回的类型有:json,html,xml,text
+                }
+                return true;
+            }, closed: function () {/* 窗口关闭后执行的函数 */
+            }
+        });
+    }
+
+    //订单商品备注
+    function remarks(orderID, shopOrderID) {
+        top.$.jBox("iframe:${ctx}/order/cmOrderRemark/remarksView?orderID=" + orderID + "&shopOrderID=" + shopOrderID, {
+            iframeScrolling: 'yes',
+            top: 150,
+            width: 400,
+            height: 480,
+            persistent: true,
+            title: "订单备注信息",
+            buttons: {"确认": '1', "关闭": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var remarks = $jboxFrame[0].contentWindow.submit();
+                    if ('' == remarks) {
+                        alertx("备注信息不能为空!!!")
+                        return false;
+                    }
+                    saveRemarks(remarks, orderID, shopOrderID);
+                    return true;
+                }
+                return true;
+            },
+            loaded: function (h) {   //隐藏滚动条
+                $(".jbox-content", top.document).css("overflow-y", "hidden");
+            }
+        });
+    }
+
+    function saveRemarks(remarks, orderID, shopOrderID) {
+        $.post("${ctx}/order/cmOrderRemark/addRemarks", {
+            "remarks": remarks, "orderID": orderID, "shopOrderID": shopOrderID
+        }, function (data) {
+            if (true == data.success) {
+                refresh(data.msg);
+            } else {
+                $.jBox.tip(data.msg, 'error');
+            }
+        }, "JSON");//这里返回的类型有:json,html,xml,text
+    }
+
+    // 二维码分享
+    function QRCodewin(orderId, orderNo) {
+        var html = '<div style="padding:10px;">订单号:' + orderNo + '' +
+            '<div class="code" style="text-align: center;"></div>' +
+            '</div>';
+        $.jBox(html, {
+            title: "订单二维码分享",
+            width: $(top.document).width() - 1700,
+            height: $(top.document).height() - 1600,
+            buttons: {'关闭': true}
+        });
+
+        var enCodeRedirectUrl;
+        var redirectUrl = '${fns:getConfig('caimei.crm.server')}oauth.action?orderId=' + orderId;
+        $.ajax({
+            url: "${ctx}/bulkpurchase/contractOrder/enCode",
+            data: {"redirectUrl": redirectUrl},
+            type: "POST",
+            async: false,
+            success: function (data) {
+                enCodeRedirectUrl = data.enCodeRedirectUrl;
+            }
+        });
+        var shareUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=${fns:getConfig('weixin.appId')}&redirect_uri=' + enCodeRedirectUrl + '&response_type=code&scope=snsapi_base&state=bulkpurchase#wechat_redirect';
+        $('.code').qrcode({
+            width: 150,
+            height: 150,
+            text: shareUrl
+        });
+    }
+
+    //刷新页面
+    function refresh(msg) {
+        $.jBox.tip(msg, 'info', {timeout: 1000});
+        setTimeout(function () {
+            window.location.href = "${ctx}/order/detail?id=${order.orderID}"
+        }, 1000)
+    }
+</script>
+<script>
+    if ("${time}" != "") {
+        window.onload = clock;
+
+        function clock() {
+            var today = new Date(),//当前时间
+                h = today.getHours(),
+                m = today.getMinutes(),
+                s = today.getSeconds();
+            var stopTime = new Date("${time}"),//结束时间
+                stopH = stopTime.getHours(),
+                stopM = stopTime.getMinutes(),
+                stopS = stopTime.getSeconds();
+            var shenyu = stopTime.getTime() - today.getTime(),//倒计时毫秒数
+                shengyuD = parseInt(shenyu / (60 * 60 * 24 * 1000)),//转换为天
+                D = parseInt(shenyu) - parseInt(shengyuD * 60 * 60 * 24 * 1000),//除去天的毫秒数
+                shengyuH = parseInt(D / (60 * 60 * 1000)),//除去天的毫秒数转换成小时
+                H = D - shengyuH * 60 * 60 * 1000,//除去天、小时的毫秒数
+                shengyuM = parseInt(H / (60 * 1000)),//除去天的毫秒数转换成分钟
+                M = H - shengyuM * 60 * 1000;//除去天、小时、分的毫秒数
+            S = parseInt((shenyu - shengyuD * 60 * 60 * 24 * 1000 - shengyuH * 60 * 60 * 1000 - shengyuM * 60 * 1000) / 1000)//除去天、小时、分的毫秒数转化为秒
+            document.getElementById("time").innerHTML = ("(剩余" + shengyuD + "天" + shengyuH + "小时" + shengyuM + "分" + S + "秒)" + "<br>");
+            setTimeout(clock, 500);
+        }
+    }
+
+    function copyText(shopOrderID) {
+        $.post("${ctx}/order/shopOrderLink", {'shopOrderId': shopOrderID}, function (data) {
+            if (data.success) {
+                var imageSrc = "data:image/jpeg|png|gif;base64," + data.imageBuffer;
+                top.$.jBox.info('<img  width="150px" height="150px" style="margin-left: 65px;" src=' + imageSrc + '>', '小程序扫码发货');
+            } else {
+                alertx(data.msg);
+            }
+        });
+
+
+    }
+
+    $(document).ready(function () {
+        if ($(".operation-block").length > 0) {
+            var length = $(".operation-block").length;
+            for (var i = 0; i < length; i++) {
+                var b = $(".operation-block").get(i);
+                if ($(b).html().trim() == '') {
+                    $(b).hide();
+                    $(b).prev().hide();
+                }
+            }
+        }
+        if ($('.supplier-product-name').html() == $('.supplier-product-alias').html()) {
+            $('.supplier-product-alias').remove();
+        }
+    })
+
+    //抹平收款
+    function collection(orderId) {
+        $.post("${ctx}/order/gatheringData", {
+            'orderId': orderId
+        }, function (data) {
+            if (true == data.success) {
+                var html = "<div id='auditBox'>" +
+                    "<P>确定抹平收款吗?抹平后该订单将变为已收款状态</p>" +
+                    "<P><span>订单金额:<b>¥" + Number(data.payTotalFee).toFixed(2) + "</b></span></p>" +
+                    "<P><span>应收金额:<b>¥" + Number(data.payableAmount).toFixed(2) + "</b><span style='color:#FF0000'>(账户余额抵扣: ¥<b>" + Number(data.balancePayFee).toFixed(2) + "</b>)</span></span></p>" +
+                    "<P><span>已收金额:<b>¥" + Number(data.associateAmount).toFixed(2) + "</b></span></p>" +
+                    "<div><div class='note-div'><span style='color:#FF0000'>*</span>备注</div></div>" +
+                    "<textarea name='auditNote' style='width: 100%;min-height:60px;'></textarea>" +
+                    "<div class='note-div' style='display: none' id='noteError'><span style='color:#FF0000'>请填写备注</span> </div>" +
+                    "</div>";
+                $.jBox(html, {
+                    title: "确认提示", width: 500, height: 400, buttons: {"确定": '1', "取消": '-1'},
+                    submit: function (v, h, f) {
+                        if ('1' == v) {
+                            if ((Number(data.payTotalFee) - Number(data.associateAmount)) > 10) {
+                                alertx("订单剩余应收金额大于¥10.00,不能抹平!");
+                                return false;
+                            }
+                            var content = document.getElementsByName("auditNote")[0].value;
+                            if (content == '' || content == null) {
+                                document.getElementById('noteError').style.display = 'block';
+                                return false;
+                            }
+                            $.post("${ctx}/order/smoothOutCollection", {
+                                'orderID': orderId,
+                                'balanceAccountsRemark': content
+                            });
+                            window.location.href = "${ctx}/order/detail?id=" + orderId;
+                        }
+                    }
+                });
+
+            } else {
+                $.jBox.tip(data.msg, 'error');
+            }
+        }, "JSON");//这里返回的类型有:json,html,xml,text
+    };
+</script>
+</body>
+</html>

+ 522 - 0
src/main/webapp/static/modules/order/order-details.css

@@ -0,0 +1,522 @@
+* {
+    margin: 0;
+    padding: 0
+}
+
+a {
+    list-style: none;
+    text-decoration: none
+}
+
+body {
+    background-color: rgb(255, 255, 255)
+}
+
+h3 {
+    line-height: 20px;
+    padding: 20px 0 20px 15px;
+    border-bottom: 1px solid #CCCCCC
+}
+
+.now-status p {
+    padding: 20px
+}
+
+.now-status span {
+    display: inline-block;
+    width: 160px;
+    line-height: 35px;
+    margin-right: 15px;
+    cursor: pointer;
+    border: 1px solid #CCCCCC;
+    text-align: center;
+    border-radius: 5px
+}
+
+.buyInfo p {
+    padding: 15px 5px 0
+}
+
+.buyInfo p label {
+    width: 60px;
+    display: inline-block
+}
+
+.buyInfo p span {
+    padding-left: 10px
+}
+
+.table th {
+    background-color: #CCCCCC
+}
+
+.table th, .table td {
+    font-weight: normal;
+    border: 1px solid #CCCCCC;
+    height: 35px;
+    text-align: center
+}
+
+.table td .div-img {
+    box-sizing: border-box
+}
+
+.table td .div-img img {
+    width: 100px;
+    height: 100px;
+    vertical-align: middle
+}
+
+.table td .div-img span {
+}
+
+.div-order span {
+    width: 260px;
+    display: inline-block;
+    margin-right: 50px
+}
+
+.text-result p {
+    padding-top: 15px
+}
+
+.text-cost p {
+    padding: 20px 0
+}
+
+.moeny-cost p {
+    padding: 10px 0 0 0;
+    text-align: left
+}
+
+.moeny-cost p label {
+    display: inline-block
+}
+
+.Staging table {
+    width: 100%;
+    border-collapse: collapse;
+    margin-top: 20px
+}
+
+.Staging table th, .Staging table td {
+    font-weight: normal;
+    border: 1px solid #000;
+    height: 35px;
+    text-align: center;
+    width: 10%
+}
+
+.change-info {
+    position: fixed;
+    top: 0%;
+    left: 50%;
+    transform: translateX(-50%);
+    z-index: 999;
+    width: 800px;
+    background-color: #fff;
+    box-shadow: 0px 0px 15px #ccc
+}
+
+.item-div label {
+    width: 260px;
+    text-align: right;
+    display: inline-block;
+    margin-right: 50px
+}
+
+.item-div input {
+    width: 300px;
+    line-height: 35px;
+    height: 35px;
+    box-sizing: border-box;
+    border: 1px solid #CCCCCC;
+    display: inline-block
+}
+
+.item-div select {
+    width: 90px;
+    height: 35px;
+    margin-right: 10px
+}
+
+.remarkShow {
+    width: 55px;
+    height: 75px;
+    top: 45%;
+    right: 0;
+    box-sizing: border-box;
+    background: #45aeea;
+    border-radius: 10px 0 0 10px;
+    padding: 15px 0;
+    color: #FFFFFF;
+    cursor: pointer;
+    position: absolute;
+    transform: scale(1.3);
+    font-family: SimSun, sans-serif;
+}
+
+.item-div textarea {
+    border: 1px solid #CCCCCC;
+    margin-top: 20px;
+    width: 300px;
+    height: 80px;
+    resize: none;
+    display: block
+}
+
+.layer-status span {
+    display: inline-block;
+    width: 80px;
+    line-height: 35px;
+    background-color: #00A6C7;
+    text-align: center;
+    color: #fff;
+    cursor: pointer
+}
+
+.layer-status span:nth-of-type(1) {
+}
+
+.layer-status span:nth-of-type(2) {
+    margin-left: 72px
+}
+
+.same-style {
+    position: fixed;
+    top: 20%;
+    left: 50%;
+    transform: translateX(-50%);
+    width: 500px;
+    background-color: #fff;
+    z-index: 999;
+    box-shadow: 0 0 15px #666
+}
+
+.reason-cancel label {
+    margin-right: 20px
+}
+
+.reason-cancel textarea {
+    width: 270px;
+    height: 80px;
+    resize: none;
+    vertical-align: text-top;
+    border: 1px solid #CCCCCC
+}
+
+.order-details-heading {
+    background: #eee
+}
+
+.order-details-heading td {
+    white-space: nowrap;
+    padding: 0 10px
+}
+
+.order-rows, .order-details-heading {
+    width: 100%;
+    border-bottom: 1px solid #ccc;
+    border-left: 1px solid #ccc;
+    border-right: 1px solid #ccc;
+    color: #666;
+    padding: 10px;
+    line-height: 30px
+}
+
+.order-details-heading {
+    border-top: 1px solid #ccc
+}
+
+.order-details-heading span, .order-rows span {
+    margin-right: 80px
+}
+
+.order-details-heading span {
+    width: 230px;
+    margin-right: 0px;
+    display: inline-block
+}
+
+.order-details-heading span label, .order-rows span label {
+    font-weight: bold
+}
+
+.order-rows .supplier-img {
+    width: 100px
+}
+
+.operation-wrapper {
+    position: relative
+}
+
+.operation-btn {
+    cursor: pointer
+}
+
+.operation-block {
+    background: #fff;
+    width: 125px;
+    position: absolute;
+    left: 826px;
+    top: 5px;
+    padding: 10px;
+    border: 1px solid #666;
+    -webkit-border-radius: 5px;
+    -moz-border-radius: 5px;
+    border-radius: 5px;
+    z-index: 100001;
+    display: none
+}
+
+.operation-block a {
+    display: block;
+    padding: 3px 0
+}
+
+.print-wrapper {
+    display: inline-block
+}
+
+.supplier-product-name, .supplier-product-alias {
+    width: 200px;
+    line-height: 20px
+}
+
+.supplier-product-info {
+    width: 55%;
+    display: inline-block;
+    position: relative;
+    top: 50%;
+    transform: translateY(30%)
+}
+
+.supplier-product-promotionInfo {
+    width: 20%;
+    display: inline-block;
+    position: relative;
+    top: 50%;
+    transform: translateY(30%)
+}
+
+.supplier-product-item {
+    margin-bottom: 10px
+}
+
+.supplier-product-alias {
+    display: inline-block;
+    margin-top: 5px
+}
+
+.supplier-name {
+    display: inline-block;
+    vertical-align: middle;
+    margin: 0 10px
+}
+
+#auditBox {
+    padding: 20px;
+    line-height: 30px
+}
+
+#auditBox p {
+    font-size: 16px;
+    margin: 0 0 0 0
+}
+
+#auditBox .note-div {
+    font-size: 16px
+}
+
+.downSpan {
+    display: block;
+    margin-left: 5px;
+    margin-bottom: -8px
+}
+
+.upSpan {
+    display: block;
+    margin-left: 5px;
+    margin-top: -8px
+}
+
+.promotionsName {
+    margin: 2px
+}
+
+.ladderPrice > span {
+    text-decoration: underline;
+    color: red
+}
+
+.ladderPrice .list {
+    display: none;
+    position: absolute;
+    z-index: 999;
+    background: #FFF;
+    white-space: nowrap;
+    border: 1px solid #EEE;
+    padding: 10px 0;
+    color: #333
+}
+
+.ladderPrice:hover .list {
+    display: block
+}
+
+.ladderPrice .list span {
+    margin: 0 20px;
+    width: 60px;
+    text-align: center;
+    display: inline-block
+}
+
+.ladderPrice .list span.price {
+    color: red
+}
+
+.weishaIcon {
+    background: darkorange;
+    color: white;
+    margin: 0 0px;
+    padding: 0 3px;
+    font-style: normal;
+    font-size: 12px;
+    display: inline-block;
+    border-radius: 2px
+}
+
+.acticer_span {
+    display: inline-block;
+    width: 14px;
+    height: 14px;
+    border-radius: 50%;
+    box-sizing: border-box;
+    border: 1px solid #999999;
+    text-align: center;
+    color: #333333;
+    font-size: 12px;
+    line-height: 14px;
+    float: none;
+    margin-left: 3px;
+}
+/*订单备注抽屉*/
+.remarks-drawer-content{
+    width: 640px;
+    height: 100%;
+    overflow-y: hidden;
+    box-sizing: border-box;
+    padding: 0 0 0 60px;
+    position: fixed;
+    right: -580px;
+    top: 0;
+    z-index: 100000;
+}
+.remarks-drawer-content .drawer-btn-main{
+    width: 60px;
+    height: 80px;
+    position: absolute;
+    top: 50%;
+    left: 0;
+    box-sizing: border-box;
+    background: #45aeea;
+    border-radius: 10px 0 0 10px;
+    padding: 15px 0;
+    color: #FFFFFF;
+    cursor: pointer;
+}
+.remarks-drawer-content .drawer-btn-main p{
+    font-size: 12px;
+    line-height: 20px;
+    text-align: center;
+}
+.remarks-drawer-content .drawer-btn-main .drawer-close{
+    display: none;
+}
+.remarks-drawer-content .drawer-content{
+    width: 100%;
+    height: 100%;
+    background: #FFFFFF;
+    box-sizing: border-box;
+    padding: 20px;
+    border: 1px solid #e1e1e1;
+    overflow-y: scroll;
+}
+.drawer-content .drawer-content-btn{
+    width: 100%;
+    height: 30px;
+    float: left;
+    text-align: right;
+}
+.drawer-content .drawer-content-none{
+    width: 100%;
+    height: 100px;
+    line-height: 200px;
+    color: #999999;
+    float: left;
+    text-align: center;
+    display: none;
+}
+.drawer-content .drawer-content-mains{
+    width: 100%;
+    min-height: 600px;
+    float: left;
+}
+.drawer-list{
+    width: 100%;
+    height: auto;
+    box-sizing: border-box;
+    padding: 5px 0;
+    border-bottom: 1px dashed #e1e1e1;
+    float: left;
+}
+.drawer-list .drawer-list-title{
+    width: 100%;
+    float: left;
+    line-height: 28px;
+    font-size: 14px;
+    font-weight: bold;
+    color: #333333;
+}
+.drawer-list .drawer-list-title span{
+    color: #333333;
+}
+.drawer-list .drawer-list-text{
+    width: 100%;
+    float: left;
+    height: auto;
+    line-height: 28px;
+    font-size: 14px;
+    color: #999999;
+}
+.drawer-list .drawer-list-text span{
+    color: #333333;
+}
+.drawer-list .drawer-list-image{
+    width: 100%;
+    height: auto;
+    float: left;
+    box-sizing: border-box;
+    padding: 10px 0;
+}
+.drawer-list .drawer-list-image a{
+    display: block;
+    width: 100px;
+    height: 100px;
+    float: left;
+    margin: 5px;
+}
+.drawer-list .drawer-list-image a img{
+    display: block;
+    width: 100px;
+    height: 100px;
+}
+.drawer-list .drawer-list-file{
+    width: 100%;
+    height: auto;
+    float: left;
+}
+.drawer-list .drawer-list-file p{
+    line-height: 40px;
+    color: #666666;
+}