소스 검색

供应商差价

plf 4 년 전
부모
커밋
de423d0305
23개의 변경된 파일1545개의 추가작업 그리고 73개의 파일을 삭제
  1. 7 0
      src/main/java/com/caimei/modules/order/dao/CmPayShopRecordDao.java
  2. 2 1
      src/main/java/com/caimei/modules/order/dao/CmReceiptOrderRelationDao.java
  3. 2 1
      src/main/java/com/caimei/modules/order/dao/CmRefundShopDao.java
  4. 4 0
      src/main/java/com/caimei/modules/order/dao/CmRefundShopRecordDao.java
  5. 5 0
      src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java
  6. 201 0
      src/main/java/com/caimei/modules/order/entity/ChangePayShopDifference.java
  7. 175 0
      src/main/java/com/caimei/modules/order/entity/ChangePayShopOther.java
  8. 120 0
      src/main/java/com/caimei/modules/order/service/CmPayShopService.java
  9. 31 5
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  10. 55 6
      src/main/java/com/caimei/modules/order/web/CmPayShopController.java
  11. 29 20
      src/main/java/com/caimei/modules/order/web/CmShopOrderController.java
  12. 48 0
      src/main/resources/mappings/modules/order/CmPayShopRecordMapper.xml
  13. 4 2
      src/main/resources/mappings/modules/order/CmReceiptOrderRelationMapper.xml
  14. 4 0
      src/main/resources/mappings/modules/order/CmRefundShopMapper.xml
  15. 10 0
      src/main/resources/mappings/modules/order/CmRefundShopRecordMapper.xml
  16. 8 0
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  17. 5 17
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopChange.jsp
  18. 4 4
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopChange1.jsp
  19. 9 4
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopChangeRecond.jsp
  20. 12 10
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp
  21. 430 0
      src/main/webapp/WEB-INF/views/modules/order/differencePriceForm.jsp
  22. 378 0
      src/main/webapp/WEB-INF/views/modules/order/shopOtherFeeForm.jsp
  23. 2 3
      src/main/webapp/WEB-INF/views/modules/user/cmUserBalanceList.jsp

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

@@ -1,5 +1,7 @@
 package com.caimei.modules.order.dao;
 
+import com.caimei.modules.order.entity.ChangePayShopDifference;
+import com.caimei.modules.order.entity.ChangePayShopOther;
 import com.caimei.modules.order.entity.CmPayShop;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
@@ -47,4 +49,9 @@ public interface CmPayShopRecordDao extends CrudDao<CmPayShopRecord> {
 
     Integer findMaxPayShopRecordId(Integer payShopID);
 
+    List<ChangePayShopOther> findShopOtherFee(Integer shopOrderId);
+
+    void insertShopOtherFee(ChangePayShopOther payShopOther);
+
+    void insertDifference(ChangePayShopDifference payShopDifference);
 }

+ 2 - 1
src/main/java/com/caimei/modules/order/dao/CmReceiptOrderRelationDao.java

@@ -5,6 +5,7 @@ import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import com.caimei.modules.order.entity.CmReceiptOrderRelation;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -29,5 +30,5 @@ public interface CmReceiptOrderRelationDao extends CrudDao<CmReceiptOrderRelatio
 
     CmReceiptOrderRelation findOrderRelation(Integer orderID);
 
-    Integer findOnlinePayment(Integer orderID);
+    Date findOnlinePayment(Integer orderID);
 }

+ 2 - 1
src/main/java/com/caimei/modules/order/dao/CmRefundShopDao.java

@@ -11,5 +11,6 @@ import com.caimei.modules.order.entity.CmRefundShop;
  */
 @MyBatisDao
 public interface CmRefundShopDao extends CrudDao<CmRefundShop> {
-	
+
+    void updateByDelFlag(Integer refundShopId);
 }

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

@@ -23,4 +23,8 @@ public interface CmRefundShopRecordDao extends CrudDao<CmRefundShopRecord> {
     List<CmRefundShopRecord> getByRefundShopID(@Param("refundShopID") String id);
 
     CmPayShopRecord getPayedRecordByShopOrderId(Integer shopOrderID);
+
+    Integer findByRefundType(Integer shopOrderId);
+
+    void updateByDelFlag(Integer refundShopId);
 }

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

@@ -5,6 +5,7 @@ import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import org.apache.ibatis.annotations.Param;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -64,4 +65,8 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
     NewShopOrder findSiblingPostFeeOrder(@Param("orderID") Integer orderID);
 
     void updatePayStatus(@Param("shopOrderID") Integer shopOrderID,@Param("payStatus") String payStatus);
+
+    void updateByShopOtherFee(@Param("shopOtherFee") BigDecimal shopOtherFee, @Param("shopOrderId") Integer shopOrderId);
+
+    void updateByDifferencePrice(@Param("type") Integer type,@Param("differencePrice") BigDecimal differencePrice, @Param("shopOrderId") Integer shopOrderId);
 }

+ 201 - 0
src/main/java/com/caimei/modules/order/entity/ChangePayShopDifference.java

@@ -0,0 +1,201 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * Description
+ *
+ * @author : plf
+ * @date : 2021/5/26
+ */
+public class ChangePayShopDifference implements Serializable {
+    private Integer id;
+    /**
+     * 子订单Id
+     */
+    private Integer shopOrderId;
+
+    /**
+     * 修改差价金额的用户Id
+     */
+    private Integer refundShopId;
+
+    /**
+     * 差价金额
+     */
+    private BigDecimal differencePrice;
+
+    /**
+     * 差价类型:1 少付;2 多付
+     */
+    private Integer type;
+
+    /**
+     * 修改第三方金额的用户ID
+     */
+    private Integer modifyUserId;
+
+    /**
+     * 备注内容
+     */
+    private String remark;
+
+    /**
+     * 备注图片(多个使用,分割)
+     */
+    private String remarkImage;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    private String[] remarkImages;
+
+    /**
+     * 待付款金额
+     */
+    private BigDecimal waitPayShop;
+
+    /**
+     * 11 线下转账,22 欠款账簿
+     */
+    private String refundWay;
+
+    /**
+     * 线下转账银行
+     */
+    private Integer refundType;
+
+    /**
+     * 线下转账金额
+     */
+    private BigDecimal refundAmount;
+
+    /**
+     * 欠款账簿金额
+     */
+    private BigDecimal refundBalanceAmount;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getShopOrderId() {
+        return shopOrderId;
+    }
+
+    public void setShopOrderId(Integer shopOrderId) {
+        this.shopOrderId = shopOrderId;
+    }
+
+    public Integer getRefundShopId() {
+        return refundShopId;
+    }
+
+    public void setRefundShopId(Integer refundShopId) {
+        this.refundShopId = refundShopId;
+    }
+
+    public BigDecimal getDifferencePrice() {
+        return differencePrice;
+    }
+
+    public void setDifferencePrice(BigDecimal differencePrice) {
+        this.differencePrice = differencePrice;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getModifyUserId() {
+        return modifyUserId;
+    }
+
+    public void setModifyUserId(Integer modifyUserId) {
+        this.modifyUserId = modifyUserId;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getRemarkImage() {
+        return remarkImage;
+    }
+
+    public void setRemarkImage(String remarkImage) {
+        this.remarkImage = remarkImage;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String[] getRemarkImages() {
+        return remarkImages;
+    }
+
+    public void setRemarkImages(String[] remarkImages) {
+        this.remarkImages = remarkImages;
+    }
+
+    public BigDecimal getWaitPayShop() {
+        return waitPayShop;
+    }
+
+    public void setWaitPayShop(BigDecimal waitPayShop) {
+        this.waitPayShop = waitPayShop;
+    }
+
+    public String getRefundWay() {
+        return refundWay;
+    }
+
+    public void setRefundWay(String refundWay) {
+        this.refundWay = refundWay;
+    }
+
+    public BigDecimal getRefundAmount() {
+        return refundAmount;
+    }
+
+    public void setRefundAmount(BigDecimal refundAmount) {
+        this.refundAmount = refundAmount;
+    }
+
+    public BigDecimal getRefundBalanceAmount() {
+        return refundBalanceAmount;
+    }
+
+    public void setRefundBalanceAmount(BigDecimal refundBalanceAmount) {
+        this.refundBalanceAmount = refundBalanceAmount;
+    }
+
+    public Integer getRefundType() {
+        return refundType;
+    }
+
+    public void setRefundType(Integer refundType) {
+        this.refundType = refundType;
+    }
+}

+ 175 - 0
src/main/java/com/caimei/modules/order/entity/ChangePayShopOther.java

@@ -0,0 +1,175 @@
+package com.caimei.modules.order.entity;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 付第三方记录表
+ *
+ * @author : plf
+ * @date : 2021/5/26
+ */
+public class ChangePayShopOther implements Serializable {
+    private Integer id;
+    /**
+     * 子订单Id
+     */
+    private Integer shopOrderId;
+
+    /**
+     * 付第三方金额
+     */
+    private BigDecimal shopOtherFee;
+
+    /**
+     * 修改第三方金额的用户ID
+     */
+    private Integer modifyUserId;
+
+    /**
+     * 开户名
+     */
+    private String bankAccountName;
+
+    /**
+     * 账号
+     */
+    private String bankAccount;
+
+    /**
+     * 开户行
+     */
+    private String bankName;
+
+    /**
+     * 账号的类型 0公账, 1私账
+     */
+    private Integer type;
+
+    /**
+     * 备注内容
+     */
+    private String remark;
+
+    /**
+     * 备注图片(多个使用,分割)
+     */
+    private String remarkImage;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    private String[] remarkImages;
+
+    /**
+     * 系统用户名称
+     */
+    private String systemName;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getShopOrderId() {
+        return shopOrderId;
+    }
+
+    public void setShopOrderId(Integer shopOrderId) {
+        this.shopOrderId = shopOrderId;
+    }
+
+    public BigDecimal getShopOtherFee() {
+        return shopOtherFee;
+    }
+
+    public void setShopOtherFee(BigDecimal shopOtherFee) {
+        this.shopOtherFee = shopOtherFee;
+    }
+
+    public Integer getModifyUserId() {
+        return modifyUserId;
+    }
+
+    public void setModifyUserId(Integer modifyUserId) {
+        this.modifyUserId = modifyUserId;
+    }
+
+    public String getBankAccountName() {
+        return bankAccountName;
+    }
+
+    public void setBankAccountName(String bankAccountName) {
+        this.bankAccountName = bankAccountName;
+    }
+
+    public String getBankAccount() {
+        return bankAccount;
+    }
+
+    public void setBankAccount(String bankAccount) {
+        this.bankAccount = bankAccount;
+    }
+
+    public String getBankName() {
+        return bankName;
+    }
+
+    public void setBankName(String bankName) {
+        this.bankName = bankName;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getRemarkImage() {
+        return remarkImage;
+    }
+
+    public void setRemarkImage(String remarkImage) {
+        this.remarkImage = remarkImage;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String[] getRemarkImages() {
+        return remarkImages;
+    }
+
+    public void setRemarkImages(String[] remarkImages) {
+        this.remarkImages = remarkImages;
+    }
+
+    public String getSystemName() {
+        return systemName;
+    }
+
+    public void setSystemName(String systemName) {
+        this.systemName = systemName;
+    }
+}

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

@@ -3,6 +3,7 @@ package com.caimei.modules.order.service;
 import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.modules.common.utils.UploadUtils;
 import com.caimei.modules.hehe.dao.HeHeNewOrderDao;
+import com.caimei.modules.miniprogram.utils.UploadPicUtils;
 import com.caimei.modules.order.dao.*;
 import com.caimei.modules.order.entity.*;
 import com.caimei.modules.sys.utils.UploadImageUtils;
@@ -59,6 +60,8 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
     private CmRefundShopRecordDao cmRefundShopRecordDao;
     @Resource
     private HeHeNewOrderDao heHeNewOrderDao;
+    @Resource
+    private CmRefundShopDao cmRefundShopDao;
 
     public CmPayShop get(String id) {
         CmPayShop payShop = super.get(id);
@@ -692,4 +695,121 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         cpsr.setDelFlag("1");
         cmPayShopRecordDao.insert(cpsr);
     }
+
+    public ChangePayShopOther shopOtherFeeForm(Integer shopOrderId) {
+        ChangePayShopOther payShopOther = new ChangePayShopOther();
+        List<ChangePayShopOther> shopOtherList = cmPayShopRecordDao.findShopOtherFee(shopOrderId);
+        if (shopOtherList != null && shopOtherList.size() > 0) {
+            payShopOther = shopOtherList.get(0);
+        }
+        return payShopOther;
+    }
+
+    @Transactional(readOnly = false)
+    public void saveShopOtherFee(ChangePayShopOther payShopOther) {
+        String[] remarkImages = payShopOther.getRemarkImages();
+        if (remarkImages != null && remarkImages.length > 0) {
+            StringBuilder remarkImage = new StringBuilder();
+            for (String image : remarkImages) {
+                if (StringUtils.isNotBlank(image)) {
+                    String url = UploadPicUtils.saveImageToServer(image);
+                    remarkImage.append(url).append(",");
+                }
+            }
+            payShopOther.setRemarkImage(String.valueOf(remarkImage));
+        }
+        payShopOther.setModifyUserId(Integer.parseInt(UserUtils.getUser().getId()));
+        cmPayShopRecordDao.insertShopOtherFee(payShopOther);
+        newShopOrderDao.updateByShopOtherFee(payShopOther.getShopOtherFee(), payShopOther.getShopOrderId());
+    }
+
+    public ChangePayShopDifference differencePriceForm(Integer shopOrderId) {
+        ChangePayShopDifference payShopDifference = new ChangePayShopDifference();
+        payShopDifference.setShopOrderId(shopOrderId);
+        NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderId);
+        BigDecimal waitPayShop = BigDecimal.ZERO;
+        if (shopOrder != null) {
+            waitPayShop = MathUtil.sub(shopOrder.getShouldPayShopAmount(), shopOrder.getPayedShopAmount());
+        }
+        payShopDifference.setWaitPayShop(waitPayShop);
+        return payShopDifference;
+    }
+
+    @Transactional(readOnly = false)
+    public void saveDifferencePrice(ChangePayShopDifference payShopDifference) throws Exception {
+        String[] remarkImages = payShopDifference.getRemarkImages();
+        if (remarkImages != null && remarkImages.length > 0) {
+            StringBuilder remarkImage = new StringBuilder();
+            for (String image : remarkImages) {
+                if (StringUtils.isNotBlank(image)) {
+                    String url = UploadPicUtils.saveImageToServer(image);
+                    remarkImage.append(url).append(",");
+                }
+            }
+            payShopDifference.setRemarkImage(String.valueOf(remarkImage));
+        }
+        Integer shopOrderId = payShopDifference.getShopOrderId();
+        NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderId);
+        //查询之前是否有差价退款过
+        Integer refundShopId = cmRefundShopRecordDao.findByRefundType(shopOrderId);
+        if (refundShopId != null && refundShopId > 0) {
+            //逻辑删除
+            cmRefundShopDao.updateByDelFlag(refundShopId);
+            cmRefundShopRecordDao.updateByDelFlag(refundShopId);
+        }
+
+        //待付供应商金额
+        BigDecimal waitPayShop = MathUtil.sub(shopOrder.getShouldPayShopAmount(), shopOrder.getPayedShopAmount());
+        //补差价金额
+        BigDecimal differencePrice = payShopDifference.getDifferencePrice();
+        if (payShopDifference.getType() == 2 && MathUtil.compare(differencePrice, waitPayShop) > 0) {
+            //多付且差价大于待付金额,会发生供应商退款操作
+            BigDecimal waitRefund = MathUtil.sub(differencePrice, waitPayShop);
+            String refundWay = payShopDifference.getRefundWay();
+            BigDecimal refundAmount = payShopDifference.getRefundAmount();
+            BigDecimal refundBalanceAmount = payShopDifference.getRefundBalanceAmount();
+            if (refundWay.equals("1")) {
+                //线下退
+                refundBalanceAmount = BigDecimal.ZERO;
+            } else if (refundWay.contains("2")) {
+                //欠款账簿
+                refundAmount = BigDecimal.ZERO;
+            } else {
+                //两种方式都有
+                refundWay = "3";
+            }
+            if (MathUtil.compare(waitRefund, MathUtil.add(refundAmount, refundBalanceAmount)) == 0) {
+                CmRefundShop refundShop = new CmRefundShop();
+                String time = DateUtils.formatDateTime(new Date());
+                User currentUser = UserUtils.getUser();
+                refundShop.setShopID(shopOrder.getShopID().toString());
+                refundShop.setOperator(currentUser.getId());
+                refundShop.setOperatTime(time);
+                refundShop.setRefundWay(refundWay);
+                refundShop.setRefundAmount(refundAmount.doubleValue());
+                refundShop.setRefundBalanceAmount(refundBalanceAmount.doubleValue());
+                refundShop.setRefundType(payShopDifference.getRefundType().toString());
+                refundShop.setRemark(payShopDifference.getRemark());
+                refundShop.setDelFlag("0");
+                cmRefundShopDao.insert(refundShop);
+
+                CmRefundShopRecord record = new CmRefundShopRecord();
+                record.setShopID(String.valueOf(shopOrder.getShopID()));
+                record.setShopOrderID(shopOrder.getShopOrderID().toString());
+                record.setShopOrderNo(shopOrder.getShopOrderNo());
+                record.setRefundType("5");
+                record.setRefundAmount(waitRefund.doubleValue());
+                record.setRefundTime(time);
+                record.setRefundShopID(refundShop.getId());
+                record.setDelFlag("0");
+                cmRefundShopRecordDao.insert(record);
+                payShopDifference.setRefundShopId(Integer.valueOf(refundShop.getId()));
+            } else {
+                throw new Exception("退款金额异常");
+            }
+        }
+        payShopDifference.setModifyUserId(Integer.parseInt(UserUtils.getUser().getId()));
+        cmPayShopRecordDao.insertDifference(payShopDifference);
+        newShopOrderDao.updateByDifferencePrice(payShopDifference.getType(), differencePrice, shopOrderId);
+    }
 }

+ 31 - 5
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -12,6 +12,9 @@ import com.caimei.modules.product.dao.ProductDao;
 import com.caimei.modules.product.entity.CmPromotion;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.modules.sys.entity.User;
+import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -281,12 +284,18 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
             Double receiptTotalFee = cmReceiptOrderRelationDao.findPayFeeByOrderID(so.getOrderID().toString());
             so.setReceiptTotalFee(receiptTotalFee);
 
-            Integer id = cmReceiptOrderRelationDao.findOnlinePayment(so.getOrderID());
-            if (id != null && id > 0) {
-                //发生线上支付,不能修改应付
-                so.setModifyPayable(true);
+            //第一次收款收款时间
+            Date receiptDate = cmReceiptOrderRelationDao.findOnlinePayment(so.getOrderID());
+            if (receiptDate != null) {
+                Calendar cal = Calendar.getInstance();
+                cal.setTime(receiptDate);
+                //第一次支付,23小时之类可以修改成本
+                cal.add(Calendar.HOUR, 23);
+                if (cal.getTime().compareTo(new Date()) < 0) {
+                    //发生线上支付,不能修改应付
+                    so.setModifyPayable(true);
+                }
             }
-
             List<NewOrderProduct> orderProductList = newOrderProductDao.findByShopOrderID(so.getShopOrderID());
             for (NewOrderProduct p : orderProductList) {
                 Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(so.getShopOrderID(), p.getOrderProductID());
@@ -551,4 +560,21 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
     public void updatePayStatus(NewShopOrder item) {
         newShopOrderDao.updatePayStatus(item.getShopOrderID(), item.getPayStatus());
     }
+
+    public List<ChangePayShopOther> shopOtherRemark(Integer shopOrderId) {
+        List<ChangePayShopOther> shopOtherList = cmPayShopRecordDao.findShopOtherFee(shopOrderId);
+        if (shopOtherList != null && shopOtherList.size() > 0) {
+            shopOtherList.forEach(other -> {
+                User user = UserUtils.get(other.getModifyUserId().toString());
+                if (user != null) {
+                    other.setSystemName(user.getName());
+                }
+                if (StringUtils.isNotBlank(other.getRemarkImage())){
+                    String[] remarkImages = other.getRemarkImage().split(",");
+                    other.setRemarkImages(remarkImages);
+                }
+            });
+        }
+        return shopOtherList;
+    }
 }

+ 55 - 6
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -9,7 +9,6 @@ import com.caimei.modules.user.entity.CmUserOrganize;
 import com.caimei.modules.user.service.CmUserOrganizeService;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.utils.DateUtils;
 import com.thinkgem.jeesite.common.utils.Encodes;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.common.web.BaseController;
@@ -320,16 +319,16 @@ public class CmPayShopController extends BaseController {
             AtomicReference<Boolean> zeroCostFlag = new AtomicReference<>(true);
             AtomicReference<Boolean> freightFlag = new AtomicReference<>(false);
 
-            newOrder.getNewShopOrders().forEach(item->{
+            newOrder.getNewShopOrders().forEach(item -> {
                 if (item.getShopID().equals(998)) {
                     freightFlag.set(true);
-                }else if (!item.getShopOrderID().equals(shopOrder.getShopOrderID()) &&  0 == item.getZeroCostFlag()){
+                } else if (!item.getShopOrderID().equals(shopOrder.getShopOrderID()) && 0 == item.getZeroCostFlag()) {
                     zeroCostFlag.set(false);
                 }
             });
             //如果含有运费子订单且其他子订单都为0成本,将运费子订单置为已付款
-            if (freightFlag.get() && zeroCostFlag.get()){
-                newOrder.getNewShopOrders().forEach(item->{
+            if (freightFlag.get() && zeroCostFlag.get()) {
+                newOrder.getNewShopOrders().forEach(item -> {
                     if (item.getShopID().equals(998)) {
                         item.setPayStatus("3");
                         //更新运费子订单
@@ -342,7 +341,7 @@ public class CmPayShopController extends BaseController {
             if (zeroCostFlag.get()) {
                 newOrder.setPayStatus("3");
                 newOrder.setZeroCostFlag(1);
-            }else {
+            } else {
                 newOrder.setPayStatus("2");
                 newOrder.setZeroCostFlag(0);
             }
@@ -751,4 +750,54 @@ public class CmPayShopController extends BaseController {
         }
         return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/?repage";
     }
+
+    /**
+     * 付第三方数据回显
+     */
+    @RequestMapping("shopOtherFeeForm")
+    public String shopOtherFeeForm(Integer shopOrderId, Model model) {
+        ChangePayShopOther payShopOther = cmPayShopService.shopOtherFeeForm(shopOrderId);
+        payShopOther.setShopOrderId(shopOrderId);
+        NewShopOrder shopOrder = newShopOrderService.findByShopOrderID(shopOrderId);
+        Double brokerage = shopOrder.getBrokerage();
+        brokerage = brokerage == null ? 0d : brokerage;
+        model.addAttribute("brokerage", brokerage);
+        model.addAttribute("payShopOther", payShopOther);
+        return "modules/order/shopOtherFeeForm";
+    }
+
+    /**
+     * 保存修改第三方金额
+     */
+    @RequestMapping("saveShopOtherFee")
+    public String saveShopOtherFee(ChangePayShopOther payShopOther, RedirectAttributes redirectAttributes) {
+        cmPayShopService.saveShopOtherFee(payShopOther);
+        addMessage(redirectAttributes, "保存成功");
+        return "redirect:" + Global.getAdminPath() + "/shopOrder/payOrderList?operatingMode=1";
+    }
+
+    /**
+     * 供应商差价数据回显
+     */
+    @RequestMapping("differencePriceForm")
+    public String differencePriceForm(Integer shopOrderId, Model model) {
+        ChangePayShopDifference payShopDifference = cmPayShopService.differencePriceForm(shopOrderId);
+        model.addAttribute("payShopDifference", payShopDifference);
+        return "modules/order/differencePriceForm";
+    }
+
+    /**
+     * 保存供应商差价
+     */
+    @RequestMapping("saveDifferencePrice")
+    public String saveDifferencePrice(ChangePayShopDifference payShopDifference, RedirectAttributes redirectAttributes) {
+        addMessage(redirectAttributes, "修改差价成功");
+        try {
+            cmPayShopService.saveDifferencePrice(payShopDifference);
+        } catch (Exception e) {
+            e.printStackTrace();
+            addMessage(redirectAttributes, e.getMessage());
+        }
+        return "redirect:" + Global.getAdminPath() + "/shopOrder/payOrderList?operatingMode=1";
+    }
 }

+ 29 - 20
src/main/java/com/caimei/modules/order/web/CmShopOrderController.java

@@ -41,9 +41,9 @@ public class CmShopOrderController extends BaseController {
     @Autowired
     private CmUserOrganizeService cmUserOrganizeService;
     @Autowired
-	private CmChangePayShopRecondService cmChangePayShopRecondService;
-	@Autowired
-	private CmChangePayShopProductService cmChangePayShopProductService;
+    private CmChangePayShopRecondService cmChangePayShopRecondService;
+    @Autowired
+    private CmChangePayShopProductService cmChangePayShopProductService;
 
     @ModelAttribute
     public NewShopOrder get(@RequestParam(required = false) String id) {
@@ -95,17 +95,17 @@ public class CmShopOrderController extends BaseController {
 
 
     @RequestMapping("payShopRemark")
-    public String payShopRemark (CmChangePayShopRecond cmChangePayShopRecond, HttpServletRequest request, HttpServletResponse response, Model model){
+    public String payShopRemark(CmChangePayShopRecond cmChangePayShopRecond, HttpServletRequest request, HttpServletResponse response, Model model) {
         Integer shopOrderId = cmChangePayShopRecond.getShopOrderId();
         List<CmChangePayShopRecond> payShopRecondList = cmChangePayShopRecondService.getByShopOrderId(shopOrderId);
-        if(CollectionUtils.isNotEmpty(payShopRecondList)){
-            for(CmChangePayShopRecond shopOrder : payShopRecondList){
-                if(StringUtils.equals(shopOrder.getChangeType(),"1")){
+        if (CollectionUtils.isNotEmpty(payShopRecondList)) {
+            for (CmChangePayShopRecond shopOrder : payShopRecondList) {
+                if (StringUtils.equals(shopOrder.getChangeType(), "1")) {
                     List<CmChangePayShopProduct> shopProductList = cmChangePayShopProductService.getByPayShopId(Integer.parseInt(shopOrder.getId()));
                     shopOrder.setCmChangePayShopProductList(shopProductList);
                 }
                 String remarkImage = shopOrder.getRemarkImage();
-                if(StringUtils.isNotEmpty(remarkImage)){
+                if (StringUtils.isNotEmpty(remarkImage)) {
                     String[] split = remarkImage.split(",");
                     List<String> strings = Arrays.asList(split);
                     shopOrder.setCmImageList(strings);
@@ -118,35 +118,35 @@ public class CmShopOrderController extends BaseController {
     }
 
     @RequestMapping("toChangePayShopAmount")
-    public String toChangePayShopAmount(NewShopOrder newShopOrder, HttpServletRequest request, HttpServletResponse response, Model model){
+    public String toChangePayShopAmount(NewShopOrder newShopOrder, HttpServletRequest request, HttpServletResponse response, Model model) {
         // 该记录只存在一条
         String costType = newShopOrder.getCostType();
         String dbCostType = "";
         Page<NewShopOrder> page = newShopOrderService.findPayOrderList(new Page<>(request, response), newShopOrder);
         List<NewShopOrder> list = page.getList();
-        if(CollectionUtils.isNotEmpty(list) && list.size() == 1){
+        if (CollectionUtils.isNotEmpty(list) && list.size() == 1) {
             dbCostType = list.get(0).getCostType();
         }
         model.addAttribute("dbCostType", dbCostType);
-        if(StringUtils.isEmpty(dbCostType))dbCostType = costType;
+        if (StringUtils.isEmpty(dbCostType)) dbCostType = costType;
         model.addAttribute("page", page);
         model.addAttribute("shopOrderId", newShopOrder.getShopOrderID());
-        if(StringUtils.equals("1",dbCostType) || StringUtils.isEmpty(dbCostType) ){
+        if (StringUtils.equals("1", dbCostType) || StringUtils.isEmpty(dbCostType)) {
             return "modules/order/cmPayShopChange";
-        }else{
+        } else {
             return "modules/order/cmPayShopChange1";
         }
 
     }
 
-	@RequiresPermissions("order:cmPayShop:view")
-	@RequestMapping("toApplyPayWipe")
-	public String applyWipeEdit(NewShopOrder newShopOrder, HttpServletRequest request, HttpServletResponse response, Model model){
-		Page<NewShopOrder> page = newShopOrderService.findPayOrderList(new Page<>(request, response), newShopOrder);
-		model.addAttribute("page", page);
+    @RequiresPermissions("order:cmPayShop:view")
+    @RequestMapping("toApplyPayWipe")
+    public String applyWipeEdit(NewShopOrder newShopOrder, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<NewShopOrder> page = newShopOrderService.findPayOrderList(new Page<>(request, response), newShopOrder);
+        model.addAttribute("page", page);
         model.addAttribute("shopOrderId", newShopOrder.getShopOrderID());
-		return "modules/order/cmPayShopWipe";
-	}
+        return "modules/order/cmPayShopWipe";
+    }
 
     @RequiresPermissions("order:cmPayShop:view")
     @RequestMapping("payedAndRefundRecordList")
@@ -199,5 +199,14 @@ public class CmShopOrderController extends BaseController {
         model.addAttribute("order", order);
         return "modules/order/refundRecord";
     }
+
+    /**
+     * 付第三方备注
+     */
+    @RequestMapping("shopOtherRemark")
+    public String shopOtherRemark(Integer shopOrderId, Model model) {
+        List<ChangePayShopOther> shopOtherList = newShopOrderService.shopOtherRemark(shopOrderId);
+        return "";
+    }
 }
 

+ 48 - 0
src/main/resources/mappings/modules/order/CmPayShopRecordMapper.xml

@@ -221,4 +221,52 @@
 	<update id="applyCompileSave" parameterType="com.caimei.modules.order.entity.CmPayShop">
 		UPDATE cm_pay_shop SET payType = #{payType},payTime = #{payTime} WHERE id = #{id}
 	</update>
+
+	<select id="findShopOtherFee" resultType="com.caimei.modules.order.entity.ChangePayShopOther">
+		SELECT
+		  `id`,
+		  `shopOrderId`,
+		  `shopOtherFee`,
+		  `bankAccountName`,
+		  `bankAccount`,
+		  `bankName`,
+		  `type`,
+		  `remark`,
+		  `remarkImage`,
+		  `updateTime`
+		FROM
+		  `cm_change_pay_shop_other`
+		WHERE
+		  shopOrderId = #{shopOrderId}
+		ORDER BY
+		  updateTime DESC
+	</select>
+
+	<insert id="insertShopOtherFee">
+		INSERT INTO `cm_change_pay_shop_other` (
+		  `shopOrderId`, `shopOtherFee`, `bankAccountName`,
+		  `bankAccount`, `bankName`, `type`, modifyUserId,
+		  `remark`, `remarkImage`, `updateTime`
+		)
+		VALUES
+		  (
+			#{shopOrderId}, #{shopOtherFee}, #{bankAccountName},
+			#{bankAccount}, #{bankName}, #{type}, #{modifyUserId},
+			#{remark}, #{remarkImage}, NOW()
+		  )
+	</insert>
+
+	<insert id="insertDifference">
+		INSERT INTO `cm_change_pay_shop_difference` (
+		  `shopOrderId`, `modifyUserId`, `refundShopId`,
+		  `differencePrice`, `type`, `remark`,
+		  `remarkImage`, `updateTime`
+		)
+		VALUES
+		  (
+			#{shopOrderId}, #{modifyUserId}, #{refundShopId},
+			#{differencePrice}, #{type}, #{remark},
+			#{remarkImage}, NOW()
+		  )
+	</insert>
 </mapper>

+ 4 - 2
src/main/resources/mappings/modules/order/CmReceiptOrderRelationMapper.xml

@@ -186,9 +186,9 @@
 		GROUP BY orderID
 	</select>
 
-	<select id="findOnlinePayment" resultType="integer">
+	<select id="findOnlinePayment" resultType="date">
 		SELECT
-		  cror.id
+		  cdr.receiptDate
 		FROM
 		  cm_receipt_order_relation cror
 		  LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
@@ -197,6 +197,8 @@
 		  AND cror.delFlag = 0
 		  AND cdr.payWay = 1
 		  AND cror.orderID = #{orderID}
+		ORDER BY
+		  cdr.receiptDate
 		LIMIT
 		  1
 	</select>

+ 4 - 0
src/main/resources/mappings/modules/order/CmRefundShopMapper.xml

@@ -163,4 +163,8 @@
 		WHERE id = #{id}
 	</delete>
 
+	<update id="updateByDelFlag">
+		UPDATE cm_refund_shop SET delFlag = 1 WHERE id = #{refundShopId}
+	</update>
+
 </mapper>

+ 10 - 0
src/main/resources/mappings/modules/order/CmRefundShopRecordMapper.xml

@@ -66,6 +66,7 @@
 			shopOrderID,
 			shopOrderNo,
 			refundAmount,
+			refundType,
 			refundTime,
 			refundShopID,
 			delFlag
@@ -75,6 +76,7 @@
 			#{shopOrderID},
 			#{shopOrderNo},
 			#{refundAmount},
+			#{refundType},
 			#{refundTime},
 			#{refundShopID},
 			#{delFlag}
@@ -138,4 +140,12 @@
 		WHERE a.shopOrderID = #{shopOrderID} and a.delFlag = '0' and a.status = '1'
 		GROUP BY shopOrderID
 	</select>
+
+	<select id="findByRefundType" resultType="integer">
+		SELECT refundShopID FROM cm_refund_shop_record WHERE shopOrderID = #{shopOrderId} AND refundType = 5
+	</select>
+
+	<update id="updateByDelFlag">
+		UPDATE cm_refund_shop_record SET delFlag = 1 WHERE refundShopID = #{refundShopId}
+	</update>
 </mapper>

+ 8 - 0
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -959,4 +959,12 @@
 		from cm_shop_order a
 		where  a.orderID = #{orderID} and a.shopID = 998
 	</select>
+
+	<update id="updateByShopOtherFee">
+		 UPDATE cm_shop_order SET shopOtherFee = #{shopOtherFee} WHERE shopOrderID = #{shopOrderId}
+	</update>
+
+	<update id="updateByDifferencePrice">
+		UPDATE cm_shop_order SET differenceType = #{type}, differencePrice = #{differencePrice} WHERE shopOrderID = #{shopOrderId}
+	</update>
 </mapper>

+ 5 - 17
src/main/webapp/WEB-INF/views/modules/order/cmPayShopChange.jsp

@@ -30,15 +30,6 @@
             margin-left: 0;
         }
 
-        #increase, #decrease, .lineNum {
-            width: 30px;
-            height: 30px;
-        }
-
-        .lineNum {
-            text-align: center;
-        }
-
         .dateInput input {
             width: 150px;
         }
@@ -115,9 +106,6 @@
         .hide-pic {
             display: none !important;
         }
-        .upload-tips {
-            margin: 10px 0;
-        }
 	</style>
 	<script type="text/javascript">
         $(document).ready(function() {
@@ -177,7 +165,7 @@
 <ul class="nav nav-tabs">
 		<li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
 		<li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
-		<li class="active"><a href="${ctx}/shopOrder/toChangePayShopAmount?costType=1&shopOrderID=${shopOrderId}">修改应付</a></li>
+		<li class="active"><a href="${ctx}/shopOrder/toChangePayShopAmount?costType=1&shopOrderID=${shopOrderId}">修改成本</a></li>
 </ul>
 <input type="hidden" id="confirmProductNames">
 <form:form id="inputForm" modelAttribute="newShopOrder" action="${ctx}/order/cmPayShop/saveChangePayShopAmount?id=${shopOrderId}&costType=1" method="post"
@@ -251,17 +239,17 @@
 					<td>
 						<b>供应商运费:</b><input type="number" id="shopPostFee" name="shopPostFee"  onchange="changeShouldPay(this)"  value="${newShopOrder.shopPostFee}" style="margin-left: 20px"/>
 					</td>
-					<td>
+					<%--<td>
 						<b>付第三方:</b><input type="number" id="shopOtherFee" name="shopOtherFee"  onchange="inputnum(this)"  value="${newShopOrder.shopOtherFee}" style="margin-left: 5px;"/>
-					</td>
+					</td>--%>
 				</tr>
 				<tr>
 					<td style="padding-top: 10px;">
 						<b>付供应商:</b><font color="red"><span id="div-supplier-fee">${newShopOrder.shouldPayShopAmount}</span></font>
 					</td>
-					<td style="padding-top: 10px;">
+					<%--<td style="padding-top: 10px;">
 						<b>已付供应商:</b><font color="red"><span id="div-payedShopAmount">${newShopOrder.payedShopAmount}</span></font>
-					</td>
+					</td>--%>
 				</tr>
 			</table>
 			<div style="margin-top: 10px">

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

@@ -206,14 +206,14 @@
                             <input type="number" id="shopPostFee" name="shopPostFee"  onchange="changeShouldPay(this)"  value="${newShopOrder.shopPostFee}" style="margin-left: 20px"/>
                         </td>
                     </tr>
-                    <tr>
+                    <%--<tr>
                         <td>
                            <b>付第三方:</b>
                         </td>
                         <td>
                             <input type="number" id="shopOtherFee" name="shopOtherFee"  onchange="inputnum(this)"  value="${newShopOrder.shopOtherFee}" style="margin-left: 20px;"/>
                         </td>
-                    </tr>
+                    </tr>--%>
 
                 </table>
 			</div>
@@ -223,9 +223,9 @@
 					<td style="padding-top: 10px;">
 						<b>付供应商:</b><font color="red"><span id="div-supplier-fee">${newShopOrder.shouldPayShopAmount}</span></font>
 					</td>
-					<td style="padding-top: 10px;padding-left: 87px">
+					<%--<td style="padding-top: 10px;padding-left: 87px">
 						<b>已付供应商:</b><font color="red"><span id="div-payedShopAmount">${newShopOrder.payedShopAmount}</span></font>
-					</td>
+					</td>--%>
 				</tr>
 			</table>
 			<div style="margin-top: 10px">

+ 9 - 4
src/main/webapp/WEB-INF/views/modules/order/cmPayShopChangeRecond.jsp

@@ -102,6 +102,11 @@
 
 <form:form id="inputForm" modelAttribute="newShopOrder" action="${ctx}/shopOrder/payShopRemark?shopOrderId=${shopOrderId}" method="post"
            class="form-horizontal">
+        <ul class="nav nav-tabs" id="myTab">
+                <li class="active"><a href="">修改成本备注</a></li>
+                <li><a href="">修改付第三方备注</a></li>
+                <li><a href="">修改供应商差价备注</a></li>
+        </ul>
         <c:if test="${not empty payShopRecondList}">
             <c:forEach items="${payShopRecondList}" var="payShopRecond">
                 <c:if test="${payShopRecond.recondType eq 2}">
@@ -134,7 +139,7 @@
                                 <tr>
                                 <lable>供应商运费:<fmt:formatNumber type="number" pattern="0.00" value="${payShopRecond.shopPostFee}"/></lable>
                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                                <lable>付第三方:<fmt:formatNumber type="number" pattern="0.00" value="${empty payShopRecond.shopOtherFee  ? 0 : payShopRecond.shopOtherFee}"/></lable>
+                                <%--<lable>付第三方:<fmt:formatNumber type="number" pattern="0.00" value="${empty payShopRecond.shopOtherFee  ? 0 : payShopRecond.shopOtherFee}"/></lable>--%>
                                 </tr>
                             </table>
                             <br>
@@ -150,9 +155,9 @@
                                 <tr>
                                     <td>供应商运费:<fmt:formatNumber type="number" pattern="0.00" value="${payShopRecond.shopPostFee}"/></td>
                                 </tr>
-                                <tr>
+                                <%--<tr>
                                     <td>付第三方:<fmt:formatNumber type="number" pattern="0.00" value="${empty payShopRecond.shopOtherFee  ? 0 : payShopRecond.shopOtherFee}"/></td>
-                                </tr>
+                                </tr>--%>
                             </table>
                             <br>
                         </c:if>
@@ -207,7 +212,7 @@
                         <tr>
                         <lable>供应商运费:<fmt:formatNumber type="number" pattern="0.00" value="${payShopRecond.shopPostFee}"/></lable>
                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                        <lable>付第三方:<fmt:formatNumber type="number" pattern="0.00" value="${empty payShopRecond.shopOtherFee  ? 0 : payShopRecond.shopOtherFee}"/></lable>
+                        <%--<lable>付第三方:<fmt:formatNumber type="number" pattern="0.00" value="${empty payShopRecond.shopOtherFee  ? 0 : payShopRecond.shopOtherFee}"/></lable>--%>
                         </tr>
                     </table>
                 </c:if>

+ 12 - 10
src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp

@@ -569,19 +569,21 @@
                 </c:forEach>
             </table>
             <div class="pay-more-func">
-                <c:if test="${operatingMode == '1'}">
-                    <c:if test="${s.paying ne '1' and s.payStatus ne '3' and !s.modifyPayable}">
+                <c:if test="${s.paying ne '1' and s.payStatus ne '3' and !s.modifyPayable}">
+                    <shiro:hasPermission name="order:cmPayShop:modifyPay">
+                        <a href="${ctx}/shopOrder/toChangePayShopAmount?shopOrderID=${s.shopOrderID}">修改成本</a>
+                    </shiro:hasPermission>
+                </c:if>
+                <c:if test="${s.modifyPayable and s.paying ne '1'}">
+                    <a href="${ctx}/order/cmPayShop/differencePriceForm?shopOrderId=${s.shopOrderID}">供应商差价</a>
+                </c:if>
+                <a href="${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=${s.shopOrderID}">付第三方</a>
+                <c:if test="${s.paying ne '1' and s.payStatus eq '2'}">
+                    <c:if test="${!s.modifyPayable || s.receiptStatus eq '3'}">
                         <shiro:hasPermission name="order:cmPayShop:modifyPay">
-                            <a href="${ctx}/shopOrder/toChangePayShopAmount?shopOrderID=${s.shopOrderID}">修改应付</a>
+                            <a href="${ctx}/shopOrder/toApplyPayWipe?shopOrderID=${s.shopOrderID}">付款抹平</a>
                         </shiro:hasPermission>
                     </c:if>
-                    <c:if test="${s.paying ne '1' and s.payStatus eq '2'}">
-                        <c:if test="${!s.modifyPayable || s.receiptStatus eq '3'}">
-                            <shiro:hasPermission name="order:cmPayShop:modifyPay">
-                                <a href="${ctx}/shopOrder/toApplyPayWipe?shopOrderID=${s.shopOrderID}">付款抹平</a>
-                            </shiro:hasPermission>
-                        </c:if>
-                    </c:if>
                 </c:if>
                 <a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${s.shopOrderID}">应付备注</a>
                 <a href="${ctx}/shopOrder/payedAndRefundRecordList?shopOrderID=${s.shopOrderID}&operatingMode=${operatingMode}">退/付款记录</a>

+ 430 - 0
src/main/webapp/WEB-INF/views/modules/order/differencePriceForm.jsp

@@ -0,0 +1,430 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>申请付款</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        .pay-table th {
+            background: #f9f9f9
+        }
+
+        .pay-table tr:first-child th {
+            background: #eee !important
+        }
+
+        .pay-table td {
+            background: #fff !important
+        }
+
+        input[type="checkbox"]::before {
+            content: '\a0';
+            display: inline-block;
+            vertical-align: .2em;
+            width: .8em;
+            height: .8em;
+            margin-right: .2em;
+            border-radius: .2em;
+            text-indent: .15em;
+            line-height: .65
+        }
+
+        .pay-more-func span:first-child {
+            margin-right: 6px
+        }
+
+        .pay-more-func span:hover {
+            color: #7aa9c3
+        }
+
+        .tips-popup-content p {
+            text-align: center;
+            padding: 80px;
+            font-size: 20px
+        }
+
+        .revise-popup-content h4, .tips-popup-content h4 {
+            padding-left: 10px;
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px solid #eee;
+            margin-bottom: 20px
+        }
+
+        .revise-popup-content div {
+            margin-top: 7px;
+            text-align: center
+        }
+
+        .revise-popup-content label {
+            width: 70px;
+            text-align: right;
+            vertical-align: text-bottom
+        }
+
+        .revise-popup-content button {
+            width: 80px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:first-child {
+            margin-left: -104px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:last-child {
+            margin-left: 30px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span span {
+            margin-left: 10px
+        }
+
+        .revise-popup-content > div:last-child {
+            text-align: center;
+            margin-top: 20px
+        }
+
+        .revise-popup-content input {
+            width: 100px;
+            margin-bottom: 0px
+        }
+
+        .form-search label {
+            width: 80px;
+            text-align: left;
+            margin-top: 12px
+        }
+
+        .remark-title span {
+            color: red
+        }
+
+        .ul-form label {
+            width: 90px;
+            text-align: left;
+            margin-top: 15px
+        }
+
+        .pay-status label {
+            margin-left: 0
+        }
+
+        .pay-status label:first-child {
+            margin-left: 10px
+        }
+        .controls{
+            font-size: 0;
+        }
+        .controls .conList{
+            display: inline-block;
+            margin-right: 15px;
+        }
+        .conList .btn:nth-of-type(1){
+            margin-left: 25px;
+        }
+        .upload-content {
+            margin-top: -70px;
+            display: inline-block;
+        }
+        .upload-content .conList .btn:nth-of-type(1) {
+            width: 90px;
+            height: 100px;
+            border: 2px solid #eee;
+            background: #fff;
+            position: relative;
+        }
+        .upload-content .conList .btn:nth-of-type(1)>div {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            color: #666;
+        }
+        .upload-content .conList .btn:nth-of-type(1) span {
+            font-size: 35px;
+        }
+        .upload-content .conList .btn:nth-of-type(1) h5 {
+            color: #666;
+        }
+        .cancel-upload {
+            background: transparent;
+            border: none;
+            box-shadow: none;
+            position: relative;
+            top: -38px;
+            left: -25px;
+            cursor: pointer;
+            z-index: 100;
+        }
+        .upload-content .conList ol li {
+            width: 114px;
+            min-height: 80px;
+            text-align: center;
+            background: #fff;
+            position: relative;
+            top: 120px;
+            margin-left: 2px;
+        }
+        .hide-pic {
+            display: none !important;
+        }
+        .refund-methods{height:auto !important}
+        .refund-methods>div{display:inline-block}
+        .refund-methods label{vertical-align:top;line-height:50px}
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $("#inputForm").validate({
+                ignore:"",
+                submitHandler: function (form) {
+                    var type = $("input[name='type']:checked").val();
+                    var differencePrice = $("#differencePrice").val();
+                    var waitPayShop = ${payShopDifference.waitPayShop};
+                    if (type == 2 && differencePrice > waitPayShop) {
+                        var refundCheckbox = $('.refund-checkbox:checked');
+                        var inputTotalAmount = 0;
+                        refundCheckbox.each(function () {
+                            var wrapper = $(this).closest('.refund-wrapper'),
+                                thisAmount = wrapper.find('.refund-amount');
+                            inputTotalAmount += Number(thisAmount.val());
+                            console.log('===', inputTotalAmount);
+                        });
+                        if (Number(inputTotalAmount - differencePrice + waitPayShop) > 0.1) {
+                            alertx("退款金额应等于差价与代付金额的差值");
+                            return false;
+                        }
+                    }
+                    /*var shopPostFee = $("#shopPostFee").val();
+                    var brokerage = ${brokerage};
+                    if (brokerage < shopPostFee) {
+                        top.$.jBox.confirm("付第三方的值不合理,导致佣金为负,确认继续吗?", '提示', function (v, h, f) {
+                            if (v == true) {
+                                loading('正在提交,请稍等...');
+                                form.submit();
+                            }
+                            return;
+                        }, {buttons: {'取消': false, '确定': true}});
+                    } else {*/
+                        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>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
+    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+    <li class="active"><a href="${ctx}/order/cmPayShop/differencePriceForm?shopOrderId=${payShopDifference.shopOrderId}">供应商差价</a></li>
+</ul>
+<form:form id="inputForm" modelAttribute="payShopDifference" action="${ctx}/order/cmPayShop/saveDifferencePrice" method="post" class="form-horizontal">
+    <form:hidden path="shopOrderId"/>
+    <br>
+    <div class="control-group">
+        <label class="control-label">差价类型:</label>&nbsp;&nbsp;&nbsp;
+            <input type="radio" name="type" value="1" checked="true" onclick="showInfo()">少付&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            <input type="radio" name="type" value="2" onclick="showInfo()">多付&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            <img src="/static/images/info.jpg" style="height: 20px;width: 20px" onclick="alertx('“少付”指成本变高了,按旧成本付款的话相当于会少付供应商,但是线上支付的订单不能修改成本,所以通过补差价的方式来弥补;“多付”指成本变低了,按旧成本付款的话相当于会多付供应商,但是线上支付的订单不能修改成本,所以通过退差价的方式来弥补。')">
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color='red'>*</font>差价金额:</label>
+        <div class="controls">
+            <input type="number" id="differencePrice" required name="differencePrice" onchange="showInfo()"/>
+            <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(目前子订单待付金额为¥${payShopDifference.waitPayShop})</label>
+        </div>
+    </div>
+    <div class="control-group" id="refundShow" hidden>
+        <div class="refund-methods">
+            <label class="control-label">接收退款方式:</label>
+            <div>
+                <div class="refund-wrapper">
+                    <input type="checkbox" class="refund-checkbox" name="refundWay" value="1" checked>线下转账&nbsp
+                    <select name="refundType" id="refundType">
+                        <option value="1">建设银行7297</option>
+                        <option value="2">中信银行0897</option>
+                        <option value="3">中信银行7172</option>
+                        <option value="4">广发银行0115</option>
+                        <option value="5">广发银行5461</option>
+                        <option value="6">虚拟银行0000</option>
+                    </select>
+                    <input type="number" name="refundAmount" class="refund-amount" value="0.00">
+                </div><br>
+                <div class="refund-wrapper">
+                    <input type="checkbox" class="refund-checkbox" name="refundWay" value="2">欠款账簿
+                    <input type="number" name="refundBalanceAmount" class="refund-amount" value="0.00">
+                </div><br>
+                <font color="red">注意:两种退款方式金额之和应该等于差价金额与待付金额的差值</font>
+            </div>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color='red'>*</font>备注内容:</label>
+        <div class="controls">
+            <textarea type="text" name="remark" placeholder="请详细说明造成付供应商差价的原因" style="position: relative;height: 100px; width: 450px;" maxlength="500" required ></textarea>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label">图片:</label>
+        <div class="controls upload-content" style="margin: -91px 0px 0px 16px;" id="remarkImageBox">
+            <div class="conList">
+                <form:hidden id="remarkImage1" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage2" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage2" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage3" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage3" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage4" path="" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage4" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage5" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage5" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage6" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage6" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage7" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage7" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage8" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage8" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList  hide-pic">
+                <form:hidden id="remarkImage9" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage9" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList  hide-pic">
+                <form:hidden id="remarkImage10" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage10" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+        </div>
+    </div>
+    <div class="form-actions">
+        <input id="btnSubmit" style="margin-left: 150px" class="btn btn-primary" type="submit" value="确认"/>&nbsp;&nbsp;&nbsp;&nbsp;
+        <input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)"/>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<script>
+
+    //图片初始化
+    $(function () {
+        $('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+        $('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
+        $('.upload-content .conList').find('.cancel-upload').hide();
+        var observeEle = document.getElementsByClassName('upload-content')[0];
+        var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
+        var MutationObserverConfig={
+            childList: true,
+            subtree: true,
+            characterData: true
+        };
+        var observer = new MutationObserver(function(mutations){
+            $.each(mutations, function(index,item) {
+                if (item.type === 'childList') {
+                    // 在创建新的 element 时调用
+                    var target = $(item.target),
+                        thisWrapper = target.closest('.conList'),
+                        nextEle = thisWrapper.next();
+                    thisWrapper.find('li').css('z-index',99);
+                    thisWrapper.find('.cancel-upload').show();
+                    if(nextEle.hasClass('hide-pic')) {
+                        nextEle.removeClass('hide-pic');
+                    }
+                }
+            })
+        });
+        observer.observe(observeEle,MutationObserverConfig);
+
+        $('body').on('click','.upload-content li',function() {
+            var index = $(this).closest('.conList').index() + 1,
+                str = 'remarkImage'+index+'FinderOpen';
+            eval(str+'()');
+        });
+        $('body').on('click', '.cancel-upload',function() {
+            var wrapper = $(this).closest('.conList');
+            wrapper.find('li').css('z-index','-1');
+            wrapper.find('input').val('');
+            $(this).hide();
+            if ($('.cancel-upload:visible').length < 9) {
+                wrapper.addClass("hide-pic");
+            }else{
+                wrapper.removeClass("hide-pic");
+            }
+            wrapper.parent().append(wrapper.clone());
+            wrapper.remove();
+            $(".conList").each(function(i,ele){
+                if($(ele).find("input.input-xlarge").val()){
+                    $(ele).next().removeClass("hide-pic")
+                }
+            })
+        });
+        $(window).on("load", function(){
+            setTimeout(function(){
+                $("#remarkImageBox").find("input.input-xlarge").each(function(i,ele){
+                    if($(ele).val()){
+                        $(ele).next().find("li").css("z-index","99");
+                        $(ele).parents(".conList").find(".cancel-upload").show();
+                        $(ele).parents(".conList").next().removeClass("hide-pic")
+                    }
+                })
+            },500);
+        });
+    });
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字
+     */
+    function onlynum(obj) {
+        obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+    }
+
+    function showInfo() {
+        var type = $("input[name='type']:checked").val();
+        if (type == 1){
+            $("#refundShow").hide();
+        } else {
+            var differencePrice = $("#differencePrice").val();
+            var waitPayShop = ${payShopDifference.waitPayShop};
+            if (differencePrice > waitPayShop) {
+                $("#refundShow").show();
+            }else {
+                $("#refundShow").hide();
+            }
+        }
+    }
+</script>
+</body>
+</html>

+ 378 - 0
src/main/webapp/WEB-INF/views/modules/order/shopOtherFeeForm.jsp

@@ -0,0 +1,378 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>申请付款</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        .pay-table th {
+            background: #f9f9f9
+        }
+
+        .pay-table tr:first-child th {
+            background: #eee !important
+        }
+
+        .pay-table td {
+            background: #fff !important
+        }
+
+        input[type="checkbox"]::before {
+            content: '\a0';
+            display: inline-block;
+            vertical-align: .2em;
+            width: .8em;
+            height: .8em;
+            margin-right: .2em;
+            border-radius: .2em;
+            text-indent: .15em;
+            line-height: .65
+        }
+
+        .pay-more-func span:first-child {
+            margin-right: 6px
+        }
+
+        .pay-more-func span:hover {
+            color: #7aa9c3
+        }
+
+        .tips-popup-content p {
+            text-align: center;
+            padding: 80px;
+            font-size: 20px
+        }
+
+        .revise-popup-content h4, .tips-popup-content h4 {
+            padding-left: 10px;
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px solid #eee;
+            margin-bottom: 20px
+        }
+
+        .revise-popup-content div {
+            margin-top: 7px;
+            text-align: center
+        }
+
+        .revise-popup-content label {
+            width: 70px;
+            text-align: right;
+            vertical-align: text-bottom
+        }
+
+        .revise-popup-content button {
+            width: 80px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:first-child {
+            margin-left: -104px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:last-child {
+            margin-left: 30px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span span {
+            margin-left: 10px
+        }
+
+        .revise-popup-content > div:last-child {
+            text-align: center;
+            margin-top: 20px
+        }
+
+        .revise-popup-content input {
+            width: 100px;
+            margin-bottom: 0px
+        }
+
+        .form-search label {
+            width: 80px;
+            text-align: left;
+            margin-top: 12px
+        }
+
+        .remark-title span {
+            color: red
+        }
+
+        .ul-form label {
+            width: 90px;
+            text-align: left;
+            margin-top: 15px
+        }
+
+        .pay-status label {
+            margin-left: 0
+        }
+
+        .pay-status label:first-child {
+            margin-left: 10px
+        }
+        .controls{
+            font-size: 0;
+        }
+        .controls .conList{
+            display: inline-block;
+            margin-right: 15px;
+        }
+        .conList .btn:nth-of-type(1){
+            margin-left: 25px;
+        }
+        .upload-content {
+            margin-top: -70px;
+            display: inline-block;
+        }
+        .upload-content .conList .btn:nth-of-type(1) {
+            width: 90px;
+            height: 100px;
+            border: 2px solid #eee;
+            background: #fff;
+            position: relative;
+        }
+        .upload-content .conList .btn:nth-of-type(1)>div {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            color: #666;
+        }
+        .upload-content .conList .btn:nth-of-type(1) span {
+            font-size: 35px;
+        }
+        .upload-content .conList .btn:nth-of-type(1) h5 {
+            color: #666;
+        }
+        .cancel-upload {
+            background: transparent;
+            border: none;
+            box-shadow: none;
+            position: relative;
+            top: -38px;
+            left: -25px;
+            cursor: pointer;
+            z-index: 100;
+        }
+        .upload-content .conList ol li {
+            width: 114px;
+            min-height: 80px;
+            text-align: center;
+            background: #fff;
+            position: relative;
+            top: 120px;
+            margin-left: 2px;
+        }
+        .hide-pic {
+            display: none !important;
+        }
+    </style>
+    <script type="text/javascript">
+            $(document).ready(function() {
+                $("#inputForm").validate({
+                    ignore:"",
+                    submitHandler: function (form) {
+                        var shopPostFee = $("#shopPostFee").val();
+                        var brokerage = ${brokerage};
+                        if (brokerage < shopPostFee) {
+                            top.$.jBox.confirm("付第三方的值不合理,导致佣金为负,确认继续吗?", '提示', function (v, h, f) {
+                                if (v == true) {
+                                    loading('正在提交,请稍等...');
+                                    form.submit();
+                                }
+                                return;
+                            }, {buttons: {'取消': false, '确定': true}});
+                        } else {
+                            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>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
+    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+    <li class="active"><a href="${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=${payShopOther.shopOrderId}">付第三方</a></li>
+</ul>
+<form:form id="inputForm" modelAttribute="payShopOther" action="${ctx}/order/cmPayShop/saveShopOtherFee" method="post" class="form-horizontal">
+    <form:hidden path="shopOrderId"/>
+    <div class="control-group">
+        <label class="control-label"><font color='red'>*</font>差价金额:</label>
+        <div class="controls">
+            <input type="number" id="shopOtherFee" required name="shopOtherFee" onchange="changeShouldPay(this)"/>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color='red'>*</font>开户名:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+        <form:input path="bankAccountName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
+        <label><font color='red'>*</font>账号:</label>
+        <form:input path="bankAccount" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color='red'>*</font>开户行:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+        <form:input path="bankName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>&nbsp;&nbsp;&nbsp;&nbsp;
+        <label><font color='red'>*</font>账户类型:</label>
+        <form:select path="type" class="select-ele input-xlarge required">
+            <form:option value="0" label="公账"/>
+            <form:option value="1" label="私账"/>
+        </form:select>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color='red'>*</font>备注内容:</label>
+        <div class="controls">
+            <textarea type="text" name="remark" placeholder="请详细说明修改的原因,不超过500字" style="position: relative;height: 100px; width: 450px;" maxlength="500" required ></textarea>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label">图片:</label>
+        <div class="controls upload-content" style="margin: -91px 0px 0px 16px;" id="remarkImageBox">
+            <div class="conList">
+                <form:hidden id="remarkImage1" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage2" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage2" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage3" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage3" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage4" path="" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage4" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage5" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage5" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage6" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage6" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage7" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage7" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden id="remarkImage8" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage8" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList  hide-pic">
+                <form:hidden id="remarkImage9" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage9" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+            <div class="conList  hide-pic">
+                <form:hidden id="remarkImage10" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage10" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </div>
+        </div>
+    </div>
+    <div class="form-actions">
+        <input id="btnSubmit" style="margin-left: 150px" class="btn btn-primary" type="submit" value="确认"/>&nbsp;&nbsp;&nbsp;&nbsp;
+        <input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)"/>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<script>
+
+    //图片初始化
+    $(function () {
+        $('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+        $('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
+        $('.upload-content .conList').find('.cancel-upload').hide();
+        var observeEle = document.getElementsByClassName('upload-content')[0];
+        var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
+        var MutationObserverConfig={
+            childList: true,
+            subtree: true,
+            characterData: true
+        };
+        var observer = new MutationObserver(function(mutations){
+            $.each(mutations, function(index,item) {
+                if (item.type === 'childList') {
+                    // 在创建新的 element 时调用
+                    var target = $(item.target),
+                        thisWrapper = target.closest('.conList'),
+                        nextEle = thisWrapper.next();
+                    thisWrapper.find('li').css('z-index',99);
+                    thisWrapper.find('.cancel-upload').show();
+                    if(nextEle.hasClass('hide-pic')) {
+                        nextEle.removeClass('hide-pic');
+                    }
+                }
+            })
+        });
+        observer.observe(observeEle,MutationObserverConfig);
+
+        $('body').on('click','.upload-content li',function() {
+            var index = $(this).closest('.conList').index() + 1,
+                str = 'remarkImage'+index+'FinderOpen';
+            eval(str+'()');
+        });
+        $('body').on('click', '.cancel-upload',function() {
+            var wrapper = $(this).closest('.conList');
+            wrapper.find('li').css('z-index','-1');
+            wrapper.find('input').val('');
+            $(this).hide();
+            if ($('.cancel-upload:visible').length < 9) {
+                wrapper.addClass("hide-pic");
+            }else{
+                wrapper.removeClass("hide-pic");
+            }
+            wrapper.parent().append(wrapper.clone());
+            wrapper.remove();
+            $(".conList").each(function(i,ele){
+                if($(ele).find("input.input-xlarge").val()){
+                    $(ele).next().removeClass("hide-pic")
+                }
+            })
+        });
+        $(window).on("load", function(){
+            setTimeout(function(){
+                $("#remarkImageBox").find("input.input-xlarge").each(function(i,ele){
+                    if($(ele).val()){
+                        $(ele).next().find("li").css("z-index","99");
+                        $(ele).parents(".conList").find(".cancel-upload").show();
+                        $(ele).parents(".conList").next().removeClass("hide-pic")
+                    }
+                })
+            },500);
+        });
+    });
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字
+     */
+    function onlynum(obj) {
+        obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+    }
+</script>
+</body>
+</html>

+ 2 - 3
src/main/webapp/WEB-INF/views/modules/user/cmUserBalanceList.jsp

@@ -117,14 +117,13 @@
 					<td>
 						<a href="${ctx}/user/cmUserBalanceRecord/userBalanceRecord?userId=${cmUser.userID}" >查看详情</a>
 						<shiro:hasPermission name="user:cmUserBalanceRecord:edit">
-							<%--<a href="javascript:void(0);" onclick="recharge('${cmUser.userID}')">充值</a>--%>
-							<font title="请使用充值订单的方式进行充值!">充值</font>
+							<a href="javascript:void(0);" onclick="recharge('${cmUser.userID}')">充值</a>
+							<%--<font title="请使用充值订单的方式进行充值!">充值</font>--%>
 							<c:if test="${cmUser.ableUserMoney > 0}">
 								<a href="${ctx}/user/cmUserBalanceRecord/userWithdrawals?userID=${cmUser.userID}" >提现</a>
 							</c:if>
 						</shiro:hasPermission>
 					</td>
-
 			</tr>
 		</c:forEach>
 		</tbody>