浏览代码

Merge remote-tracking branch 'remotes/origin/developer' into developerC

# Conflicts:
#	src/main/java/com/caimei/modules/user/dao/CmUserDao.java
#	src/main/resources/mappings/modules/user/CmUserMapper.xml
Aslee 3 年之前
父节点
当前提交
eb93d79e73
共有 71 个文件被更改,包括 4800 次插入1916 次删除
  1. 1 0
      src/main/java/com/caimei/modules/bulkpurchase/web/CmRefundsProductController.java
  2. 0 34
      src/main/java/com/caimei/modules/hehe/service/HeHeNewOrderService.java
  3. 4 55
      src/main/java/com/caimei/modules/hehe/web/HeHeNewOrderController.java
  4. 16 5
      src/main/java/com/caimei/modules/order/dao/CmPayShopRecordDao.java
  5. 2 0
      src/main/java/com/caimei/modules/order/dao/CmRefundShopRecordDao.java
  6. 25 0
      src/main/java/com/caimei/modules/order/dao/NewOrderDao.java
  7. 143 0
      src/main/java/com/caimei/modules/order/entity/ChangePayShopDifference.java
  8. 65 0
      src/main/java/com/caimei/modules/order/entity/ChangePayShopOther.java
  9. 380 358
      src/main/java/com/caimei/modules/order/entity/CmPayShop.java
  10. 118 110
      src/main/java/com/caimei/modules/order/entity/CmPayShopRecord.java
  11. 9 0
      src/main/java/com/caimei/modules/order/entity/NewOrder.java
  12. 19 0
      src/main/java/com/caimei/modules/order/entity/NewShopOrder.java
  13. 296 116
      src/main/java/com/caimei/modules/order/service/CmPayShopService.java
  14. 76 0
      src/main/java/com/caimei/modules/order/service/CmReturnedPurchaseService.java
  15. 122 3
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  16. 33 3
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  17. 106 0
      src/main/java/com/caimei/modules/order/utils/RandomCode.java
  18. 51 2
      src/main/java/com/caimei/modules/order/web/CmPayShopController.java
  19. 10 0
      src/main/java/com/caimei/modules/order/web/CmShopOrderController.java
  20. 9 1
      src/main/java/com/caimei/modules/user/dao/CmUserDao.java
  21. 29 2
      src/main/java/com/caimei/modules/user/dao/CmUserbeanshistoryDao.java
  22. 3 0
      src/main/java/com/caimei/modules/user/dao/NewCmClubDao.java
  23. 803 806
      src/main/java/com/caimei/modules/user/entity/CmUser.java
  24. 145 0
      src/main/java/com/caimei/modules/user/entity/UserBeansHistory.java
  25. 36 29
      src/main/java/com/caimei/modules/user/service/CmUserbeanshistoryService.java
  26. 5 0
      src/main/java/com/caimei/modules/user/service/NewCmClubService.java
  27. 1 10
      src/main/java/com/caimei/modules/user/web/CmUserBalanceRecordController.java
  28. 1 1
      src/main/java/com/caimei/modules/user/web/CmUserOrganizeController.java
  29. 41 62
      src/main/java/com/caimei/modules/user/web/CmUserbeanshistoryController.java
  30. 7 8
      src/main/java/com/caimei/modules/user/web/NewCmClubController.java
  31. 13 2
      src/main/java/com/caimei/modules/user/web/newUser/AgencyController.java
  32. 7 2
      src/main/resources/mappings/modules/order/CmPayShopMapper.xml
  33. 22 5
      src/main/resources/mappings/modules/order/CmPayShopRecordMapper.xml
  34. 15 1
      src/main/resources/mappings/modules/order/CmRefundShopRecordMapper.xml
  35. 21 0
      src/main/resources/mappings/modules/order/OrderMapper.xml
  36. 3 6
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  37. 4 0
      src/main/resources/mappings/modules/user/CmUserMapper.xml
  38. 84 90
      src/main/resources/mappings/modules/user/CmUserbeanshistoryMapper.xml
  39. 13 0
      src/main/resources/mappings/modules/user/NewCmClubMapper.xml
  40. 7 4
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/applyRefoundForm.jsp
  41. 7 5
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderConfirmReturnRecord.jsp
  42. 7 4
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderReturnRecord.jsp
  43. 7 4
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderReviewReturnRecord.jsp
  44. 7 13
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/refundRecord.jsp
  45. 2 2
      src/main/webapp/WEB-INF/views/modules/order/checkPaymentOrder.jsp
  46. 25 4
      src/main/webapp/WEB-INF/views/modules/order/cmPayFormList.jsp
  47. 3 3
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopChange.jsp
  48. 3 3
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp
  49. 4 4
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp
  50. 9 12
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopEdit.jsp
  51. 3 3
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp
  52. 34 13
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp
  53. 252 0
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp
  54. 121 0
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherDetail.jsp
  55. 131 0
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherEdit.jsp
  56. 402 0
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherForm.jsp
  57. 161 0
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetail.jsp
  58. 9 3
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopPrintDetail.jsp
  59. 107 17
      src/main/webapp/WEB-INF/views/modules/order/differencePriceForm.jsp
  60. 7 0
      src/main/webapp/WEB-INF/views/modules/order/differencePriceRemark.jsp
  61. 1 1
      src/main/webapp/WEB-INF/views/modules/order/newOrderList.jsp
  62. 4 2
      src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp
  63. 7 4
      src/main/webapp/WEB-INF/views/modules/order/otherRemark.jsp
  64. 582 0
      src/main/webapp/WEB-INF/views/modules/order/paidShopOrderList.jsp
  65. 6 0
      src/main/webapp/WEB-INF/views/modules/order/payedAndRefundRecordList.jsp
  66. 10 3
      src/main/webapp/WEB-INF/views/modules/order/shopOtherFeeForm.jsp
  67. 1 0
      src/main/webapp/WEB-INF/views/modules/product-new/secondHand.jsp
  68. 3 1
      src/main/webapp/WEB-INF/views/modules/user/cmUserBalanceList.jsp
  69. 68 0
      src/main/webapp/WEB-INF/views/modules/user/cmUserBeansList.jsp
  70. 0 84
      src/main/webapp/WEB-INF/views/modules/user/cmUserbeanshistoryForm.jsp
  71. 72 16
      src/main/webapp/WEB-INF/views/modules/user/cmUserbeanshistoryList.jsp

+ 1 - 0
src/main/java/com/caimei/modules/bulkpurchase/web/CmRefundsProductController.java

@@ -191,6 +191,7 @@ public class CmRefundsProductController extends BaseController {
             List<NewShopOrder> newShopOrders = newOrder.getNewShopOrders();
             for (NewShopOrder shopOrder : newShopOrders) {
                 List<NewOrderProduct> newOrderProducts = shopOrder.getNewOrderProducts();
+                newOrderProducts.removeIf(op -> (newOrder.getUserBeans() != null && newOrder.getUserBeans() > 0 && 998 == op.getShopID()));
                 if (!CollectionUtils.isEmpty(newOrderProducts)) {
                     for (NewOrderProduct orderProduct : newOrderProducts) {
                         Integer num = orderProduct.getNum();

+ 0 - 34
src/main/java/com/caimei/modules/hehe/service/HeHeNewOrderService.java

@@ -1,8 +1,5 @@
 package com.caimei.modules.hehe.service;
 
-import com.caimei.modules.bulkpurchase.dao.OrderInvoiceDao;
-import com.caimei.modules.bulkpurchase.service.OrderInvoiceService;
-import com.caimei.modules.hehe.dao.CmHeheUserDao;
 import com.caimei.modules.hehe.dao.HeHeNewOrderDao;
 import com.caimei.modules.order.dao.*;
 import com.caimei.modules.order.entity.*;
@@ -10,14 +7,9 @@ import com.caimei.modules.order.service.CmReceiptOrderRelationService;
 import com.caimei.modules.order.service.OrderUserInfoService;
 import com.caimei.modules.order.utils.NewOrderStatus;
 import com.caimei.modules.product.dao.CmPromotionDao;
-import com.caimei.modules.product.dao.ProductDao;
 import com.caimei.modules.product.entity.OrderProductLadderPrice;
 import com.caimei.modules.user.dao.CmUserDao;
-import com.caimei.modules.user.dao.NewCmClubDao;
-import com.caimei.modules.user.dao.NewCmShopDao;
 import com.caimei.modules.user.entity.CmUser;
-import com.caimei.modules.user.service.CmUserBalanceRecordService;
-import com.caimei.modules.user.service.CmUserService;
 import com.caimei.utils.AppKeys;
 import com.caimei.utils.AppUtils;
 import com.caimei.utils.SysConfig;
@@ -49,38 +41,14 @@ public class HeHeNewOrderService extends CrudService<HeHeNewOrderDao, NewOrder>
     @Resource
     private NewOrderProductDao newOrderProductDao;
     @Resource
-    private OrderInvoiceService orderInvoiceService;
-    @Resource
     private OrderUserInfoService orderUserInfoService;
     @Resource
     private NewShopOrderDao newShopOrderDao;
     @Resource
-    private NewCmClubDao newCmClubDao;
-    @Resource
-    private LogisticsBatchDao logisticsBatchDao;
-    @Resource
-    private LogisticsRecordDao logisticsRecordDao;
-    @Resource
-    private LogisticsInformationDao logisticsInformationDao;
-    @Resource
-    private OrderInvoiceDao orderInvoiceDao;
-    @Resource
-    private NewOrderConfigDao newOrderConfigDao;
-    @Resource
-    private ProductDao productDao;
-    @Resource
-    private NewCmShopDao newCmShopDao;
-    @Resource
     private CmUserDao cmUserDao;
     @Resource
-    private CmUserService cmUserService;
-    @Resource
-    private CmReturnedPurchaseProductDao cmReturnedPurchaseProductDao;
-    @Resource
     private CmDiscernReceiptDao cmDiscernReceiptDao;
     @Resource
-    private CmUserBalanceRecordService cmUserBalanceRecordService;
-    @Resource
     private CmReturnedPurchaseDao cmReturnedPurchaseDao;
     @Resource
     private CmPayShopRecordDao cmPayShopRecordDao;
@@ -90,8 +58,6 @@ public class HeHeNewOrderService extends CrudService<HeHeNewOrderDao, NewOrder>
     private CmReceiptOrderRelationService cmReceiptOrderRelationService;
     @Autowired
     private CmPromotionDao cmPromotionDao;
-    @Autowired
-    private CmHeheUserDao cmHeheUserDao;
 
     @Override
     public NewOrder get(String id) {

+ 4 - 55
src/main/java/com/caimei/modules/hehe/web/HeHeNewOrderController.java

@@ -2,34 +2,21 @@ package com.caimei.modules.hehe.web;
 
 import com.caimei.modules.bulkpurchase.entity.BpClause;
 import com.caimei.modules.bulkpurchase.service.BpClauseService;
-import com.caimei.modules.bulkpurchase.service.CmFinanceChargeService;
-import com.caimei.modules.bulkpurchase.service.PurchaseProductService;
 import com.caimei.modules.hehe.dao.CmHeheUserDao;
 import com.caimei.modules.hehe.entity.CmHeheUser;
-import com.caimei.modules.hehe.service.CmHeheUserService;
 import com.caimei.modules.hehe.service.HeHeNewOrderService;
 import com.caimei.modules.order.dao.CmDiscernReceiptDao;
 import com.caimei.modules.order.dao.CmReceiptOrderRelationDao;
 import com.caimei.modules.order.dao.CmReturnedPurchaseDao;
-import com.caimei.modules.order.dao.NewOrderProductDao;
 import com.caimei.modules.order.entity.*;
-import com.caimei.modules.order.service.*;
-import com.caimei.modules.product.dao.CmPromotionDao;
-import com.caimei.modules.product.dao.ProductDao;
-import com.caimei.modules.product.service.CmSecondHandDetailService;
-import com.caimei.modules.product.service.RepeatPurchasePriceHistoryService;
-import com.caimei.modules.product.service.RepeatPurchasePriceService;
-import com.caimei.modules.project.dao.ClubDao;
-import com.caimei.modules.user.dao.CmUserDao;
-import com.caimei.modules.user.service.CmMessageService;
-import com.caimei.modules.user.service.CmUserOrganizeService;
-import com.caimei.modules.user.service.CmUserService;
-import com.caimei.modules.user.service.NewCmShopService;
+import com.caimei.modules.order.service.CmDiscernReceiptService;
+import com.caimei.modules.order.service.CmReceiptOrderRelationService;
+import com.caimei.modules.order.service.CmReturnedPurchaseService;
+import com.caimei.modules.order.service.NewOrderConfigService;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.common.web.BaseController;
 import org.apache.commons.collections.CollectionUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -59,57 +46,19 @@ public class HeHeNewOrderController extends BaseController {
     @Resource
     private BpClauseService bpClauseService;
     @Resource
-    private NewOrderProductService newOrderProductService;
-    @Autowired
-    private NewReceiptListService newReceiptListService;
-    @Resource
-    private NewShopOrderService newShopOrderService;
-    @Resource
-    private CmFinanceChargeService cmFinanceChargeService;
-    @Resource
-    private OrderUserInfoService orderUserInfoService;
-    @Resource
-    private CmMessageService cmMessageService;
-    @Resource
-    private ClubDao clubDao;
-    @Autowired
-    private ProductDao productDao;
-    @Resource
-    private CmProductSnService cmProductSnService;
-    @Autowired
-    private NewOrderProductDao newOrderProductDao;
-    @Resource
     private CmReturnedPurchaseDao cmReturnedPurchaseDao;
     @Resource
-    private CmUserService cmUserService;
-    @Resource
-    private RepeatPurchasePriceService repeatPurchasePriceService;
-    @Resource
-    private NewCmShopService newCmShopService;
-    @Resource
-    private RepeatPurchasePriceHistoryService repeatPurchasePriceHistoryService;
-    @Resource
     private NewOrderConfigService newOrderConfigService;
     @Resource
     private CmDiscernReceiptService cmDiscernReceiptService;
     @Resource
-    private CmUserDao cmUserDao;
-    @Resource
     private CmReturnedPurchaseService cmReturnedPurchaseService;
     @Resource
     private CmReceiptOrderRelationDao cmReceiptOrderRelationDao;
     @Autowired
-    private CmUserOrganizeService cmUserOrganizeService;
-    @Autowired
-    private CmSecondHandDetailService cmSecondHandDetailService;
-    @Autowired
     private CmDiscernReceiptDao cmDiscernReceiptDao;
     @Autowired
     private CmReceiptOrderRelationService cmReceiptOrderRelationService;
-    @Resource
-    private CmPromotionDao cmPromotionDao;
-    @Autowired
-    private PurchaseProductService purchaseProductService;
 
     @ModelAttribute
     public NewOrder get(@RequestParam(required = false) String id) {

+ 16 - 5
src/main/java/com/caimei/modules/order/dao/CmPayShopRecordDao.java

@@ -8,10 +8,12 @@ import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import com.caimei.modules.order.entity.CmPayShopRecord;
 import org.apache.ibatis.annotations.Param;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
  * 付款记录表DAO接口
+ *
  * @author lwt
  * @version 2019-07-01
  */
@@ -22,25 +24,26 @@ public interface CmPayShopRecordDao extends CrudDao<CmPayShopRecord> {
 
     void checkNotPass(@Param("payShopID") String payShopID);
 
-    void updateByID(@Param("payShopID") String payShopID,@Param("shopOrderID") String shopOrderID,@Param("payAmount") Double payAmount,@Param("wipePayment") Double wipePayment);
+    void updateByID(@Param("payShopID") String payShopID, @Param("shopOrderID") String shopOrderID, @Param("payAmount") Double payAmount, @Param("wipePayment") Double wipePayment);
 
     void updateWipePayment(@Param("id") Integer id, @Param("wipePayment") Double wipePayment, @Param("wipeTime") String wipeTime);
 
     void deleteByFlag(@Param("ids") List<String> ids);
 
-    void updateStatusByPayShopID(@Param("status") String status,@Param("payShopID") String payShopID);
+    void updateStatusByPayShopID(@Param("status") String status, @Param("payShopID") String payShopID);
 
-    List<CmPayShopRecord> findByOrderIDsGroupBy(@Param("orderIDs")String[] orderIDs);
+    List<CmPayShopRecord> findByOrderIDsGroupBy(@Param("orderIDs") String[] orderIDs);
 
-    List<CmPayShopRecord> getPayedRecords(@Param("shopOrderID")String shopOrderID);
+    List<CmPayShopRecord> getPayedRecords(@Param("shopOrderID") String shopOrderID);
 
-    List<CmPayShopRecord> getPayedRecordsGroupBy(@Param("shopOrderID")String shopOrderID);
+    List<CmPayShopRecord> getPayedRecordsGroupBy(@Param("shopOrderID") String shopOrderID);
 
     Double sumByShopOrderID(@Param("shopOrderID") Integer shopOrderID);
 
     void applyCompileSave(CmPayShop cmPayShop);
 
     Double sumWipePayment(@Param("shopOrderID") Integer shopOrderID);
+
     Double sumWipePaymentNoStatus(@Param("shopOrderID") Integer shopOrderID);
 
     void cancelRecordWipePayment(Integer shopOrderID);
@@ -56,4 +59,12 @@ public interface CmPayShopRecordDao extends CrudDao<CmPayShopRecord> {
     void insertDifference(ChangePayShopDifference payShopDifference);
 
     List<ChangePayShopDifference> findShopDifference(Integer shopOrderId);
+
+    /**
+     * 查询第三方已付款金额
+     *
+     * @param shopOrderId
+     * @return
+     */
+    BigDecimal findPayShopOtherFee(Integer shopOrderId);
 }

+ 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);
 }

+ 25 - 0
src/main/java/com/caimei/modules/order/dao/NewOrderDao.java

@@ -112,4 +112,29 @@ public interface NewOrderDao extends CrudDao<NewOrder> {
      * @param ossName
      */
     void insertQualificationFile(@Param("recordId") Integer recordId, @Param("fileName") String fileName, @Param("ossName") String ossName);
+
+    /**
+     * 查询短链接是否存在
+     *
+     * @param shortLink
+     * @return
+     */
+    Integer findBYShortLink(String shortLink);
+
+    /**
+     * 保存短链接信息
+     *
+     * @param markId    短信类型
+     * @param shortLink 短链接
+     * @param url       跳转地址
+     */
+    void insertShortLink(@Param("markId") int markId, @Param("shortLink") String shortLink, @Param("url") String url);
+
+    /**
+     * 保存短信发送条数
+     *
+     * @param markId
+     * @param num
+     */
+    void updateSendNum(@Param("markId") int markId, @Param("num") int num);
 }

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

@@ -22,6 +22,11 @@ public class ChangePayShopDifference implements Serializable {
      */
     private Integer refundShopId;
 
+    /**
+     * 已付款少付,付款单id
+     */
+    private Integer payShopId;
+
     /**
      * 差价金额
      */
@@ -52,6 +57,41 @@ public class ChangePayShopDifference implements Serializable {
      */
     private Date updateTime;
 
+    /**
+     * 付款单名称
+     */
+    private String name;
+
+    /**
+     * 开户名
+     */
+    private String bankAccountName;
+
+    /**
+     * 账号
+     */
+    private String bankAccount;
+
+    /**
+     * 开户行
+     */
+    private String bankName;
+
+    /**
+     * 账号的类型 0公账, 1私账
+     */
+    private Integer bankType;
+
+    /**
+     * 欠款抵扣金额
+     */
+    private BigDecimal balancePayFee;
+
+    /**
+     * 转账支付
+     */
+    private BigDecimal transferPayFee;
+
     private String[] remarkImages;
 
     /**
@@ -84,6 +124,21 @@ public class ChangePayShopDifference implements Serializable {
      */
     private String systemName;
 
+    /**
+     * 供应商欠款金额
+     */
+    private BigDecimal rebateAmount;
+
+    /**
+     * 供应商可用余额
+     */
+    private BigDecimal ableRebateAmount;
+
+    /**
+     * (付款供应商)付款状态:1待付款、2部分付款、3已付款
+     */
+    private String payStatus;
+
     /**
      * 退款数据
      */
@@ -224,4 +279,92 @@ public class ChangePayShopDifference implements Serializable {
     public void setRefundShop(CmRefundShop refundShop) {
         this.refundShop = refundShop;
     }
+
+    public Integer getPayShopId() {
+        return payShopId;
+    }
+
+    public void setPayShopId(Integer payShopId) {
+        this.payShopId = payShopId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    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 getBankType() {
+        return bankType;
+    }
+
+    public void setBankType(Integer bankType) {
+        this.bankType = bankType;
+    }
+
+    public BigDecimal getBalancePayFee() {
+        return balancePayFee;
+    }
+
+    public void setBalancePayFee(BigDecimal balancePayFee) {
+        this.balancePayFee = balancePayFee;
+    }
+
+    public BigDecimal getTransferPayFee() {
+        return transferPayFee;
+    }
+
+    public void setTransferPayFee(BigDecimal transferPayFee) {
+        this.transferPayFee = transferPayFee;
+    }
+
+    public BigDecimal getRebateAmount() {
+        return rebateAmount;
+    }
+
+    public void setRebateAmount(BigDecimal rebateAmount) {
+        this.rebateAmount = rebateAmount;
+    }
+
+    public BigDecimal getAbleRebateAmount() {
+        return ableRebateAmount;
+    }
+
+    public void setAbleRebateAmount(BigDecimal ableRebateAmount) {
+        this.ableRebateAmount = ableRebateAmount;
+    }
+
+    public String getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(String payStatus) {
+        this.payStatus = payStatus;
+    }
 }

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

@@ -69,6 +69,31 @@ public class ChangePayShopOther implements Serializable {
      */
     private String systemName;
 
+    /**
+     * 付款单名称
+     */
+    private String name;
+
+    /**
+     * 子订单编号
+     */
+    private String shopOrderNo;
+
+    /**
+     * 主订单ID
+     */
+    private Integer orderId;
+
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+
+    /**
+     * 付款单表id
+     */
+    private Integer payShopId;
+
     public Integer getId() {
         return id;
     }
@@ -172,4 +197,44 @@ public class ChangePayShopOther implements Serializable {
     public void setSystemName(String systemName) {
         this.systemName = systemName;
     }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getShopOrderNo() {
+        return shopOrderNo;
+    }
+
+    public void setShopOrderNo(String shopOrderNo) {
+        this.shopOrderNo = shopOrderNo;
+    }
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Integer getPayShopId() {
+        return payShopId;
+    }
+
+    public void setPayShopId(Integer payShopId) {
+        this.payShopId = payShopId;
+    }
 }

+ 380 - 358
src/main/java/com/caimei/modules/order/entity/CmPayShop.java

@@ -1,373 +1,395 @@
 package com.caimei.modules.order.entity;
 
-import org.hibernate.validator.constraints.Length;
-
 import com.thinkgem.jeesite.common.persistence.DataEntity;
+import org.hibernate.validator.constraints.Length;
 
 import java.beans.Transient;
 import java.util.List;
 
 /**
  * 付款单表Entity
+ *
  * @author lwt
  * @version 2019-07-01
  */
 public class CmPayShop extends DataEntity<CmPayShop> {
 
-	private static final long serialVersionUID = 1L;
-	private String organizeID;//组织ID
-	private String shopID;		// 供应商Id
-	private String name;		// 付款单名称
-	private String shopName;		// 供应商名称
-	private String bankAccountName;		// 付款账号的户名
-	private String bankAccount;		// 付款账号
-	private String bankName;		// 付款账号的开户行
-	private String type;		//  付款账号的类型 0公账, 1私账
-	private Double totalAmount;		// 付供应商总金额
-	private Double balancePayFee;		// 余额支付
-	private Double transferPayFee;		// 转账支付
-	private String payType;		// 付款银行
-	private Double wipePayment;		// '付款抹平金额'
-	private String wipeRemarks;		// '付款抹平备注'
-	private String wipeRemarkImages;
-	private String wipeTime;		// 抹平申请时间
-	private List<String> wipeImages;
-	private String applicant;		// 申请人
-	private String applicantName;		// 申请人名称
-	private String applyTime;		// 申请时间
-	private String reviewer;		// 审核人
-	private String reviewerName;		// 审核人名称
-	private String reviewTime;		// 审核时间
-	private String payTime; 		//付款时间
-	private String status;		// 审核状态  0待审核,  1审核通过 2 审核不通过
-	private String reason;		// 审核不通过原因
-
-	private String startTime;
-	private String endTime;
-	private Double ableRebateAmount;//供应商可用余额
-	private Double rebateAmount;//供应商余额
-	private List<NewShopOrder> shopOrders;  //付款单关联的子订单
-	private String reApply;  // 审核不通过  重新修改发起申请
-
-	private String shopOrderNo;// 子订单编号
-
-	private String shopOrderID;  // 子订单ID
-	private String orderID;  //主订单ID
-	private String orderNo;  //订单编号
-	private String rePayment; //1可以重申,2不可以重申
-
-	public Double getWipePayment() {
-		return wipePayment;
-	}
-	public void setWipePayment(Double wipePayment) {
-		this.wipePayment = wipePayment;
-	}
-	public String getWipeRemarks() {
-		return wipeRemarks;
-	}
-	public void setWipeRemarks(String wipeRemarks) {
-		this.wipeRemarks = wipeRemarks;
-	}
-	public String getWipeRemarkImages() {
-		return wipeRemarkImages;
-	}
-	public void setWipeRemarkImages(String wipeRemarkImages) {
-		this.wipeRemarkImages = wipeRemarkImages;
-	}
-	@Length(min=0, max=19, message="抹平时间长度必须介于 0 和 19 之间")
-	public String getWipeTime() {
-		return wipeTime;
-	}
-
-	public void setWipeTime(String wipeTime) {
-		this.wipeTime = wipeTime;
-	}
-
-	public List<String> getWipeImages() {
-		return wipeImages;
-	}
-
-	public void setWipeImages(List<String> wipeImages) {
-		this.wipeImages = wipeImages;
-	}
-
-	public CmPayShop() {
-		super();
-	}
-
-	public CmPayShop(String id){
-		super(id);
-	}
-
-	@Length(min=0, max=11, message="供应商Id长度必须介于 0 和 11 之间")
-	public String getShopID() {
-		return shopID;
-	}
-
-	public void setShopID(String shopID) {
-		this.shopID = shopID;
-	}
-
-	@Length(min=0, max=250, message="付款单名称长度必须介于 0 和 250 之间")
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	@Length(min=0, max=20, message="供应商名称长度必须介于 0 和 20 之间")
-	public String getShopName() {
-		return shopName;
-	}
-
-	public void setShopName(String shopName) {
-		this.shopName = shopName;
-	}
-
-	@Length(min=0, max=30, message="付款账号的户名长度必须介于 0 和 30 之间")
-	public String getBankAccountName() {
-		return bankAccountName;
-	}
-
-	public void setBankAccountName(String bankAccountName) {
-		this.bankAccountName = bankAccountName;
-	}
-
-	@Length(min=0, max=30, message="付款账号长度必须介于 0 和 30 之间")
-	public String getBankAccount() {
-		return bankAccount;
-	}
-
-	public void setBankAccount(String bankAccount) {
-		this.bankAccount = bankAccount;
-	}
-
-	@Length(min=0, max=19, message="付款账号的开户行长度必须介于 0 和 19 之间")
-	public String getBankName() {
-		return bankName;
-	}
-
-	public void setBankName(String bankName) {
-		this.bankName = bankName;
-	}
-
-	@Length(min=0, max=1, message=" 付款账号的类型 0公账, 1私账长度必须介于 0 和 1 之间")
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-
-	public Double getTotalAmount() {
-		return totalAmount;
-	}
-
-	public void setTotalAmount(Double totalAmount) {
-		this.totalAmount = totalAmount;
-	}
-
-	public Double getBalancePayFee() {
-		return balancePayFee;
-	}
-
-	public void setBalancePayFee(Double balancePayFee) {
-		this.balancePayFee = balancePayFee;
-	}
-
-	public Double getTransferPayFee() {
-		return transferPayFee;
-	}
-
-	public void setTransferPayFee(Double TransferPayFee) {
-		this.transferPayFee = TransferPayFee;
-	}
-
-	@Length(min=0, max=20, message="付款银行长度必须介于 0 和 20 之间")
-	public String getPayType() {
-		return payType;
-	}
-
-	public void setPayType(String bankNo) {
-		this.payType = bankNo;
-	}
-
-	@Length(min=0, max=11, message="申请人长度必须介于 0 和 11 之间")
-	public String getApplicant() {
-		return applicant;
-	}
-
-	public void setApplicant(String applicant) {
-		this.applicant = applicant;
-	}
-
-	@Length(min=0, max=19, message="申请时间长度必须介于 0 和 19 之间")
-	public String getApplyTime() {
-		return applyTime;
-	}
-
-	public void setApplyTime(String applyTime) {
-		this.applyTime = applyTime;
-	}
-
-	@Length(min=0, max=11, message="审核人长度必须介于 0 和 11 之间")
-	public String getReviewer() {
-		return reviewer;
-	}
-
-	public void setReviewer(String reviewer) {
-		this.reviewer = reviewer;
-	}
-
-	@Length(min=0, max=19, message="审核时间长度必须介于 0 和 19 之间")
-	public String getReviewTime() {
-		return reviewTime;
-	}
-
-	public void setReviewTime(String reviewTime) {
-		this.reviewTime = reviewTime;
-	}
-
-	@Length(min=0, max=1, message="审核状态  0待审核,  1审核通过长度必须介于 0 和 1 之间")
-	public String getStatus() {
-		return status;
-	}
-
-	public void setStatus(String status) {
-		this.status = status;
-	}
-
-	@Length(min=0, max=20, message="审核不通过原因长度必须介于 0 和 20 之间")
-	public String getReason() {
-		return reason;
-	}
-
-	public void setReason(String reason) {
-		this.reason = reason;
-	}
-
-	@Transient
-	public List<NewShopOrder> getShopOrders() {
-		return shopOrders;
-	}
-
-	public void setShopOrders(List<NewShopOrder> shopOrders) {
-		this.shopOrders = shopOrders;
-	}
-	@Transient
-	public String getApplicantName() {
-		return applicantName;
-	}
-
-	public void setApplicantName(String applicantName) {
-		this.applicantName = applicantName;
-	}
-	@Transient
-	public String getReviewerName() {
-		return reviewerName;
-	}
-
-	public void setReviewerName(String reviewerName) {
-		this.reviewerName = reviewerName;
-	}
-	@Transient
-	public String getStartTime() {
-		return startTime;
-	}
-
-	public void setStartTime(String startTime) {
-		this.startTime = startTime;
-	}
-	@Transient
-	public String getEndTime() {
-		return endTime;
-	}
-
-	public void setEndTime(String endTime) {
-		this.endTime = endTime;
-	}
-	@Transient
-	public Double getAbleRebateAmount() {
-		return ableRebateAmount;
-	}
-
-	public void setAbleRebateAmount(Double ableRebateAmount) {
-		this.ableRebateAmount = ableRebateAmount;
-	}
-	@Transient
-	public Double getRebateAmount() {
-		return rebateAmount;
-	}
-
-	public void setRebateAmount(Double rebateAmount) {
-		this.rebateAmount = rebateAmount;
-	}
-	@Transient
-	public String getReApply() {
-		return reApply;
-	}
-
-	public void setReApply(String reApply) {
-		this.reApply = reApply;
-	}
-
-	@Transient
-	public String getShopOrderNo() {
-		return shopOrderNo;
-	}
-
-	public void setShopOrderNo(String shopOrderNo) {
-		this.shopOrderNo = shopOrderNo;
-	}
-
-	public String getShopOrderID() {
-		return shopOrderID;
-	}
-
-	public void setShopOrderID(String shopOrderID) {
-		this.shopOrderID = shopOrderID;
-	}
-
-	public String getOrderID() {
-		return orderID;
-	}
-
-	public void setOrderID(String orderID) {
-		this.orderID = orderID;
-	}
-
-	public String getOrderNo() {
-		return orderNo;
-	}
-
-	public void setOrderNo(String orderNo) {
-		this.orderNo = orderNo;
-	}
-
-	public String getRePayment() {
-		return rePayment;
-	}
-
-	public void setRePayment(String rePayment) {
-		this.rePayment = rePayment;
-	}
-
-	public String getPayTime() {
-		return payTime;
-	}
-
-	public void setPayTime(String payTime) {
-		this.payTime = payTime;
-	}
-
-	public String getOrganizeID() {
-		return organizeID;
-	}
-
-	public void setOrganizeID(String organizeID) {
-		this.organizeID = organizeID;
-	}
+    private static final long serialVersionUID = 1L;
+    private String organizeID;//组织ID
+    private String shopID;        // 供应商Id
+    private String name;        // 付款单名称
+    private String shopName;        // 供应商名称
+    private String bankAccountName;        // 付款账号的户名
+    private String bankAccount;        // 付款账号
+    private String bankName;        // 付款账号的开户行
+    private String type;        //  付款账号的类型 0公账, 1私账
+    private Double totalAmount;        // 付供应商总金额
+    private Double balancePayFee;        // 余额支付
+    private Double transferPayFee;        // 转账支付
+    private String payType;        // 付款银行
+    private Double wipePayment;        // '付款抹平金额'
+    private String wipeRemarks;        // '付款抹平备注'
+    private String wipeRemarkImages;
+    private String wipeTime;        // 抹平申请时间
+    private List<String> wipeImages;
+    private String applicant;        // 申请人
+    private String applicantName;        // 申请人名称
+    private String applyTime;        // 申请时间
+    private String reviewer;        // 审核人
+    private String reviewerName;        // 审核人名称
+    private String reviewTime;        // 审核时间
+    private String payTime;        //付款时间
+    private String status;        // 审核状态  0待审核,  1审核通过 2 审核不通过
+    private String reason;        // 审核不通过原因
+    private Integer paymentType; //付款类型: 1子订单付款 2供应商差价 3付第三方
+
+    private String startTime;
+    private String endTime;
+    private Double ableRebateAmount;//供应商可用余额
+    private Double rebateAmount;//供应商余额
+    private List<NewShopOrder> shopOrders;  //付款单关联的子订单
+    private String reApply;  // 审核不通过  重新修改发起申请
+
+    private String shopOrderNo;// 子订单编号
+
+    private String shopOrderID;  // 子订单ID
+    private String orderID;  //主订单ID
+    private String orderNo;  //订单编号
+    private String rePayment; //1可以重申,2不可以重申
+
+    public Double getWipePayment() {
+        return wipePayment;
+    }
+
+    public void setWipePayment(Double wipePayment) {
+        this.wipePayment = wipePayment;
+    }
+
+    public String getWipeRemarks() {
+        return wipeRemarks;
+    }
+
+    public void setWipeRemarks(String wipeRemarks) {
+        this.wipeRemarks = wipeRemarks;
+    }
+
+    public String getWipeRemarkImages() {
+        return wipeRemarkImages;
+    }
+
+    public void setWipeRemarkImages(String wipeRemarkImages) {
+        this.wipeRemarkImages = wipeRemarkImages;
+    }
+
+    @Length(min = 0, max = 19, message = "抹平时间长度必须介于 0 和 19 之间")
+    public String getWipeTime() {
+        return wipeTime;
+    }
+
+    public void setWipeTime(String wipeTime) {
+        this.wipeTime = wipeTime;
+    }
+
+    public List<String> getWipeImages() {
+        return wipeImages;
+    }
+
+    public void setWipeImages(List<String> wipeImages) {
+        this.wipeImages = wipeImages;
+    }
+
+    public CmPayShop() {
+        super();
+    }
+
+    public CmPayShop(String id) {
+        super(id);
+    }
+
+    @Length(min = 0, max = 11, message = "供应商Id长度必须介于 0 和 11 之间")
+    public String getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(String shopID) {
+        this.shopID = shopID;
+    }
+
+    @Length(min = 0, max = 250, message = "付款单名称长度必须介于 0 和 250 之间")
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Length(min = 0, max = 20, message = "供应商名称长度必须介于 0 和 20 之间")
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    @Length(min = 0, max = 30, message = "付款账号的户名长度必须介于 0 和 30 之间")
+    public String getBankAccountName() {
+        return bankAccountName;
+    }
+
+    public void setBankAccountName(String bankAccountName) {
+        this.bankAccountName = bankAccountName;
+    }
+
+    @Length(min = 0, max = 30, message = "付款账号长度必须介于 0 和 30 之间")
+    public String getBankAccount() {
+        return bankAccount;
+    }
+
+    public void setBankAccount(String bankAccount) {
+        this.bankAccount = bankAccount;
+    }
+
+    @Length(min = 0, max = 19, message = "付款账号的开户行长度必须介于 0 和 19 之间")
+    public String getBankName() {
+        return bankName;
+    }
+
+    public void setBankName(String bankName) {
+        this.bankName = bankName;
+    }
+
+    @Length(min = 0, max = 1, message = " 付款账号的类型 0公账, 1私账长度必须介于 0 和 1 之间")
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Double getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(Double totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public Double getBalancePayFee() {
+        return balancePayFee;
+    }
+
+    public void setBalancePayFee(Double balancePayFee) {
+        this.balancePayFee = balancePayFee;
+    }
+
+    public Double getTransferPayFee() {
+        return transferPayFee;
+    }
+
+    public void setTransferPayFee(Double TransferPayFee) {
+        this.transferPayFee = TransferPayFee;
+    }
+
+    @Length(min = 0, max = 20, message = "付款银行长度必须介于 0 和 20 之间")
+    public String getPayType() {
+        return payType;
+    }
+
+    public void setPayType(String bankNo) {
+        this.payType = bankNo;
+    }
+
+    @Length(min = 0, max = 11, message = "申请人长度必须介于 0 和 11 之间")
+    public String getApplicant() {
+        return applicant;
+    }
+
+    public void setApplicant(String applicant) {
+        this.applicant = applicant;
+    }
+
+    @Length(min = 0, max = 19, message = "申请时间长度必须介于 0 和 19 之间")
+    public String getApplyTime() {
+        return applyTime;
+    }
+
+    public void setApplyTime(String applyTime) {
+        this.applyTime = applyTime;
+    }
+
+    @Length(min = 0, max = 11, message = "审核人长度必须介于 0 和 11 之间")
+    public String getReviewer() {
+        return reviewer;
+    }
+
+    public void setReviewer(String reviewer) {
+        this.reviewer = reviewer;
+    }
+
+    @Length(min = 0, max = 19, message = "审核时间长度必须介于 0 和 19 之间")
+    public String getReviewTime() {
+        return reviewTime;
+    }
+
+    public void setReviewTime(String reviewTime) {
+        this.reviewTime = reviewTime;
+    }
+
+    @Length(min = 0, max = 1, message = "审核状态  0待审核,  1审核通过长度必须介于 0 和 1 之间")
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    @Length(min = 0, max = 20, message = "审核不通过原因长度必须介于 0 和 20 之间")
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    @Transient
+    public List<NewShopOrder> getShopOrders() {
+        return shopOrders;
+    }
+
+    public void setShopOrders(List<NewShopOrder> shopOrders) {
+        this.shopOrders = shopOrders;
+    }
+
+    @Transient
+    public String getApplicantName() {
+        return applicantName;
+    }
+
+    public void setApplicantName(String applicantName) {
+        this.applicantName = applicantName;
+    }
+
+    @Transient
+    public String getReviewerName() {
+        return reviewerName;
+    }
+
+    public void setReviewerName(String reviewerName) {
+        this.reviewerName = reviewerName;
+    }
+
+    @Transient
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    @Transient
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    @Transient
+    public Double getAbleRebateAmount() {
+        return ableRebateAmount;
+    }
+
+    public void setAbleRebateAmount(Double ableRebateAmount) {
+        this.ableRebateAmount = ableRebateAmount;
+    }
+
+    @Transient
+    public Double getRebateAmount() {
+        return rebateAmount;
+    }
+
+    public void setRebateAmount(Double rebateAmount) {
+        this.rebateAmount = rebateAmount;
+    }
+
+    @Transient
+    public String getReApply() {
+        return reApply;
+    }
+
+    public void setReApply(String reApply) {
+        this.reApply = reApply;
+    }
+
+    @Transient
+    public String getShopOrderNo() {
+        return shopOrderNo;
+    }
+
+    public void setShopOrderNo(String shopOrderNo) {
+        this.shopOrderNo = shopOrderNo;
+    }
+
+    public String getShopOrderID() {
+        return shopOrderID;
+    }
+
+    public void setShopOrderID(String shopOrderID) {
+        this.shopOrderID = shopOrderID;
+    }
+
+    public String getOrderID() {
+        return orderID;
+    }
+
+    public void setOrderID(String orderID) {
+        this.orderID = orderID;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getRePayment() {
+        return rePayment;
+    }
+
+    public void setRePayment(String rePayment) {
+        this.rePayment = rePayment;
+    }
+
+    public String getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(String payTime) {
+        this.payTime = payTime;
+    }
+
+    public String getOrganizeID() {
+        return organizeID;
+    }
+
+    public void setOrganizeID(String organizeID) {
+        this.organizeID = organizeID;
+    }
+
+    public Integer getPaymentType() {
+        return paymentType;
+    }
+
+    public void setPaymentType(Integer paymentType) {
+        this.paymentType = paymentType;
+    }
 }

+ 118 - 110
src/main/java/com/caimei/modules/order/entity/CmPayShopRecord.java

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

+ 9 - 0
src/main/java/com/caimei/modules/order/entity/NewOrder.java

@@ -76,6 +76,7 @@ public class NewOrder extends DataEntity<NewOrder> {
     private Double paidAmount;//已付金额(用户已支付金额包括余额支付和线上线下支付)
     private Double totalDiscount;//订单退款已退的经理折扣金额
     private Integer zeroCostFlag;//订单0成本标识
+    private Integer userBeans;//采美豆抵扣运费数量(100:1)
     // -----------------  v5.0.0 end
 
     //-------------        虚拟字段   ----------------------------
@@ -955,6 +956,14 @@ public class NewOrder extends DataEntity<NewOrder> {
         this.zeroCostFlag = zeroCostFlag;
     }
 
+    public Integer getUserBeans() {
+        return userBeans;
+    }
+
+    public void setUserBeans(Integer userBeans) {
+        this.userBeans = userBeans;
+    }
+
     public String getAssociationType() {
         return associationType;
     }

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

@@ -85,6 +85,7 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private Integer zeroCostFlag;   //子订单0成本标识
     private Integer differenceType; //差价类型:1 少付;2 多付
     private BigDecimal differencePrice;  //补差价金额
+    private Integer userBeans; //订单采美豆数量
     //-------------        虚拟字段   ----------------------------
     private String shopName;            //供应商
     private String commercialCode;      //分账方,子商户商编
@@ -137,6 +138,8 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
 
     private boolean modifyPayable = false; //是否线上支付
 
+    private boolean payShopOtherFee = true; //是否可以付第三方申请
+
     public Integer getOrderPromotionsId() {
         return orderPromotionsId;
     }
@@ -1083,4 +1086,20 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     public void setDifferencePrice(BigDecimal differencePrice) {
         this.differencePrice = differencePrice;
     }
+
+    public Integer getUserBeans() {
+        return userBeans;
+    }
+
+    public void setUserBeans(Integer userBeans) {
+        this.userBeans = userBeans;
+    }
+
+    public boolean getPayShopOtherFee() {
+        return payShopOtherFee;
+    }
+
+    public void setPayShopOtherFee(boolean payShopOtherFee) {
+        this.payShopOtherFee = payShopOtherFee;
+    }
 }

+ 296 - 116
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -355,6 +355,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 record.setPayShopID(cmPayShop.getId());
                 record.setStatus("0");
                 record.setDelFlag("0");
+                record.setPaymentType(1);
                 cmPayShopRecordDao.insert(record);
             }
             if (orderID != null) {
@@ -488,61 +489,86 @@ 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());
+            }
+            cmPayShop.setReviewer(currentUser.getId());
+            cmPayShop.setReviewTime(DateUtils.getDateTime());
+            cmPayShop.setPayTime(DateUtils.getDateTime());
+            cmPayShop.setStatus("1");
+            cmPayShopDao.update(cmPayShop);
+        } 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);
+            Integer shopOrderId = Integer.valueOf(records.get(0).getShopOrderID());
+            if (3 == cmPayShop.getPaymentType()) {
+                //已付第三方金额
+                BigDecimal shopOtherFee = cmPayShopRecordDao.findPayShopOtherFee(shopOrderId);
+                newShopOrderDao.updateByShopOtherFee(shopOtherFee, shopOrderId);
+            } else if (2 == cmPayShop.getPaymentType()) {
+                NewShopOrder shopOrder = newShopOrderDao.get(shopOrderId.toString());
+                BigDecimal differencePrice = MathUtil.add(shopOrder.getDifferencePrice(), cmPayShop.getTotalAmount());
+                newShopOrderDao.updateByDifferencePrice(1, differencePrice, shopOrderId);
             }
-            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();
@@ -572,11 +598,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()));
+            }
         }
     }
 
@@ -612,70 +640,96 @@ 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);
+            }
+        } 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);
+            Integer shopOrderId = Integer.valueOf(records.get(0).getShopOrderID());
+            if (3 == cmPayShop.getPaymentType()) {
+                //撤回付第三方
+                BigDecimal shopOtherFee = cmPayShopRecordDao.findPayShopOtherFee(shopOrderId);
+                newShopOrderDao.updateByShopOtherFee(shopOtherFee, shopOrderId);
+            } else if (2 == cmPayShop.getPaymentType()) {
+                NewShopOrder shopOrder = newShopOrderDao.get(shopOrderId.toString());
+                BigDecimal differencePrice = MathUtil.sub(shopOrder.getDifferencePrice(), cmPayShop.getTotalAmount());
+                newShopOrderDao.updateByDifferencePrice(1, differencePrice, shopOrderId);
             }
-            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);
         }
     }
 
@@ -739,7 +793,50 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         }
         payShopOther.setModifyUserId(Integer.parseInt(UserUtils.getUser().getId()));
         cmPayShopRecordDao.insertShopOtherFee(payShopOther);
-        newShopOrderDao.updateByShopOtherFee(payShopOther.getShopOtherFee(), payShopOther.getShopOrderId());
+
+        //保存付第三方付款记录
+        User currentUser = UserUtils.getUser();
+        String time = DateUtils.getDateTime();
+        NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(payShopOther.getShopOrderId());
+        CmPayShop payShop = new CmPayShop();
+        payShop.setShopID(shopOrder.getShopID().toString());
+        payShop.setName(payShopOther.getName());
+        payShop.setBankAccountName(payShopOther.getBankAccountName());
+        payShop.setBankAccount(payShopOther.getBankAccount());
+        payShop.setBankName(payShopOther.getBankName());
+        payShop.setType(payShopOther.getType().toString());
+        payShop.setTotalAmount(payShopOther.getShopOtherFee().doubleValue());
+        payShop.setBalancePayFee(0d);
+        payShop.setTransferPayFee(payShopOther.getShopOtherFee().doubleValue());
+        payShop.setWipePayment(0d);
+        payShop.setApplicant(currentUser.getId());
+        payShop.setApplyTime(time);
+        payShop.setStatus("0");
+        payShop.setDelFlag("0");
+        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());
+        payShopRecord.setShopOrderID(payShopOther.getShopOrderId().toString());
+        payShopRecord.setShopOrderNo(shopOrder.getOrderNo());
+        payShopRecord.setPayAmount(payShopOther.getShopOtherFee().doubleValue());
+        payShopRecord.setWipePayment(0d);
+        payShopRecord.setPaymentType(3);
+        payShopRecord.setPayShopID(payShop.getId());
+        payShopRecord.setStatus("0");
+        payShopRecord.setDelFlag("0");
+        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) {
@@ -748,7 +845,18 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderId);
         BigDecimal waitPayShop = BigDecimal.ZERO;
         if (shopOrder != null) {
+            payShopDifference.setPayStatus(shopOrder.getPayStatus());
             waitPayShop = MathUtil.sub(shopOrder.getShouldPayShopAmount(), shopOrder.getPayedShopAmount());
+            NewCmShop shop = newCmShopDao.get(shopOrder.getShopID().toString());
+            payShopDifference.setBankAccount(shop.getBankAccount());
+            payShopDifference.setBankAccountName(shop.getBankAccountName());
+            payShopDifference.setBankName(shop.getBankName());
+            double ableRebateAmount = shop.getAbleRebateAmount() == null ? 0D : shop.getAbleRebateAmount();
+            payShopDifference.setAbleRebateAmount(BigDecimal.valueOf(ableRebateAmount));
+            double rebateAmount = shop.getRebateAmount() == null ? 0D : shop.getRebateAmount();
+            payShopDifference.setRebateAmount(BigDecimal.valueOf(rebateAmount));
+            payShopDifference.setType(shopOrder.getDifferenceType());
+            payShopDifference.setDifferencePrice(shopOrder.getDifferencePrice());
         }
         payShopDifference.setWaitPayShop(waitPayShop);
         return payShopDifference;
@@ -756,6 +864,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
 
     @Transactional(readOnly = false)
     public void saveDifferencePrice(ChangePayShopDifference payShopDifference) throws Exception {
+        User currentUser = UserUtils.getUser();
+        String time = DateUtils.getDateTime();
+        //补差价金额
+        BigDecimal differencePrice = payShopDifference.getDifferencePrice();
         String[] remarkImages = payShopDifference.getRemarkImages();
         if (remarkImages != null && remarkImages.length > 0) {
             StringBuilder remarkImage = new StringBuilder();
@@ -769,6 +881,55 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         }
         Integer shopOrderId = payShopDifference.getShopOrderId();
         NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderId);
+        payShopDifference.setPayStatus(shopOrder.getPayStatus());
+        if ("3".equals(shopOrder.getPayStatus()) && 1 == payShopDifference.getType()) {
+            //已付款且少付情况下,保存付第三方付款记录
+            BigDecimal totalAmount = MathUtil.add(payShopDifference.getTransferPayFee(), payShopDifference.getBalancePayFee());
+            if (MathUtil.compare(totalAmount, differencePrice) != 0) {
+                throw new Exception("付款金额异常");
+            }
+            CmPayShop payShop = new CmPayShop();
+            payShop.setShopID(shopOrder.getShopID().toString());
+            payShop.setName(payShopDifference.getName());
+            payShop.setBankAccountName(payShopDifference.getBankAccountName());
+            payShop.setBankAccount(payShopDifference.getBankAccount());
+            payShop.setBankName(payShopDifference.getBankName());
+            payShop.setType(payShopDifference.getType().toString());
+            payShop.setTotalAmount(differencePrice.doubleValue());
+            if (MathUtil.compare(payShopDifference.getBalancePayFee(), 0) > 0) {
+                payShop.setBalancePayFee(payShopDifference.getBalancePayFee().doubleValue());
+            }
+            if (MathUtil.compare(payShopDifference.getTransferPayFee(), 0) > 0) {
+                payShop.setTransferPayFee(payShopDifference.getTransferPayFee().doubleValue());
+            }
+            payShop.setWipePayment(0d);
+            payShop.setApplicant(currentUser.getId());
+            payShop.setApplyTime(time);
+            payShop.setStatus("0");
+            payShop.setDelFlag("0");
+            cmPayShopDao.insert(payShop);
+
+            CmPayShopRecord payShopRecord = new CmPayShopRecord();
+            payShopRecord.setShopID(shopOrder.getShopID().toString());
+            payShopRecord.setShopOrderID(payShopDifference.getShopOrderId().toString());
+            payShopRecord.setShopOrderNo(shopOrder.getOrderNo());
+            payShopRecord.setPayAmount(differencePrice.doubleValue());
+            payShopRecord.setWipePayment(0d);
+            payShopRecord.setPaymentType(2);
+            payShopRecord.setPayShopID(payShop.getId());
+            payShopRecord.setStatus("0");
+            payShopRecord.setDelFlag("0");
+            cmPayShopRecordDao.insert(payShopRecord);
+            payShopDifference.setPayShopId(Integer.valueOf(payShop.getId()));
+
+            //使用欠款抵扣
+            if (MathUtil.compare(payShopDifference.getBalancePayFee(), 0) > 0) {
+                NewCmShop shop = newCmShopDao.get(shopOrder.getShopID().toString());
+                BigDecimal ableRebateAmount = MathUtil.sub(shop.getAbleRebateAmount(), payShopDifference.getBalancePayFee());
+                shop.setAbleRebateAmount(ableRebateAmount.doubleValue());
+                newCmShopDao.updateAbleRebateAmount(shop);
+            }
+        }
         //查询之前是否有差价退款过
         Integer refundShopId = cmRefundShopRecordDao.findByRefundType(shopOrderId);
         if (refundShopId != null && refundShopId > 0) {
@@ -779,8 +940,6 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
 
         //待付供应商金额
         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);
@@ -790,17 +949,16 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             if (refundWay.equals("1")) {
                 //线下退
                 refundBalanceAmount = BigDecimal.ZERO;
-            } else if (refundWay.contains("2")) {
+            } else if (refundWay.equals("2")) {
                 //欠款账簿
                 refundAmount = BigDecimal.ZERO;
             } else {
                 //两种方式都有
                 refundWay = "3";
             }
+            logger.info("待付waitRefund>>>" + waitRefund + ">>>refundAmount金额>>>" + refundAmount + ">>>refundBalanceAmount金额>>>" + refundBalanceAmount);
             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);
@@ -842,6 +1000,28 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         }
         payShopDifference.setModifyUserId(Integer.parseInt(UserUtils.getUser().getId()));
         cmPayShopRecordDao.insertDifference(payShopDifference);
-        newShopOrderDao.updateByDifferencePrice(payShopDifference.getType(), differencePrice, shopOrderId);
+        if (!("3".equals(shopOrder.getPayStatus()) && 1 == payShopDifference.getType())) {
+            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;
     }
 }

+ 76 - 0
src/main/java/com/caimei/modules/order/service/CmReturnedPurchaseService.java

@@ -11,8 +11,11 @@ import com.caimei.modules.product.dao.CmSecondHandDetailDao;
 import com.caimei.modules.product.entity.CmPromotion;
 import com.caimei.modules.user.dao.CmUserBalanceRecordDao;
 import com.caimei.modules.user.dao.CmUserDao;
+import com.caimei.modules.user.dao.CmUserbeanshistoryDao;
+import com.caimei.modules.user.dao.NewCmClubDao;
 import com.caimei.modules.user.entity.CmUser;
 import com.caimei.modules.user.entity.CmUserBalanceRecord;
+import com.caimei.modules.user.entity.UserBeansHistory;
 import com.caimei.modules.user.service.CmUserBalanceRecordService;
 import com.caimei.utils.AppUtils;
 import com.caimei.utils.MathUtil;
@@ -76,6 +79,10 @@ public class CmReturnedPurchaseService extends CrudService<CmReturnedPurchaseDao
     private CmUserBalanceRecordDao cmUserBalanceRecordDao;
     @Autowired
     private CmSecondHandDetailDao cmSecondHandDetailDao;
+    @Autowired
+    private NewCmClubDao newCmClubDao;
+    @Autowired
+    private CmUserbeanshistoryDao cmUserbeanshistoryDao;
 
 
     public CmReturnedPurchase get(String id) {
@@ -581,6 +588,64 @@ public class CmReturnedPurchaseService extends CrudService<CmReturnedPurchaseDao
                 }
                 logger.info("二手订单交易全退,OrderID>>>" + newOrder.getStatus());
             }
+
+            //采美豆退款相关
+            if ("7".equals(newOrder.getStatus())) {
+                int userBeans = user.getUserBeans();
+                //抵扣运费退回
+                UserBeansHistory beansHistory = new UserBeansHistory();
+                beansHistory.setUserId(newOrder.getUserID());
+                beansHistory.setOrderId(newOrder.getOrderID());
+                beansHistory.setAddTime(new Date());
+                if (newOrder.getUserBeans() != null && newOrder.getUserBeans() > 0) {
+                    beansHistory.setBeansType(9);
+                    beansHistory.setType(1);
+                    beansHistory.setNum(newOrder.getUserBeans());
+                    beansHistory.setPushStatus(0);
+                    newCmClubDao.insertBeansHistory(beansHistory);
+                    userBeans = userBeans + newOrder.getUserBeans();
+                    cmUserDao.updateUserBeans(newOrder.getUserID(), userBeans);
+                }
+                //支付采美豆回收
+                Integer num = cmUserbeanshistoryDao.findByBeansType(newOrder.getOrderID());
+                if (num != null && num > 0) {
+                    beansHistory.setBeansType(11);
+                    beansHistory.setType(2);
+                    beansHistory.setNum(num);
+                    beansHistory.setPushStatus(0);
+                    newCmClubDao.insertBeansHistory(beansHistory);
+                    userBeans = userBeans - num;
+                    if (userBeans < 0) {
+                        userBeans = 0;
+                    }
+                    cmUserDao.updateUserBeans(newOrder.getUserID(), userBeans);
+                }
+            }
+            //退款短信推送
+            try {
+                if (user != null && StringUtils.isNotBlank(user.getBindMobile())) {
+                    String wwwServer = Global.getConfig("wwwServer");
+                    boolean sendSms = false;
+                    if ("1".equals(newOrder.getRefundType())) {
+                        //部分退
+                        String shortLink = newOrderService.getShortLink(8, 9, wwwServer + "user/order/detail.html?orderId=" + newOrder.getOrderID());
+                        String content = "订单(订单编号:" + newOrder.getOrderNo() + ")已部分退款成功,本次退款金额¥" + returnedPurchase.getRefundFee() + "。您可关注采美公众号或者访问采美微信小程序和网站查看订单。" +
+                                "平台公众号:微信搜索“采美365网”; 微信小程序:微信搜索“采美采购商城”;网址:www.caimei365.com/t/" + shortLink;
+                        sendSms = newOrderService.getSendSms(9, user.getBindMobile(), content);
+                    } else if ("2".equals(newOrder.getRefundType())) {
+                        //全部退
+                        String shortLink = newOrderService.getShortLink(8, 10, wwwServer + "user/order/detail.html?orderId=" + newOrder.getOrderID());
+                        String content = "订单(订单编号:" + newOrder.getOrderNo() + ")已全部退款成功,退款金额¥" + returnedPurchase.getRefundFee() + "。您可关注采美公众号或者访问采美微信小程序和网站查看订单。" +
+                                "平台公众号:微信搜索“采美365网”; 微信小程序:微信搜索“采美采购商城”;网址:www.caimei365.com/t/" + shortLink;
+                        sendSms = newOrderService.getSendSms(10, user.getBindMobile(), content);
+                    }
+                    if (!sendSms) {
+                        logger.info("退款短信推送失败,订单id>>>>" + newOrder.getOrderID());
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
         } else if (cmReturnedPurchase.getStatus().equals("3")) {//审核不通过
             cmReturnedPurchaseDao.update(cmReturnedPurchase);
             //解冻余额
@@ -772,6 +837,17 @@ public class CmReturnedPurchaseService extends CrudService<CmReturnedPurchaseDao
                 cmUserBalanceRecord.setDelFlag("1");
                 cmUserBalanceRecordService.updateBalanceRecordBuyReturned(cmUserBalanceRecord);
             }
+            //撤销退款采美豆
+            Integer userBeans = cmUser.getUserBeans();
+            Integer num = cmUserbeanshistoryDao.findByBeansType(newOrder.getOrderID());
+            if (num != null && num > 0) {
+                userBeans = userBeans + num;
+            }
+            if (newOrder.getUserBeans() != null && newOrder.getUserBeans() > 0) {
+                userBeans = userBeans - newOrder.getUserBeans();
+            }
+            cmUserbeanshistoryDao.updateBeansHistoryByReturned(newOrder.getOrderID());
+            cmUserDao.updateUserBeans(newOrder.getUserID(), userBeans);
             //修改子订单信息
             updateShopOrderAmount(newOrder.getOrderID());
         } catch (Exception e) {

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

@@ -13,6 +13,7 @@ import com.caimei.modules.order.entity.*;
 import com.caimei.modules.order.utils.HttpClientUtils;
 import com.caimei.modules.order.utils.NewOrderStatus;
 import com.caimei.modules.order.utils.OrderUtil;
+import com.caimei.modules.order.utils.RandomCode;
 import com.caimei.modules.product.dao.CmPromotionDao;
 import com.caimei.modules.product.dao.CmSecondHandDetailDao;
 import com.caimei.modules.product.dao.ProductDao;
@@ -47,6 +48,8 @@ import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 
@@ -351,6 +354,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             newOrderProduct.setOrderID(newOrder.getOrderID());
             List<NewOrderProduct> dbOrderProducts = newOrderProductDao.findAllList(newOrderProduct);
 
+            StringBuilder productName = new StringBuilder();
             if (flag) {
                 //新增加的订单,那么删除原有的子订单 和订单商品信息
                 newOrderProductDao.deleteByOrderID(newOrder.getOrderID());
@@ -370,6 +374,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                     double shopReducedPrice = 0d;
                     double needPayAmount = shopOrder.getNeedPayAmount();
                     for (NewOrderProduct orderProduct : shopOrder.getNewOrderProducts()) {
+                        productName.append(orderProduct.getName());
                         // 没有折扣时促销才生效
                         if (orderProduct.getDiscount() >= 100d) {
                             if (null != promotionsList && promotionsList.size() > 0) {
@@ -641,8 +646,66 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             }
             newOrder.setShopOrderIDs(shopOrderIDs);
             newOrderDao.update(newOrder);
+
+            //下单短信推送
+            try {
+                if (flag) {
+                    CmUser user = cmUserDao.get(newOrder.getUserID().toString());
+                    if (user != null && StringUtils.isNotBlank(user.getBindMobile())) {
+                        String wwwServer = Global.getConfig("wwwServer");
+                        String shortLink = getShortLink(8, 3, wwwServer + "user/order/detail.html?orderId=" + newOrder.getOrderID());
+                        String name = productName.toString();
+                        if (name.length() > 10) {
+                            name = name.substring(0, 10);
+                        }
+                        String content = "您已成功下单“" + name + "...”等" + newOrder.getProductCount() + "件商品,订单编号:" + newOrder.getOrderNo() + ",订单等待支付,支付完成后采美将尽快安排发货。" +
+                                "您可关注采美公众号或者访问采美微信小程序和网站查看并支付订单。平台公众号:微信搜索“采美365网”; 微信小程序:微信搜索“采美采购商城”;网址:www.caimei365.com/t/" + shortLink;
+                        boolean sendSms = getSendSms(3, user.getBindMobile(), content);
+                        if (!sendSms) {
+                            logger.info("下单推送失败,orderId>>>>" + newOrder.getOrderID());
+                        }
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+    }
+
+    public String getShortLink(int length, int markId, String url) {
+        String shortLink = RandomCode.generateShortLink(length);
+        Integer id = newOrderDao.findBYShortLink(shortLink);
+        if (id != null && id > 0) {
+            getShortLink(length, markId, url);
         }
+        newOrderDao.insertShortLink(markId, shortLink, url);
+        return shortLink;
+    }
 
+    public boolean getSendSms(int markId, String mobile, String content) throws Exception {
+        if (org.apache.commons.lang.StringUtils.isNotBlank(mobile) && mobile.length() == 11) {
+            String regex = "^(1[3-9]\\d{9}$)";
+            Pattern pattern = Pattern.compile(regex);
+            Matcher matcher = pattern.matcher(mobile);
+            if (matcher.matches()) {
+                Map<String, Object> map = new HashMap<>(2);
+                map.put("content", content);
+                map.put("mobile", mobile);
+                String coreServer = Global.getConfig("caimei.core");
+                String url = coreServer + "/tools/sms/send";
+                String result = HttpRequest.sendPost(url, map);
+                JSONObject parseObject = JSONObject.parseObject(result);
+                Integer code = parseObject.getInteger("code");
+                if (code != 0) {
+                    logger.info("短信发送失败,手机号>>>>" + mobile);
+                } else {
+                    newOrderDao.updateSendNum(markId, 1);
+                    return true;
+                }
+            }
+        }
+        return false;
     }
 
     private void insertLadderPrice(NewOrderProduct orderProduct) {
@@ -1141,10 +1204,9 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
     public void cancelOrder(Integer orderID) {
         NewOrder order = newOrderDao.findByOrderID(orderID);
         //余额退回原账户
+        CmUser user = cmUserDao.get(order.getUserID().toString());
         if (order.getBalancePayFee() > 0) {
-            CmUser user1 = cmUserDao.get(order.getUserID().toString());
-            setBalance(user1, order.getBalancePayFee(), order);
-
+            setBalance(user, order.getBalancePayFee(), order);
             //取消收支记录
             CmUserBalanceRecord cmUserBalanceRecord = new CmUserBalanceRecord();
             cmUserBalanceRecord.setUserId(order.getUserID());
@@ -1162,6 +1224,35 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                 cmSecondHandDetailDao.updatSecondHnadBySold(orderProduct.getProductID());
             }
         }
+        //采美豆退回
+        if (order.getUserBeans() != null && order.getUserBeans() > 0) {
+            UserBeansHistory beansHistory = new UserBeansHistory();
+            beansHistory.setUserId(order.getUserID());
+            beansHistory.setOrderId(order.getOrderID());
+            beansHistory.setBeansType(9);
+            beansHistory.setType(1);
+            beansHistory.setNum(order.getUserBeans());
+            beansHistory.setPushStatus(0);
+            beansHistory.setAddTime(new Date());
+            newCmClubDao.insertBeansHistory(beansHistory);
+            int userBeans = user.getUserBeans() + order.getUserBeans();
+            cmUserDao.updateUserBeans(order.getUserID(), userBeans);
+        }
+        //取消订单短信推送
+        try {
+            if (user != null && StringUtils.isNotBlank(user.getBindMobile())) {
+                String wwwServer = Global.getConfig("wwwServer");
+                String shortLink = getShortLink(8, 11, wwwServer + "user/order/detail.html?orderId=" + orderID);
+                String content = "您已成功取消订单(订单编号:" + order.getOrderNo() + "),订单金额¥" + order.getPayTotalFee() + "。您可关注采美公众号或者访问采美微信小程序和网站查看订单。" +
+                        "平台公众号:微信搜索“采美365网”; 微信小程序:微信搜索“采美采购商城”;网址:www.caimei365.com/t/" + shortLink;
+                boolean sendSms = getSendSms(11, user.getBindMobile(), content);
+                if (!sendSms) {
+                    logger.info("取消订单推送失败,订单id>>>>" + orderID);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
     }
 
     /**
@@ -1247,6 +1338,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         }
         //同步更新主订单的发货状态
         NewOrder order = newOrderDao.findByOrderID(orderID);
+        String sendOutStatus = order.getSendOutStatus();
         List<NewShopOrder> shopOrders = newShopOrderDao.findListByOrderID(order.getOrderID());
 
         String statusSuffix = "";
@@ -1320,6 +1412,33 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                 logisticsInformationDao.insert(l);
             }
         }
+
+        try {
+            //发货短信推送
+            CmUser user = cmUserDao.get(order.getUserID().toString());
+            if (user != null && StringUtils.isNotBlank(user.getBindMobile())) {
+                String wwwServer = Global.getConfig("wwwServer");
+                boolean sendSms = false;
+                if ("2".equals(order.getSendOutStatus()) && "1".equals(sendOutStatus)) {
+                    //部分发货
+                    String shortLink = getShortLink(8, 7, wwwServer + "user/order/detail.html?orderId=" + order.getOrderID());
+                    String content = "您的订单(订单编号:" + order.getOrderNo() + ")已部分发货。您可关注采美公众号或者访问采美微信小程序和网站查看订单。平台公众号:微信搜索“采美365网”; " +
+                            "微信小程序:微信搜索“采美采购商城”;网址:www.caimei365.com/t/" + shortLink;
+                    sendSms = getSendSms(7, user.getBindMobile(), content);
+                } else if ("3".equals(order.getSendOutStatus())) {
+                    //已发货
+                    String shortLink = getShortLink(8, 8, wwwServer + "user/order/detail.html?orderId=" + order.getOrderID());
+                    String content = "您的订单(订单编号:" + order.getOrderNo() + ")已发货完毕。您可关注采美公众号或者访问采美微信小程序和网站查看订单。平台公众号:微信搜索“采美365网”; " +
+                            "微信小程序:微信搜索“采美采购商城”;网址:www.caimei365.com/t/" + shortLink;
+                    sendSms = getSendSms(8, user.getBindMobile(), content);
+                }
+                if (!sendSms) {
+                    logger.info("发货短信推送失败,订单id>>>>" + order.getOrderID());
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         return lb.getId();
     }
 

+ 33 - 3
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -71,6 +72,8 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
     private CmPromotionDao cmPromotionDao;
     @Resource
     private HeHeNewOrderDao heHeNewOrderDao;
+    @Resource
+    private CmPayShopDao cmPayShopDao;
 
 
     public List<NewShopOrder> findListByOrderID() {
@@ -261,7 +264,7 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
     @Transactional(readOnly = false)
     public Page<NewShopOrder> findPayOrderList(Page<NewShopOrder> page, NewShopOrder shopOrder) {
         shopOrder.setPage(page);
-        if (shopOrder.getPayStatus() != null && shopOrder.getPayStatus() != "") {
+        if (StringUtils.isNotBlank(shopOrder.getPayStatus())) {
             String[] split = shopOrder.getPayStatus().split(",");
             shopOrder.setPs(split);
         }
@@ -313,11 +316,22 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
             //经理折扣
             so.setDiscountTotalFee(newOrder.getDiscountFee());
             //机构运费
-            so.setFreight(newOrder.getFreight());
+            if ("1".equals(newOrder.getFreePostFlag())) {
+                so.setFreight(newOrder.getFreight());
+            } else {
+                so.setFreight(Double.valueOf(newOrder.getFreePostFlag()));
+            }
+            //订单采美豆
+            so.setUserBeans(newOrder.getUserBeans());
             //机构运费是否已退
             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;
     }
@@ -582,7 +596,8 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
         List<ChangePayShopDifference> differenceList = cmPayShopRecordDao.findShopDifference(shopOrderId);
         if (differenceList != null && differenceList.size() > 0) {
             differenceList.forEach(difference -> {
-                if (difference.getType() == 2 && difference.getRefundShopId() > 0) {
+                if (difference.getType() == 2 && difference.getRefundShopId() != null) {
+                    //退款数据
                     CmRefundShop refundShop = cmRefundShopDao.findByRefundShopId(difference.getRefundShopId());
                     difference.setRefundShop(refundShop);
                 }
@@ -594,6 +609,21 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
                     String[] remarkImages = difference.getRemarkImage().split(",");
                     difference.setRemarkImages(remarkImages);
                 }
+                if (difference.getType() == 1 && difference.getPayShopId() != null) {
+                    //付款数据
+                    CmPayShop payShop = cmPayShopDao.get(difference.getPayShopId().toString());
+                    if (payShop != null) {
+                        difference.setBankType(Integer.valueOf(payShop.getType()));
+                        difference.setName(payShop.getName());
+                        difference.setBankAccount(payShop.getBankAccount());
+                        difference.setBankAccountName(payShop.getBankAccountName());
+                        difference.setBankName(payShop.getBankName());
+                        double balancePayFee = payShop.getBalancePayFee() == null ? 0d : payShop.getBalancePayFee();
+                        difference.setBalancePayFee(BigDecimal.valueOf(balancePayFee));
+                        double transferPayFee = payShop.getTransferPayFee() == null ? 0d : payShop.getTransferPayFee();
+                        difference.setTransferPayFee(BigDecimal.valueOf(transferPayFee));
+                    }
+                }
             });
         }
         return differenceList;

+ 106 - 0
src/main/java/com/caimei/modules/order/utils/RandomCode.java

@@ -0,0 +1,106 @@
+package com.caimei.modules.order.utils;
+import java.util.Random;
+
+public class RandomCode {
+
+	// TODO 与WWW的RandomCodeGenerator是重复的,后续需要删除www的RandomCodeGenerator
+	private static char[] codeSequence = {
+			'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 
+			'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 
+			'W', 'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7', 
+			'8', '9'
+		};
+	
+	private static char[] intSequence = {
+		'2', '3', '4', '5', '6', '7', 
+		'8', '9'
+	};
+	
+	private static char[] stringSequence = {
+		'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 
+		'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 
+		'W', 'X', 'Y', 'Z'
+	};
+
+	private static char[] newStringSequence = {
+			'A','a', 'B','b', 'D','d', 'E' ,'e', 'F','f', 'G','g', 'H','h',
+			'L', 'N','n', 'Q','q', 'R','r', 'T','t', 'Y','y'
+	};
+//	C,i,j,k,M,O,P,S,U,V,W,X,Z,l
+
+	private static char[] shortLink = {
+		'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
+		'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'O',
+		'W', 'X', 'Y', 'Z',
+		'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
+		'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'o',
+		'w', 'x', 'y', 'z' ,
+		'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'
+	};
+
+	public static String generateShortLink(int length) {
+		StringBuffer sb = new StringBuffer();
+		Random random = new Random();
+		for (int i = 0; i < shortLink.length && i < length; ++i) {
+			sb.append(shortLink[random.nextInt(shortLink.length)]);
+		}
+		return sb.toString();
+	}
+
+	public static String generateCode(int length) {
+		StringBuffer sb = new StringBuffer();
+		Random random = new Random();
+		for (int i = 0; i < codeSequence.length && i < length; ++i) {
+			sb.append(codeSequence[random.nextInt(codeSequence.length)]);
+		}
+		
+		return sb.toString();
+	}
+	
+	public static String generateCodeInt(int length) {
+		StringBuffer sb = new StringBuffer();
+		Random random = new Random();
+		for (int i = 0; i < intSequence.length && i < length; ++i) {
+			sb.append(intSequence[random.nextInt(intSequence.length)]);
+		}
+		
+		return sb.toString();
+	}
+	
+	public static String generateCodeString(int length) {
+		StringBuffer sb = new StringBuffer();
+		Random random = new Random();
+		for (int i = 0; i < stringSequence.length && i < length; ++i) {
+			sb.append(stringSequence[random.nextInt(stringSequence.length)]);
+		}
+		
+		return sb.toString();
+	}
+
+	public static String getRandomCharAndNumr(int length) {
+		String val = "";
+		Random random = new Random();
+		for (int i = 0; i < length; i++) {
+			// 输出字母还是数字
+			String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num";
+			// 字符串
+			if ("char".equalsIgnoreCase(charOrNum)) {
+				// 取得大写字母还是小写字母
+				int choice = random.nextInt(2) % 2 == 0 ? 65 : 97;
+				val += (char) (choice + random.nextInt(26));
+			} else if ("num".equalsIgnoreCase(charOrNum)) { // 数字
+				val += String.valueOf(random.nextInt(10));
+			}
+		}
+		return val;
+	}
+
+	public static String generateAccount(int length){
+		StringBuffer sb = new StringBuffer();
+		Random random = new Random();
+		for (int i = 0; i < newStringSequence.length && i < length; ++i) {
+			sb.append(newStringSequence[random.nextInt(newStringSequence.length)]);
+		}
+		return sb.toString();
+	}
+}

+ 51 - 2
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -2,6 +2,7 @@ package com.caimei.modules.order.web;
 
 import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.modules.common.utils.UploadUtils;
+import com.caimei.modules.order.dao.CmPayShopRecordDao;
 import com.caimei.modules.order.entity.*;
 import com.caimei.modules.order.service.*;
 import com.caimei.modules.sys.utils.UploadImageUtils;
@@ -27,6 +28,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicReference;
@@ -57,6 +59,8 @@ public class CmPayShopController extends BaseController {
     private CmChangePayShopRecondService cmChangePayShopRecondService;
     @Autowired
     private CmChangePayShopProductService cmChangePayShopProductService;
+    @Autowired
+    private CmPayShopRecordDao cmPayShopRecordDao;
 
     @ModelAttribute
     public CmPayShop get(@RequestParam(required = false) String id) {
@@ -215,11 +219,24 @@ public class CmPayShopController extends BaseController {
             String imageUrl = getImageUrl(remarkImage10);
             imgStr.append(imageUrl).append(",");
         }
-        if (null != imgStr && imgStr.length() > 0) {
+        if (imgStr.length() > 0) {
             String substring = imgStr.substring(0, imgStr.length() - 1);
             cmChangePayShopRecond.setRemarkImage(substring);
         }
         cmChangePayShopRecondService.save(cmChangePayShopRecond);
+        if (!shopOrder.getShopOtherFee().equals(thirdPartyFee)) {
+            //保存付第三方备注
+            ChangePayShopOther payShopOther = new ChangePayShopOther();
+            payShopOther.setShopOrderId(newShopOrder.getShopOrderID());
+            payShopOther.setRemark(newShopOrder.getModifyShouldPayNote());
+            if (imgStr.length() > 0) {
+                payShopOther.setRemarkImage(imgStr.substring(0, imgStr.length() - 1));
+            }
+            payShopOther.setShopOtherFee(BigDecimal.valueOf(thirdPartyFee));
+            payShopOther.setModifyUserId(Integer.valueOf(UserUtils.getUser().getId()));
+            payShopOther.setUpdateTime(new Date());
+            cmPayShopRecordDao.insertShopOtherFee(payShopOther);
+        }
         String cmChangePayShopRecondId2 = cmChangePayShopRecond.getId();
         List<NewOrderProduct> orderProducts = new ArrayList<>();
         Boolean soZeroCostFlag = true;
@@ -545,6 +562,9 @@ public class CmPayShopController extends BaseController {
             logger.info(e.getMessage());
             e.printStackTrace();
         }
+        if (3 == cmPayShop.getPaymentType()) {
+            return "modules/order/cmPayShopOtherEdit";
+        }
         return "modules/order/cmPayShopEdit";
     }
 
@@ -578,6 +598,9 @@ public class CmPayShopController extends BaseController {
             logger.info(e.getMessage());
             e.printStackTrace();
         }
+        if (3 == cmPayShop.getPaymentType()) {
+            return "modules/order/cmPayShopOtherPrintDetail";
+        }
         return "modules/order/cmPayShopDetail";
     }
 
@@ -598,6 +621,9 @@ public class CmPayShopController extends BaseController {
             logger.info(e.getMessage());
             e.printStackTrace();
         }
+        if (3 == cmPayShop.getPaymentType()) {
+            return "modules/order/cmPayShopOtherPrintDetail";
+        }
         return "modules/order/cmPayShopPrintDetail";
     }
 
@@ -618,6 +644,9 @@ public class CmPayShopController extends BaseController {
             logger.info(e.getMessage());
             e.printStackTrace();
         }
+        if (3 == cmPayShop.getPaymentType()) {
+            return "modules/order/cmPayShopOtherCheck";
+        }
         return "modules/order/cmPayShopCheck";
     }
 
@@ -767,6 +796,7 @@ public class CmPayShopController extends BaseController {
         ChangePayShopOther payShopOther = cmPayShopService.shopOtherFeeForm(shopOrderId);
         payShopOther.setShopOrderId(shopOrderId);
         NewShopOrder shopOrder = newShopOrderService.findByShopOrderID(shopOrderId);
+        payShopOther.setShopOtherFee(BigDecimal.valueOf(shopOrder.getShopOtherFee()));
         Double brokerage = shopOrder.getBrokerage();
         brokerage = brokerage == null ? 0d : brokerage;
         model.addAttribute("brokerage", brokerage);
@@ -781,7 +811,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/";
     }
 
     /**
@@ -806,6 +836,25 @@ public class CmPayShopController extends BaseController {
             e.printStackTrace();
             addMessage(redirectAttributes, e.getMessage());
         }
+        if ("3".equals(payShopDifference.getPayStatus())) {
+            if (1 == payShopDifference.getType()) {
+                //去付款列表
+                return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/";
+            } else {
+                //退款列表
+                return "redirect:" + Global.getAdminPath() + "/order/cmRefundShop/";
+            }
+        }
         return "redirect:" + Global.getAdminPath() + "/shopOrder/payOrderList?operatingMode=1";
     }
+
+    /**
+     * 申请第三方付款,页面回显
+     */
+    @RequestMapping("shopOtherApplyEdit")
+    public String shopOtherApplyEdit(Integer payShopId, Model model) {
+        ChangePayShopOther payShopOther = cmPayShopService.shopOtherApplyEdit(payShopId);
+        model.addAttribute("payShopOther", payShopOther);
+        return "modules/order/cmPayShopOtherForm";
+    }
 }

+ 10 - 0
src/main/java/com/caimei/modules/order/web/CmShopOrderController.java

@@ -1,5 +1,6 @@
 package com.caimei.modules.order.web;
 
+import com.caimei.modules.order.dao.CmPayShopRecordDao;
 import com.caimei.modules.order.entity.*;
 import com.caimei.modules.order.service.CmChangePayShopProductService;
 import com.caimei.modules.order.service.CmChangePayShopRecondService;
@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -43,6 +45,8 @@ public class CmShopOrderController extends BaseController {
     private CmChangePayShopRecondService cmChangePayShopRecondService;
     @Autowired
     private CmChangePayShopProductService cmChangePayShopProductService;
+    @Autowired
+    private CmPayShopRecordDao cmPayShopRecordDao;
 
     @ModelAttribute
     public NewShopOrder get(@RequestParam(required = false) String id) {
@@ -73,6 +77,10 @@ public class CmShopOrderController extends BaseController {
         model.addAttribute("cmUserOrganizeList", cmUserOrganizeList);
         model.addAttribute("page", page);
         model.addAttribute("operatingMode", newShopOrder.getOperatingMode());
+        if ("3".equals(newShopOrder.getOperatingMode())) {
+            //已付款子订单页面
+            return "modules/order/paidShopOrderList";
+        }
         return "modules/order/cmPayShopList";
     }
 
@@ -130,6 +138,8 @@ public class CmShopOrderController extends BaseController {
         if (CollectionUtils.isNotEmpty(list) && list.size() == 1) {
             dbCostType = list.get(0).getCostType();
         }
+        BigDecimal payShopOtherFee = cmPayShopRecordDao.findPayShopOtherFee(newShopOrder.getShopOrderID());
+        model.addAttribute("payShopOtherFee", payShopOtherFee);
         model.addAttribute("dbCostType", dbCostType);
         if (StringUtils.isEmpty(dbCostType)) dbCostType = costType;
         model.addAttribute("page", page);

+ 9 - 1
src/main/java/com/caimei/modules/user/dao/CmUserDao.java

@@ -62,7 +62,15 @@ public interface CmUserDao extends CrudDao<CmUser> {
 
     void updateMoney(CmUser user);
 
-    List<CmUser> selectByMobileOrEmail(@Param("mobileOrEmail") String mobileOrEmail,@Param("source")  String source);
+    List<CmUser> selectByMobileOrEmail(@Param("mobileOrEmail") String mobileOrEmail, @Param("source") String source);
+
+    /**
+     * 修改采美豆数量
+     *
+     * @param userID
+     * @param userBeans
+     */
+    void updateUserBeans(@Param("userID") Integer userID, @Param("userBeans") int userBeans);
 
     CmUser findUserByOrganizeId(Integer organizeId);
 

+ 29 - 2
src/main/java/com/caimei/modules/user/dao/CmUserbeanshistoryDao.java

@@ -1,15 +1,42 @@
 package com.caimei.modules.user.dao;
 
+import com.caimei.modules.user.entity.CmUser;
+import com.caimei.modules.user.entity.UserBeansHistory;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import com.caimei.modules.user.entity.CmUserbeanshistory;
 
+import java.util.List;
+
 /**
  * 采美豆记录DAO接口
+ *
  * @author zcp
  * @version 2017-10-19
  */
 @MyBatisDao
-public interface CmUserbeanshistoryDao extends CrudDao<CmUserbeanshistory> {
-	
+public interface CmUserbeanshistoryDao {
+
+    List<CmUser> findUserBeansList(CmUser cmuser);
+
+    List<UserBeansHistory> findBeansHistoryList(UserBeansHistory userBeansHistory);
+
+    Integer findOrderReceiptId(Integer orderId);
+
+    /**
+     * 查询下单送豆
+     *
+     * @param orderId
+     * @return
+     */
+    Integer findByBeansType(Integer orderId);
+
+    /**
+     * 逻辑删除退款回收
+     *
+     * @param orderId
+     */
+    void updateBeansHistoryByReturned(Integer orderId);
+
+    Integer findPurchaseReturnedId(Integer orderId);
 }

+ 3 - 0
src/main/java/com/caimei/modules/user/dao/NewCmClubDao.java

@@ -1,6 +1,7 @@
 package com.caimei.modules.user.dao;
 
 import com.caimei.modules.user.entity.NewCmClub;
+import com.caimei.modules.user.entity.UserBeansHistory;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 
@@ -20,4 +21,6 @@ public interface NewCmClubDao extends CrudDao<NewCmClub> {
     NewCmClub getclubByUserId(Integer userId);
 
     Integer findSpId(Integer spID);
+
+    void insertBeansHistory(UserBeansHistory beansHistory);
 }

+ 803 - 806
src/main/java/com/caimei/modules/user/entity/CmUser.java

@@ -1,822 +1,819 @@
 package com.caimei.modules.user.entity;
 
-import com.caimei.modules.miniprogram.utils.UrlEncoderUtils;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
-import com.thinkgem.jeesite.common.utils.StringUtils;
 import org.hibernate.validator.constraints.Length;
 
 import javax.validation.constraints.NotNull;
 import java.beans.Transient;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.List;
 
 /**
  * 用户Entity
+ *
  * @author ZCP
  * @version 2017-10-10
  */
 public class CmUser extends DataEntity<CmUser> {
 
-	private static final long serialVersionUID = 1L;
-	private Integer userID;		// userID
-	private Integer userOrganizeID;//用户组织ID
-	private String mobile;		// 手机号码
-	private Integer userPermission;		// 用户权限
-	private String email;		// 邮箱
-	private String userName;		// 用户名
-	private String image;		// image
-	private String password;		// 密码
-	private String userLevelID;		// 用户会员等级,见表c_userlevel或枚举UserLevel
-	private String name;		// 组织名称
-	private String nick;		// 昵称
-	private String sex;		// 性别
-	private String registerUserTypeID;		// 用户类型,见表c_usertype或枚举UserType
-	private String manufacturerFlag;		// 已废弃 是否是供应商,1是 空或0否
-	private String manufacturerStatus;		// 供应商状态,见表c_shopstatus或枚举ShopStatus
-	private String shopID;		// 供应商Id
-	private String serviceProviderFlag;		// 已废弃  是否创客,1是 空或0否
-	private String clubFlag;		//已废弃  是否会所,1是 空或0否
-	private String masterFlag;		//已废弃  masterFlag
-	private String normalFlag;		//已废弃  normalFlag
-	private String auditStatus;		// auditStatus
-	private String auditTime;		// auditTime
-	private String auditNote;		// auditNote
-	private String registerTime;		// 注册时间
-	private String registerIP;		// 注册ip
-	private String loginTime;		// 登录时间
-	private String loginFailTime;		// 登录失败次数
-	private String loginIP;		// 登录ip
-	private String validFlag;		// 用户状态,1正常,0冻结
-	private String emailCheckFlag;		// emailCheckFlag
-	private String mobileCheckFlag;		// mobileCheckFlag
-	private String clubStatus;		// 会所状态,见表c_clubstatus或枚举ClubStatus
-	private String clubID;		// 会所Id
-	private String agreeFlag;		// agreeFlag
-	private String activationCode;		// activationCode
-	private String activationDate;		// activationDate
-	private String serviceProviderStatus;		// 创客状态
-	private String serviceProviderID;		// 创客Id
-	private String masterStatus;		// masterStatus
-	private String masterID;		// masterID
-	private Double userMoney;		// 账户余额
-	private Double ableUserMoney;		//账户可用余额
-	private String point;		// point
-	private String shopERPFlag;		// shopERPFlag
-	private String fromUserID;		// 邀请人Id
-	private String fromUserName;		// 邀请人名称
-	private String logoffTime;		// logoffTime
-	private String appKey;		// appKey
-	private String appSecret;		// appSecret
-	private String sampleFlag;		// sampleFlag
-	private String scanFlag;		// 扫描标志(4 CRM拉上来的会所)
-	private String sysroleid;		// sysroleid
-	private String gender;		// gender
-	private String age;		// 年龄
-	private String salerbuyer;		// salerbuyer
-	private String position;		// position
-	private String skill;		// skill
-	private String workage;		// workage
-	private String wechat;		// 微信号
-	private String qq;		// QQ号
-	private String smsFlag;		// 短信是否发送成功
-	private String userBeans;		// 采美豆数量
-	private String privateShopFlag;		// 平台商标志位  0非平台商 1平台商
-	private String privateClubFlag;		// 平台会所标志位  0非平台会所 1平台会所
-	private String isMeiDaoAuthorized;		// isMeiDaoAuthorized
-	private String guideFlag;		// 引导层弹出  0需要弹出  1不需要弹出
-	private String nickName;        // 微信昵称
-	private String startTime;     //注册时间开始 查询条件
-	private String endTime;		//注册时间结束  查询条件
-	private String operatorMobile; //
-
-
-
-	/**
-	 *  用户模块重构
-	 */
-	private String account;//账号名: 企业账号登录使用
-	private Integer userIdentity;//用户身份
-	private String realName;//真实姓名
-	private Integer companyUserID;//企业用户id
-	private String openID;//微信openID
-	private String bindMobile;//企业绑定手机号
-	private String tipStatus;//弹窗提示状态
-	private String identityDisplay; //前台身份展示
-	private String linkMan;//联系人
-
-	//会所用户信息
-	private String town; // 区
-	private String city; // 市
-	private String province; //省
-	private String address;		// 详细地址
-
-	public CmUser() {
-		super();
-	}
-
-	public CmUser(String id){
-		super(id);
-	}
-
-	@NotNull(message="userID不能为空")
-	public Integer getUserID() {
-		return userID;
-	}
-
-	public void setUserID(Integer userID) {
-		this.userID = userID;
-	}
-
-	public String getMobile() {
-		return mobile;
-	}
-
-	public void setMobile(String mobile) {
-		this.mobile = mobile;
-	}
-
-	public Integer getUserPermission() {
-		return userPermission;
-	}
-
-	public void setUserPermission(Integer userPermission) {
-		this.userPermission = userPermission;
-	}
-
-	public String getEmail() {
-		return email;
-	}
-
-	public void setEmail(String email) {
-		this.email = email;
-	}
-
-	public String getUserName() {
-		return userName;
-	}
-
-	public void setUserName(String userName) {
-		this.userName = userName;
-	}
-
-	public String getImage() {
-		return image;
-	}
-
-	public void setImage(String image) {
-		this.image = image;
-	}
-
-	public String getPassword() {
-		return password;
-	}
-
-	public void setPassword(String password) {
-		this.password = password;
-	}
-
-	public String getUserLevelID() {
-		return userLevelID;
-	}
-
-	public void setUserLevelID(String userLevelID) {
-		this.userLevelID = userLevelID;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getNick() {
-		return nick;
-	}
-
-	public void setNick(String nick) {
-		this.nick = nick;
-	}
-
-	public String getSex() {
-		return sex;
-	}
-
-	public void setSex(String sex) {
-		this.sex = sex;
-	}
-
-	public String getRegisterUserTypeID() {
-		return registerUserTypeID;
-	}
-
-	public void setRegisterUserTypeID(String registerUserTypeID) {
-		this.registerUserTypeID = registerUserTypeID;
-	}
-
-	@Length(min=0, max=1, message="是否是供应商,1是 空或0否长度必须介于 0 和 1 之间")
-	public String getManufacturerFlag() {
-		return manufacturerFlag;
-	}
-
-	public void setManufacturerFlag(String manufacturerFlag) {
-		this.manufacturerFlag = manufacturerFlag;
-	}
-
-	@Length(min=0, max=11, message="供应商状态,见表c_shopstatus或枚举ShopStatus长度必须介于 0 和 11 之间")
-	public String getManufacturerStatus() {
-		return manufacturerStatus;
-	}
-
-	public void setManufacturerStatus(String manufacturerStatus) {
-		this.manufacturerStatus = manufacturerStatus;
-	}
-
-	@Length(min=0, max=11, message="供应商Id长度必须介于 0 和 11 之间")
-	public String getShopID() {
-		return shopID;
-	}
-
-	public void setShopID(String shopID) {
-		this.shopID = shopID;
-	}
-
-	@Length(min=0, max=1, message="是否创客,1是 空或0否长度必须介于 0 和 1 之间")
-	public String getServiceProviderFlag() {
-		return serviceProviderFlag;
-	}
-
-	public void setServiceProviderFlag(String serviceProviderFlag) {
-		this.serviceProviderFlag = serviceProviderFlag;
-	}
-
-	@Length(min=0, max=1, message="是否会所,1是 空或0否长度必须介于 0 和 1 之间")
-	public String getClubFlag() {
-		return clubFlag;
-	}
-
-	public void setClubFlag(String clubFlag) {
-		this.clubFlag = clubFlag;
-	}
-
-	@Length(min=0, max=1, message="masterFlag长度必须介于 0 和 1 之间")
-	public String getMasterFlag() {
-		return masterFlag;
-	}
-
-	public void setMasterFlag(String masterFlag) {
-		this.masterFlag = masterFlag;
-	}
-
-	@Length(min=0, max=1, message="normalFlag长度必须介于 0 和 1 之间")
-	public String getNormalFlag() {
-		return normalFlag;
-	}
-
-	public void setNormalFlag(String normalFlag) {
-		this.normalFlag = normalFlag;
-	}
-
-	@Length(min=0, max=1, message="auditStatus长度必须介于 0 和 1 之间")
-	public String getAuditStatus() {
-		return auditStatus;
-	}
-
-	public void setAuditStatus(String auditStatus) {
-		this.auditStatus = auditStatus;
-	}
-
-	@Length(min=0, max=19, message="auditTime长度必须介于 0 和 19 之间")
-	public String getAuditTime() {
-		return auditTime;
-	}
-
-	public void setAuditTime(String auditTime) {
-		this.auditTime = auditTime;
-	}
-
-	@Length(min=0, max=100, message="auditNote长度必须介于 0 和 100 之间")
-	public String getAuditNote() {
-		return auditNote;
-	}
-
-	public void setAuditNote(String auditNote) {
-		this.auditNote = auditNote;
-	}
-
-	public String getRegisterTime() {
-		return registerTime;
-	}
-
-	public void setRegisterTime(String registerTime) {
-		this.registerTime = registerTime;
-	}
-
-	public String getRegisterIP() {
-		return registerIP;
-	}
-
-	public void setRegisterIP(String registerIP) {
-		this.registerIP = registerIP;
-	}
-
-	public String getLoginTime() {
-		return loginTime;
-	}
-
-	public void setLoginTime(String loginTime) {
-		this.loginTime = loginTime;
-	}
-
-	public String getLoginFailTime() {
-		return loginFailTime;
-	}
-
-	public void setLoginFailTime(String loginFailTime) {
-		this.loginFailTime = loginFailTime;
-	}
-
-	public String getLoginIP() {
-		return loginIP;
-	}
-
-	public void setLoginIP(String loginIP) {
-		this.loginIP = loginIP;
-	}
-
-	public String getValidFlag() {
-		return validFlag;
-	}
-
-	public void setValidFlag(String validFlag) {
-		this.validFlag = validFlag;
-	}
-
-	public String getEmailCheckFlag() {
-		return emailCheckFlag;
-	}
-
-	public void setEmailCheckFlag(String emailCheckFlag) {
-		this.emailCheckFlag = emailCheckFlag;
-	}
-
-	public String getMobileCheckFlag() {
-		return mobileCheckFlag;
-	}
-
-	public void setMobileCheckFlag(String mobileCheckFlag) {
-		this.mobileCheckFlag = mobileCheckFlag;
-	}
-
-	public String getClubStatus() {
-		return clubStatus;
-	}
-
-	public void setClubStatus(String clubStatus) {
-		this.clubStatus = clubStatus;
-	}
-
-	public String getClubID() {
-		return clubID;
-	}
-
-	public void setClubID(String clubID) {
-		this.clubID = clubID;
-	}
-
-	public String getAgreeFlag() {
-		return agreeFlag;
-	}
-
-	public void setAgreeFlag(String agreeFlag) {
-		this.agreeFlag = agreeFlag;
-	}
-
-	public String getActivationCode() {
-		return activationCode;
-	}
-
-	public void setActivationCode(String activationCode) {
-		this.activationCode = activationCode;
-	}
-
-	public String getActivationDate() {
-		return activationDate;
-	}
-
-	public void setActivationDate(String activationDate) {
-		this.activationDate = activationDate;
-	}
-
-	@Length(min=0, max=11, message="创客状态长度必须介于 0 和 11 之间")
-	public String getServiceProviderStatus() {
-		return serviceProviderStatus;
-	}
-
-	public void setServiceProviderStatus(String serviceProviderStatus) {
-		this.serviceProviderStatus = serviceProviderStatus;
-	}
-
-	@Length(min=0, max=11, message="创客Id长度必须介于 0 和 11 之间")
-	public String getServiceProviderID() {
-		return serviceProviderID;
-	}
-
-	public void setServiceProviderID(String serviceProviderID) {
-		this.serviceProviderID = serviceProviderID;
-	}
-
-	@Length(min=0, max=11, message="masterStatus长度必须介于 0 和 11 之间")
-	public String getMasterStatus() {
-		return masterStatus;
-	}
-
-	public void setMasterStatus(String masterStatus) {
-		this.masterStatus = masterStatus;
-	}
-
-	@Length(min=0, max=11, message="masterID长度必须介于 0 和 11 之间")
-	public String getMasterID() {
-		return masterID;
-	}
-
-	public void setMasterID(String masterID) {
-		this.masterID = masterID;
-	}
-
-	public Double getUserMoney() {
-		return userMoney;
-	}
-
-	public void setUserMoney(Double userMoney) {
-		this.userMoney = userMoney;
-	}
-
-	public Double getAbleUserMoney() {
-		return ableUserMoney;
-	}
-
-	public void setAbleUserMoney(Double ableUserMoney) {
-		this.ableUserMoney = ableUserMoney;
-	}
-
-	@Length(min=0, max=11, message="point长度必须介于 0 和 11 之间")
-	public String getPoint() {
-		return point;
-	}
-
-	public void setPoint(String point) {
-		this.point = point;
-	}
-
-	@Length(min=0, max=1, message="shopERPFlag长度必须介于 0 和 1 之间")
-	public String getShopERPFlag() {
-		return shopERPFlag;
-	}
-
-	public void setShopERPFlag(String shopERPFlag) {
-		this.shopERPFlag = shopERPFlag;
-	}
-
-	@Length(min=0, max=11, message="邀请人Id长度必须介于 0 和 11 之间")
-	public String getFromUserID() {
-		return fromUserID;
-	}
-
-	public void setFromUserID(String fromUserID) {
-		this.fromUserID = fromUserID;
-	}
-
-	public String getFromUserName() {
-		return fromUserName;
-	}
-
-	public void setFromUserName(String fromUserName) {
-		this.fromUserName = fromUserName;
-	}
-
-	public String getLogoffTime() {
-		return logoffTime;
-	}
-
-	public void setLogoffTime(String logoffTime) {
-		this.logoffTime = logoffTime;
-	}
-
-	@Length(min=0, max=20, message="appKey长度必须介于 0 和 20 之间")
-	public String getAppKey() {
-		return appKey;
-	}
-
-	public void setAppKey(String appKey) {
-		this.appKey = appKey;
-	}
-
-	@Length(min=0, max=25, message="appSecret长度必须介于 0 和 25 之间")
-	public String getAppSecret() {
-		return appSecret;
-	}
-
-	public void setAppSecret(String appSecret) {
-		this.appSecret = appSecret;
-	}
-
-	@Length(min=0, max=1, message="sampleFlag长度必须介于 0 和 1 之间")
-	public String getSampleFlag() {
-		return sampleFlag;
-	}
-
-	public void setSampleFlag(String sampleFlag) {
-		this.sampleFlag = sampleFlag;
-	}
-
-	@Length(min=0, max=11, message="扫描标志(4 CRM拉上来的会所)长度必须介于 0 和 11 之间")
-	public String getScanFlag() {
-		return scanFlag;
-	}
-
-	public void setScanFlag(String scanFlag) {
-		this.scanFlag = scanFlag;
-	}
-
-	@Length(min=0, max=11, message="sysroleid长度必须介于 0 和 11 之间")
-	public String getSysroleid() {
-		return sysroleid;
-	}
-
-	public void setSysroleid(String sysroleid) {
-		this.sysroleid = sysroleid;
-	}
-
-	@Length(min=0, max=2, message="gender长度必须介于 0 和 2 之间")
-	public String getGender() {
-		return gender;
-	}
-
-	public void setGender(String gender) {
-		this.gender = gender;
-	}
-
-	@Length(min=0, max=11, message="年龄长度必须介于 0 和 11 之间")
-	public String getAge() {
-		return age;
-	}
-
-	public void setAge(String age) {
-		this.age = age;
-	}
-
-	@Length(min=0, max=11, message="salerbuyer长度必须介于 0 和 11 之间")
-	public String getSalerbuyer() {
-		return salerbuyer;
-	}
-
-	public void setSalerbuyer(String salerbuyer) {
-		this.salerbuyer = salerbuyer;
-	}
-
-	@Length(min=0, max=128, message="position长度必须介于 0 和 128 之间")
-	public String getPosition() {
-		return position;
-	}
-
-	public void setPosition(String position) {
-		this.position = position;
-	}
-
-	@Length(min=0, max=128, message="skill长度必须介于 0 和 128 之间")
-	public String getSkill() {
-		return skill;
-	}
-
-	public void setSkill(String skill) {
-		this.skill = skill;
-	}
-
-	public String getWorkage() {
-		return workage;
-	}
-
-	public void setWorkage(String workage) {
-		this.workage = workage;
-	}
-
-	@Length(min=0, max=64, message="微信号长度必须介于 0 和 64 之间")
-	public String getWechat() {
-		return wechat;
-	}
-
-	public void setWechat(String wechat) {
-		this.wechat = wechat;
-	}
-
-	@Length(min=0, max=32, message="QQ号长度必须介于 0 和 32 之间")
-	public String getQq() {
-		return qq;
-	}
-
-	public void setQq(String qq) {
-		this.qq = qq;
-	}
-
-	@Length(min=0, max=1, message="短信是否发送成功长度必须介于 0 和 1 之间")
-	public String getSmsFlag() {
-		return smsFlag;
-	}
-
-	public void setSmsFlag(String smsFlag) {
-		this.smsFlag = smsFlag;
-	}
-
-	@Length(min=0, max=11, message="采美豆数量长度必须介于 0 和 11 之间")
-	public String getUserBeans() {
-		return userBeans;
-	}
-
-	public void setUserBeans(String userBeans) {
-		this.userBeans = userBeans;
-	}
-
-	@Length(min=0, max=11, message="平台商标志位  0非平台商 1平台商长度必须介于 0 和 11 之间")
-	public String getPrivateShopFlag() {
-		return privateShopFlag;
-	}
-
-	public void setPrivateShopFlag(String privateShopFlag) {
-		this.privateShopFlag = privateShopFlag;
-	}
-
-	@Length(min=0, max=11, message="平台会所标志位  0非平台会所 1平台会所长度必须介于 0 和 11 之间")
-	public String getPrivateClubFlag() {
-		return privateClubFlag;
-	}
-
-	public void setPrivateClubFlag(String privateClubFlag) {
-		this.privateClubFlag = privateClubFlag;
-	}
-
-	@Length(min=0, max=11, message="isMeiDaoAuthorized长度必须介于 0 和 11 之间")
-	public String getIsMeiDaoAuthorized() {
-		return isMeiDaoAuthorized;
-	}
-
-	public void setIsMeiDaoAuthorized(String isMeiDaoAuthorized) {
-		this.isMeiDaoAuthorized = isMeiDaoAuthorized;
-	}
-
-	@Length(min=0, max=1, message="引导层弹出  0需要弹出  1不需要弹出长度必须介于 0 和 1 之间")
-	public String getGuideFlag() {
-		return guideFlag;
-	}
-
-	public void setGuideFlag(String guideFlag) {
-		this.guideFlag = guideFlag;
-	}
-
-	public String getNickName() {
-		return nickName;
-	}
-
-	public void setNickName(String nickName) {
-		this.nickName = nickName;
-	}
-
-	public String getAccount() {
-		return account;
-	}
-
-	public void setAccount(String account) {
-		this.account = account;
-	}
-
-	public Integer getUserIdentity() {
-		return userIdentity;
-	}
-
-	public void setUserIdentity(Integer userIdentity) {
-		this.userIdentity = userIdentity;
-	}
-
-	public String getRealName() {
-		return realName;
-	}
-
-	public void setRealName(String realName) {
-		this.realName = realName;
-	}
-
-	public Integer getCompanyUserID() {
-		return companyUserID;
-	}
-
-	public void setCompanyUserID(Integer companyUserID) {
-		this.companyUserID = companyUserID;
-	}
-
-	public String getOpenID() {
-		return openID;
-	}
-
-	public void setOpenID(String openID) {
-		this.openID = openID;
-	}
-
-	public String getBindMobile() {
-		return bindMobile;
-	}
-
-	public void setBindMobile(String bindMobile) {
-		this.bindMobile = bindMobile;
-	}
-
-	public String getTipStatus() {
-		return tipStatus;
-	}
-
-	public void setTipStatus(String tipStatus) {
-		this.tipStatus = tipStatus;
-	}
-
-	@Transient
-	public String getIdentityDisplay() {
-		return identityDisplay;
-	}
-
-	public void setIdentityDisplay(String identityDisplay) {
-		this.identityDisplay = identityDisplay;
-	}
-	@Transient
-	public String getStartTime() {
-		return startTime;
-	}
-
-	public void setStartTime(String startTime) {
-		this.startTime = startTime;
-	}
-	@Transient
-	public String getEndTime() {
-		return endTime;
-	}
-
-	public void setEndTime(String endTime) {
-		this.endTime = endTime;
-	}
-
-	public Integer getUserOrganizeID() {
-		return userOrganizeID;
-	}
-
-	public void setUserOrganizeID(Integer userOrganizeID) {
-		this.userOrganizeID = userOrganizeID;
-	}
-
-	public String getLinkMan() {
-		return linkMan;
-	}
-
-	public void setLinkMan(String linkMan) {
-		this.linkMan = linkMan;
-	}
-
-	public String getTown() {
-		return town;
-	}
-
-	public void setTown(String town) {
-		this.town = town;
-	}
-
-	public String getCity() {
-		return city;
-	}
-
-	public void setCity(String city) {
-		this.city = city;
-	}
-
-	public String getProvince() {
-		return province;
-	}
-
-	public void setProvince(String province) {
-		this.province = province;
-	}
-
-	public String getAddress() {
-		return address;
-	}
-
-	public void setAddress(String address) {
-		this.address = address;
-	}
-
-	public String getOperatorMobile() {
-		return operatorMobile;
-	}
-
-	public void setOperatorMobile(String operatorMobile) {
-		this.operatorMobile = operatorMobile;
-	}
+    private static final long serialVersionUID = 1L;
+    private Integer userID;        // userID
+    private Integer userOrganizeID;//用户组织ID
+    private String mobile;        // 手机号码
+    private Integer userPermission;        // 用户权限
+    private String email;        // 邮箱
+    private String userName;        // 用户名
+    private String image;        // image
+    private String password;        // 密码
+    private String userLevelID;        // 用户会员等级,见表c_userlevel或枚举UserLevel
+    private String name;        // 组织名称
+    private String nick;        // 昵称
+    private String sex;        // 性别
+    private String registerUserTypeID;        // 用户类型,见表c_usertype或枚举UserType
+    private String manufacturerFlag;        // 已废弃 是否是供应商,1是 空或0否
+    private String manufacturerStatus;        // 供应商状态,见表c_shopstatus或枚举ShopStatus
+    private String shopID;        // 供应商Id
+    private String serviceProviderFlag;        // 已废弃  是否创客,1是 空或0否
+    private String clubFlag;        //已废弃  是否会所,1是 空或0否
+    private String masterFlag;        //已废弃  masterFlag
+    private String normalFlag;        //已废弃  normalFlag
+    private String auditStatus;        // auditStatus
+    private String auditTime;        // auditTime
+    private String auditNote;        // auditNote
+    private String registerTime;        // 注册时间
+    private String registerIP;        // 注册ip
+    private String loginTime;        // 登录时间
+    private String loginFailTime;        // 登录失败次数
+    private String loginIP;        // 登录ip
+    private String validFlag;        // 用户状态,1正常,0冻结
+    private String emailCheckFlag;        // emailCheckFlag
+    private String mobileCheckFlag;        // mobileCheckFlag
+    private String clubStatus;        // 会所状态,见表c_clubstatus或枚举ClubStatus
+    private String clubID;        // 会所Id
+    private String agreeFlag;        // agreeFlag
+    private String activationCode;        // activationCode
+    private String activationDate;        // activationDate
+    private String serviceProviderStatus;        // 创客状态
+    private String serviceProviderID;        // 创客Id
+    private String masterStatus;        // masterStatus
+    private String masterID;        // masterID
+    private Double userMoney;        // 账户余额
+    private Double ableUserMoney;        //账户可用余额
+    private String point;        // point
+    private String shopERPFlag;        // shopERPFlag
+    private String fromUserID;        // 邀请人Id
+    private String fromUserName;        // 邀请人名称
+    private String logoffTime;        // logoffTime
+    private String appKey;        // appKey
+    private String appSecret;        // appSecret
+    private String sampleFlag;        // sampleFlag
+    private String scanFlag;        // 扫描标志(4 CRM拉上来的会所)
+    private String sysroleid;        // sysroleid
+    private String gender;        // gender
+    private String age;        // 年龄
+    private String salerbuyer;        // salerbuyer
+    private String position;        // position
+    private String skill;        // skill
+    private String workage;        // workage
+    private String wechat;        // 微信号
+    private String qq;        // QQ号
+    private String smsFlag;        // 短信是否发送成功
+    private Integer userBeans;        // 采美豆数量
+    private String privateShopFlag;        // 平台商标志位  0非平台商 1平台商
+    private String privateClubFlag;        // 平台会所标志位  0非平台会所 1平台会所
+    private String isMeiDaoAuthorized;        // isMeiDaoAuthorized
+    private String guideFlag;        // 引导层弹出  0需要弹出  1不需要弹出
+    private String nickName;        // 微信昵称
+    private String startTime;     //注册时间开始 查询条件
+    private String endTime;        //注册时间结束  查询条件
+    private String operatorMobile; //
+
+
+    /**
+     * 用户模块重构
+     */
+    private String account;//账号名: 企业账号登录使用
+    private Integer userIdentity;//用户身份
+    private String realName;//真实姓名
+    private Integer companyUserID;//企业用户id
+    private String openID;//微信openID
+    private String bindMobile;//企业绑定手机号
+    private String tipStatus;//弹窗提示状态
+    private String identityDisplay; //前台身份展示
+    private String linkMan;//联系人
+
+    //会所用户信息
+    private String town; // 区
+    private String city; // 市
+    private String province; //省
+    private String address;        // 详细地址
+
+    public CmUser() {
+        super();
+    }
+
+    public CmUser(String id) {
+        super(id);
+    }
+
+    @NotNull(message = "userID不能为空")
+    public Integer getUserID() {
+        return userID;
+    }
+
+    public void setUserID(Integer userID) {
+        this.userID = userID;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public Integer getUserPermission() {
+        return userPermission;
+    }
+
+    public void setUserPermission(Integer userPermission) {
+        this.userPermission = userPermission;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getImage() {
+        return image;
+    }
+
+    public void setImage(String image) {
+        this.image = image;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getUserLevelID() {
+        return userLevelID;
+    }
+
+    public void setUserLevelID(String userLevelID) {
+        this.userLevelID = userLevelID;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getNick() {
+        return nick;
+    }
+
+    public void setNick(String nick) {
+        this.nick = nick;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getRegisterUserTypeID() {
+        return registerUserTypeID;
+    }
+
+    public void setRegisterUserTypeID(String registerUserTypeID) {
+        this.registerUserTypeID = registerUserTypeID;
+    }
+
+    @Length(min = 0, max = 1, message = "是否是供应商,1是 空或0否长度必须介于 0 和 1 之间")
+    public String getManufacturerFlag() {
+        return manufacturerFlag;
+    }
+
+    public void setManufacturerFlag(String manufacturerFlag) {
+        this.manufacturerFlag = manufacturerFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "供应商状态,见表c_shopstatus或枚举ShopStatus长度必须介于 0 和 11 之间")
+    public String getManufacturerStatus() {
+        return manufacturerStatus;
+    }
+
+    public void setManufacturerStatus(String manufacturerStatus) {
+        this.manufacturerStatus = manufacturerStatus;
+    }
+
+    @Length(min = 0, max = 11, message = "供应商Id长度必须介于 0 和 11 之间")
+    public String getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(String shopID) {
+        this.shopID = shopID;
+    }
+
+    @Length(min = 0, max = 1, message = "是否创客,1是 空或0否长度必须介于 0 和 1 之间")
+    public String getServiceProviderFlag() {
+        return serviceProviderFlag;
+    }
+
+    public void setServiceProviderFlag(String serviceProviderFlag) {
+        this.serviceProviderFlag = serviceProviderFlag;
+    }
+
+    @Length(min = 0, max = 1, message = "是否会所,1是 空或0否长度必须介于 0 和 1 之间")
+    public String getClubFlag() {
+        return clubFlag;
+    }
+
+    public void setClubFlag(String clubFlag) {
+        this.clubFlag = clubFlag;
+    }
+
+    @Length(min = 0, max = 1, message = "masterFlag长度必须介于 0 和 1 之间")
+    public String getMasterFlag() {
+        return masterFlag;
+    }
+
+    public void setMasterFlag(String masterFlag) {
+        this.masterFlag = masterFlag;
+    }
+
+    @Length(min = 0, max = 1, message = "normalFlag长度必须介于 0 和 1 之间")
+    public String getNormalFlag() {
+        return normalFlag;
+    }
+
+    public void setNormalFlag(String normalFlag) {
+        this.normalFlag = normalFlag;
+    }
+
+    @Length(min = 0, max = 1, message = "auditStatus长度必须介于 0 和 1 之间")
+    public String getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(String auditStatus) {
+        this.auditStatus = auditStatus;
+    }
+
+    @Length(min = 0, max = 19, message = "auditTime长度必须介于 0 和 19 之间")
+    public String getAuditTime() {
+        return auditTime;
+    }
+
+    public void setAuditTime(String auditTime) {
+        this.auditTime = auditTime;
+    }
+
+    @Length(min = 0, max = 100, message = "auditNote长度必须介于 0 和 100 之间")
+    public String getAuditNote() {
+        return auditNote;
+    }
+
+    public void setAuditNote(String auditNote) {
+        this.auditNote = auditNote;
+    }
+
+    public String getRegisterTime() {
+        return registerTime;
+    }
+
+    public void setRegisterTime(String registerTime) {
+        this.registerTime = registerTime;
+    }
+
+    public String getRegisterIP() {
+        return registerIP;
+    }
+
+    public void setRegisterIP(String registerIP) {
+        this.registerIP = registerIP;
+    }
+
+    public String getLoginTime() {
+        return loginTime;
+    }
+
+    public void setLoginTime(String loginTime) {
+        this.loginTime = loginTime;
+    }
+
+    public String getLoginFailTime() {
+        return loginFailTime;
+    }
+
+    public void setLoginFailTime(String loginFailTime) {
+        this.loginFailTime = loginFailTime;
+    }
+
+    public String getLoginIP() {
+        return loginIP;
+    }
+
+    public void setLoginIP(String loginIP) {
+        this.loginIP = loginIP;
+    }
+
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
+    }
+
+    public String getEmailCheckFlag() {
+        return emailCheckFlag;
+    }
+
+    public void setEmailCheckFlag(String emailCheckFlag) {
+        this.emailCheckFlag = emailCheckFlag;
+    }
+
+    public String getMobileCheckFlag() {
+        return mobileCheckFlag;
+    }
+
+    public void setMobileCheckFlag(String mobileCheckFlag) {
+        this.mobileCheckFlag = mobileCheckFlag;
+    }
+
+    public String getClubStatus() {
+        return clubStatus;
+    }
+
+    public void setClubStatus(String clubStatus) {
+        this.clubStatus = clubStatus;
+    }
+
+    public String getClubID() {
+        return clubID;
+    }
+
+    public void setClubID(String clubID) {
+        this.clubID = clubID;
+    }
+
+    public String getAgreeFlag() {
+        return agreeFlag;
+    }
+
+    public void setAgreeFlag(String agreeFlag) {
+        this.agreeFlag = agreeFlag;
+    }
+
+    public String getActivationCode() {
+        return activationCode;
+    }
+
+    public void setActivationCode(String activationCode) {
+        this.activationCode = activationCode;
+    }
+
+    public String getActivationDate() {
+        return activationDate;
+    }
+
+    public void setActivationDate(String activationDate) {
+        this.activationDate = activationDate;
+    }
+
+    @Length(min = 0, max = 11, message = "创客状态长度必须介于 0 和 11 之间")
+    public String getServiceProviderStatus() {
+        return serviceProviderStatus;
+    }
+
+    public void setServiceProviderStatus(String serviceProviderStatus) {
+        this.serviceProviderStatus = serviceProviderStatus;
+    }
+
+    @Length(min = 0, max = 11, message = "创客Id长度必须介于 0 和 11 之间")
+    public String getServiceProviderID() {
+        return serviceProviderID;
+    }
+
+    public void setServiceProviderID(String serviceProviderID) {
+        this.serviceProviderID = serviceProviderID;
+    }
+
+    @Length(min = 0, max = 11, message = "masterStatus长度必须介于 0 和 11 之间")
+    public String getMasterStatus() {
+        return masterStatus;
+    }
+
+    public void setMasterStatus(String masterStatus) {
+        this.masterStatus = masterStatus;
+    }
+
+    @Length(min = 0, max = 11, message = "masterID长度必须介于 0 和 11 之间")
+    public String getMasterID() {
+        return masterID;
+    }
+
+    public void setMasterID(String masterID) {
+        this.masterID = masterID;
+    }
+
+    public Double getUserMoney() {
+        return userMoney;
+    }
+
+    public void setUserMoney(Double userMoney) {
+        this.userMoney = userMoney;
+    }
+
+    public Double getAbleUserMoney() {
+        return ableUserMoney;
+    }
+
+    public void setAbleUserMoney(Double ableUserMoney) {
+        this.ableUserMoney = ableUserMoney;
+    }
+
+    @Length(min = 0, max = 11, message = "point长度必须介于 0 和 11 之间")
+    public String getPoint() {
+        return point;
+    }
+
+    public void setPoint(String point) {
+        this.point = point;
+    }
+
+    @Length(min = 0, max = 1, message = "shopERPFlag长度必须介于 0 和 1 之间")
+    public String getShopERPFlag() {
+        return shopERPFlag;
+    }
+
+    public void setShopERPFlag(String shopERPFlag) {
+        this.shopERPFlag = shopERPFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "邀请人Id长度必须介于 0 和 11 之间")
+    public String getFromUserID() {
+        return fromUserID;
+    }
+
+    public void setFromUserID(String fromUserID) {
+        this.fromUserID = fromUserID;
+    }
+
+    public String getFromUserName() {
+        return fromUserName;
+    }
+
+    public void setFromUserName(String fromUserName) {
+        this.fromUserName = fromUserName;
+    }
+
+    public String getLogoffTime() {
+        return logoffTime;
+    }
+
+    public void setLogoffTime(String logoffTime) {
+        this.logoffTime = logoffTime;
+    }
+
+    @Length(min = 0, max = 20, message = "appKey长度必须介于 0 和 20 之间")
+    public String getAppKey() {
+        return appKey;
+    }
+
+    public void setAppKey(String appKey) {
+        this.appKey = appKey;
+    }
+
+    @Length(min = 0, max = 25, message = "appSecret长度必须介于 0 和 25 之间")
+    public String getAppSecret() {
+        return appSecret;
+    }
+
+    public void setAppSecret(String appSecret) {
+        this.appSecret = appSecret;
+    }
+
+    @Length(min = 0, max = 1, message = "sampleFlag长度必须介于 0 和 1 之间")
+    public String getSampleFlag() {
+        return sampleFlag;
+    }
+
+    public void setSampleFlag(String sampleFlag) {
+        this.sampleFlag = sampleFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "扫描标志(4 CRM拉上来的会所)长度必须介于 0 和 11 之间")
+    public String getScanFlag() {
+        return scanFlag;
+    }
+
+    public void setScanFlag(String scanFlag) {
+        this.scanFlag = scanFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "sysroleid长度必须介于 0 和 11 之间")
+    public String getSysroleid() {
+        return sysroleid;
+    }
+
+    public void setSysroleid(String sysroleid) {
+        this.sysroleid = sysroleid;
+    }
+
+    @Length(min = 0, max = 2, message = "gender长度必须介于 0 和 2 之间")
+    public String getGender() {
+        return gender;
+    }
+
+    public void setGender(String gender) {
+        this.gender = gender;
+    }
+
+    @Length(min = 0, max = 11, message = "年龄长度必须介于 0 和 11 之间")
+    public String getAge() {
+        return age;
+    }
+
+    public void setAge(String age) {
+        this.age = age;
+    }
+
+    @Length(min = 0, max = 11, message = "salerbuyer长度必须介于 0 和 11 之间")
+    public String getSalerbuyer() {
+        return salerbuyer;
+    }
+
+    public void setSalerbuyer(String salerbuyer) {
+        this.salerbuyer = salerbuyer;
+    }
+
+    @Length(min = 0, max = 128, message = "position长度必须介于 0 和 128 之间")
+    public String getPosition() {
+        return position;
+    }
+
+    public void setPosition(String position) {
+        this.position = position;
+    }
+
+    @Length(min = 0, max = 128, message = "skill长度必须介于 0 和 128 之间")
+    public String getSkill() {
+        return skill;
+    }
+
+    public void setSkill(String skill) {
+        this.skill = skill;
+    }
+
+    public String getWorkage() {
+        return workage;
+    }
+
+    public void setWorkage(String workage) {
+        this.workage = workage;
+    }
+
+    @Length(min = 0, max = 64, message = "微信号长度必须介于 0 和 64 之间")
+    public String getWechat() {
+        return wechat;
+    }
+
+    public void setWechat(String wechat) {
+        this.wechat = wechat;
+    }
+
+    @Length(min = 0, max = 32, message = "QQ号长度必须介于 0 和 32 之间")
+    public String getQq() {
+        return qq;
+    }
+
+    public void setQq(String qq) {
+        this.qq = qq;
+    }
+
+    @Length(min = 0, max = 1, message = "短信是否发送成功长度必须介于 0 和 1 之间")
+    public String getSmsFlag() {
+        return smsFlag;
+    }
+
+    public void setSmsFlag(String smsFlag) {
+        this.smsFlag = smsFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "采美豆数量长度必须介于 0 和 11 之间")
+    public Integer getUserBeans() {
+        return userBeans;
+    }
+
+    public void setUserBeans(Integer userBeans) {
+        this.userBeans = userBeans;
+    }
+
+    @Length(min = 0, max = 11, message = "平台商标志位  0非平台商 1平台商长度必须介于 0 和 11 之间")
+    public String getPrivateShopFlag() {
+        return privateShopFlag;
+    }
+
+    public void setPrivateShopFlag(String privateShopFlag) {
+        this.privateShopFlag = privateShopFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "平台会所标志位  0非平台会所 1平台会所长度必须介于 0 和 11 之间")
+    public String getPrivateClubFlag() {
+        return privateClubFlag;
+    }
+
+    public void setPrivateClubFlag(String privateClubFlag) {
+        this.privateClubFlag = privateClubFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "isMeiDaoAuthorized长度必须介于 0 和 11 之间")
+    public String getIsMeiDaoAuthorized() {
+        return isMeiDaoAuthorized;
+    }
+
+    public void setIsMeiDaoAuthorized(String isMeiDaoAuthorized) {
+        this.isMeiDaoAuthorized = isMeiDaoAuthorized;
+    }
+
+    @Length(min = 0, max = 1, message = "引导层弹出  0需要弹出  1不需要弹出长度必须介于 0 和 1 之间")
+    public String getGuideFlag() {
+        return guideFlag;
+    }
+
+    public void setGuideFlag(String guideFlag) {
+        this.guideFlag = guideFlag;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public Integer getUserIdentity() {
+        return userIdentity;
+    }
+
+    public void setUserIdentity(Integer userIdentity) {
+        this.userIdentity = userIdentity;
+    }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public Integer getCompanyUserID() {
+        return companyUserID;
+    }
+
+    public void setCompanyUserID(Integer companyUserID) {
+        this.companyUserID = companyUserID;
+    }
+
+    public String getOpenID() {
+        return openID;
+    }
+
+    public void setOpenID(String openID) {
+        this.openID = openID;
+    }
+
+    public String getBindMobile() {
+        return bindMobile;
+    }
+
+    public void setBindMobile(String bindMobile) {
+        this.bindMobile = bindMobile;
+    }
+
+    public String getTipStatus() {
+        return tipStatus;
+    }
+
+    public void setTipStatus(String tipStatus) {
+        this.tipStatus = tipStatus;
+    }
+
+    @Transient
+    public String getIdentityDisplay() {
+        return identityDisplay;
+    }
+
+    public void setIdentityDisplay(String identityDisplay) {
+        this.identityDisplay = identityDisplay;
+    }
+
+    @Transient
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    @Transient
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public Integer getUserOrganizeID() {
+        return userOrganizeID;
+    }
+
+    public void setUserOrganizeID(Integer userOrganizeID) {
+        this.userOrganizeID = userOrganizeID;
+    }
+
+    public String getLinkMan() {
+        return linkMan;
+    }
+
+    public void setLinkMan(String linkMan) {
+        this.linkMan = linkMan;
+    }
+
+    public String getTown() {
+        return town;
+    }
+
+    public void setTown(String town) {
+        this.town = town;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getOperatorMobile() {
+        return operatorMobile;
+    }
+
+    public void setOperatorMobile(String operatorMobile) {
+        this.operatorMobile = operatorMobile;
+    }
 }

+ 145 - 0
src/main/java/com/caimei/modules/user/entity/UserBeansHistory.java

@@ -0,0 +1,145 @@
+package com.caimei.modules.user.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+import java.util.Date;
+
+/**
+ * user_beans_history
+ *
+ * @author
+ */
+public class UserBeansHistory extends DataEntity<UserBeansHistory> {
+    /**
+     * 用户id
+     */
+    private Integer userId;
+
+    /**
+     * 收支类型:1收入,2支出
+     */
+    private Integer type;
+
+    /**
+     * 采美豆类型:1注册机构,2升级会员机构,3普通机构完善资料,4会员机构完善资料,5下单,
+     * 6线上支付订单,7确认收货,8系统发放,9抵用退回,10抵用运费,11退款回收
+     */
+    private Integer beansType;
+
+    /**
+     * 主订单id
+     */
+    private Integer orderId;
+
+    /**
+     * 采美豆数量
+     */
+    private Integer num;
+
+    /**
+     * 推送状态:0未推送,1已推送
+     */
+    private Integer pushStatus;
+
+    /**
+     * 添加时间
+     */
+    private Date addTime;
+
+    /**
+     * 机构id
+     */
+    private Integer clubId;
+
+    /**
+     * 收款id
+     */
+    private Integer receiptId;
+
+    /**
+     * 退款id
+     */
+    private Integer returnedId;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getBeansType() {
+        return beansType;
+    }
+
+    public void setBeansType(Integer beansType) {
+        this.beansType = beansType;
+    }
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    public Integer getNum() {
+        return num;
+    }
+
+    public void setNum(Integer num) {
+        this.num = num;
+    }
+
+    public Integer getPushStatus() {
+        return pushStatus;
+    }
+
+    public void setPushStatus(Integer pushStatus) {
+        this.pushStatus = pushStatus;
+    }
+
+    public Date getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(Date addTime) {
+        this.addTime = addTime;
+    }
+
+    public Integer getClubId() {
+        return clubId;
+    }
+
+    public void setClubId(Integer clubId) {
+        this.clubId = clubId;
+    }
+
+    public Integer getReceiptId() {
+        return receiptId;
+    }
+
+    public void setReceiptId(Integer receiptId) {
+        this.receiptId = receiptId;
+    }
+
+    public Integer getReturnedId() {
+        return returnedId;
+    }
+
+    public void setReturnedId(Integer returnedId) {
+        this.returnedId = returnedId;
+    }
+}

+ 36 - 29
src/main/java/com/caimei/modules/user/service/CmUserbeanshistoryService.java

@@ -1,44 +1,51 @@
 package com.caimei.modules.user.service;
 
-import java.util.List;
-
+import com.caimei.modules.user.dao.CmUserDao;
+import com.caimei.modules.user.dao.CmUserbeanshistoryDao;
+import com.caimei.modules.user.entity.CmUser;
+import com.caimei.modules.user.entity.UserBeansHistory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.service.CrudService;
-import com.caimei.modules.user.entity.CmUserbeanshistory;
-import com.caimei.modules.user.dao.CmUserbeanshistoryDao;
+import java.util.List;
 
 /**
  * 采美豆记录Service
+ *
  * @author zcp
  * @version 2017-10-19
  */
 @Service
 @Transactional(readOnly = true)
-public class CmUserbeanshistoryService extends CrudService<CmUserbeanshistoryDao, CmUserbeanshistory> {
+public class CmUserbeanshistoryService {
+    @Autowired
+    private CmUserbeanshistoryDao cmUserbeanshistoryDao;
+    @Autowired
+    private CmUserDao cmUserDao;
+
+    public List<CmUser> findUserBeansList(CmUser cmuser) {
+        return cmUserbeanshistoryDao.findUserBeansList(cmuser);
+    }
 
-	public CmUserbeanshistory get(String id) {
-		return super.get(id);
-	}
-	
-	public List<CmUserbeanshistory> findList(CmUserbeanshistory cmUserbeanshistory) {
-		return super.findList(cmUserbeanshistory);
-	}
-	
-	public Page<CmUserbeanshistory> findPage(Page<CmUserbeanshistory> page, CmUserbeanshistory cmUserbeanshistory) {
-		return super.findPage(page, cmUserbeanshistory);
-	}
-	
-	@Transactional(readOnly = false)
-	public void save(CmUserbeanshistory cmUserbeanshistory) {
-		super.save(cmUserbeanshistory);
-	}
-	
-	@Transactional(readOnly = false)
-	public void delete(CmUserbeanshistory cmUserbeanshistory) {
-		super.delete(cmUserbeanshistory);
-	}
-	
+    public List<UserBeansHistory> findBeansHistoryList(UserBeansHistory userBeansHistory) {
+        List<UserBeansHistory> historyList = cmUserbeanshistoryDao.findBeansHistoryList(userBeansHistory);
+        if (historyList != null && historyList.size() > 0) {
+            for (UserBeansHistory history : historyList) {
+                CmUser user = cmUserDao.get(history.getUserId().toString());
+                history.setClubId(Integer.valueOf(user.getClubID()));
+                if (6 == history.getBeansType()) {
+                    //收款id
+                    Integer receiptId = cmUserbeanshistoryDao.findOrderReceiptId(history.getOrderId());
+                    history.setReceiptId(receiptId);
+                }
+                if (9 == history.getBeansType() || 11 == history.getBeansType()) {
+                    //退款id
+                    Integer returnedId = cmUserbeanshistoryDao.findPurchaseReturnedId(history.getOrderId());
+                    history.setReturnedId(returnedId);
+                }
+            }
+        }
+        return historyList;
+    }
 }

+ 5 - 0
src/main/java/com/caimei/modules/user/service/NewCmClubService.java

@@ -2,6 +2,7 @@ package com.caimei.modules.user.service;
 
 import java.util.List;
 
+import com.caimei.modules.user.entity.UserBeansHistory;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -70,4 +71,8 @@ public class NewCmClubService extends CrudService<NewCmClubDao, NewCmClub> {
         }
     }
 
+    @Transactional(readOnly = false)
+    public void insertBeansHistory(UserBeansHistory beansHistory) {
+        newCmClubDao.insertBeansHistory(beansHistory);
+    }
 }

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

@@ -107,19 +107,9 @@ public class CmUserBalanceRecordController extends BaseController {
         return "modules/user/cmUserBalanceList";
     }
 
-//	@RequiresPermissions("user:cmUserBalanceRecord:view")
-//	@RequestMapping(value = "form")
-//	public String form(CmUserBalanceRecord cmUserBalanceRecord, Model model) {
-//		model.addAttribute("cmUserBalanceRecord", cmUserBalanceRecord);
-//		return "modules/user/cmUserBalanceRecordForm";
-//	}
-
     @RequiresPermissions("user:cmUserBalanceRecord:edit")
     @RequestMapping(value = "save")
     public String save(CmUserBalanceRecord cmUserBalanceRecord, Model model, RedirectAttributes redirectAttributes) {
-//		if (!beanValidator(model, cmUserBalanceRecord)){
-//			return form(cmUserBalanceRecord, model);
-//		}
         cmUserBalanceRecordService.save(cmUserBalanceRecord);
         addMessage(redirectAttributes, "保存用户余额收支记录成功");
         return "redirect:" + Global.getAdminPath() + "/user/cmUserBalanceRecord/?repage";
@@ -133,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));

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

@@ -400,7 +400,7 @@ public class CmUserOrganizeController extends BaseController {
         cmUser.setAbleUserMoney(0d);
         cmUser.setPoint("0");
         cmUser.setShopERPFlag("0");
-        cmUser.setUserBeans("0");
+        cmUser.setUserBeans(0);
         cmUser.setValidFlag("1");
         cmUser.setAgreeFlag("1");
         cmUser.setLoginFailTime("0");

+ 41 - 62
src/main/java/com/caimei/modules/user/web/CmUserbeanshistoryController.java

@@ -1,26 +1,21 @@
 package com.caimei.modules.user.web;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.shiro.authz.annotation.RequiresPermissions;
+import com.caimei.modules.user.entity.CmUser;
+import com.caimei.modules.user.entity.UserBeansHistory;
+import com.caimei.modules.user.service.CmUserService;
+import com.caimei.modules.user.service.CmUserbeanshistoryService;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.user.entity.CmUserbeanshistory;
-import com.caimei.modules.user.service.CmUserbeanshistoryService;
+import java.util.List;
 
 /**
  * 采美豆记录Controller
+ *
  * @author zcp
  * @version 2017-10-19
  */
@@ -28,53 +23,37 @@ import com.caimei.modules.user.service.CmUserbeanshistoryService;
 @RequestMapping(value = "${adminPath}/user/cmUserbeanshistory")
 public class CmUserbeanshistoryController extends BaseController {
 
-	@Autowired
-	private CmUserbeanshistoryService cmUserbeanshistoryService;
-	
-	@ModelAttribute
-	public CmUserbeanshistory get(@RequestParam(required=false) String id) {
-		CmUserbeanshistory entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = cmUserbeanshistoryService.get(id);
-		}
-		if (entity == null){
-			entity = new CmUserbeanshistory();
-		}
-		return entity;
-	}
-	
-	@RequiresPermissions("user:cmUserbeanshistory:view")
-	@RequestMapping(value = {"list", ""})
-	public String list(CmUserbeanshistory cmUserbeanshistory, HttpServletRequest request, HttpServletResponse response, Model model) {
-		Page<CmUserbeanshistory> page = cmUserbeanshistoryService.findPage(new Page<CmUserbeanshistory>(request, response), cmUserbeanshistory); 
-		model.addAttribute("page", page);
-		return "modules/user/cmUserbeanshistoryList";
-	}
-
-	@RequiresPermissions("user:cmUserbeanshistory:view")
-	@RequestMapping(value = "form")
-	public String form(CmUserbeanshistory cmUserbeanshistory, Model model) {
-		model.addAttribute("cmUserbeanshistory", cmUserbeanshistory);
-		return "modules/user/cmUserbeanshistoryForm";
-	}
-
-	@RequiresPermissions("user:cmUserbeanshistory:edit")
-	@RequestMapping(value = "save")
-	public String save(CmUserbeanshistory cmUserbeanshistory, Model model, RedirectAttributes redirectAttributes) {
-		if (!beanValidator(model, cmUserbeanshistory)){
-			return form(cmUserbeanshistory, model);
-		}
-		cmUserbeanshistoryService.save(cmUserbeanshistory);
-		addMessage(redirectAttributes, "保存采美豆记录成功");
-		return "redirect:"+Global.getAdminPath()+"/user/cmUserbeanshistory/?repage";
-	}
-	
-	@RequiresPermissions("user:cmUserbeanshistory:delete")
-	@RequestMapping(value = "delete")
-	public String delete(CmUserbeanshistory cmUserbeanshistory, RedirectAttributes redirectAttributes) {
-		cmUserbeanshistoryService.delete(cmUserbeanshistory);
-		addMessage(redirectAttributes, "删除采美豆记录成功");
-		return "redirect:"+Global.getAdminPath()+"/user/cmUserbeanshistory/?repage";
-	}
-
+    @Autowired
+    private CmUserbeanshistoryService cmUserbeanshistoryService;
+    @Autowired
+    private CmUserService cmUserService;
+
+
+    /**
+     * 采美豆列表
+     */
+    @RequestMapping(value = "userBeansList")
+    public String userBeansList(CmUser cmuser, Page page, Model model) {
+        page.setPageSize(30);
+        cmuser.setPage(page);
+        List<CmUser> userBalanceList = cmUserbeanshistoryService.findUserBeansList(cmuser);
+        page.setList(userBalanceList);
+        model.addAttribute("page", page);
+        return "modules/user/cmUserBeansList";
+    }
+
+    /**
+     * 采美豆详情
+     */
+    @RequestMapping(value = "beansHistoryList")
+    public String beansHistoryList(UserBeansHistory userBeansHistory, Page page, Model model) {
+        page.setPageSize(30);
+        userBeansHistory.setPage(page);
+        List<UserBeansHistory> historyList = cmUserbeanshistoryService.findBeansHistoryList(userBeansHistory);
+        page.setList(historyList);
+        CmUser user = cmUserService.get(userBeansHistory.getUserId().toString());
+        model.addAttribute("page", page);
+        model.addAttribute("user", user);
+        return "modules/user/cmUserbeanshistoryList";
+    }
 }

+ 7 - 8
src/main/java/com/caimei/modules/user/web/NewCmClubController.java

@@ -1,7 +1,6 @@
 package com.caimei.modules.user.web;
 
 import com.caimei.constants.ClubStatus;
-import com.caimei.constants.UserBeanHistoryType;
 import com.caimei.modules.product.service.CmShoporderService;
 import com.caimei.modules.sys.utils.CmMsgUtils;
 import com.caimei.modules.sys.utils.SMSUtils;
@@ -279,7 +278,7 @@ public class NewCmClubController extends BaseController {
      * @param response
      * @return
      */
-    @RequiresPermissions("user:newCmClub:edit")
+   /* @RequiresPermissions("user:newCmClub:edit")
     @ResponseBody
     @RequestMapping(value = "auditClub")
     public Map<String, Object> auditClub(String auditStatus, String auditNote, String id, HttpServletRequest request, HttpServletResponse response) {
@@ -305,7 +304,7 @@ public class NewCmClubController extends BaseController {
             // 2、个人用户升级成为企业会所
             //获取企业会所下级用户
             List<CmUser> cmUsers = cmUserService.findByCompanyUserID(companyUserID);
-            /**审核处理*/
+            *//**审核处理*//*
             //审核通过
             if (StringUtils.equals("1", auditStatus)) {
                 userPermission = 2;
@@ -328,7 +327,7 @@ public class NewCmClubController extends BaseController {
                 }
                 companyUser.setUserPermission(userPermission);
                 //审核通过 采美豆+5000
-                if (StringUtils.isBlank(companyUser.getUserBeans())) {
+                *//*if (StringUtils.isBlank(companyUser.getUserBeans())) {
                     companyUser.setUserBeans("5000");
                 } else {
                     companyUser.setUserBeans(5000 + Integer.parseInt(companyUser.getUserBeans()) + "");
@@ -340,7 +339,7 @@ public class NewCmClubController extends BaseController {
                 cmUserbeanshistory.setPayBeans("5000");
                 cmUserbeanshistory.setInfo("审核上线赠送");
                 cmUserbeanshistory.setAddTime(DateUtils.getDateTime());
-                cmUserbeanshistoryService.save(cmUserbeanshistory);
+                cmUserbeanshistoryService.save(cmUserbeanshistory);*//*
                 if (upByUser)
                     smsMessage = "您申请的企业账号已成功通过资料审核,您现有的账号身份已升级为企业员工身份。";
                 else
@@ -378,9 +377,9 @@ public class NewCmClubController extends BaseController {
             } else {
                 messageContent = title + "【未通过】,原因:" + auditNote;
             }
-            /**发送采美消息*/
+            *//**发送采美消息*//*
             sendMessage("1", companyUser.getUserID(), title, messageContent);
-            /**发送短信*/
+            *//**发送短信*//*
             if (StringUtils.isNotEmpty(mobile)) {
                 SMSUtils.sendSms(mobile, smsMessage);
             }
@@ -392,7 +391,7 @@ public class NewCmClubController extends BaseController {
             map.put("msg", "操作失败");
         }
         return map;
-    }
+    }*/
 
     /**
      * 检查微信注册的用户是否需要发送短信 checkAndSendSMS:(这里用一句话描述这个方法的作用). <br/>

+ 13 - 2
src/main/java/com/caimei/modules/user/web/newUser/AgencyController.java

@@ -529,6 +529,8 @@ public class AgencyController extends BaseController {
                 //审核通过升级为会员机构
                 companyUser.setUserIdentity(2);
                 smsMessage = "恭喜您成功升级为会员机构!立马登录采美365网享受享受更多更好的服务吧~";
+                int userBeans = companyUser.getUserBeans() == null ? 0 : companyUser.getUserBeans();
+                companyUser.setUserBeans(userBeans + 20);
             } else {
                 //审核未通过,普通机构权限
                 userPermission = 5;
@@ -559,6 +561,15 @@ public class AgencyController extends BaseController {
             String messageContent = "";
             if (auditStatus.equals("1")) {
                 messageContent = "恭喜您," + title + "【已通过】,恭喜您成功加入采美,祝您开启愉快的采购之旅。";
+                //升级为机构成功,送20采美豆
+                UserBeansHistory beansHistory = new UserBeansHistory();
+                beansHistory.setUserId(companyUser.getUserID());
+                beansHistory.setBeansType(2);
+                beansHistory.setType(1);
+                beansHistory.setNum(20);
+                beansHistory.setPushStatus(0);
+                beansHistory.setAddTime(new Date());
+                newCmClubService.insertBeansHistory(beansHistory);
             } else {
                 messageContent = title + "【未通过】,原因:" + auditNote;
             }
@@ -676,7 +687,7 @@ public class AgencyController extends BaseController {
      */
     @RequestMapping("checkMobile")
     @ResponseBody
-    public Map<String,String> checkMobile(String bindMobile,Integer userID){
-        return cmUserService.checkMobile(bindMobile,userID,"crm");
+    public Map<String, String> checkMobile(String bindMobile, Integer userID) {
+        return cmUserService.checkMobile(bindMobile, userID, "crm");
     }
 }

+ 7 - 2
src/main/resources/mappings/modules/order/CmPayShopMapper.xml

@@ -38,7 +38,8 @@
 		u2.name AS reviewerName,
 		s.name AS shopName,
 		s.ableRebateAmount AS ableRebateAmount,
-		s.rebateAmount AS rebateAmount
+		s.rebateAmount AS rebateAmount,
+		(SELECT paymentType FROM cm_pay_shop_record WHERE payShopID = a.id LIMIT 1) AS paymentType
 		FROM cm_pay_shop a
 		<include refid="cmPayShopJoins"/>
 		left join shop s on s.shopID = a.shopID
@@ -65,7 +66,8 @@
 			<include refid="cmPayShopColumns"/>,
 		u1.name AS applicantName,
 		u2.name AS reviewerName,
-		s.name AS shopName
+		s.name AS shopName,
+		(SELECT paymentType FROM cm_pay_shop_record WHERE payShopID = a.id LIMIT 1) AS paymentType
 		FROM cm_pay_shop a
 		left join sys_user u1 on u1.id = a.applicant
 		left join sys_user u2 on u2.id = a.reviewer
@@ -110,6 +112,9 @@
 			<if test="orderNo != null and orderNo != ''">
 				AND a.id in (SELECT cpsr.payShopID FROM cm_pay_shop_record  cpsr LEFT JOIN cm_shop_order so ON so.shopOrderID=cpsr.shopOrderID WHERE so.orderNo LIKE CONCAT('%',#{orderNo},'%'))
 			</if>
+			<if test="paymentType != null">
+				AND a.id IN(SELECT payShopID FROM cm_pay_shop_record WHERE paymentType = #{paymentType} AND delFlag = 0)
+			</if>
 			and a.delFlag = '0'
 			and a.shopID != 998
 		</where>

+ 22 - 5
src/main/resources/mappings/modules/order/CmPayShopRecordMapper.xml

@@ -9,6 +9,7 @@
 		a.shopOrderNo AS "shopOrderNo",
 		a.payAmount AS "payAmount",
 		a.wipePayment AS "wipePayment",
+		a.paymentType AS "paymentType",
 		a.payType AS "payType",
 		a.payTime AS "payTime",
 		a.wipeTime AS "wipeTime",
@@ -95,6 +96,7 @@
 			shopOrderNo,
 			payAmount,
 			wipePayment,
+			paymentType,
 			payType,
 			payTime,
 			wipeTime,
@@ -108,6 +110,7 @@
 			#{shopOrderNo},
 			#{payAmount},
 			#{wipePayment},
+			#{paymentType},
 			#{payType},
 			#{payTime},
 			#{wipeTime},
@@ -228,6 +231,7 @@
 		  `shopOrderId`,
 		  `shopOtherFee`,
 		  modifyUserId,
+		  name,
 		  `bankAccountName`,
 		  `bankAccount`,
 		  `bankName`,
@@ -247,13 +251,13 @@
 		INSERT INTO `cm_change_pay_shop_other` (
 		  `shopOrderId`, `shopOtherFee`, `bankAccountName`,
 		  `bankAccount`, `bankName`, `type`, modifyUserId,
-		  `remark`, `remarkImage`, `updateTime`
+		  `remark`, `remarkImage`, `updateTime`, name
 		)
 		VALUES
 		  (
 			#{shopOrderId}, #{shopOtherFee}, #{bankAccountName},
 			#{bankAccount}, #{bankName}, #{type}, #{modifyUserId},
-			#{remark}, #{remarkImage}, NOW()
+			#{remark}, #{remarkImage}, NOW(), #{name}
 		  )
 	</insert>
 
@@ -261,13 +265,13 @@
 		INSERT INTO `cm_change_pay_shop_difference` (
 		  `shopOrderId`, `modifyUserId`, `refundShopId`,
 		  `differencePrice`, `type`, `remark`,
-		  `remarkImage`, `updateTime`
+		  `remarkImage`, `updateTime`, payShopId
 		)
 		VALUES
 		  (
 			#{shopOrderId}, #{modifyUserId}, #{refundShopId},
 			#{differencePrice}, #{type}, #{remark},
-			#{remarkImage}, NOW()
+			#{remarkImage}, NOW(), #{payShopId}
 		  )
 	</insert>
 
@@ -276,6 +280,7 @@
 		  `id`,
 		  `shopOrderId`,
 		  `modifyUserId`,
+		  payShopId,
 		  `refundShopId`,
 		  `differencePrice`,
 		  `type`,
@@ -287,6 +292,18 @@
 		WHERE
 		  shopOrderId = #{shopOrderId}
 		ORDER BY
-		  updateTime
+		  updateTime DESC
+	</select>
+
+	<select id="findPayShopOtherFee" resultType="java.math.BigDecimal">
+		SELECT
+		  SUM(payAmount)
+		FROM
+		  cm_pay_shop_record
+		WHERE
+		  delFlag = 0
+		  AND status = 1
+		  AND paymentType = 3
+		  AND shopOrderID =	#{shopOrderId}
 	</select>
 </mapper>

+ 15 - 1
src/main/resources/mappings/modules/order/CmRefundShopRecordMapper.xml

@@ -142,10 +142,24 @@
 	</select>
 
 	<select id="findByRefundType" resultType="integer">
-		SELECT refundShopID FROM cm_refund_shop_record WHERE shopOrderID = #{shopOrderId} AND refundType = 5
+		SELECT refundShopID FROM cm_refund_shop_record WHERE shopOrderID = #{shopOrderId} AND refundType = 5 AND delFlag = 0
 	</select>
 
 	<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>

+ 21 - 0
src/main/resources/mappings/modules/order/OrderMapper.xml

@@ -40,6 +40,7 @@
 		a.updateDate AS updateDate,
 		a.freePostFlag AS freePostFlag,
 		a.freight AS freight,
+		a.userBeans AS userBeans,
 		a.delFlag AS delFlag,
 		a.onlinePayFlag AS onlinePayFlag,
 		a.payTime AS payTime,
@@ -838,4 +839,24 @@
             #{recordId}, #{fileName}, #{ossName}
           )
     </insert>
+
+	<select id="findBYShortLink" resultType="integer">
+        SELECT id FROM cm_short_link WHERE shortLink = #{shortLink}
+    </select>
+
+	<insert id="insertShortLink">
+    INSERT INTO `caimei`.`cm_short_link` (
+      `markId`, `shortLink`, `jumpLink`,
+      `createTime`
+    )
+    VALUES
+      (
+        #{markId}, #{shortLink}, #{url},
+        NOW()
+      )
+    </insert>
+
+	<update id="updateSendNum">
+        UPDATE cm_sms_statistics SET sendNum = (sendNum + #{num}) WHERE markId = #{markId}
+    </update>
 </mapper>

+ 3 - 6
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -809,14 +809,11 @@
 			<if test="operatingMode != null and operatingMode == '2'.toString()">
 				and a.payStatus != 1 and co.status != 6
 			</if>
+			<if test="operatingMode != null and operatingMode == '3'.toString()">
+				and a.payStatus = 3 and co.status NOT IN (6,7)
+			</if>
 			and co.delFlag = 0
 			and a.delFlag = 0
-			and a.shopOrderID not in (
-				select cror.orderID from cm_receipt_order_relation cror
-				LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
-				where cror.relationType = '1' and  cror.delFlag = '0' AND cdr.receiptStatus = '2'
-				and  cror.orderID is not null
-			)
 			and a.shopID != 998
 			and co.orderID not in (
 				SELECT orderID FROM cm_order_product WHERE productID IN

+ 4 - 0
src/main/resources/mappings/modules/user/CmUserMapper.xml

@@ -779,6 +779,10 @@
 			AND u.registerUserTypeID IN (1,2,3,32,4)
 		</if>
 	</select>
+
+	<update id="updateUserBeans">
+		UPDATE USER SET userBeans = #{userBeans} WHERE userID = #{userID}
+	</update>
 	<select id="findUserByOrganizeId" resultType="com.caimei.modules.user.entity.CmUser">
 		SELECT
 		<include refid="cmUserColumns"/>

+ 84 - 90
src/main/resources/mappings/modules/user/CmUserbeanshistoryMapper.xml

@@ -1,102 +1,96 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.user.dao.CmUserbeanshistoryDao">
-    
-	<sql id="cmUserbeanshistoryColumns">
-		a.userBeansHistoryID AS "id",
-		a.userBeanHistoryTypeID AS "userBeanHistoryTypeID",
-		a.userID AS "userID",
-		a.relatedID AS "relatedID",
-		a.payBeans AS "payBeans",
-		a.info AS "info",
-		a.addTime AS "addTime"
-	</sql>
-	
-	<sql id="cmUserbeanshistoryJoins">
-	</sql>
-    
-	<select id="get" resultType="CmUserbeanshistory">
-		SELECT 
-			<include refid="cmUserbeanshistoryColumns"/>
-		FROM userbeanshistory a
-		<include refid="cmUserbeanshistoryJoins"/>
-		WHERE a.userBeansHistoryID = #{id}
-	</select>
-	
-	<select id="findList" resultType="CmUserbeanshistory">
-		SELECT 
-			<include refid="cmUserbeanshistoryColumns"/>
-		FROM userbeanshistory a
-		<include refid="cmUserbeanshistoryJoins"/>
+	<select id="findUserBeansList" resultType="com.caimei.modules.user.entity.CmUser">
+		SELECT
+			userID,
+			userName,
+			name,
+			userBeans
+		FROM user
 		<where>
-			
-			<if test="userBeansHistoryID != null and userBeansHistoryID != ''">
-				AND a.userBeansHistoryID = #{id}
-			</if>
-			<if test="userID != null and userID != ''">
-				AND a.userID = #{userID}
+			<if test="name != null and name != ''">
+				and name LIKE concat('%',#{name},'%')
 			</if>
+			and userIdentity in (2,4)
+			AND validFlag = 1
+			AND clubStatus in (90,1,92)
 		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
+		ORDER BY userBeans DESC
 	</select>
-	
-	<select id="findAllList" resultType="CmUserbeanshistory">
-		SELECT 
-			<include refid="cmUserbeanshistoryColumns"/>
-		FROM userbeanshistory a
-		<include refid="cmUserbeanshistoryJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
+
+	<select id="findBeansHistoryList" resultType="com.caimei.modules.user.entity.UserBeansHistory">
+		SELECT
+		  `id`,
+		  `userId`,
+		  `type`,
+		  `beansType`,
+		  `orderId`,
+		  `num`,
+		  `pushStatus`,
+		  `addTime`
+		FROM
+		  `user_beans_history`
+		WHERE
+		  userId = #{userId}
+		  AND delFlag = 0
+		<if test="type != null">
+			AND type = #{type}
+		</if>
+		<if test="beansType != null and beansType != 3">
+			AND beansType = #{beansType}
+		</if>
+		<if test="beansType == 3">
+			AND beansType IN (3,4)
+		</if>
+		ORDER BY addTime DESC
+	</select>
+
+	<select id="findOrderReceiptId" resultType="integer">
+		SELECT
+		  receiptID
+		FROM
+		  cm_receipt_order_relation cror
+		  LEFT JOIN cm_discern_receipt cdr ON cdr.id = cror.receiptID
+		WHERE
+		  cror.relationType = 2
+		  AND cror.delFlag = 0
+		  AND cdr.receiptStatus = 3
+		  AND cror.orderID = #{orderId}
+	</select>
+
+	<select id="findByBeansType" resultType="integer">
+		SELECT
+		  SUM(num)
+		FROM
+		  user_beans_history
+		WHERE
+		  orderId = #{orderId}
+		  AND beansType = 5
 	</select>
 	
-	<insert id="insert" parameterType="CmUserbeanshistory"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO userbeanshistory(
-			userBeansHistoryID,
-			userBeanHistoryTypeID,
-			userID,
-			relatedID,
-			payBeans,
-			info,
-			addTime
-		) VALUES (
-			#{userBeansHistoryID},
-			#{userBeanHistoryTypeID},
-			#{userID},
-			#{relatedID},
-			#{payBeans},
-			#{info},
-			#{addTime}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE userbeanshistory SET 	
-			userBeanHistoryTypeID = #{userBeanHistoryTypeID},
-			userID = #{userID},
-			relatedID = #{relatedID},
-			payBeans = #{payBeans},
-			info = #{info},
-			addTime = #{addTime}
-		WHERE userBeansHistoryID = #{id}
+	<update id="updateBeansHistoryByReturned">
+		UPDATE
+		  user_beans_history
+		SET
+		  delFlag = 1
+		WHERE
+		  orderId = #{orderId}
+		  AND beansType IN (9, 11)
+		  AND delFlag = 0
 	</update>
-	
-	<delete id="delete">
-		DELETE FROM userbeanshistory
-		WHERE userBeansHistoryID = #{id}
-	</delete>
+
+	<select id="findPurchaseReturnedId" resultType="integer">
+		SELECT
+		  id
+		FROM
+		  cm_returned_purchase
+		WHERE
+		  STATUS = 2
+		  AND delFlag = 0
+		  AND orderID = #{orderId}
+		LIMIT
+		  1
+	</select>
 	
 </mapper>

+ 13 - 0
src/main/resources/mappings/modules/user/NewCmClubMapper.xml

@@ -605,8 +605,21 @@
 		JOIN province d ON c.`provinceID` =d.`provinceID`
 		WHERE  a.clubID=#{clubID}
 	</select>
+
 	<select id="findSpId" resultType="java.lang.Integer">
 		select serviceProviderID from serviceprovider where serviceProviderID = #{spID} and status = 90
 	</select>
 
+	<insert id="insertBeansHistory">
+        INSERT INTO `user_beans_history` (
+          `userId`, `type`, `beansType`, `orderId`,
+          `num`, `pushStatus`, `addTime`, delFlag
+        )
+        VALUES
+          (
+            #{userId}, #{type}, #{beansType}, #{orderId},
+            #{num}, #{pushStatus}, #{addTime}, 0
+          )
+    </insert>
+
 </mapper>

+ 7 - 4
src/main/webapp/WEB-INF/views/modules/bulkpurchase/applyRefoundForm.jsp

@@ -354,18 +354,21 @@
             </td>
             <td>
                 运费:
-                <c:if test="${order.freight == 0}">
+                <c:if test="${order.freePostFlag == 0}">
                     包邮
                 </c:if>
-                <c:if test="${order.freight == -1}">
+                <c:if test="${order.freePostFlag == -1}">
                     到付
                 </c:if>
-                <c:if test="${order.freight == -2}">
+                <c:if test="${order.freePostFlag == -2}">
                     仪器到付-产品包邮
                 </c:if>
-                <c:if test="${order.freight != -1 && order.freight != 0 && order.freight != -2}">
+                <c:if test="${order.freePostFlag != -1 && order.freePostFlag != 0 && order.freePostFlag != -2}">
                     <fmt:formatNumber value="${order.freight}" type="currency"/>
                 </c:if>
+                <c:if test="${order.userBeans > 0}">
+                    <font color="red">(采美豆抵用:${order.userBeans})</font>
+                </c:if>
             </td>
         </tr>
         <tr>

+ 7 - 5
src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderConfirmReturnRecord.jsp

@@ -255,19 +255,21 @@
         </td>
         <td>
             运费:
-            <%--<fmt:formatNumber type="number" value="${order.freight}" pattern="0.00" maxFractionDigits="2" />--%>
-            <c:if test="${order.freight == 0}">
+            <c:if test="${order.freePostFlag == 0}">
                 包邮
             </c:if>
-            <c:if test="${order.freight == -1}">
+            <c:if test="${order.freePostFlag == -1}">
                 到付
             </c:if>
-            <c:if test="${order.freight == -2}">
+            <c:if test="${order.freePostFlag == -2}">
                 仪器到付-产品包邮
             </c:if>
-            <c:if test="${order.freight != -1 && order.freight != 0 && order.freight != -2}">
+            <c:if test="${order.freePostFlag != -1 && order.freePostFlag != 0 && order.freePostFlag != -2}">
                 <fmt:formatNumber value="${order.freight}" type="currency"/>
             </c:if>
+            <c:if test="${order.userBeans > 0}">
+                <font color="red">(采美豆抵用:${order.userBeans})</font>
+            </c:if>
         </td>
     </tr>
     <tr>

+ 7 - 4
src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderReturnRecord.jsp

@@ -365,19 +365,22 @@
                 </td>
                 <td>
                     机构运费:
-                    <c:if test="${order.freight == 0}">
+                    <c:if test="${order.freePostFlag == 0}">
                         包邮
                     </c:if>
-                    <c:if test="${order.freight == -1}">
+                    <c:if test="${order.freePostFlag == -1}">
                         到付
                     </c:if>
-                    <c:if test="${order.freight == -2}">
+                    <c:if test="${order.freePostFlag == -2}">
                         仪器到付-产品包邮
                     </c:if>
-                    <c:if test="${order.freight != -1 && order.freight != 0 && order.freight != -2}">
+                    <c:if test="${order.freePostFlag != -1 && order.freePostFlag != 0 && order.freePostFlag != -2}">
                         <fmt:formatNumber value="${order.freight}" type="currency"/>
                         <c:if test="${order.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
                     </c:if>
+                    <c:if test="${order.userBeans > 0}">
+                        <font color="red">(采美豆抵用:${order.userBeans})</font>
+                    </c:if>
                 </td>
             </tr>
             <tr>

+ 7 - 4
src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderReviewReturnRecord.jsp

@@ -335,18 +335,21 @@
         </td>
         <td>
             运费:
-            <c:if test="${order.freight == 0}">
+            <c:if test="${order.freePostFlag == 0}">
                 包邮
             </c:if>
-            <c:if test="${order.freight == -1}">
+            <c:if test="${order.freePostFlag == -1}">
                 到付
             </c:if>
-            <c:if test="${order.freight == -2}">
+            <c:if test="${order.freePostFlag == -2}">
                 仪器到付-产品包邮
             </c:if>
-            <c:if test="${order.freight != -1 && order.freight != 0 && order.freight != -2}">
+            <c:if test="${order.freePostFlag != -1 && order.freePostFlag != 0 && order.freePostFlag != -2}">
                 ¥<fmt:formatNumber type="number" value="${order.freight}" pattern="0.00" maxFractionDigits="2" />
             </c:if>
+            <c:if test="${order.userBeans > 0}">
+                <font color="red">(采美豆抵用:${order.userBeans})</font>
+            </c:if>
         </td>
     </tr>
     <tr>

+ 7 - 13
src/main/webapp/WEB-INF/views/modules/bulkpurchase/refundRecord.jsp

@@ -11,15 +11,6 @@
             margin-left: 0;
         }
 
-        #increase, #decrease, .lineNum {
-            width: 30px;
-            height: 30px;
-        }
-
-        .lineNum {
-            text-align: center;
-        }
-
         .dateInput input {
             width: 150px;
         }
@@ -187,18 +178,21 @@
         </td>
         <td>
             运费:
-            <c:if test="${order.freight == 0}">
+            <c:if test="${order.freePostFlag == 0}">
                 包邮
             </c:if>
-            <c:if test="${order.freight == -1}">
+            <c:if test="${order.freePostFlag == -1}">
                 到付
             </c:if>
-            <c:if test="${order.freight == -2}">
+            <c:if test="${order.freePostFlag == -2}">
                 仪器到付-产品包邮
             </c:if>
-            <c:if test="${order.freight != -1 && order.freight != 0 && order.freight != -2}">
+            <c:if test="${order.freePostFlag != -1 && order.freePostFlag != 0 && order.freePostFlag != -2}">
                 ¥<fmt:formatNumber value="${order.freight}" pattern="0.00"/>
             </c:if>
+            <c:if test="${order.userBeans > 0}">
+                <font color="red">(采美豆抵用:${order.userBeans})</font>
+            </c:if>
         </td>
     </tr>
     <tr>

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

@@ -311,10 +311,10 @@
                         </td>
                         <td colspan="2">
                             <fmt:formatNumber value="${so.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
-                            <c:if test="${so.differenceType eq 1}">
+                            <c:if test="${so.differenceType eq 1 && so.differencePrice > 0}">
                                 <font color="red">(需补差价¥${so.differencePrice})</font>
                             </c:if>
-                            <c:if test="${so.differenceType eq 2}">
+                            <c:if test="${so.differenceType eq 2 && so.differencePrice > 0}">
                                 <font color="red">(需退差价¥${so.differencePrice})</font>
                             </c:if>
                         </td>

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

@@ -35,6 +35,7 @@
 		<li class="active"><a href="${ctx}/order/cmPayShop/">付款列表</a></li>
 		<shiro:hasPermission name="order:cmPayShop:view">
             <li onclick="sessionStorage.removeItem('checkedIndexArr')"><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+			<li onclick="sessionStorage.removeItem('checkedIndexArr')"><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
         </shiro:hasPermission>
 	</ul>
 	<form:form id="searchForm" modelAttribute="cmPayShop" action="${ctx}/order/cmPayShop/" method="post" class="breadcrumb form-search">
@@ -77,6 +78,13 @@
 					<form:option value="9999" label="呵呵商城"/>
 					<form:options items="${cmUserOrganizeList}" itemLabel="organizeName" itemValue="id"
 								  htmlEscape="false"/>
+				</form:select>&nbsp;&nbsp;&nbsp;&nbsp;
+				<label>付款类型:</label>
+				<form:select path="paymentType" class="input-medium">
+					<form:option value="" label="请选择"/>
+					<form:option value="1" label="付款子订单"/>
+					<form:option value="2" label="供应商差价"/>
+					<form:option value="3" label="付第三方"/>
 				</form:select>
 				&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 				<div class="clearfix"></div>
@@ -89,6 +97,7 @@
 			<tr style="width:30%">
 				<th>付款单ID</th>
 				<th style="width:150px">付款单名称</th>
+				<th>付款类型</th>
 				<th>供应商</th>
 				<th>付款金额</th>
 				<th>子订单编号(ID)</th>
@@ -107,6 +116,9 @@
 			<tr>
 				<td>${cmPayShop.id}</td>
 				<td>${cmPayShop.name}</td>
+				<td>
+					${cmPayShop.paymentType eq 2 ? "供应商差价":(cmPayShop.paymentType eq 3 ? "付第三方":"子订单付款")}
+				</td>
 				<td>${cmPayShop.shopName}</td>
 				<td>
 					<fmt:formatNumber value="${cmPayShop.totalAmount}" type="number" pattern="#,##0.00"/>
@@ -171,7 +183,12 @@
 					</shiro:hasPermission>
 					<c:if test="${cmPayShop.status == '0'}">
 						<shiro:hasPermission name="order:cmPayShop:apply">
-							<a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">申请付款</a>
+							<c:if test="${cmPayShop.paymentType ne 3 && cmPayShop.paymentType ne 2}">
+								<a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">申请付款</a>
+							</c:if>
+							<c:if test="${cmPayShop.paymentType eq 3 && cmPayShop.paymentType ne 2}">
+								<a class="td-a" href="${ctx}/order/cmPayShop/shopOtherApplyEdit?payShopId=${cmPayShop.id}">申请付款</a>
+							</c:if>
 						</shiro:hasPermission>
 						<shiro:hasPermission name="order:cmPayShop:cancel">
 							<a class="td-a" href="${ctx}/order/cmPayShop/cancel?id=${cmPayShop.id}"
@@ -189,9 +206,13 @@
 					</c:if>
 					<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.rePayment == '1' && cmPayShop.paymentType ne 2}">
+								<c:if test="${cmPayShop.paymentType ne 3}">
+									<a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">重申付款</a>
+								</c:if>
+								<c:if test="${cmPayShop.paymentType eq 3}">
+									<a class="td-a" href="${ctx}/order/cmPayShop/shopOtherApplyEdit?payShopId=${cmPayShop.id}">重申付款</a>
+								</c:if>
 							</c:if>
 							<c:if test="${cmPayShop.rePayment == '2'}">重申付款</c:if>
 						</shiro:hasPermission>

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

@@ -239,9 +239,9 @@
 					<td>
 						<b>供应商运费:</b><input type="number" id="shopPostFee" name="shopPostFee"  onchange="changeShouldPay(this)"  value="${newShopOrder.shopPostFee}" style="margin-left: 20px"/>
 					</td>
-					<%--<td>
-						<b>付第三方:</b><input type="number" id="shopOtherFee" name="shopOtherFee"  onchange="inputnum(this)"  value="${newShopOrder.shopOtherFee}" style="margin-left: 5px;"/>
-					</td>--%>
+					<td>
+						<b>付第三方:</b><input type="number" id="shopOtherFee" name="shopOtherFee"  onchange="inputnum(this)"  value="${newShopOrder.shopOtherFee}" style="margin-left: 5px;" ${(!newShopOrder.payShopOtherFee || payShopOtherFee > 0) ? 'readonly="true"':""}/>
+					</td>
 				</tr>
 				<tr>
 					<td style="padding-top: 10px;">

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

@@ -170,10 +170,10 @@
 						<td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
 						<td colspan="2" class="supplier-fee">
 							<div>应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
-								<c:if test="${s.differenceType eq 1}">
+								<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
 									<font color="red">(需补差价¥${s.differencePrice})</font>
 								</c:if>
-								<c:if test="${s.differenceType eq 2}">
+								<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
 									<font color="red">(需退差价¥${s.differencePrice})</font>
 								</c:if>,
 								 已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
@@ -264,7 +264,7 @@
 		</div>
 		<div class="payment-form-bottom">
 			<div >
-				<label style="font-weight: bold; font-size:18px">付供应商总金额:</label>
+				<label style="font-weight: bold; font-size:18px">${cmPayShop.paymentType eq 2 ? "需补供应商差价":"付供应商总金额"}:</label>
 				<span id="totalAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber value="${cmPayShop.totalAmount}" pattern="#,##0.00"/> </span>
 				<c:if test="${cmPayShop.wipePayment > 0}">
 					<span class="red">(付款抹平总额:¥<fmt:formatNumber value="${cmPayShop.wipePayment}" pattern="#,##0.00"/>)</span>

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

@@ -181,10 +181,10 @@
 					<td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
 					<td colspan="2" class="supplier-fee">
 						<div>应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
-							<c:if test="${s.differenceType eq 1}">
+							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
 								<font color="red">(需补差价¥${s.differencePrice})</font>
 							</c:if>
-							<c:if test="${s.differenceType eq 2}">
+							<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
 								<font color="red">(需退差价¥${s.differencePrice})</font>
 							</c:if>,
 							 已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
@@ -193,7 +193,7 @@
 							<c:if test="${s.refundAmount > 0}">
 								<span style="color:red">退款:<fmt:formatNumber value="${s.refundAmount}" type="number" pattern="#,##0.00"/></span>,
 							</c:if>
-							待付: <fmt:formatNumber value="${s.wipePayment>0 ? 0 : s.waitPayShop}" type="number" pattern="#,##0.00"/>
+							待付: <fmt:formatNumber value="${s.wipePayment > 0 ? 0 : (s.differenceType eq 1 ? (s.differencePrice + s.waitPayShop):(s.waitPayShop - s.differencePrice))}" type="number" pattern="#,##0.00"/>
 						</div>
 						<c:if test="${s.wipePayment > 0}">
 							<div>
@@ -275,7 +275,7 @@
 		</div>
 		<div class="payment-form-bottom">
 			<div >
-				<label style="font-weight: bold; font-size:18px">付供应商总金额:</label>
+				<label style="font-weight: bold; font-size:18px">${cmPayShop.paymentType eq 2 ? "需补供应商差价":"付供应商总金额"}:</label>
 				<span id="totalAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber value="${cmPayShop.totalAmount}" pattern="#,##0.00"/> </span>
 				<c:if test="${cmPayShop.wipePayment > 0}">
 					<span class="red">(付款抹平总额:¥<fmt:formatNumber value="${cmPayShop.wipePayment}" pattern="#,##0.00"/>)</span>

+ 9 - 12
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;}
@@ -174,8 +165,14 @@
                         <td colspan="2" class="payCm-t"></td>
                         <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
                         <td colspan="2" class="supplier-fee">
-                            <div>应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>,
-                                 已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
+                            <div>应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
+                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                                    <font color="red">(需补差价¥${s.differencePrice})</font>
+                                </c:if>
+                                <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                                    <font color="red">(需退差价¥${s.differencePrice})</font>
+                                </c:if>
+                                ,已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
                             </div>
                             <div>待付:<fmt:formatNumber value="${s.wipePayment>0 ? 0 : s.waitPayShop}" type="number" pattern="#,##0.00"/></div>
 							<c:if test="${s.wipePayment > 0}">
@@ -253,7 +250,7 @@
         </div>
         <div class="payment-form-bottom">
             <div>
-                <label style="font-weight: bold; font-size:18px">付供应商总金额:</label>
+                <label style="font-weight: bold; font-size:18px">${cmPayShop.paymentType eq 2 ? "需补供应商差价":"付供应商总金额"}:</label>
                 <span id="totalAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber value="${cmPayShop.totalAmount}" pattern="#,##0.00"/> </span>
 				<c:if test="${cmPayShop.wipePayment > 0}">
 					<span class="red">(付款抹平总额:¥<fmt:formatNumber value="${cmPayShop.wipePayment}" pattern="#,##0.00"/>)</span>

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

@@ -194,10 +194,10 @@
 					<td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
 					<td colspan="2" class="supplier-fee">
 						<div><span class="nowrap">应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" pattern="#,##0.00"/>
-							<c:if test="${s.differenceType eq 1}">
+							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
 								<font color="red">(需补差价¥${s.differencePrice})</font>
 							</c:if>
-							<c:if test="${s.differenceType eq 2}">
+							<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
 								<font color="red">(需退差价¥${s.differencePrice})</font>
 							</c:if>,</span>
 							 <span class="nowrap">已付:${s.payedShopAmount},</span></div>
@@ -275,7 +275,7 @@
 		<div class="inputForm">
 			<table border="0" cellspacing="0" cellpadding="0" width="100%">
 				<tr>
-					<th><span style="font-weight:bold;font-size:18px">付供应商总金额:</span></th>
+					<th><span style="font-weight:bold;font-size:18px">${cmPayShop.paymentType eq 2 ? "需补供应商差价":"付供应商总金额"}:</span></th>
 					<td colspan="3">
 						<span id="totalAmount" style="font-weight: bold;font-size:18px"><fmt:formatNumber value="${cmPayShop.totalAmount}" pattern="#,##0.00"/></span>
 						<span class="wipeVisible">(付款抹平总额:<em class="red wipeTotalFee">¥0.00</em>)</span>

+ 34 - 13
src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp

@@ -13,10 +13,6 @@
             text-align: center
         }
 
-        #searchForm {
-            white-space: nowrap
-        }
-
         .pay-wrapper {
             padding: 0 10px
         }
@@ -50,7 +46,7 @@
         }
 
         .t-btn {
-            width: 70px;
+            width: 100px;
             height: 30px;
             -webkit-border-radius: 5px;
             -moz-border-radius: 5px;
@@ -299,6 +295,7 @@
     <c:if test="${operatingMode == '1'}">
         <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
         <li class="active tab-li"><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+        <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
     </c:if>
     <c:if test="${operatingMode == '2'}">
         <li><a href="${ctx}/order/cmRefundShop/">退款列表</a></li>
@@ -357,6 +354,7 @@
     <button id="select-all" style="color:white;background-color:#2F6FAB">全选</button>
     <c:if test="${operatingMode == '1'}">
         <button id="apply" class="t-btn" style="color:white;background-color:#2F6FAB">付款申请</button>
+        <button id="applyShopOtherFee" class="t-btn" style="color:white;background-color:#2F6FAB">付第三方申请</button>
     </c:if>
     <c:if test="${operatingMode == '2'}">
         <button id="refund" class="t-btn">已付退款</button>
@@ -375,10 +373,10 @@
                             </c:if>
                             <c:if test="${s.paying ne '1' && s.payStatus ne '3' }">
                                 <input type="checkbox" ${s.status eq 7 ?'disabled':''}
-                                       data-shoporderid="${s.shopOrderID}" data-shopid="${s.shopID}"/>
+                                       data-shoporderid="${s.shopOrderID}" data-shopid="${s.shopID}" data-isPayShopOtherFee="${s.payShopOtherFee}"/>
                             </c:if>
                         </c:if>
-                        <c:if test="${operatingMode == '2'}">
+<%--                        <c:if test="${operatingMode == '2'}">
                             <c:if test="${s.refunding == '1'}">
                                 退款中
                             </c:if>
@@ -387,12 +385,12 @@
                             </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'}">
                             ${sIndex.index + 1}
-                        </c:if>
+                        </c:if>--%>
                     </th>
                     <th>子订单编号(ID)</th>
                     <th colspan="3">订单编号(ID)</th>
@@ -474,6 +472,9 @@
                             <fmt:formatNumber value="${s.freight}" type="currency"/>
                             <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
                         </c:if>
+                        <c:if test="${s.userBeans > 0}">
+                            <br><font color="red">(采美豆抵用:${s.userBeans})</font>
+                        </c:if>
                     </td>
                     <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
                                                           pattern="#,##0.00"/></td>
@@ -487,10 +488,10 @@
                                                                     pattern="#,##0.00"/></td>
                     <td class="supplier-fee">
                         <font color="#E15616"><fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/></font>
-                        <c:if test="${s.differenceType eq 1}">
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
                             <font color="red">(需补差价¥${s.differencePrice})</font>
                         </c:if>
-                        <c:if test="${s.differenceType eq 2}">
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
                             <font color="red">(需退差价¥${s.differencePrice})</font>
                         </c:if>
                     </td>
@@ -580,10 +581,9 @@
                         <a href="${ctx}/shopOrder/toChangePayShopAmount?shopOrderID=${s.shopOrderID}">修改成本</a>
                     </shiro:hasPermission>
                 </c:if>
-                <c:if test="${s.modifyPayable and s.paying ne '1'}">
+                <c:if test="${(s.modifyPayable and s.paying ne '1') || s.payStatus eq '2'}">
                     <a href="${ctx}/order/cmPayShop/differencePriceForm?shopOrderId=${s.shopOrderID}">供应商差价</a>
                 </c:if>
-                <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">
@@ -885,6 +885,27 @@
             window.location.href = '${ctx}/order/cmPayShop/applyEdit' + params;
         });
 
+        //付第三方
+        $('#applyShopOtherFee').on('click', function () {
+            var checked = $('.pay-wrapper input[type=checkbox]:checked');
+            if (checked.length < 1) {
+                alertx('请选择一个子订单');
+                return false;
+            }
+            if (checked.length > 1) {
+                alertx('每次只能选择一个子订单进行付第三方申请');
+                return false;
+            }
+            var isPayShopOtherFee = $(checked[0]).attr('data-isPayShopOtherFee');
+            if ("false" == isPayShopOtherFee) {
+                alertx("付第三方处于待审核状态,暂不能操作");
+                return false;
+            }
+            var shopOrderId = $(checked[0]).attr('data-shoporderid');
+
+            window.location.href = '${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=' + shopOrderId;
+        });
+
         $('#refund').on('click', function () {
             var checked = $('.pay-wrapper input[type=checkbox]:checked'), params = '?';
             for (var i = 0; i < checked.length; i++) {

+ 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>

+ 121 - 0
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherDetail.jsp

@@ -0,0 +1,121 @@
+<%--
+<%@ 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/applyDetail?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>${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>
+    </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>

+ 402 - 0
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherForm.jsp

@@ -0,0 +1,402 @@
+<%@ 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;
+        }
+
+        .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() {
+            $("#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 class="active"><a>提交付款单</a></li>
+</ul>
+<form:form id="inputForm" modelAttribute="payShopOther" action="${ctx}/order/cmPayShop/saveShopOtherFee" method="post" class="form-horizontal">
+    <form:hidden path="shopOrderId"/>
+    <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">
+            <form:input path="name" htmlEscape="false" maxlength="250" class="input-xlarge required"/>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color='red'>*</font>付第三方金额:</label>
+        <div class="controls">
+            <input type="number" id="shopOtherFee" required name="shopOtherFee" value="${payShopOther.shopOtherFee}" onchange="changeShouldPay(this)"/>
+        </div>
+    </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 >${payShopOther.remark}</textarea>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label">图片:</label>
+        <div class="controls upload-content" style="margin: -91px 0px 0px 16px;" id="remarkImageBox">
+            <div class="conList">
+                <form:hidden id="remarkImage1" path="remarkImages" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="remarkImage1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+            </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>

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

@@ -0,0 +1,161 @@
+<%@ 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>
+        a[href]:after {
+            content: none !important;
+        }
+        .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/applyDetail?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>
+        <div class="check-btn">
+            <button class="export apply-btn btn btn-primary">打印</button>
+        </div>
+    </c:if>
+</div>
+<script>
+    (function(){
+        $('.export').on('click',function() {
+            window.print();
+        })
+    })()
+</script>
+</body>
+</html>

+ 9 - 3
src/main/webapp/WEB-INF/views/modules/order/cmPayShopPrintDetail.jsp

@@ -169,8 +169,14 @@
 						<c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if></td>
 					<td class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
 					<td class="supplier-fee">
-						<div>应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>,
-							 已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
+						<div>应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
+							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+								<font color="red">(需补差价¥${s.differencePrice})</font>
+							</c:if>
+							<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+								<font color="red">(需退差价¥${s.differencePrice})</font>
+							</c:if>
+							,已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
 						</div>
 						<div>
 							<c:if test="${s.refundAmount > 0}">
@@ -229,7 +235,7 @@
 		</div>
 		<div class="payment-form-bottom">
 			<div>
-				<label style="font-weight: bold; font-size:18px">付供应商总金额:</label>
+				<label style="font-weight: bold; font-size:18px">${cmPayShop.paymentType eq 2 ? "需补供应商差价":"付供应商总金额"}:</label>
 				<span id="totalAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber value="${cmPayShop.totalAmount}" pattern="#,##0.00"/> </span>
 				<c:if test="${cmPayShop.wipePayment > 0}">
 					<span class="red">(付款抹平总额:¥<fmt:formatNumber value="${cmPayShop.wipePayment}" pattern="#,##0.00"/>)</span>

+ 107 - 17
src/main/webapp/WEB-INF/views/modules/order/differencePriceForm.jsp

@@ -200,25 +200,44 @@
                             inputTotalAmount += Number(thisAmount.val());
                             console.log('===', inputTotalAmount);
                         });
-                        if (Number(inputTotalAmount - differencePrice + waitPayShop) > 0.1) {
+                        if (Number(differencePrice - inputTotalAmount - 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();
+                    if (type == 1 && ${payShopDifference.payStatus eq 3}){
+                        var bankAccountName = $("#bankAccountName").val();
+                        if (bankAccountName == '' || bankAccountName == null){
+                            alertx("开户名不能为空");
+                            return false;
+                        }
+                        var bankAccount = $("#bankAccount").val();
+                        if (bankAccount == '' || bankAccount == null){
+                            alertx("账号不能为空");
+                            return false;
+                        }
+                        var bankName = $("#bankName").val();
+                        if (bankName == '' || bankName == null){
+                            alertx("开户行不能为空");
+                            return false;
+                        }
+                        var payShopCheckbox = $('.payShop-checkbox:checked');
+                        var totalAmount = 0;
+                        payShopCheckbox.each(function () {
+                            if ($(this).val() == 1){
+                                totalAmount += Number($('input[name=transferPayFee]').val());
                             }
-                            return;
-                        }, {buttons: {'取消': false, '确定': true}});
-                    } else {*/
-                        loading('正在提交,请稍等...');
-                        form.submit();
-                    /*}*/
+                            if ($(this).val() == 2){
+                                totalAmount += Number($('input[name=balancePayFee]').val());
+                            }
+                        });
+                        if (totalAmount != differencePrice){
+                            alertx("转账支付金额与欠款抵扣金额之和不等于差价,不能提交");
+                            return false;
+                        }
+                    }
+                    loading('正在提交,请稍等...');
+                    form.submit();
                 },
                 errorContainer: "#messageBox",
                 errorPlacement: function(error, element) {
@@ -244,9 +263,21 @@
     <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('“少付”指成本变高了,按旧成本付款的话相当于会少付供应商,但是线上支付的订单不能修改成本,所以通过补差价的方式来弥补;“多付”指成本变低了,按旧成本付款的话相当于会多付供应商,但是线上支付的订单不能修改成本,所以通过退差价的方式来弥补。')">
+            <input type="radio" name="type" value="1" ${(payShopDifference.differencePrice > 0 && payShopDifference.type eq 2) ? 'disabled="disabled"':'checked="true"'} onclick="showInfo()">少付&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            <input type="radio" name="type" value="2" ${(payShopDifference.differencePrice > 0 && payShopDifference.type eq 1) ? 'disabled="disabled"':'checked="true"'} onclick="showInfo()">多付&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            <img src="/static/images/info.jpg" style="height: 20px;width: 20px" onclick="alertx('“少付”指成本变高了,按旧成本付款的话相当于会少付供应商,\n'+
+'在已不能修改成本的情况下,通过补差价的方式来弥补;\n'+
+'\n'+
+'“多付”指成本变低了,按旧成本付款的话相当于会多付供应商,\n'+
+'在已不能修改成本的情况下,通过退差价的方式来弥补。\n'+
+'\n'+
+'特别注意:一个子订单可以申请多次供应商差价,但是每次只能选择同一种差价类型。若要修改差价类型,需要将该子订单的所有供应商差价付款单取消后才能操作')">
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color='red'>*</font>付款单名称:</label>
+        <div class="controls">
+            <form:input path="name" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
+        </div>
     </div>
     <div class="control-group">
         <label class="control-label"><font color='red'>*</font>差价金额:</label>
@@ -255,6 +286,46 @@
             <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(目前子订单待付金额为¥${payShopDifference.waitPayShop})</label>
         </div>
     </div>
+    <c:if test="${payShopDifference.payStatus eq 3}">
+        <div id="payShopShow">
+            <div class="control-group">
+                <label class="control-label"><font color='red'>*</font>付款方式:</label>
+                <input type="checkbox" class="payShop-checkbox" value="1" checked>转账支付
+            </div>
+            <div style="margin-left: 80px">
+                <div class="control-group">
+                    <label class="control-label"><font color='red'>*</font>转账金额:</label>
+                    <div class="controls">
+                        <input type="number" name="transferPayFee" value="" 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" id="bankAccountName" htmlEscape="false" maxlength="100" class="input-xlarge"/>&nbsp;&nbsp;&nbsp;&nbsp;
+                    <label><font color='red'>*</font>账号:</label>
+                    <form:input path="bankAccount" id="bankAccount" htmlEscape="false" maxlength="100" class="input-xlarge"/>
+                </div>
+                <div class="control-group">
+                    <label class="control-label"><font color='red'>*</font>开户行:</label>&nbsp;&nbsp;&nbsp;&nbsp;
+                    <form:input path="bankName" id="bankName" htmlEscape="false" maxlength="100" class="input-xlarge"/>&nbsp;&nbsp;&nbsp;&nbsp;
+                    <label><font color='red'>*</font>账户类型:</label>
+                    <form:select path="bankType" class="select-ele input-xlarge">
+                        <form:option value="0" label="公账"/>
+                        <form:option value="1" label="私账"/>
+                    </form:select>
+                </div>
+            </div>
+            <div style="margin-left: 160px">
+                <div class="control-group">
+                    <input type="checkbox" class="payShop-checkbox" value="2">欠款抵扣
+                </div>
+                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总欠款:<span id="rebateAmount">${payShopDifference.rebateAmount}</span>,
+                可用抵扣欠款:<span id="ableRebateAmount">${payShopDifference.ableRebateAmount}</span>,
+                使用:<input type="number" value="${payShopDifference.balancePayFee}" name="balancePayFee" class="used-amount">,
+                剩余:<span id="remainingBalance">${payShopDifference.ableRebateAmount}</span>
+            </div>
+        </div><br>
+    </c:if>
     <div class="control-group" id="refundShow" hidden>
         <div class="refund-methods">
             <label class="control-label">接收退款方式:</label>
@@ -401,6 +472,23 @@
                 })
             },500);
         });
+
+        //使用余额<总余额
+        $('body').on('input propertychange','.used-amount',function() {
+            var thisEle = $(this),
+                thisVal = Number(thisEle.val()),
+                totalAmount = Number($('#differencePrice').val()),
+                ableRebateAmount = Number($('#ableRebateAmount').text());
+            if (totalAmount === 0){
+                alertx("请输入差价金额");
+                thisEle.val(0);
+            }else if (thisVal > ableRebateAmount || thisVal > totalAmount){
+                thisEle.val(0);
+            }else {
+                $('#remainingBalance').text(ableRebateAmount - thisVal);
+            }
+        });
+        showInfo();
     });
 
     /**
@@ -415,7 +503,9 @@
         var type = $("input[name='type']:checked").val();
         if (type == 1){
             $("#refundShow").hide();
+            $("#payShopShow").show();
         } else {
+            $("#payShopShow").hide();
             var differencePrice = $("#differencePrice").val();
             var waitPayShop = ${payShopDifference.waitPayShop};
             if (differencePrice > waitPayShop) {

+ 7 - 0
src/main/webapp/WEB-INF/views/modules/order/differencePriceRemark.jsp

@@ -113,6 +113,13 @@
             <div>
                 <ul>差价类型:${difference.type eq 1 ? "少付":"多付"}</ul>
                 <ul>差价金额:${difference.differencePrice}</ul>
+                <c:if test="${not empty difference.payShopId}">
+                    <ul>付款单名称:${difference.name}</ul>
+                    <ul>转账支付:${difference.transferPayFee}</ul>
+                    <ul>开户名:${difference.bankAccountName} <span style="margin-left: 100px">账号:${difference.bankAccount}</span></ul>
+                    <ul>开户行:${difference.bankName}  <span style="margin-left: 100px">账户类型:${difference.bankType eq 0 ? "公账":"私账"}</span></ul>
+                    <ul>欠款抵扣:${difference.balancePayFee}</ul>
+                </c:if>
                 <c:if test="${not empty difference.refundShop}">
                     <ul>接收退款方式:</ul>
                     <div style="margin-left: 100px">

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

@@ -1129,7 +1129,7 @@
                         <%--                        <a href="javascript:void(0);" onclick="remarks('${order.orderID}','')">备注</a>--%>
                         <%--包含订单充值商品就不显示--%>
                         <c:if test="${empty order.rechargeGoods}">
-                            <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6 && order.status ne 4}">
+                            <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6}">
                                 <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}">发货记录</a>
                             </c:if>
                             <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 6}">

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

@@ -4,7 +4,6 @@
 <head>
     <title>订单列表</title>
     <meta name="decorator" content="default"/>
-    <%--<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>--%>
     <style type="text/css">
         *{margin:0;padding:0}
         a{list-style:none;text-decoration:none}
@@ -273,6 +272,9 @@
             <c:if test="${order.freePostFlag != -1 && order.freePostFlag != 0 && order.freePostFlag != -2}">
                 <fmt:formatNumber value="${order.freight}" type="currency"/>
             </c:if>
+            <c:if test="${order.userBeans > 0}">
+                <font color="red">(采美豆抵用:${order.userBeans})</font>
+            </c:if>
         </td>
         <td style="position: relative;"><a class="operation-btn btn">功能</a>
             <div class="operation-block">
@@ -368,7 +370,7 @@
                     <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2">订单备注</a>
                     <%--包含订单充值商品就不显示--%>
                     <c:if test="${empty order.rechargeGoods}">
-                        <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6 && order.status ne 4}">
+                        <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6}">
                             <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}">发货记录</a>
                         </c:if>
                         <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 6}">

+ 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">

+ 582 - 0
src/main/webapp/WEB-INF/views/modules/order/paidShopOrderList.jsp

@@ -0,0 +1,582 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>申请付款</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        .pay-wrapper {
+            padding: 0 10px
+        }
+
+        .pay-list-item {
+            margin-bottom: 30px
+        }
+
+        .pay-table th {
+            background: #f9f9f9
+        }
+
+        .pay-table tr:first-child th {
+            background: #eee !important
+        }
+
+        .pay-table td {
+            background: #fff !important
+        }
+
+        input[type="checkbox"]::before {
+            content: '\a0';
+            display: inline-block;
+            vertical-align: .2em;
+            width: .8em;
+            height: .8em;
+            margin-right: .2em;
+            border-radius: .2em;
+            text-indent: .15em;
+            line-height: .65
+        }
+
+        .t-btn {
+            width: 120px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            background: #fff;
+            border: 1px solid #ddd;
+            margin-bottom: 10px
+        }
+
+        #select-all {
+            width: 70px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            background: #fff;
+            border: 1px solid #ddd;
+            margin-bottom: 10px
+        }
+
+        #select-all:active {
+            background: #3daae9;
+            color: #fff
+        }
+
+        .pay-more-func {
+            float: right;
+            color: #2fa4e7;
+            cursor: pointer
+        }
+
+        .pay-more-func span:first-child {
+            margin-right: 6px
+        }
+
+        .pay-more-func span:hover {
+            color: #7aa9c3
+        }
+
+        .mask {
+            width: 100%;
+            height: 100%;
+            position: fixed;
+            top: 0;
+            background: rgba(0, 0, 0, 0.7);
+            display: none
+        }
+
+        .revise-popup-content, .tips-popup-content {
+            width: 40%;
+            height: auto;
+            padding-bottom: 30px;
+            background: #fff;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%)
+        }
+
+        .revise-popup-content {
+            width: 450px;
+            height: 360px;
+            overflow-y: scroll;
+            padding: 0 15px 30px 15px
+        }
+
+        .tips-popup-content {
+            width: 30%
+        }
+
+        .tips-popup-content p {
+            text-align: center;
+            padding: 80px;
+            font-size: 20px
+        }
+
+        .revise-popup-content h4, .tips-popup-content h4 {
+            padding-left: 10px;
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px solid #eee;
+            margin-bottom: 20px
+        }
+
+        .revise-popup-content div {
+            margin-top: 7px;
+            text-align: center
+        }
+
+        .revise-popup-content label {
+            width: 70px;
+            text-align: right;
+            vertical-align: text-bottom
+        }
+
+        .revise-popup-content button {
+            width: 80px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:first-child {
+            margin-left: -104px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:last-child {
+            margin-left: 30px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span span {
+            margin-left: 10px
+        }
+
+        .revise-popup-content > div:last-child {
+            text-align: center;
+            margin-top: 20px
+        }
+
+        .revise-popup-content input {
+            width: 100px;
+            margin-bottom: 0px
+        }
+
+        .tips-input-wrapper {
+            width: 100px
+        }
+
+        .pay-status {
+            height: 40px;
+            line-height: 40px;
+            display: block
+        }
+
+        .form-search label {
+            width: 80px;
+            text-align: left;
+            margin-top: 12px
+        }
+
+        .remark-textarea {
+            width: 95%;
+            height: 100px;
+            resize: none
+        }
+
+        .remark-title {
+            text-align: left !important
+        }
+
+        .remark-title span {
+            color: red
+        }
+
+        .ul-form {
+            white-space: nowrap;
+            margin-left: -10px !important
+        }
+
+        .ul-form label {
+            width: 90px;
+            text-align: left;
+            margin-top: 15px
+        }
+
+        .time-space-symbols {
+            width: 100px;
+            display: inline-block;
+            text-align: center
+        }
+
+        #btnSubmit {
+            width: 128px;
+            margin-left: 165px
+        }
+
+        .pay-status label {
+            margin-left: 0
+        }
+
+        .pay-status label:first-child {
+            margin-left: 10px
+        }
+
+        .weishaIcon {background:darkorange;color:white;margin:0 0px;padding:0 3px;font-style:normal;font-size: 12px; display:inline-block;border-radius:2px}
+
+    </style>
+    <script type="text/javascript">
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
+    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+    <li class="active tab-li"><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
+</ul>
+<form:form id="searchForm" onsubmit="submitFunc()" modelAttribute="newShopOrder"
+           action="${ctx}/shopOrder/payOrderList?operatingMode=${operatingMode
+}" method="post" class="breadcrumb form-search">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <div class="ul-form">
+        <label>子订单ID:</label>
+        <form:input path="shopOrderID" htmlEscape="false" onkeyup="onlynum(this)" maxlength="8" class="input-medium"/>
+        <label>子订单编号:</label>
+        <form:input path="shopOrderNo" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label>订单ID:</label>
+        <form:input path="orderID" htmlEscape="false" onkeyup="onlynum(this)" maxlength="8" class="input-medium"/>
+        <label>订单编号:</label>
+        <form:input path="orderNo" htmlEscape="false" maxlength="20" class="input-medium"/><br>
+        <label>供应商:</label>
+        <form:input path="shopName" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label>机构:</label>
+        <form:input path="clubName" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label class="control-label">下单时间:</label>
+        <form:input path="startTime" type="text" maxlength="10" class="input-medium Wdate" value="${startTime}"
+                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+        <span class="time-space-symbols">至</span>
+        <form:input path="endTime" type="text" maxlength="10" class="input-medium Wdate" value="${endTime}"
+                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+        <div class="pay-status">
+            <label>组织:</label>
+            <form:select path="organizeID" class="input-medium">
+                <form:option value="" label="请选择"/>
+                <form:option value="0" label="采美"/>
+                <form:option value="9999" label="呵呵商城"/>
+                <form:options items="${cmUserOrganizeList}" itemLabel="organizeName" itemValue="id" htmlEscape="false"/>
+            </form:select>
+            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<div class="pay-wrapper">
+    <button id="applyShopOtherFee" class="t-btn" style="color:white;background-color:#2F6FAB">付第三方申请</button>
+    <button id="applyDifferencePrice" class="t-btn" style="color:white;background-color:#2F6FAB">供应商差价申请</button>
+    <c:forEach items="${page.list}" var="s" varStatus="sIndex">
+        <div class="pay-list-item">
+            <table class="table table-striped table-bordered table-condensed pay-table">
+                <tr>
+                    <th style="width:20px;">
+                        <input type="checkbox" ${s.status eq 7 ?'disabled':''} data-shoporderid="${s.shopOrderID}" data-shopid="${s.shopID}" data-isPayShopOtherFee="${s.payShopOtherFee}"/>
+                    </th>
+                    <th>子订单编号(ID)</th>
+                    <th colspan="3">订单编号(ID)</th>
+                    <th colspan="2">订单金额</th>
+                    <th colspan="3">下单时间</th>
+                    <th>收款状态</th>
+                    <th>收款金额</th>
+                    <th colspan="3">经理折扣</th>
+                    <th colspan="2">成本类型</th>
+                </tr>
+                <tr>
+                    <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></td>
+                    <td colspan="3"><a href="${ctx}/order/detail?id=${s.orderID}">${s.orderNo}(${s.orderID})</a></td>
+                    <td colspan="2"><fmt:formatNumber value="${s.payTotalFee}" type="number" pattern="#,##0.00"/></td>
+                    <td colspan="3">${s.orderTime}</td>
+                        <%--此处对应订单列表收款状态--%>
+                    <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">
+                        <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
+                        <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
+                        <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
+                    </td>
+                    <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">${s.receiptTotalFee}</a></td>
+                    <td colspan="3">
+                        <c:if test="${s.discountTotalFee gt 0}">
+                            <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
+                                <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
+                                                  type="currency"/>
+                            </c:if>
+                            <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
+                                ¥0.00
+                            </c:if>
+                            <c:if test="${s.returnedPurchaseTotalFee gt 0}">
+                                <span style="color: red">
+                                    (原<fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>,因退货折扣取消
+                                    <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
+                                        <fmt:formatNumber value="${s.returnedPurchaseTotalFee}" type="currency"/>
+                                    </c:if>
+                                    <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
+                                        <fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>
+                                    </c:if>)
+                                </span>
+                            </c:if>
+                        </c:if>
+                        <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
+                    </td>
+                    <td colspan="2"><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
+                            test="${s.costType == '2'}">比例成本</c:if></td>
+                </tr>
+                <tr>
+                    <th>供应商</th>
+                    <th colspan="3">机构</th>
+                    <th>机构运费</th>
+                    <th>供应商运费</th>
+                    <th colspan="3">商品费</th>
+                    <th colspan="2">付款状态</th>
+                    <th colspan="3">应付税费</th>
+                    <th>付供应商</th>
+                    <th>付第三方</th>
+                </tr>
+                <tr>
+                    <td>${s.shopName}</td>
+                    <td colspan="3">
+                        <c:if test="${s.organizeID eq 1}"><span class="org-note">星范</span></c:if>
+                            ${s.clubName}
+                        <c:if test="${s.orderType eq 2}"><font color="red">(呵呵商城)</font></c:if>
+                        <c:if test="${s.organizeID == 3}"><em class="weishaIcon">维沙</em></c:if>
+                    </td>
+                    <td>
+                        <c:if test="${s.freight == 0}">
+                            包邮
+                        </c:if>
+                        <c:if test="${s.freight == -1}">
+                            到付
+                        </c:if>
+                        <c:if test="${s.freight == -2}">
+                            仪器到付-产品包邮
+                        </c:if>
+                        <c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
+                            <fmt:formatNumber value="${s.freight}" type="currency"/>
+                            <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
+                        </c:if>
+                        <c:if test="${s.userBeans > 0}">
+                            <br><font color="red">(采美豆抵用:${s.userBeans})</font>
+                        </c:if>
+                    </td>
+                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                                                          pattern="#,##0.00"/></td>
+                    <td colspan="3" class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number"
+                                                                          pattern="#,##0.00"/></td>
+                    <td colspan="2"><c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
+                            color="red">待付款</font></c:if>
+                        <c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
+                        <c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if></td>
+                    <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number"
+                                                                    pattern="#,##0.00"/></td>
+                    <td class="supplier-fee">
+                        <font color="#E15616"><fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/></font>
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <font color="red">(需补差价¥${s.differencePrice})</font>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <font color="red">(需退差价¥${s.differencePrice})</font>
+                        </c:if>
+                    </td>
+                    <input type="hidden" class="payedShopAmount" value="${s.payedShopAmount}">
+                    <input type="hidden" class="productAmount" value="${s.productAmount}">
+                    <input type="hidden" class="costType" value="${s.costType}">
+                    <input type="hidden" class="proportional" value="${s.proportional}">
+                    <input type="hidden" class="modifyShouldPayNote" value="${s.modifyShouldPayNote}">
+                    <td class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number"
+                                                                  pattern="#,##0.00"/></td>
+                </tr>
+                <tr>
+                    <th>商品名</th>
+                    <th>规格</th>
+                    <th>数量<%--(赠品)--%></th>
+                    <th>退货</th>
+                    <th colspan="2">单价</th>
+                    <th colspan="3">机构税率 / 单税费 / 总税费</th>
+                    <th colspan="2">总价</th>
+                    <th colspan="3">供应商税率 / 单税费 / 总税费</th>
+                    <th>成本(单)</th>
+                    <th>成本(总)</th>
+                </tr>
+                <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
+                    <tr class="pay-product-item">
+                        <input type="hidden" class="p-copId" value="${p.orderProductID}">
+                        <td style="width:300px;" class="p-name">
+                            <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
+                            <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
+                                ${p.name}
+                        </td>
+                        <td style="width:80px;">${p.unit}</td>
+                        <td class="p-num" data-num="${p.num + p.presentNum}">
+                                ${p.num}
+                            <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
+                        </td>
+                        <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
+                        <td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                                                          type="number" pattern="#,##0.00"/>
+                            <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
+                                <label style="color: red">
+                                    (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+                                </label>
+                            </c:if>
+                        </td>
+                        <td>${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.taxRate?0.0:p.taxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
+                        <td>${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.addedValueTax ?0.00:p.addedValueTax}</td>
+                        <td>
+                            <c:choose>
+                                <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
+                                    ---
+                                </c:when>
+                                <c:otherwise>
+                                    <fmt:formatNumber
+                                            value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}"
+                                            type="number" pattern="#,##0.00"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </td>
+                        <td colspan="2"><fmt:formatNumber
+                                value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
+                                type="number" pattern="#,##0.00"/></td>
+                        <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
+                        <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
+                        <td class="p-taxes-t">
+                            <c:choose>
+                                <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
+                                    ---
+                                </c:when>
+                                <c:otherwise>
+                                    <fmt:formatNumber
+                                            value="${empty p.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
+                                            type="number" pattern="#,##0.00"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </td>
+                        <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
+                                                                  pattern="#,##0.00"/></td>
+                        <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
+                                              type="number" pattern="#,##0.00"/></td>
+                    </tr>
+                </c:forEach>
+            </table>
+            <div class="pay-more-func">
+                <a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${s.shopOrderID}">应付备注</a>
+                <a href="${ctx}/shopOrder/payedAndRefundRecordList?shopOrderID=${s.shopOrderID}&operatingMode=${operatingMode}">退/付款记录</a>
+            </div>
+        </div>
+    </c:forEach>
+</div>
+<div class="pagination">${page}</div>
+
+<script>
+    (function () {
+        var payTableEle = $('.pay-table'),
+            payProductEle = $('.pay-product-item');
+        payTableEle.each(function (i, l) {
+            var leftLength = $(this).find('tr').length,
+                productLength = $(this).find('.pay-product-item').length;
+            // 左侧栏合并单元格
+            $(this).find('tr:first-child th:first-child').attr('rowspan', leftLength);
+        });
+
+        $('.tab-li').on('click', function () {
+            if (getCheckedArr) {
+                sessionStorage.removeItem('checkedIndexArr');
+            }
+        });
+
+        //付第三方
+        $('#applyShopOtherFee').on('click', function () {
+            var checked = $('.pay-wrapper input[type=checkbox]:checked');
+            if (checked.length < 1) {
+                alertx('请选择一个子订单');
+                return false;
+            }
+            if (checked.length > 1) {
+                alertx('每次只能选择一个子订单进行付第三方申请');
+                return false;
+            }
+            var isPayShopOtherFee = $(checked[0]).attr('data-isPayShopOtherFee');
+            if ("false" == isPayShopOtherFee) {
+                alertx("付第三方处于待审核状态,暂不能操作");
+                return false;
+            }
+            var shopOrderId = $(checked[0]).attr('data-shoporderid');
+            window.location.href = '${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=' + shopOrderId;
+        });
+
+        //供应商差价申请
+        $('#applyDifferencePrice').on('click', function () {
+            var checked = $('.pay-wrapper input[type=checkbox]:checked');
+            if (checked.length < 1) {
+                alertx('请选择一个子订单');
+                return false;
+            }
+            if (checked.length > 1){
+                alertx('每次只能选择一个子订单进行供应商差价申请');
+                return false;
+            }
+            var shopOrderId = $(checked[0]).attr('data-shoporderid');
+            window.location.href = '${ctx}/order/cmPayShop/differencePriceForm?shopOrderId=' + shopOrderId;
+        });
+
+    })();
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字
+     */
+    function onlynum(obj) {
+        obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+    }
+
+    function submitFunc() {
+        var checkedArr = [];
+        $('.pay-checkbox').each(function (index) {
+            var thisStatus = $(this).prop('checked');
+            if (thisStatus) {
+                checkedArr.push(index);
+            }
+        })
+        if (checkedArr.length > 0) {
+            sessionStorage.setItem('checkedIndexArr', JSON.stringify(checkedArr));
+        } else {
+            sessionStorage.setItem('checkedIndexArr', []);
+        }
+    }
+
+    function inputnum(obj, val) {
+        obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
+        obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
+        obj.value = obj.value.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
+        obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+        obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
+    }
+</script>
+</body>
+</html>

+ 6 - 0
src/main/webapp/WEB-INF/views/modules/order/payedAndRefundRecordList.jsp

@@ -49,6 +49,12 @@
             <li><a href="${ctx}/shopOrder/refundRecordList?operatingMode=2">记录退款</a></li>
             <li class="active"><a href="${ctx}/shopOrder/payedAndRefundRecordList?shopOrderID=${s.shopOrderID}&operatingMode=2">退/付款记录</a></li>
         </c:if>
+        <c:if test="${operatingMode == 3}">
+            <li><a href="${ctx}/shopOrder/payOrderList">付款列表</a></li>
+            <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+            <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
+            <li class="active"><a href="${ctx}/shopOrder/payedAndRefundRecordList?shopOrderID=${s.shopOrderID}&operatingMode=1">退/付款记录</a></li>
+        </c:if>
 
 	</ul>
     <table class="table table-striped table-bordered table-condensed pay-table">

+ 10 - 3
src/main/webapp/WEB-INF/views/modules/order/shopOtherFeeForm.jsp

@@ -185,9 +185,9 @@
                 $("#inputForm").validate({
                     ignore:"",
                     submitHandler: function (form) {
-                        var shopPostFee = $("#shopPostFee").val();
+                        var shopOtherFee = $("#shopOtherFee").val();
                         var brokerage = ${brokerage};
-                        if (brokerage < shopPostFee) {
+                        if (brokerage < shopOtherFee) {
                             top.$.jBox.confirm("付第三方的值不合理,导致佣金为负,确认继续吗?", '提示', function (v, h, f) {
                                 if (v == true) {
                                     loading('正在提交,请稍等...');
@@ -217,14 +217,21 @@
 <ul class="nav nav-tabs">
     <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
     <li class="active"><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">
+            <form:input path="name" htmlEscape="false" maxlength="250" class="input-xlarge required"/>
+        </div>
+    </div>
     <div class="control-group">
         <label class="control-label"><font color='red'>*</font>付第三方金额:</label>
         <div class="controls">
-            <input type="number" id="shopOtherFee" required name="shopOtherFee" onchange="changeShouldPay(this)"/>
+            <input type="number" id="shopOtherFee" required name="shopOtherFee" min="0" value="${payShopOther.shopOtherFee}" onchange="changeShouldPay(this)"/>
         </div>
     </div>
     <div class="control-group">

+ 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>

+ 68 - 0
src/main/webapp/WEB-INF/views/modules/user/cmUserBeansList.jsp

@@ -0,0 +1,68 @@
+<%@ 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;}
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function() {
+
+        });
+        function page(n,s){
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li class="active"><a href="${ctx}/user/cmUserbeanshistory/userBeansList">采美豆列表</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="cmUser" action="${ctx}/user/cmUserbeanshistory/userBeansList" method="post" class="breadcrumb form-search">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <div class="ul-form">
+        <label>机构名称:</label>
+        <form:input path="name" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<table id="contentTable" class="table table-striped table-bordered table-condensed" >
+    <thead>
+    <tr>
+        <th>序号</th>
+        <th>机构名称</th>
+        <th>采美豆</th>
+        <th>操作</th>
+    </tr>
+    </thead>
+    <tbody>
+    <c:forEach items="${page.list}" var="cmUser" varStatus="index">
+        <tr>
+            <td>
+                    ${(page.pageNo-1)*page.pageSize+index.index+1}
+            </td>
+            <td>
+                    ${cmUser.name}
+            </td>
+            <td>
+                ${empty cmUser.userBeans ? 0:cmUser.userBeans}
+            </td>
+            <td>
+                <a href="${ctx}/user/cmUserbeanshistory/beansHistoryList?userId=${cmUser.userID}" >查看详情</a>
+            </td>
+        </tr>
+    </c:forEach>
+    </tbody>
+</table>
+<div class="pagination">${page}</div>
+</body>
+</html>

+ 0 - 84
src/main/webapp/WEB-INF/views/modules/user/cmUserbeanshistoryForm.jsp

@@ -1,84 +0,0 @@
-<%@ page contentType="text/html;charset=UTF-8" %>
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
-<html>
-<head>
-	<title>采美豆记录管理</title>
-	<meta name="decorator" content="default"/>
-	<script type="text/javascript">
-		$(document).ready(function() {
-			//$("#name").focus();
-			$("#inputForm").validate({
-				submitHandler: function(form){
-					loading('正在提交,请稍等...');
-					form.submit();
-				},
-				errorContainer: "#messageBox",
-				errorPlacement: function(error, element) {
-					$("#messageBox").text("输入有误,请先更正。");
-					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
-						error.appendTo(element.parent().parent());
-					} else {
-						error.insertAfter(element);
-					}
-				}
-			});
-		});
-	</script>
-</head>
-<body>
-	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/user/cmUserbeanshistory/">采美豆记录列表</a></li>
-		<li class="active"><a href="${ctx}/user/cmUserbeanshistory/form?id=${cmUserbeanshistory.id}">采美豆记录<shiro:hasPermission name="user:cmUserbeanshistory:edit">${not empty cmUserbeanshistory.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission name="user:cmUserbeanshistory:edit">查看</shiro:lacksPermission></a></li>
-	</ul><br/>
-	<form:form id="inputForm" modelAttribute="cmUserbeanshistory" action="${ctx}/user/cmUserbeanshistory/save" method="post" class="form-horizontal">
-		<form:hidden path="id"/>
-		<sys:message content="${message}"/>		
-		<div class="control-group">
-			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>userBeansHistoryID:</label>
-			<div class="controls">
-				<form:input path="userBeansHistoryID" htmlEscape="false" maxlength="11" class="input-xlarge required digits"/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">类型,见表c_userbeanhistorytype或枚举UserBeanHistoryType:</label>
-			<div class="controls">
-				<form:input path="userBeanHistoryTypeID" htmlEscape="false" maxlength="11" class="input-xlarge "/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">对应用户Id:</label>
-			<div class="controls">
-				<form:input path="userID" htmlEscape="false" maxlength="11" class="input-xlarge  digits"/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">相关订单Id:</label>
-			<div class="controls">
-				<form:input path="relatedID" htmlEscape="false" maxlength="11" class="input-xlarge "/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">数量:</label>
-			<div class="controls">
-				<form:input path="payBeans" htmlEscape="false" class="input-xlarge "/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">备注:</label>
-			<div class="controls">
-				<form:input path="info" htmlEscape="false" maxlength="64" class="input-xlarge "/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">添加时间:</label>
-			<div class="controls">
-				<form:input path="addTime" htmlEscape="false" maxlength="19" class="input-xlarge "/>
-			</div>
-		</div>
-		<div class="form-actions">
-			<shiro:hasPermission name="user:cmUserbeanshistory: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>
-	</form:form>
-</body>
-</html>

+ 72 - 16
src/main/webapp/WEB-INF/views/modules/user/cmUserbeanshistoryList.jsp

@@ -1,8 +1,9 @@
+<%@ taglib prefix="for" uri="/struts-tags" %>
 <%@ page contentType="text/html;charset=UTF-8" %>
 <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
 <html>
 <head>
-	<title>采美豆记录管理</title>
+	<title>采美豆记录</title>
 	<meta name="decorator" content="default"/>
 	<style type="text/css">
 		.table th{text-align: center;}
@@ -22,37 +23,92 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<li class="active"><a href="${ctx}/user/cmUserbeanshistory/">采美豆记录列表</a></li>
-		<shiro:hasPermission name="user:cmUserbeanshistory:edit"><li><a href="${ctx}/user/cmUserbeanshistory/form">采美豆记录添加</a></li></shiro:hasPermission>
+		<li><a href="${ctx}/user/cmUserbeanshistory/userBeansList">采美豆列表</a></li>
+		<li class="active"><a href="${ctx}/user/cmUserbeanshistory/beansHistoryList?userId=${user.userID}">采美豆详情</a></li>
 	</ul>
-	<form:form id="searchForm" modelAttribute="cmUserbeanshistory" action="${ctx}/user/cmUserbeanshistory/" method="post" class="breadcrumb form-search">
+	<form:form id="searchForm" modelAttribute="userBeansHistory" action="${ctx}/user/cmUserbeanshistory/beansHistoryList" method="post" class="breadcrumb form-search">
 		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
 		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<input name="userId" type="hidden" value="${user.userID}"/>
 		<div class="ul-form">
-			 <label>userBeansHistoryID:</label>
-				<form:input path="userBeansHistoryID" htmlEscape="false" maxlength="11" class="input-medium"/>
-			 <label>对应用户Id:</label>
-				<form:input path="userID" htmlEscape="false" maxlength="11" class="input-medium"/>
+			 <label>收支类型:</label>
+			<form:select path="type" class="select-ele input-medium required">
+				<form:option value="" label="请选择"/>
+				<form:option value="1" label="获取"/>
+				<form:option value="2" label="消耗"/>
+			</form:select>
+			 <label>采美豆类型:</label>
+			<form:select path="beansType" class="select-ele input-medium required">
+				<form:option value="" label="全部"/>
+				<form:option value="1" label="注册机构"/>
+				<form:option value="2" label="升级会员机构"/>
+				<form:option value="3" label="完善资料"/>
+				<form:option value="5" label="下单"/>
+				<form:option value="6" label="线上支付订单"/>
+				<form:option value="7" label="确认收货"/>
+				<form:option value="8" label="系统发放"/>
+				<form:option value="9" label="抵用退回"/>
+				<form:option value="10" label="抵用运费"/>
+				<form:option value="11" label="退款回收"/>
+			</form:select>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 			<div class="clearfix"></div>
 		</div>
 	</form:form>
 	<sys:message content="${message}"/>
+	<b>机构名称:${user.name}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可用数量:${user.userBeans}</b>
 	<table id="contentTable" class="table table-striped table-bordered table-condensed">
 		<thead>
 			<tr>
-				<shiro:hasPermission name="user:cmUserbeanshistory:edit"><th>操作</th></shiro:hasPermission>
+				<th>时间</th>
+				<th>收支类型</th>
+				<th>数量</th>
+				<th>采美豆类型</th>
 			</tr>
 		</thead>
 		<tbody>
-		<c:forEach items="${page.list}" var="cmUserbeanshistory">
+		<c:forEach items="${page.list}" var="userBeansHistory">
 			<tr>
-				<shiro:hasPermission name="user:cmUserbeanshistory:edit"><td>
-    				<a href="${ctx}/user/cmUserbeanshistory/form?id=${cmUserbeanshistory.id}">编辑</a>
-    				<shiro:hasPermission name="user:cmUserbeanshistory:delete">
-					<a href="${ctx}/user/cmUserbeanshistory/delete?id=${cmUserbeanshistory.id}" onclick="return confirmx('确认要删除该采美豆记录吗?', this.href)">删除</a>
-					</shiro:hasPermission>
-				</td></shiro:hasPermission>
+				<td><fmt:formatDate value="${userBeansHistory.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+				<td>${userBeansHistory.type eq 1 ? "获取":"消耗"}</td>
+				<td>${userBeansHistory.num}</td>
+				<td>
+					<c:if test="${userBeansHistory.beansType eq 1}">
+						注册机构
+					</c:if>
+					<c:if test="${userBeansHistory.beansType eq 2}">
+						<a href="${ctx}/new/user/agency/form?id=${userBeansHistory.clubId}&source=1">升级会员机构</a>
+					</c:if>
+					<c:if test="${userBeansHistory.beansType eq 3 || userBeansHistory.beansType eq 4}">
+						<a href="${ctx}/new/user/agency/form?id=${userBeansHistory.clubId}&source=1">完善资料</a>
+					</c:if>
+					<c:if test="${userBeansHistory.beansType eq 5}">
+						<a href="${ctx}/hehe/new/order/detail?id=${userBeansHistory.orderId}">下单</a>
+					</c:if>
+					<c:if test="${userBeansHistory.beansType eq 6}">
+						<a href="${ctx}/order/cmDiscernReceipt/detail?id=${userBeansHistory.receiptId}">线上支付订单</a>
+					</c:if>
+					<c:if test="${userBeansHistory.beansType eq 7}">
+						<a href="${ctx}/hehe/new/order/detail?id=${userBeansHistory.orderId}">确认收货</a>
+					</c:if>
+					<c:if test="${userBeansHistory.beansType eq 8}">
+						系统发放
+					</c:if>
+					<c:if test="${userBeansHistory.beansType eq 9}">
+						<c:if test="${not empty userBeansHistory.returnedId}">
+							<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecord?id=${userBeansHistory.returnedId}&orderID=${userBeansHistory.orderId}">抵用退回</a>
+						</c:if>
+						<c:if test="${empty userBeansHistory.returnedId}">
+							<a href="${ctx}/hehe/new/order/detail?id=${userBeansHistory.orderId}">抵用退回</a>
+						</c:if>
+					</c:if>
+					<c:if test="${userBeansHistory.beansType eq 10}">
+						抵用运费
+					</c:if>
+					<c:if test="${userBeansHistory.beansType eq 11}">
+						<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecord?id=${userBeansHistory.returnedId}&orderID=${userBeansHistory.orderId}">退款回收</a>
+					</c:if>
+				</td>
 			</tr>
 		</c:forEach>
 		</tbody>