Forráskód Böngészése

付第三方修改

plf 3 éve
szülő
commit
93e9ee3c4b
19 módosított fájl, 839 hozzáadás és 161 törlés
  1. 2 0
      src/main/java/com/caimei/modules/order/dao/CmRefundShopRecordDao.java
  2. 13 0
      src/main/java/com/caimei/modules/order/entity/ChangePayShopOther.java
  3. 10 0
      src/main/java/com/caimei/modules/order/entity/NewShopOrder.java
  4. 188 131
      src/main/java/com/caimei/modules/order/service/CmPayShopService.java
  5. 5 0
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  6. 12 3
      src/main/java/com/caimei/modules/order/web/CmPayShopController.java
  7. 1 0
      src/main/java/com/caimei/modules/user/web/CmUserBalanceRecordController.java
  8. 14 0
      src/main/resources/mappings/modules/order/CmRefundShopRecordMapper.xml
  9. 7 3
      src/main/webapp/WEB-INF/views/modules/order/cmPayFormList.jsp
  10. 0 9
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopEdit.jsp
  11. 7 1
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp
  12. 252 0
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp
  13. 8 7
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherDetail.jsp
  14. 131 0
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherEdit.jsp
  15. 20 2
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherForm.jsp
  16. 158 0
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetail.jsp
  17. 7 4
      src/main/webapp/WEB-INF/views/modules/order/otherRemark.jsp
  18. 1 0
      src/main/webapp/WEB-INF/views/modules/product-new/secondHand.jsp
  19. 3 1
      src/main/webapp/WEB-INF/views/modules/user/cmUserBalanceList.jsp

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

@@ -27,4 +27,6 @@ public interface CmRefundShopRecordDao extends CrudDao<CmRefundShopRecord> {
     Integer findByRefundType(Integer shopOrderId);
 
     void updateByDelFlag(Integer refundShopId);
+
+    Integer findByPaymentType(Integer shopOrderID);
 }

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

@@ -89,6 +89,11 @@ public class ChangePayShopOther implements Serializable {
      */
     private String orderNo;
 
+    /**
+     * 付款单表id
+     */
+    private Integer payShopId;
+
     public Integer getId() {
         return id;
     }
@@ -224,4 +229,12 @@ public class ChangePayShopOther implements Serializable {
     public void setOrderNo(String orderNo) {
         this.orderNo = orderNo;
     }
+
+    public Integer getPayShopId() {
+        return payShopId;
+    }
+
+    public void setPayShopId(Integer payShopId) {
+        this.payShopId = payShopId;
+    }
 }

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

@@ -138,6 +138,8 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
 
     private boolean modifyPayable = false; //是否线上支付
 
+    private boolean isPayShopOtherFee = true; //是否可以付第三方申请
+
     public Integer getOrderPromotionsId() {
         return orderPromotionsId;
     }
@@ -1092,4 +1094,12 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     public void setUserBeans(Integer userBeans) {
         this.userBeans = userBeans;
     }
+
+    public boolean isPayShopOtherFee() {
+        return isPayShopOtherFee;
+    }
+
+    public void setPayShopOtherFee(boolean payShopOtherFee) {
+        isPayShopOtherFee = payShopOtherFee;
+    }
 }

+ 188 - 131
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -489,73 +489,88 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
     @Transactional(readOnly = false)
     public void checkPass(CmPayShop cmPayShop) throws Exception {
         List<CmPayShopRecord> records = cmPayShopRecordDao.findByPayShopID(cmPayShop.getId());
-        //修改每一条子订单的已付款金额
-        for (CmPayShopRecord record : records) {
-            NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
-            Double wipePayment = cmPayShopRecordDao.sumWipePaymentNoStatus(Integer.valueOf(record.getShopOrderID()));
-            wipePayment = wipePayment != null ? wipePayment : 0d;
-            // 本次付款金额 + 抹平金额 + 原来已经付过的金额
-            BigDecimal payedFee = MathUtil.add(MathUtil.add(record.getPayAmount(), wipePayment), shopOrder.getPayedShopAmount());
-            // 总共要付的金额
-            BigDecimal shouldPayFee = BigDecimal.valueOf(shopOrder.getShouldPayShopAmount());
-            //判断是否有差价金额
-            if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 1) {
-                shouldPayFee = MathUtil.add(shouldPayFee, shopOrder.getDifferencePrice());
-            } else if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 2) {
-                shouldPayFee = MathUtil.sub(shouldPayFee, shopOrder.getDifferencePrice());
-            }
-            if (MathUtil.compare(payedFee, shouldPayFee) == -1) {
-                // (本次付款金额 + 抹平金额 + 原来已经付过的金额)  < 总共要付的金额
-                shopOrder.setPayStatus("2");
-                //那么主订单肯定也是部分付款
-                newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
-            } else if (MathUtil.compare(payedFee, shouldPayFee) == 0) {
-                // 本次付款金额 + 原来已经付过的金额  近似于 总共要付的金额相等
-                shopOrder.setPayStatus("3");
-            } else {
-                logger.info("已付款金额:" + shopOrder.getPayedShopAmount() + "本次付款金额:" + record.getPayAmount() + "付供应商:" + shouldPayFee + "付款id:" + cmPayShop.getId());
-                logger.info("check ----> 付款金额异常, 付款金额大于待付款金额");
-                throw new Exception("付款金额异常, 付款金额大于待付款金额");
-            }
-            shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() == null ? 0D : shopOrder.getPayedShopAmount() + record.getPayAmount());
-            shopOrder.setPaying("0"); //退出付款进行状态
-            newShopOrderDao.update(shopOrder);
-            record.setStatus("1");
-            record.setPayTime(DateUtils.formatDateTime(new Date()));
-            record.setPayType(cmPayShop.getPayType());
-            cmPayShopRecordDao.update(record);
-            List<String> payStatus = newShopOrderDao.findPayStatusByOrderID(shopOrder.getOrderID());
-            boolean f = true;
-            for (String p : payStatus) {
-                if (!"3".equals(p)) {
-                    //不是所有的子订单都全部付款了
-                    f = false;
-                    break;
+        User currentUser = UserUtils.getUser();
+        if (cmPayShop.getPaymentType() == null || cmPayShop.getPaymentType() == 1) {
+            //修改每一条子订单的已付款金额
+            for (CmPayShopRecord record : records) {
+                NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
+                Double wipePayment = cmPayShopRecordDao.sumWipePaymentNoStatus(Integer.valueOf(record.getShopOrderID()));
+                wipePayment = wipePayment != null ? wipePayment : 0d;
+                // 本次付款金额 + 抹平金额 + 原来已经付过的金额
+                BigDecimal payedFee = MathUtil.add(MathUtil.add(record.getPayAmount(), wipePayment), shopOrder.getPayedShopAmount());
+                // 总共要付的金额
+                BigDecimal shouldPayFee = BigDecimal.valueOf(shopOrder.getShouldPayShopAmount());
+                //判断是否有差价金额
+                if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 1) {
+                    shouldPayFee = MathUtil.add(shouldPayFee, shopOrder.getDifferencePrice());
+                } else if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 2) {
+                    shouldPayFee = MathUtil.sub(shouldPayFee, shopOrder.getDifferencePrice());
+                }
+                if (MathUtil.compare(payedFee, shouldPayFee) == -1) {
+                    // (本次付款金额 + 抹平金额 + 原来已经付过的金额)  < 总共要付的金额
+                    shopOrder.setPayStatus("2");
+                    //那么主订单肯定也是部分付款
+                    newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
+                } else if (MathUtil.compare(payedFee, shouldPayFee) == 0) {
+                    // 本次付款金额 + 原来已经付过的金额  近似于 总共要付的金额相等
+                    shopOrder.setPayStatus("3");
+                } else {
+                    logger.info("已付款金额:" + shopOrder.getPayedShopAmount() + "本次付款金额:" + record.getPayAmount() + "付供应商:" + shouldPayFee + "付款id:" + cmPayShop.getId());
+                    logger.info("check ----> 付款金额异常, 付款金额大于待付款金额");
+                    throw new Exception("付款金额异常, 付款金额大于待付款金额");
                 }
+                shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() == null ? 0D : shopOrder.getPayedShopAmount() + record.getPayAmount());
+                shopOrder.setPaying("0"); //退出付款进行状态
+                newShopOrderDao.update(shopOrder);
+                record.setStatus("1");
+                record.setPayTime(DateUtils.formatDateTime(new Date()));
+                record.setPayType(cmPayShop.getPayType());
+                cmPayShopRecordDao.update(record);
+                List<String> payStatus = newShopOrderDao.findPayStatusByOrderID(shopOrder.getOrderID());
+                boolean f = true;
+                for (String p : payStatus) {
+                    if (!"3".equals(p)) {
+                        //不是所有的子订单都全部付款了
+                        f = false;
+                        break;
+                    }
+                }
+                if (f) //所有的子订单都是全部付款
+                    newOrderDao.updatePayStatus("3", shopOrder.getOrderID());
+                else
+                    newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
             }
-            if (f) //所有的子订单都是全部付款
-                newOrderDao.updatePayStatus("3", shopOrder.getOrderID());
-            else
-                newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
-        }
-        User currentUser = UserUtils.getUser();
-        cmPayShop.setReviewer(currentUser.getId());
-        cmPayShop.setReviewTime(DateUtils.getDateTime());
-        cmPayShop.setPayTime(DateUtils.getDateTime());
-        cmPayShop.setStatus("1");
-        cmPayShopDao.update(cmPayShop);
-        if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
-            //如果使用了余额付款 往余额记录表里面写入记录的cm_rebate_record
-            CmRebateRecord r = new CmRebateRecord();
-            r.setType("2");
-            r.setShopId(cmPayShop.getShopID());
-            r.setPayShopID(cmPayShop.getId());
-            r.setShopOrderId(StringUtil.join(records.stream().map(CmPayShopRecord::getShopOrderID).toArray(), ","));
-            r.setRebateAmount(cmPayShop.getBalancePayFee());
-            r.setOperatTime(DateUtils.formatDateTime(new Date()));
-            cmRebateRecordDao.insert(r);
-            //扣除供应商余额
-            newCmShopDao.updateRebateAmount(cmPayShop.getBalancePayFee(), Integer.valueOf(cmPayShop.getShopID()));
+            cmPayShop.setReviewer(currentUser.getId());
+            cmPayShop.setReviewTime(DateUtils.getDateTime());
+            cmPayShop.setPayTime(DateUtils.getDateTime());
+            cmPayShop.setStatus("1");
+            cmPayShopDao.update(cmPayShop);
+            if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
+                //如果使用了余额付款 往余额记录表里面写入记录的cm_rebate_record
+                CmRebateRecord r = new CmRebateRecord();
+                r.setType("2");
+                r.setShopId(cmPayShop.getShopID());
+                r.setPayShopID(cmPayShop.getId());
+                r.setShopOrderId(StringUtil.join(records.stream().map(CmPayShopRecord::getShopOrderID).toArray(), ","));
+                r.setRebateAmount(cmPayShop.getBalancePayFee());
+                r.setOperatTime(DateUtils.formatDateTime(new Date()));
+                cmRebateRecordDao.insert(r);
+                //扣除供应商余额
+                newCmShopDao.updateRebateAmount(cmPayShop.getBalancePayFee(), Integer.valueOf(cmPayShop.getShopID()));
+            }
+        }else {
+            //付第三方与付供应商差价
+            records.forEach(record->{
+                record.setStatus("1");
+                record.setPayTime(DateUtils.formatDateTime(new Date()));
+                record.setPayType(cmPayShop.getPayType());
+                cmPayShopRecordDao.update(record);
+            });
+            cmPayShop.setReviewer(currentUser.getId());
+            cmPayShop.setReviewTime(DateUtils.getDateTime());
+            cmPayShop.setPayTime(DateUtils.getDateTime());
+            cmPayShop.setStatus("1");
+            cmPayShopDao.update(cmPayShop);
         }
     }
 
@@ -573,11 +588,13 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         cmPayShopDao.update(cmPayShop);
         //付款记录 修改状态
         cmPayShopRecordDao.updateStatusByPayShopID("2", cmPayShop.getId());
-        //子订单退出付款状态
-        newShopOrderDao.outPaying(cmPayShop.getId());
-        //退还子订单可用余额
-        if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
-            newCmShopDao.backAbleRebateAmount(cmPayShop.getBalancePayFee(), Integer.valueOf(cmPayShop.getShopID()));
+        if (cmPayShop.getPaymentType() == null || cmPayShop.getPaymentType() == 1) {
+            //子订单退出付款状态
+            newShopOrderDao.outPaying(cmPayShop.getId());
+            //退还子订单可用余额
+            if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
+                newCmShopDao.backAbleRebateAmount(cmPayShop.getBalancePayFee(), Integer.valueOf(cmPayShop.getShopID()));
+            }
         }
     }
 
@@ -613,70 +630,86 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
     public void rollBackApply(CmPayShop cmPayShop) throws Exception {
         //回滚付款单审核通过的所有操作
         List<CmPayShopRecord> records = cmPayShopRecordDao.findByPayShopID(cmPayShop.getId());
-        //修改每一条子订单的已付款金额
-        for (CmPayShopRecord record : records) {
-            NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
-            shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() - record.getPayAmount());
-            if (shopOrder.getPayedShopAmount() == 0D) {
-                // 本次付款金额 + 原来已经付过的金额  < 总共要付的金额
-                shopOrder.setPayStatus("1");
+        if (cmPayShop.getPaymentType() == null || cmPayShop.getPaymentType() == 1) {
+            //修改每一条子订单的已付款金额
+            for (CmPayShopRecord record : records) {
+                NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
+                shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() - record.getPayAmount());
+                if (shopOrder.getPayedShopAmount() == 0D) {
+                    // 本次付款金额 + 原来已经付过的金额  < 总共要付的金额
+                    shopOrder.setPayStatus("1");
+                    List<String> payStatus = newShopOrderDao.findPayStatusByOrderID(shopOrder.getOrderID());
+                    boolean f = true;
+                    for (String p : payStatus) {
+                        if (p != null && !"1".equals(p)) {
+                            //是部分付款或者已付款的子订单  那么主订单就是部分付款了
+                            f = false;
+                            break;
+                        }
+                    }
+                    if (f)
+                        newOrderDao.updatePayStatus("1", shopOrder.getOrderID());
+                    else
+                        newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
+                } else if (shopOrder.getPayedShopAmount() > 0D) {
+                    // 本次付款金额 + 原来已经付过的金额  近似于 总共要付的金额相等
+                    shopOrder.setPayStatus("2");
+                    newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
+                } else {
+                    logger.info("rollBackApply ----> 付款金额异常, 付款金额大于待付款金额");
+                    throw new Exception("付款金额异常, 退款金额大于已付款金额");
+                }
+                shopOrder.setPaying("1"); //进入付款进行状态
+                newShopOrderDao.update(shopOrder);
+                record.setStatus("0");
+                record.setPayTime(DateUtils.formatDateTime(new Date()));
+                record.setPayType(cmPayShop.getPayType());
+                cmPayShopRecordDao.update(record);
+
+                // 还原主订单的状态 ----
                 List<String> payStatus = newShopOrderDao.findPayStatusByOrderID(shopOrder.getOrderID());
                 boolean f = true;
                 for (String p : payStatus) {
-                    if (p != null && !"1".equals(p)) {
-                        //是部分付款或者已付款的子订单  那么主订单就是部分付款了
+                    if (!"1".equals(p)) {
+                        //不是所有的子订单都没有付款
                         f = false;
                         break;
                     }
                 }
-                if (f)
+                if (f) //所有的子订单都是没有付款
                     newOrderDao.updatePayStatus("1", shopOrder.getOrderID());
                 else
                     newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
-            } else if (shopOrder.getPayedShopAmount() > 0D) {
-                // 本次付款金额 + 原来已经付过的金额  近似于 总共要付的金额相等
-                shopOrder.setPayStatus("2");
-                newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
-            } else {
-                logger.info("rollBackApply ----> 付款金额异常, 付款金额大于待付款金额");
-                throw new Exception("付款金额异常, 退款金额大于已付款金额");
+
             }
-            shopOrder.setPaying("1"); //进入付款进行状态
-            newShopOrderDao.update(shopOrder);
-            record.setStatus("0");
-            record.setPayTime(DateUtils.formatDateTime(new Date()));
-            record.setPayType(cmPayShop.getPayType());
-            cmPayShopRecordDao.update(record);
-
-            // 还原主订单的状态 ----
-            List<String> payStatus = newShopOrderDao.findPayStatusByOrderID(shopOrder.getOrderID());
-            boolean f = true;
-            for (String p : payStatus) {
-                if (!"1".equals(p)) {
-                    //不是所有的子订单都没有付款
-                    f = false;
-                    break;
-                }
+            cmPayShop.setStatus("0");
+            cmPayShop.setPayTime(null);
+            cmPayShop.setReviewer(null);
+            cmPayShop.setReviewTime(null);
+            cmPayShop.setPayType(null);
+            cmPayShopDao.update(cmPayShop);
+            if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
+                //如果使用了余额付款 删除之前往这里面插入的记录 往余额记录表里面写入记录的cm_rebate_record
+                cmRebateRecordDao.deleteByPayShopID(cmPayShop.getId());
+                //使用了余额,退还余额 但是不退可用余额
+                NewCmShop shop = newCmShopDao.get(cmPayShop.getShopID());
+                shop.setRebateAmount(shop.getRebateAmount() + cmPayShop.getBalancePayFee());
+                newCmShopDao.update(shop);
             }
-            if (f) //所有的子订单都是没有付款
-                newOrderDao.updatePayStatus("1", shopOrder.getOrderID());
-            else
-                newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
-
-        }
-        cmPayShop.setStatus("0");
-        cmPayShop.setPayTime(null);
-        cmPayShop.setReviewer(null);
-        cmPayShop.setReviewTime(null);
-        cmPayShop.setPayType(null);
-        cmPayShopDao.update(cmPayShop);
-        if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
-            //如果使用了余额付款 删除之前往这里面插入的记录 往余额记录表里面写入记录的cm_rebate_record
-            cmRebateRecordDao.deleteByPayShopID(cmPayShop.getId());
-            //使用了余额,退还余额 但是不退可用余额
-            NewCmShop shop = newCmShopDao.get(cmPayShop.getShopID());
-            shop.setRebateAmount(shop.getRebateAmount() + cmPayShop.getBalancePayFee());
-            newCmShopDao.update(shop);
+        } else {
+            //付第三方或者付供应商差价
+            records.forEach(record -> {
+                record.setStatus("0");
+                record.setPayTime(DateUtils.formatDateTime(new Date()));
+                record.setPayType(cmPayShop.getPayType());
+                cmPayShopRecordDao.update(record);
+            });
+            cmPayShop.setStatus("0");
+            cmPayShop.setPayTime(null);
+            cmPayShop.setReviewer(null);
+            cmPayShop.setReviewTime(null);
+            cmPayShop.setPayType(null);
+            cmPayShopDao.update(cmPayShop);
         }
     }
 
@@ -722,12 +755,6 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         if (shopOtherList != null && shopOtherList.size() > 0) {
             payShopOther = shopOtherList.get(0);
         }
-        NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderId);
-        if (shopOrder != null) {
-            payShopOther.setOrderId(shopOrder.getOrderID());
-            payShopOther.setOrderNo(shopOrder.getOrderNo());
-            payShopOther.setShopOrderNo(shopOrder.getShopOrderNo());
-        }
         return payShopOther;
     }
 
@@ -771,7 +798,12 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         payShop.setPayTime(time);
         payShop.setStatus("0");
         payShop.setDelFlag("0");
-        cmPayShopDao.insert(payShop);
+        if (payShopOther.getPayShopId() == null) {
+            cmPayShopDao.insert(payShop);
+        } else {
+            payShop.setId(payShopOther.getPayShopId().toString());
+            cmPayShopDao.update(payShop);
+        }
 
         CmPayShopRecord payShopRecord = new CmPayShopRecord();
         payShopRecord.setShopID(shopOrder.getShopID().toString());
@@ -780,11 +812,16 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         payShopRecord.setPayAmount(payAmount);
         payShopRecord.setWipePayment(0d);
         payShopRecord.setPaymentType(3);
-        payShopRecord.setPayTime(time);
         payShopRecord.setPayShopID(payShop.getId());
         payShopRecord.setStatus("0");
         payShopRecord.setDelFlag("0");
-        cmPayShopRecordDao.insert(payShopRecord);
+        if (payShopOther.getPayShopId() == null) {
+            cmPayShopRecordDao.insert(payShopRecord);
+        } else {
+            List<CmPayShopRecord> payShopRecords = cmPayShopRecordDao.findByPayShopID(payShopOther.getPayShopId().toString());
+            payShopRecord.setId(payShopRecords.get(0).getId());
+            cmPayShopRecordDao.update(payShopRecord);
+        }
     }
 
     public ChangePayShopDifference differencePriceForm(Integer shopOrderId) {
@@ -889,4 +926,24 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         cmPayShopRecordDao.insertDifference(payShopDifference);
         newShopOrderDao.updateByDifferencePrice(payShopDifference.getType(), differencePrice, shopOrderId);
     }
+
+    public ChangePayShopOther shopOtherApplyEdit(Integer payShopId) {
+        ChangePayShopOther payShopOther = new ChangePayShopOther();
+        List<CmPayShopRecord> shopRecords = cmPayShopRecordDao.findByPayShopID(payShopId.toString());
+        if (shopRecords != null && shopRecords.size() > 0) {
+            Integer shopOrderId = Integer.valueOf(shopRecords.get(0).getShopOrderID());
+            List<ChangePayShopOther> shopOtherList = cmPayShopRecordDao.findShopOtherFee(shopOrderId);
+            if (shopOtherList != null && shopOtherList.size() > 0) {
+                payShopOther = shopOtherList.get(0);
+            }
+            NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderId);
+            if (shopOrder != null) {
+                payShopOther.setOrderId(shopOrder.getOrderID());
+                payShopOther.setOrderNo(shopOrder.getOrderNo());
+                payShopOther.setShopOrderNo(shopOrder.getShopOrderNo());
+            }
+        }
+        payShopOther.setPayShopId(payShopId);
+        return payShopOther;
+    }
 }

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

@@ -324,6 +324,11 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
             Integer returnedFreightNum = newOrderProductDao.countReturnedFreightProduct(so.getOrderID());
             Boolean returnedFreightFlag = returnedFreightNum == null ? false : returnedFreightNum > 0 ? true : false;
             so.setReturnedFreightFlag(returnedFreightFlag);
+            //是否用待审核的付第三方付款数据
+            Integer id = cmRefundShopRecordDao.findByPaymentType(so.getShopOrderID());
+            if (id != null && id > 0) {
+                so.setPayShopOtherFee(false);
+            }
         }
         return page;
     }

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

@@ -554,6 +554,9 @@ public class CmPayShopController extends BaseController {
             logger.info(e.getMessage());
             e.printStackTrace();
         }
+        if (3 == cmPayShop.getPaymentType()) {
+            return "modules/order/cmPayShopOtherEdit";
+        }
         return "modules/order/cmPayShopEdit";
     }
 
@@ -610,6 +613,9 @@ public class CmPayShopController extends BaseController {
             logger.info(e.getMessage());
             e.printStackTrace();
         }
+        if (3 == cmPayShop.getPaymentType()) {
+            return "modules/order/cmPayShopOtherPrintDetail";
+        }
         return "modules/order/cmPayShopPrintDetail";
     }
 
@@ -630,6 +636,9 @@ public class CmPayShopController extends BaseController {
             logger.info(e.getMessage());
             e.printStackTrace();
         }
+        if (3 == cmPayShop.getPaymentType()) {
+            return "modules/order/cmPayShopOtherCheck";
+        }
         return "modules/order/cmPayShopCheck";
     }
 
@@ -794,7 +803,7 @@ public class CmPayShopController extends BaseController {
     public String saveShopOtherFee(ChangePayShopOther payShopOther, RedirectAttributes redirectAttributes) {
         cmPayShopService.saveShopOtherFee(payShopOther);
         addMessage(redirectAttributes, "保存成功");
-        return "redirect:" + Global.getAdminPath() + "/shopOrder/payOrderList?operatingMode=1";
+        return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/";
     }
 
     /**
@@ -826,8 +835,8 @@ public class CmPayShopController extends BaseController {
      * 申请第三方付款,页面回显
      */
     @RequestMapping("shopOtherApplyEdit")
-    public String shopOtherApplyEdit(Integer shopOrderId, Model model) {
-        ChangePayShopOther payShopOther = cmPayShopService.shopOtherFeeForm(shopOrderId);
+    public String shopOtherApplyEdit(Integer payShopId, Model model) {
+        ChangePayShopOther payShopOther = cmPayShopService.shopOtherApplyEdit(payShopId);
         model.addAttribute("payShopOther", payShopOther);
         return "modules/order/cmPayShopOtherForm";
     }

+ 1 - 0
src/main/java/com/caimei/modules/user/web/CmUserBalanceRecordController.java

@@ -123,6 +123,7 @@ public class CmUserBalanceRecordController extends BaseController {
         return "redirect:" + Global.getAdminPath() + "/user/cmUserBalanceRecord/?repage";
     }
 
+    @RequiresPermissions("user:cmUserBalanceRecord:recharge")
     @RequestMapping(value = "recharge")
     public String recharge(Integer userId, Model model) {
         CmUser cmUser = cmNormalUserService.get(String.valueOf(userId));

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

@@ -148,4 +148,18 @@
 	<update id="updateByDelFlag">
 		UPDATE cm_refund_shop_record SET delFlag = 1 WHERE refundShopID = #{refundShopId}
 	</update>
+
+	<select id="findByPaymentType" resultType="integer">
+		SELECT
+		  id
+		FROM
+		  cm_pay_shop_record
+		WHERE
+		  STATUS = 0
+		  AND paymentType = 3
+		  AND delFlag = 0
+		  AND shopOrderID = #{shopOrderID}
+		LIMIT
+		  1
+	</select>
 </mapper>

+ 7 - 3
src/main/webapp/WEB-INF/views/modules/order/cmPayFormList.jsp

@@ -183,7 +183,7 @@
 								<a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">申请付款</a>
 							</c:if>
 							<c:if test="${cmPayShop.paymentType eq 3}">
-								<a class="td-a" href="${ctx}/order/cmPayShop/shopOtherApplyEdit?shopOrderId=${cmPayShop.shopOrderID}">申请付款</a>
+								<a class="td-a" href="${ctx}/order/cmPayShop/shopOtherApplyEdit?payShopId=${cmPayShop.id}">申请付款</a>
 							</c:if>
 						</shiro:hasPermission>
 						<shiro:hasPermission name="order:cmPayShop:cancel">
@@ -203,8 +203,12 @@
 					<c:if test="${cmPayShop.status == '2'}">
 						<shiro:hasPermission name="order:cmPayShop:apply">
 							<c:if test="${cmPayShop.rePayment == '1'}">
-								<%--<a class="td-a" href="${ctx}/order/cmPayShop/apply?reApply=1&id=${cmPayShop.id}">重申付款</a>--%>
-								<a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">重申付款</a>
+								<c:if test="${cmPayShop.paymentType ne 3}">
+									<a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">重申付款</a>
+								</c:if>
+								<c:if test="${cmPayShop.paymentType eq 3}">
+									<a class="td-a" href="${ctx}/order/cmPayShop/shopOtherApplyEdit?payShopId=${cmPayShop.id}">重申付款</a>
+								</c:if>
 							</c:if>
 							<c:if test="${cmPayShop.rePayment == '2'}">重申付款</c:if>
 						</shiro:hasPermission>

+ 0 - 9
src/main/webapp/WEB-INF/views/modules/order/cmPayShopEdit.jsp

@@ -20,7 +20,6 @@
         .pay-table th{background:#f9f9f9}
         .pay-table tr:first-child th{background:#eee !important}
         .pay-table td{background:#fff !important}
-        /*.supplier-fee{text-align:left !important;padding-top:20px !important;padding-left:20px !important}*/
         .check-btn{width:96%;margin-left:2%;text-align:center;height:60px;line-height:60px;margin-top:30px}
         .check-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
         .need-to-pay{width:50px}
@@ -31,19 +30,11 @@
         .process-details div{display:inline-block}
         .payment-btn{width:96%;margin-left:2%;text-align:center;height:60px;line-height:60px;margin-top:30px}
         .payment-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
-        .apply-btn{background:#3daae9;color:#fff}
-        .cfm-btn:active,.return-btn:active{background:#ddd;color:#fff}
         .mask{width:100%;height:100%;position:fixed;top:0;background:rgba(0,0,0,0.7);display:none}
         .tips-popup-content{width:40%;height:auto;padding-bottom:30px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
         .tips-popup-content div{width:100%;text-align:center}
-        .tips-popup-content{width:30%}
         .tips-popup-content p{text-align:center;padding:80px;font-size:20px}
         .tips-popup-content h4{padding-left:10px;height:40px;line-height:40px;border-bottom:1px solid #eee;margin-bottom:20px}
-        .tips-cfm-btn,.tips-cancel-btn,.export{width:100px;height:40px;margin:auto;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;background:#3daae9;color:#fff;border:none}
-        .return-btn,.tips-cancel-btn{background:#fff;color:#555;margin-left:50px}
-        .tips-cancel-btn{border:1px solid #ddd;margin-left:20px;display:none}
-        #close-btn1{top:8px;right:10px;width:18px;position:absolute;cursor:pointer}
-        .export{float:right;margin-right:50px}
 		.red{color:red;}
 		.payment-form-bottom .wipeImgs{height:auto;padding:8px 0;}
 		.wipeImgs img{width:120px;height:90px;background-color:#eee;margin-right:15px;}

+ 7 - 1
src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp

@@ -385,7 +385,7 @@
                             </c:if>
                             <c:if test="${s.refunding ne '1' && s.payStatus ne '1' && not empty s.payStatus}">
                                 <input type="checkbox" data-shoporderid="${s.shopOrderID}" data-shopid="${s.shopID}"
-                                       data-receiptStatus="${s.receiptStatus}" data-modifyPayable="${s.modifyPayable}"/>
+                                       data-receiptStatus="${s.receiptStatus}" data-modifyPayable="${s.modifyPayable}" data-isPayShopOtherFee="${s.isPayShopOtherFee}"/>
                             </c:if>
                         </c:if>
                         <c:if test="${operatingMode == '3'}">
@@ -896,7 +896,13 @@
                 alertx('每次只能选择一个子订单进行付第三方申请');
                 return false;
             }
+            var isPayShopOtherFee = $(checked[0]).attr('data-isPayShopOtherFee');
+            if (!isPayShopOtherFee){
+                alertx("付第三方处于待审核状态,暂不能操作");
+                return false;
+            }
             var shopOrderId = $(checked[0]).attr('data-shoporderid');
+
             window.location.href = '${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=' + shopOrderId;
         });
 

+ 252 - 0
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp

@@ -0,0 +1,252 @@
+<%@ 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>
+        .table th{text-align:center}
+        .table td{text-align:center}
+        .payment-form h4{width:96%;margin-left:2%;padding-bottom:20px;text-align:center;border-bottom:1px solid #eee}
+        .required{color:red}
+        .payment-form label{width:100px;text-align:right;vertical-align:middle;font-weight:600}
+        .payment-form-top{padding:10px 0}
+        .payment-form-top>div,.payment-form-bottom>div{width:94%;margin-left:3%;height:50px;line-height:50px;border-bottom:1px solid #eee;white-space:nowrap}
+        .payment-form-top input{vertical-align:baseline}
+        .payment-form-top>div:last-child span{margin-left:15px}
+        .payment-form-top>div:last-child span:nth-of-type(1){margin-left:0}
+        .pay-table th{background:#f9f9f9}
+        .pay-table tr:first-child th{background:#eee !important}
+        .pay-table td{background:#fff !important}
+        .check-btn{width:96%;margin-left:2%;text-align:center;height:60px;line-height:60px;margin-top:30px}
+        .check-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
+        .payment-form-bottom label{width:140px}
+        .process-details span{width:140px;margin-left:50px;font-weight:600}
+        .process-details div{display:inline-block}
+        .payment-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
+        .tips-popup-content div{width:100%;text-align:center}
+        .tips-popup-content p{text-align:center;padding:80px;font-size:20px}
+        .tips-popup-content h4{padding-left:10px;height:40px;line-height:40px;border-bottom:1px solid #eee;margin-bottom:20px}
+        .check-btn{width:96%;margin-left:2%;text-align:center;height:60px;line-height:60px;margin-top:30px}
+        .check-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
+        .mask{width:100%;height:100%;position:fixed;top:0;background:rgba(0,0,0,0.7);display:none}
+        .tips-popup-content{width:40%;height:auto;padding-bottom:30px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
+        .tips-popup-content div{width:100%;text-align:center}
+        .tips-popup-content{width:30%}
+        .tips-popup-content p{text-align:center;padding:80px;font-size:20px}
+        .tips-popup-content h4{padding-left:10px;height:40px;line-height:40px;border-bottom:1px solid #eee;margin-bottom:20px}
+        .tips-cfm-btn,.tips-cancel-btn,.check-blue-btn,.check-grey-btn{width:100px;height:40px;margin:auto;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;background:#3daae9;color:#fff;border:none}
+        .refuse-btn{margin-left:50px}
+        .return-btn,.tips-cancel-btn,.check-grey-btn{background:#fff;color:#555;margin-left:50px}
+        .tips-cancel-btn,.check-grey-btn{border:1px solid #ddd;margin-left:20px;display:none}
+        #close-btn1{top:8px;right:10px;width:18px;position:absolute;cursor:pointer}
+        .tips-popup-reason .tips-popup-content{height:250px}
+        .tips-popup-reason .tips-popup-content div{position:absolute;bottom:15px}
+        .tips-popup-reason .check-grey-btn{display:inline-block}
+        #refuse-reason{width:80%;height:48%;left:8%;position:absolute;resize:none}
+        .tips-popup-reason h5{color:#555;padding-left:8%;margin-bottom:4px;margin-top:-12px}
+        .check-cfm-btn{background:#3daae9;color:#fff}
+    </style>
+    <style media="print">
+        .styleWidth{width:6%;word-break:break-all}
+        .styleWidth{}
+        .styleWidth3{width:10%;word-break:break-all}
+        .table{margin-left:0;margin-bottom:20px;padding-bottom:2px;border-bottom:1px solid #ddd;box-sizing:border-box}
+        .export{display:none}
+    </style>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/cmPayShop/">付款列表</a></li>
+    <li class="active"><a href="${ctx}/order/cmPayShop/toCheck?id=${cmPayShop.id}">付款审核</a></li>
+</ul><br/>
+<div class="payment-form">
+    <h4>付款单</h4>
+    <div class="payment-form-top">
+        <div>
+            <label>订单编号(ID):</label>&nbsp;&nbsp;
+            <span><a href="${ctx}/order/detail?id=${cmPayShop.shopOrders.get(0).orderID}">${cmPayShop.shopOrders.get(0).orderNo}(${cmPayShop.shopOrders.get(0).orderID})</a></span>
+        </div>
+        <div>
+            <label>子订单编号(ID):</label>&nbsp;&nbsp;&nbsp;&nbsp;
+            <span><a href="${ctx}/order/detail?id=${cmPayShop.shopOrders.get(0).orderID}">${cmPayShop.shopOrders.get(0).shopOrderNo}(${cmPayShop.shopOrders.get(0).shopOrderID})</a></span>
+        </div>
+        <div>
+            <label>付款单名称:</label>
+            <span>${cmPayShop.name}</span>
+        </div>
+        <div>
+            <label>付款账号:</label>
+            <c:if test="${cmPayShop.payType eq '6'}">
+                无
+            </c:if>
+            <c:if test="${cmPayShop.payType ne '6'}">
+                <span>户名:${cmPayShop.bankAccountName}</span>
+                <span>账号:${cmPayShop.bankAccount}</span>
+                <span>开户行:${cmPayShop.bankName}</span>
+                <span>账户类型:
+						<c:if test="${cmPayShop.type == '0'}">公帐</c:if>
+						<c:if test="${cmPayShop.type == '1'}">私帐</c:if>
+					</span>
+            </c:if>
+        </div>
+        <div>
+            <label>付第三方金额:</label>
+            <span>${cmPayShop.totalAmount}</span>
+        </div>
+        <div>
+            <label>付款银行:</label><span>
+					<select name="payType">
+						<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>
+					</select>
+				</span>
+            <label>付款时间:</label>
+            <span>${cmPayShop.payTime}</span>
+            <input name="id" value="${cmPayShop.id}" id="id" type="hidden">
+        </div>
+        <div>
+            <label>申请人:</label>
+            <span>${cmPayShop.applicantName}</span>
+        </div>
+        <div>
+            <label>申请时间:</label>
+            <span>${cmPayShop.applyTime}</span>
+        </div>
+        <div>
+            <label>审核状态:</label>
+            <span>
+                <c:if test="${cmPayShop.status == '0'}">
+						<font color="red">
+							<strong>待审核</strong>
+						</font>
+                </c:if>
+                <c:if test="${cmPayShop.status == '1'}">
+                    审核通过
+                </c:if>
+                <c:if test="${cmPayShop.status == '2'}">
+                    审核不通过
+                </c:if>
+            </span>
+        </div>
+        <c:if test="${cmPayShop.status == '2'}">
+            <div>
+                <label>原因:</label>
+                <span>${cmPayShop.reason}</span>
+            </div>
+        </c:if>
+    </div>
+    <div class="check-btn">
+        <button class="check-cfm-btn" type="button">审核通过</button>
+        <button class="refuse-btn" type="button">审核不通过</button>
+        <button class="return-btn" type="button" onclick="history.go(-1)">返回</button>
+    </div>
+    <div class="mask tips-popup-reason">
+        <div class="tips-popup-content">
+            <h4>确认提示</h4>
+            <h5><span class="required">* </span>审核不通过原因:</h5>
+            <textarea id="refuse-reason" cols="30" rows="10" maxlength="200"></textarea>
+            <div>
+                <button class="check-cfm-btn check-blue-btn" type="button">确定</button>
+                <button class="check-grey-btn" type="button">取消</button>
+            </div>
+            <img id="close-btn1" src="/static/images/close-btn.png" alt="close-btn">
+        </div>
+    </div>
+    <div class="mask tips-popup">
+        <div class="tips-popup-content">
+            <h4>信息提示</h4>
+            <p></p>
+            <div>
+                <button class="tips-cfm-btn tips-cfm-directly" type="button">确定</button>
+                <button class="tips-cancel-btn" type="button">取消</button>
+            </div>
+            <img id="close-btn1" src="/static/images/close-btn.png" alt="close-btn">
+        </div>
+    </div>
+</div>
+<script>
+    (function(){
+        var payTableEle = $('.pay-table'),
+            accessFlag = true,
+            unaccessFlag = true,
+            payProductEle = $('.pay-product-item');
+        payTableEle.each(function (i,l) {
+            var productLength = $(this).find('.pay-product-item').length;
+            // 商品列表合并单元格
+            // $(this).find('.mergeRows').attr('rowspan',productLength);
+        });
+
+        $('.pay-table').each(function(){
+            var thisEle = $(this),
+                totalComissionVal = 0,
+                resVal = '';
+            totalComissionEle = thisEle.find('.payCm'),
+                comissionEle = thisEle.find('.payCm-t'),
+                thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',',''),
+                freightVal = thisEle.find('.freight').text().replace(',','');
+            totalComissionEle.each(function(){
+                totalComissionVal += Number($(this).text().replace(',',''));
+            })
+            resVal = (totalComissionVal - thirdPartyVal - freightVal).toFixed(2);
+            comissionEle.text(resVal);
+        })
+
+        $('.tips-cancel-btn, #close-btn1').on('click',function() {
+            $('.mask').hide();
+        })
+        $('.tips-cfm-directly').on('click',function() {
+            if($('.tips-cfm-btn').hasClass('tips-cfm-directly')) {
+                $('.tips-popup').hide();
+            } else {
+                $('#form').submit();
+            }
+        })
+        $('.refuse-btn').on('click',function() {
+            $('.tips-popup-reason').show();
+        })
+        $('.check-grey-btn').on('click',function() {
+            $('.tips-popup-reason').hide();
+        })
+
+        function showTips(title,text) {
+            $('.tips-popup h4').text(title);
+            $('.tips-popup p').text(text);
+            $('.tips-popup').show();
+        }
+
+
+        function submitForm() {
+            $('.tips-cfm-btn').removeClass('tips-cfm-directly').addClass('submit-now');
+            $('.tips-cancel-btn').hide();
+            showTips('信息提示','审核通过');
+        }
+
+        $('.check-cfm-btn').on('click',function(e) {
+            var payType = $('select[name="payType"]').val(),
+                id = $('#id').val();
+            if($(this).hasClass('check-blue-btn')) {
+                var textareaVal = $('#refuse-reason').val();
+                if(!textareaVal.trim()) {
+                    showTips('信息提示','审核原因不能为空');
+                    return false;
+                }
+                if(unaccessFlag) {
+                    window.location.href = '${ctx}/order/cmPayShop/checkNotPass?id=' + id + '&reason=' + textareaVal;
+                    unaccessFlag = false;
+                }
+            } else {
+                if(accessFlag) {
+                    window.location.href = '${ctx}/order/cmPayShop/checkPass?payType=' + payType + '&id=' + id;
+                    accessFlag = false;
+                }
+            }
+        })
+
+    })()
+</script>
+</body>
+</html>

+ 8 - 7
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherDetail.jsp

@@ -9,7 +9,7 @@
         .table td{text-align:center}
         .payment-form h4{width:96%;margin-left:2%;padding-bottom:20px;text-align:center;border-bottom:1px solid #eee}
         .required{color:red}
-        .payment-form label{width:100px;text-align:right;vertical-align:middle;font-weight:600}
+        .payment-form label{width:105px;text-align:right;vertical-align:middle;font-weight:600}
         .payment-form-top{padding:10px 0}
         .payment-form-top>div,.payment-form-bottom>div{width:94%;margin-left:3%;height:50px;line-height:50px;border-bottom:1px solid #eee;white-space:nowrap}
         .payment-form-top input{vertical-align:baseline}
@@ -59,10 +59,6 @@
             <label>付款单名称:</label>
             <span>${cmPayShop.name}</span>
         </div>
-        <div>
-            <label>供应商名称:</label>
-            <span>${cmPayShop.shopName}</span>
-        </div>
         <div>
             <label>付款账号:</label>
             <c:if test="${cmPayShop.payType eq '6'}">
@@ -102,17 +98,22 @@
                     审核通过
                 </c:if>
                 <c:if test="${cmPayShop.status == '2'}">
-                    审核不通过<br><font color="red">原因: ${cmPayShop.reason}</font>
+                    审核不通过
                 </c:if>
             </span>
         </div>
     </div>
+    <c:if test="${cmPayShop.status == '2'}">
+        <div>
+            <label>原因:</label>
+            <span class="required">${cmPayShop.reason}</span>
+        </div>
+    </c:if>
     <div class="check-btn">
         <button class="apply-btn btn btn-primary" type="button" onclick="window.location.href='${ctx}/order/cmPayShop/printDetail?id=${cmPayShop.id}'">去打印</button>
     </div>
 </div>
 <script>
-
 </script>
 </body>
 </html>

+ 131 - 0
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherEdit.jsp

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

+ 20 - 2
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherForm.jsp

@@ -179,6 +179,13 @@
         .hide-pic {
             display: none !important;
         }
+
+        .payment-form h4{
+            width:96%;
+            margin-left:2%;
+            padding-bottom:20px;
+            text-align:center;
+            border-bottom:1px solid #eee}
     </style>
     <script type="text/javascript">
         $(document).ready(function() {
@@ -220,7 +227,18 @@
 </ul>
 <form:form id="inputForm" modelAttribute="payShopOther" action="${ctx}/order/cmPayShop/saveShopOtherFee" method="post" class="form-horizontal">
     <form:hidden path="shopOrderId"/>
-    <h4>付款单</h4>
+    <form:hidden path="payShopId"/>
+    <div class="payment-form">
+        <h4>付款单${payShopOther.payShopId}</h4>
+    </div><br>
+    <div class="control-group">
+        <label class="control-label"><font color='red'>*</font>订单编号(ID):</label>&nbsp;&nbsp;
+        <a href="${ctx}/order/detail?id=${payShopOther.orderId}">${payShopOther.orderNo}(${payShopOther.orderId})</a>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color='red'>*</font>子订单编号(ID):</label>&nbsp;&nbsp;
+        <a href="${ctx}/order/detail?id=${payShopOther.orderId}">${payShopOther.shopOrderNo}(${payShopOther.shopOrderId})</a>
+    </div>
     <div class="control-group">
         <label class="control-label"><font color='red'>*</font>付款单名称:</label>
         <div class="controls">
@@ -251,7 +269,7 @@
     <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>
+            <textarea type="text" name="remark" placeholder="请详细说明修改的原因,不超过500字" style="position: relative;height: 100px; width: 450px;" maxlength="500" required >${payShopOther.remark}</textarea>
         </div>
     </div>
     <div class="control-group">

+ 158 - 0
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetail.jsp

@@ -0,0 +1,158 @@
+<%@ 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>
+        .table th{text-align:center}
+        .table td{text-align:center}
+        .payment-form h4{width:96%;margin-left:2%;padding-bottom:20px;text-align:center;border-bottom:1px solid #eee}
+        .required{color:red}
+        .payment-form label{width:105px;text-align:right;vertical-align:middle;font-weight:600}
+        .payment-form-top{padding:10px 0}
+        .payment-form-top>div,.payment-form-bottom>div{width:94%;margin-left:3%;height:50px;line-height:50px;border-bottom:1px solid #eee;white-space:nowrap}
+        .payment-form-top input{vertical-align:baseline}
+        .payment-form-top>div:last-child span{margin-left:15px}
+        .payment-form-top>div:last-child span:nth-of-type(1){margin-left:0}
+        .pay-table th{background:#f9f9f9}
+        .pay-table tr:first-child th{background:#eee !important}
+        .pay-table td{background:#fff !important}
+        .check-btn{width:96%;margin-left:2%;text-align:center;height:60px;line-height:60px;margin-top:30px}
+        .check-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
+        .payment-form-bottom label{width:140px}
+        .process-details span{width:140px;margin-left:50px;font-weight:600}
+        .process-details div{display:inline-block}
+        .payment-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
+        .apply-btn{background:#3daae9;color:#fff}
+        .tips-popup-content div{width:100%;text-align:center}
+        .tips-popup-content p{text-align:center;padding:80px;font-size:20px}
+        .tips-popup-content h4{padding-left:10px;height:40px;line-height:40px;border-bottom:1px solid #eee;margin-bottom:20px}
+        .payment-form-bottom .wipeImgs{height:auto;padding:8px 0;}
+        .wipeImgs img{width:120px;height:90px;background-color:#eee;margin-right:15px;}
+    </style>
+    <style media="print">
+        .styleWidth{width:6%;word-break:break-all}
+        .styleWidth{}
+        .styleWidth3{width:10%;word-break:break-all}
+        .table{margin-left:0;margin-bottom:20px;padding-bottom:2px;border-bottom:1px solid #ddd;box-sizing:border-box}
+        .export{display:none}
+    </style>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/cmPayShop/">付款管理</a></li>
+    <li class="active"><a href="${ctx}/order/cmPayShop/printDetail?id=${cmPayShop.id}">付款详情</a></li>
+</ul><br/>
+<div class="payment-form">
+    <h4>付款单</h4>
+    <div class="payment-form-top">
+        <div>
+            <label>订单编号(ID):</label>&nbsp;&nbsp;
+            <span><a href="${ctx}/order/detail?id=${cmPayShop.shopOrders.get(0).orderID}">${cmPayShop.shopOrders.get(0).orderNo}(${cmPayShop.shopOrders.get(0).orderID})</a></span>
+        </div>
+        <div>
+            <label>子订单编号(ID):</label>&nbsp;&nbsp;&nbsp;&nbsp;
+            <span><a href="${ctx}/order/detail?id=${cmPayShop.shopOrders.get(0).orderID}">${cmPayShop.shopOrders.get(0).shopOrderNo}(${cmPayShop.shopOrders.get(0).shopOrderID})</a></span>
+        </div>
+        <div>
+            <label>付款单名称:</label>
+            <span>${cmPayShop.name}</span>
+        </div>
+        <div>
+            <label>付款账号:</label>
+            <c:if test="${cmPayShop.payType eq '6'}">
+                无
+            </c:if>
+            <c:if test="${cmPayShop.payType ne '6'}">
+                <span>户名:${cmPayShop.bankAccountName}</span>
+                <span>账号:${cmPayShop.bankAccount}</span>
+                <span>开户行:${cmPayShop.bankName}</span>
+                <span>账户类型:
+						<c:if test="${cmPayShop.type == '0'}">公帐</c:if>
+						<c:if test="${cmPayShop.type == '1'}">私帐</c:if>
+					</span>
+            </c:if>
+        </div>
+        <div>
+            <label>付第三方金额:</label>
+            <span>${cmPayShop.totalAmount}</span>
+        </div>
+        <div>
+            <label>付款银行:</label>
+            <span>
+                <c:if test="${cmPayShop.payType eq 1}">
+                    建设银行7297
+                </c:if>
+                <c:if test="${cmPayShop.payType eq 2}">
+                    中信银行0897
+                </c:if>
+                <c:if test="${cmPayShop.payType eq 3}">
+                    中信银行7172
+                </c:if>
+                <c:if test="${cmPayShop.payType eq 4}">
+                    广发银行0115
+                </c:if>
+                <c:if test="${cmPayShop.payType eq 5}">
+                    广发银行5461
+                </c:if>
+            </span>
+        </div>
+        <div>
+            <label>付款时间:</label>
+            <span>${cmPayShop.payTime}</span>
+        </div>
+        <div>
+            <label>申请人:</label>
+            <span>${cmPayShop.applicantName}</span>
+        </div>
+        <div>
+            <label>申请时间:</label>
+            <span>${cmPayShop.applyTime}</span>
+        </div>
+        <div>
+            <label>审核状态:</label>
+            <span>
+                <c:if test="${cmPayShop.status == '0'}">
+						<font color="red">
+							<strong>待审核</strong>
+						</font>
+                </c:if>
+                <c:if test="${cmPayShop.status == '1'}">
+                    审核通过
+                </c:if>
+                <c:if test="${cmPayShop.status == '2'}">
+                    审核不通过
+                </c:if>
+            </span>
+        </div>
+        <c:if test="${cmPayShop.status == '2'}">
+            <div>
+                <label>原因:</label>
+                <span class="required">${cmPayShop.reason}</span>
+            </div>
+        </c:if>
+        <div>
+            <label>审核时间:</label>
+            <span>${cmPayShop.reviewTime}</span>
+        </div>
+    </div>
+    <c:if test="${cmPayShop.status == '1'}">
+        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>财务签名:</span>
+        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>审批人签名:</span>
+    </c:if>
+    <div class="check-btn">
+        <button class="export apply-btn btn btn-primary">打印</button>
+    </div>
+</div>
+<script>
+    (function(){
+        $('.export').on('click',function() {
+            window.print();
+        })
+    })()
+</script>
+</body>
+</html>

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

@@ -89,8 +89,6 @@
             return false;
         }
 
-        //初始化默认清除本地本地Item数据
-
     </script>
 </head>
 <body>
@@ -111,9 +109,14 @@
                 <div style="font-weight: bold;width: 100%;float: left;"><span style="float: left;">${shopOther.systemName}</span><span style="float: left;margin-left:10px;"><fmt:formatDate value="${shopOther.updateTime}" pattern="yyyy-MM-dd HH:mm"/></span></div>
                 <br><br>
                 <div>
+                    <c:if test="${not empty shopOther.name}">
+                        <ul>付款单名称:${shopOther.name}</ul>
+                    </c:if>
                     <ul>付第三方:${shopOther.shopOtherFee}</ul>
-                    <ul>开户名:${shopOther.bankAccountName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;账号:${shopOther.bankAccount}</ul>
-                    <ul>开户行:${shopOther.bankName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;账户类型:${shopOther.type eq 0 ? "公账":"私账"}</ul>
+                    <c:if test="${not empty shopOther.name}">
+                        <ul>开户名:${shopOther.bankAccountName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;账号:${shopOther.bankAccount}</ul>
+                        <ul>开户行:${shopOther.bankName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;账户类型:${shopOther.type eq 0 ? "公账":"私账"}</ul>
+                    </c:if>
                     <ul>备注内容:${shopOther.remark}</ul>
                     <ul>图片:
                         <c:forEach items="${shopOther.remarkImages}" var="image">

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/product-new/secondHand.jsp

@@ -98,6 +98,7 @@
                     <form:option value="1" label="网站"/>
                     <form:option value="2" label="小程序"/>
                     <form:option value="3" label="后台"/>
+                    <form:option value="4" label="小程序-协销"/>
                 </form:select>
             </div>
             <div class="item">

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

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