Jelajahi Sumber

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

Aslee 3 tahun lalu
induk
melakukan
f1de2da862
52 mengubah file dengan 2042 tambahan dan 360 penghapusan
  1. 2 0
      src/main/java/com/caimei/modules/coupon/dao/CmCouponDao.java
  2. 27 0
      src/main/java/com/caimei/modules/coupon/entity/CmCoupon.java
  3. 9 0
      src/main/java/com/caimei/modules/coupon/entity/CmCouponClub.java
  4. 13 2
      src/main/java/com/caimei/modules/coupon/service/CmCouponService.java
  5. 56 4
      src/main/java/com/caimei/modules/coupon/web/CmCouponController.java
  6. 2 0
      src/main/java/com/caimei/modules/order/dao/CmDiscernReceiptDao.java
  7. 1 1
      src/main/java/com/caimei/modules/order/dao/NewOrderDao.java
  8. 10 0
      src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java
  9. 66 0
      src/main/java/com/caimei/modules/order/entity/ReceipCouponInfoVo.java
  10. 9 0
      src/main/java/com/caimei/modules/order/entity/ReceiptDetailVo.java
  11. 12 0
      src/main/java/com/caimei/modules/order/entity/ReceiptVipInfoVo.java
  12. 8 3
      src/main/java/com/caimei/modules/order/service/CmDiscernReceiptService.java
  13. 5 0
      src/main/java/com/caimei/modules/product/dao/ProductNewDao.java
  14. 9 0
      src/main/java/com/caimei/modules/product/entity/Product.java
  15. 3 1
      src/main/java/com/caimei/modules/product/service/ProductService.java
  16. 5 1
      src/main/java/com/caimei/modules/product/web/ProductNewController.java
  17. 7 0
      src/main/java/com/caimei/modules/user/dao/NewCmShopDao.java
  18. 6 5
      src/main/java/com/caimei/modules/user/entity/NewCmShop.java
  19. 33 0
      src/main/java/com/caimei/modules/user/entity/SplitCode.java
  20. 195 176
      src/main/java/com/caimei/modules/user/service/NewCmShopService.java
  21. 1 0
      src/main/resources/mappings/modules/coupon/CmCouponClubMapper.xml
  22. 56 4
      src/main/resources/mappings/modules/coupon/CmCouponMapper.xml
  23. 15 1
      src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml
  24. 1 1
      src/main/resources/mappings/modules/order/CmReturnedPurchaseProductMapper.xml
  25. 0 1
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  26. 1 0
      src/main/resources/mappings/modules/product/ProductMapper.xml
  27. 8 0
      src/main/resources/mappings/modules/product/ProductNewMapper.xml
  28. 14 5
      src/main/resources/mappings/modules/user/NewCmShopMapper.xml
  29. 985 0
      src/main/webapp/WEB-INF/views/modules/coupon/MoneyCouponForm.jsp
  30. 33 15
      src/main/webapp/WEB-INF/views/modules/coupon/cmCouponClubList.jsp
  31. 5 5
      src/main/webapp/WEB-INF/views/modules/coupon/cmCouponForm.jsp
  32. 26 16
      src/main/webapp/WEB-INF/views/modules/coupon/cmCouponList.jsp
  33. 139 0
      src/main/webapp/WEB-INF/views/modules/coupon/cmMoneyCouponList.jsp
  34. 5 5
      src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryForm.jsp
  35. 27 16
      src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryList.jsp
  36. 5 5
      src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserForm.jsp
  37. 25 15
      src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserList.jsp
  38. 5 5
      src/main/webapp/WEB-INF/views/modules/coupon/couponShopForm.jsp
  39. 25 15
      src/main/webapp/WEB-INF/views/modules/coupon/couponShopList.jsp
  40. 5 5
      src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveForm.jsp
  41. 33 23
      src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveList.jsp
  42. 13 0
      src/main/webapp/WEB-INF/views/modules/coupon/productCouponDetails.jsp
  43. 3 3
      src/main/webapp/WEB-INF/views/modules/coupon/redemptionCodeCouponForm.jsp
  44. 18 13
      src/main/webapp/WEB-INF/views/modules/coupon/redemptionCodeCouponList.jsp
  45. 1 1
      src/main/webapp/WEB-INF/views/modules/info/infoForm.jsp
  46. 26 1
      src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptForm.jsp
  47. 5 0
      src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptList.jsp
  48. 1 0
      src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp
  49. 9 0
      src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp
  50. 4 3
      src/main/webapp/WEB-INF/views/modules/user/cmUserBalanceWithdrawalsForm.jsp
  51. 56 7
      src/main/webapp/WEB-INF/views/modules/user/newCmShopForm.jsp
  52. 14 2
      src/main/webapp/WEB-INF/views/modules/userNew/cmAgencyForm.jsp

+ 2 - 0
src/main/java/com/caimei/modules/coupon/dao/CmCouponDao.java

@@ -86,4 +86,6 @@ public interface CmCouponDao extends CrudDao<CmCoupon> {
      * @param clubCouponId
      */
     void updateClubCoupon(@Param("clubCouponId") Integer clubCouponId, @Param("orderId") Integer orderId);
+
+    List<CmCoupon> findCouponList(@Param("userId")Integer userId,@Param("moneyCouponFlag")Integer moneyCouponFlag);
 }

+ 27 - 0
src/main/java/com/caimei/modules/coupon/entity/CmCoupon.java

@@ -48,6 +48,9 @@ public class CmCoupon extends DataEntity<CmCoupon> {
     private String couponDesc;        //描述
     private String redemptionCode;      //兑换码
     private CmCouponClub couponClub;
+    private Integer moneyCouponType; //价值优惠券属性 1,意向券,2,定向券
+    private Integer moneyCouponFlag; //是否是价值优惠券,1是,2不是
+    private Double moneyCouponPrice; //价值优惠券购买金额
     private NewCmShop shop;
     private List<Integer> productIdList;
 
@@ -62,6 +65,30 @@ public class CmCoupon extends DataEntity<CmCoupon> {
         super(id);
     }
 
+    public Integer getMoneyCouponFlag() {
+        return moneyCouponFlag;
+    }
+
+    public void setMoneyCouponFlag(Integer moneyCouponFlag) {
+        this.moneyCouponFlag = moneyCouponFlag;
+    }
+
+    public Double getMoneyCouponPrice() {
+        return moneyCouponPrice;
+    }
+
+    public void setMoneyCouponPrice(Double moneyCouponPrice) {
+        this.moneyCouponPrice = moneyCouponPrice;
+    }
+
+    public Integer getMoneyCouponType() {
+        return moneyCouponType;
+    }
+
+    public void setMoneyCouponType(Integer moneyCouponType) {
+        this.moneyCouponType = moneyCouponType;
+    }
+
     @Length(min = 0, max = 50, message = "活动主题长度必须介于 0 和 50 之间")
     public String getName() {
         return name;

+ 9 - 0
src/main/java/com/caimei/modules/coupon/entity/CmCouponClub.java

@@ -29,6 +29,7 @@ public class CmCouponClub extends DataEntity<CmCouponClub> {
     private BigDecimal couponAmount;        // 优惠券金额(面值)
     private BigDecimal touchPrice;        // 优惠满减条件金额
     private String couponStatus;    // 状态 0未生效 1已生效 2已关闭 3已失效
+    private Integer moneyCouponFlag; //普通/价值优惠券标记1是2不是
     private Date startDate;        // 使用开始时间(有效期)
     private Date endDate;        // 使用结束时间(有效期)
     private String orderNo;     //订单编号
@@ -49,6 +50,14 @@ public class CmCouponClub extends DataEntity<CmCouponClub> {
         this.userId = userId;
     }
 
+    public Integer getMoneyCouponFlag() {
+        return moneyCouponFlag;
+    }
+
+    public void setMoneyCouponFlag(Integer moneyCouponFlag) {
+        this.moneyCouponFlag = moneyCouponFlag;
+    }
+
     public Integer getCouponId() {
         return couponId;
     }

+ 13 - 2
src/main/java/com/caimei/modules/coupon/service/CmCouponService.java

@@ -149,6 +149,9 @@ public class CmCouponService extends CrudService<CmCouponDao, CmCoupon> {
         if (null == cmCoupon.getVipFlag()){
             cmCoupon.setVipFlag(0);
         }
+        if(null==cmCoupon.getMoneyCouponFlag()){
+            cmCoupon.setMoneyCouponFlag(2);
+        }
         super.save(cmCoupon);
         List<Integer> associateIds = cmCouponDao.findByCouponId(cmCoupon.getId());
         if (0 == cmCoupon.getCouponType()) {
@@ -331,8 +334,8 @@ public class CmCouponService extends CrudService<CmCouponDao, CmCoupon> {
         return couponsLogo;
     }
 
-    public List<CmCoupon> findClubCouponList(Product product, Integer userId) {
-        List<CmCoupon> couponList = cmCouponDao.findClubCouponList(userId);
+    public List<CmCoupon> findClubCouponList(Product product,Integer userId,Integer moneyCouponFlag) {
+        List<CmCoupon> couponList = cmCouponDao.findCouponList(userId,moneyCouponFlag);
         filterCoupon(product, couponList);
         setCouponCopywriting(couponList);
         return couponList;
@@ -420,4 +423,12 @@ public class CmCouponService extends CrudService<CmCouponDao, CmCoupon> {
             });
         }
     }
+
+    @Transactional(readOnly = false)
+    public void moneyCouponSave(CmCoupon cmCoupon) {
+        cmCoupon.setCouponsMode("0");
+        cmCoupon.setMoneyCouponFlag(1);
+        save(cmCoupon);
+    }
+
 }

+ 56 - 4
src/main/java/com/caimei/modules/coupon/web/CmCouponController.java

@@ -62,11 +62,13 @@ public class CmCouponController extends BaseController {
     }
 
 
-
     @RequiresPermissions("coupon:cmCoupon:view")
     @RequestMapping(value = {"list", ""})
     public String list(CmCoupon cmCoupon, HttpServletRequest request, HttpServletResponse response, Model model) {
         cmCoupon.setCouponsMode("0");
+        if (null == cmCoupon.getMoneyCouponFlag()) {
+            cmCoupon.setMoneyCouponFlag(2);
+        }
         Page<CmCoupon> page = cmCouponService.findPage(new Page<CmCoupon>(request, response), cmCoupon);
         model.addAttribute("page", page);
         if (0 == cmCoupon.getCouponType()) {
@@ -81,10 +83,14 @@ public class CmCouponController extends BaseController {
         } else if (3 == cmCoupon.getCouponType()) {
             //店铺券
             return "modules/coupon/couponShopList";
-        } else {
+        } else if (4 == cmCoupon.getCouponType()) {
             //新用户券
             return "modules/coupon/couponNewUserList";
+        } else if (1 == cmCoupon.getMoneyCouponFlag()) {
+            //价值优惠券
+            return "modules/coupon/cmMoneyCouponList";
         }
+        return null;
     }
 
     @RequiresPermissions("coupon:cmCoupon:view")
@@ -133,6 +139,9 @@ public class CmCouponController extends BaseController {
         if ("1".equals(cmCoupon.getCouponsMode())) {
             return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/codeCouponList";
         }
+        if(null!=cmCoupon.getMoneyCouponFlag()&&1==(cmCoupon.getMoneyCouponFlag())){
+            return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/list?moneyCouponFlag=1&&couponType=5";
+        }
         return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/list?couponType=" + cmCoupon.getCouponType();
     }
 
@@ -161,7 +170,7 @@ public class CmCouponController extends BaseController {
     }
 
     /**
-     *  开启优惠券
+     * 开启优惠券
      */
     @RequestMapping("open")
     public String open(CmCoupon cmCoupon, RedirectAttributes redirectAttributes) {
@@ -230,6 +239,30 @@ public class CmCouponController extends BaseController {
         return "/modules/coupon/redemptionCodeCouponForm";
     }
 
+    //价值优惠券
+    @RequestMapping("moneyCouponForm")
+    public String moneyCouponForm(CmCoupon cmCoupon, Model model) {
+        model.addAttribute("cmCoupon", cmCoupon);
+        if (cmCoupon != null && cmCoupon.getCouponType() != null) {
+            if (0 == cmCoupon.getCouponType()) {
+                List<CmCouponAssociate> associateList = new ArrayList<>();
+                if (StringUtils.isNotBlank(cmCoupon.getId()) && "2".equals(cmCoupon.getProductType())) {
+                    associateList = cmCouponService.findByProductType(cmCoupon);
+                }
+                model.addAttribute("associateList", associateList);
+            } else if (2 == cmCoupon.getCouponType()) {
+                CmUser cmUser = null;
+                if (cmCoupon.getUserId() != null) {
+                    cmUser = cmUserDao.get(cmCoupon.getUserId().toString());
+                    NewCmClub club = newCmClubDao.getclubByUserId(cmCoupon.getUserId());
+                    cmUser.setShortName(club.getSname());
+                }
+                model.addAttribute("cmUser", cmUser);
+            }
+        }
+        return "/modules/coupon/MoneyCouponForm";
+    }
+
     /**
      * 兑换码优惠券-保存
      */
@@ -240,6 +273,20 @@ public class CmCouponController extends BaseController {
         return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/codeCouponList";
     }
 
+    /**
+     * 价值优惠券保存
+     *
+     * @param cmCoupon
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping("moneyCouponSave")
+    public String moneyCouponSave(CmCoupon cmCoupon, RedirectAttributes redirectAttributes) {
+        cmCouponService.moneyCouponSave(cmCoupon);
+        addMessage(redirectAttributes, "保存价值优惠券成功");
+        return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/list?moneyCouponFlag=1&&couponType=5";
+    }
+
     /**
      * 查看兑换码页面
      */
@@ -259,11 +306,16 @@ public class CmCouponController extends BaseController {
         Product product = productService.get(productId.toString());
         String wwwServer = Global.getConfig("wwwServer");
         product.setMainImage(AppUtils.getImageURL("product", product.getMainImage(), 0, wwwServer));
-        List<CmCoupon> ordinaryCoupons = cmCouponService.findClubCouponList(product, userId);
+        //展示全部可用普通优惠券,不包含已领取兑换优惠券
+        List<CmCoupon> ordinaryCoupons = cmCouponService.findClubCouponList(product, userId,2);
+        //展示全部可用兑换优惠券
         List<CmCoupon> redeemCoupons = cmCouponService.findNotRedeemedCoupon(product);
+        //展示全部可用价值优惠券
+        List<CmCoupon> moneyCoupons = cmCouponService.findClubCouponList(product, userId,1);
         model.addAttribute("product", product);
         model.addAttribute("ordinaryCoupons", ordinaryCoupons);
         model.addAttribute("redeemCoupons", redeemCoupons);
+        model.addAttribute("moneyCoupons", moneyCoupons);
         return "/modules/coupon/productCouponDetails";
     }
 }

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

@@ -107,4 +107,6 @@ public interface CmDiscernReceiptDao extends CrudDao<CmDiscernReceipt> {
     Double findRefundUserMoney(String orderID);
 
     Double findOnlinePay(Integer orderID);
+
+    ReceipCouponInfoVo getCouponInfo(String receiptID);
 }

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

@@ -159,7 +159,7 @@ public interface NewOrderDao extends CrudDao<NewOrder> {
     /**
      * 定金商品撤销收款,用户余额扣除
      */
-    void updateUserMoneyByUserId(Double payTotalFee, Integer userID);
+    void updateUserMoneyByUserId(@Param("payTotalFee")Double payTotalFee,@Param("userID") Integer userID);
 
     /**
      * 查询订单优惠券信息

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

@@ -51,6 +51,7 @@ public class CmDiscernReceipt extends DataEntity<CmDiscernReceipt> {
     private String associationType;//订单关联方式: 1手动 2自动
 
     //	--------------------
+    private String backName;//收款列表优惠券购买人名称回显
     private String orders;//关联订单号
     private String orderType;//关联订单类型  与 关联订单号一一对应
     private String startTime;     //时间开始 查询条件 收款时间
@@ -76,6 +77,15 @@ public class CmDiscernReceipt extends DataEntity<CmDiscernReceipt> {
         this.balanceAccountsRemark = balanceAccountsRemark;
     }
 
+
+    public String getBackName() {
+        return backName;
+    }
+
+    public void setBackName(String backName) {
+        this.backName = backName;
+    }
+
     public Integer getOrganizeID() {
         return organizeID;
     }

+ 66 - 0
src/main/java/com/caimei/modules/order/entity/ReceipCouponInfoVo.java

@@ -0,0 +1,66 @@
+package com.caimei.modules.order.entity;
+
+public class ReceipCouponInfoVo {
+    //劵类型 0活动券 1品类券 2用户专享券 3店铺券 4新用户券
+    private Integer couponType;
+    //机构名称
+    private String clubName;
+    //收款时间
+    private String confirmDate;
+
+    //优惠满减条件金额
+    private String touchPrice;
+
+    //优惠券面值金额
+    private String couponAmount;
+
+    private String mbOrderId;
+
+    public Integer getCouponType() {
+        return couponType;
+    }
+
+    public void setCouponType(Integer couponType) {
+        this.couponType = couponType;
+    }
+
+    public String getClubName() {
+        return clubName;
+    }
+
+    public void setClubName(String clubName) {
+        this.clubName = clubName;
+    }
+
+    public String getConfirmDate() {
+        return confirmDate;
+    }
+
+    public void setConfirmDate(String confirmDate) {
+        this.confirmDate = confirmDate;
+    }
+
+    public String getTouchPrice() {
+        return touchPrice;
+    }
+
+    public void setTouchPrice(String touchPrice) {
+        this.touchPrice = touchPrice;
+    }
+
+    public String getCouponAmount() {
+        return couponAmount;
+    }
+
+    public void setCouponAmount(String couponAmount) {
+        this.couponAmount = couponAmount;
+    }
+
+    public String getMbOrderId() {
+        return mbOrderId;
+    }
+
+    public void setMbOrderId(String mbOrderId) {
+        this.mbOrderId = mbOrderId;
+    }
+}

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

@@ -30,6 +30,7 @@ public class ReceiptDetailVo {
     private String confirmTime; //确认时间    非订单款项的确认时间
     private List<ReceiptOrderInfoVo> orderInfos; //一个收款可能会关联了一个或多个订单
     private ReceiptVipInfoVo vipInfo;// 一个收款关联一个会员记录
+    private ReceipCouponInfoVo couponInfo;//优惠券购买记录
     private boolean receiptOrderFlag;// 判断订单中抹平的订单是否是和多个订单一起支付的,
 
     public ReceiptVipInfoVo getVipInfo() {
@@ -167,4 +168,12 @@ public class ReceiptDetailVo {
     public void setReceiptOrderFlag(boolean receiptOrderFlag) {
         this.receiptOrderFlag = receiptOrderFlag;
     }
+
+    public ReceipCouponInfoVo getCouponInfo() {
+        return couponInfo;
+    }
+
+    public void setCouponInfo(ReceipCouponInfoVo couponInfo) {
+        this.couponInfo = couponInfo;
+    }
 }

+ 12 - 0
src/main/java/com/caimei/modules/order/entity/ReceiptVipInfoVo.java

@@ -41,6 +41,10 @@ public class ReceiptVipInfoVo {
      * 支付时间
      */
     private Date payTime;
+    /**
+     * 购买机构名称
+     */
+    private String clubName;
     /**
      * 商户唯一订单请求号(订单编号#随机时间戳)
      */
@@ -117,4 +121,12 @@ public class ReceiptVipInfoVo {
     public void setOrderRequestNo(String orderRequestNo) {
         this.orderRequestNo = orderRequestNo;
     }
+
+    public String getClubName() {
+        return clubName;
+    }
+
+    public void setClubName(String clubName) {
+        this.clubName = clubName;
+    }
 }

+ 8 - 3
src/main/java/com/caimei/modules/order/service/CmDiscernReceiptService.java

@@ -100,14 +100,14 @@ public class CmDiscernReceiptService extends CrudService<CmDiscernReceiptDao, Cm
                     }
                 }
             }
-            if ("6".equals(bean.getReceiptType())){
+            if ("6".equals(bean.getReceiptType())) {
                 // 超级会员款
                 Integer vipRecordId = cmDiscernReceiptDao.getVipRecordId(bean.getId());
                 Integer userId = cmDiscernReceiptDao.getVipUserId(vipRecordId);
                 String userName = cmDiscernReceiptDao.getUserNameByUserId(userId);
                 bean.setName(userName);
             }
-            if("7".equals(bean.getReceiptType())){
+            if ("7".equals(bean.getReceiptType())) {
                 //二手商品上架费
                 bean.setName("-----");
             }
@@ -207,6 +207,11 @@ public class CmDiscernReceiptService extends CrudService<CmDiscernReceiptDao, Cm
             // 二手商品上架费
 
         }
+        if ("8".equals(vo.getReceiptType())) {
+            //优惠券购买费
+            ReceipCouponInfoVo couponInfo = cmDiscernReceiptDao.getCouponInfo(vo.getReceiptID());
+            vo.setCouponInfo(couponInfo);
+        }
         vo.setOrderInfos(orderInfos);
         return vo;
     }
@@ -257,7 +262,7 @@ public class CmDiscernReceiptService extends CrudService<CmDiscernReceiptDao, Cm
                         cmUserBalanceRecord.setAddDate(new Date());
                         cmUserBalanceRecord.setDelFlag("0");
                         cmUserBalanceRecord.setAmount(order.getPayTotalFee().toString());
-                        cmUserBalanceRecord.setOrderId( order.getUserID());
+                        cmUserBalanceRecord.setOrderId(order.getUserID());
                         cmUserBalanceRecord.setRemark("定金商品撤销收款");
                         cmUserBalanceRecordDao.insertUserBalanceRecord(cmUserBalanceRecord);
                     }

+ 5 - 0
src/main/java/com/caimei/modules/product/dao/ProductNewDao.java

@@ -3,6 +3,7 @@ package com.caimei.modules.product.dao;
 import com.caimei.modules.product.entity.Product;
 import com.caimei.modules.product.entity.ProductParameters;
 import com.caimei.modules.product.entity.ProductStatusRecord;
+import com.caimei.modules.user.entity.SplitCode;
 import com.caimei.po.ProductImage;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
@@ -56,4 +57,8 @@ public interface ProductNewDao extends CrudDao<Product> {
     void insertStatusRecord(ProductStatusRecord statusRecord);
 
     List<ProductStatusRecord> findAllStatusRemarks(Integer productId);
+
+    List<SplitCode> findSplitCode(Integer shopID);
+
+    String findSplitCodeByProduct(Integer productID);
 }

+ 9 - 0
src/main/java/com/caimei/modules/product/entity/Product.java

@@ -82,6 +82,7 @@ public class Product extends DataEntity<Product> {
     private String recommendType; //相关推荐类型 0自动选择; 1手动推荐
     private Integer combinationID;//商品组合Id
     private String productDetail; //普通机构商品详情1同资质机构商品详情,2用普通机构商品详情
+    private String splitCode; //  该商品分账商户号
     //-----------------  虚拟字段 ----
     private boolean customClass = false;  //是否有自定义分类
     private String brandName;//品牌名称
@@ -211,6 +212,14 @@ public class Product extends DataEntity<Product> {
      */
     private Integer searchType;
 
+    public String getSplitCode() {
+        return splitCode;
+    }
+
+    public void setSplitCode(String splitCode) {
+        this.splitCode = splitCode;
+    }
+
     public String getProductDescribe() {
         return productDescribe;
     }

+ 3 - 1
src/main/java/com/caimei/modules/product/service/ProductService.java

@@ -383,7 +383,9 @@ public class ProductService extends CrudService<ProductDao, Product> {
             }
         }
         product.setQualificationImg(res);
-
+//        if(StringUtils.isNotBlank(product.getSplitCode())&&"0".equals(product.getSplitCode())){
+//            product.setSplitCode(null);
+//        }
         productDao.updateByPrimaryKeySelective(product);
         ProductDetailInfo queryProductDetailInfo = productDao.queryProductDetailInfo(product.getProductID());
         if (queryProductDetailInfo != null) {

+ 5 - 1
src/main/java/com/caimei/modules/product/web/ProductNewController.java

@@ -11,6 +11,7 @@ import com.caimei.modules.product.entity.*;
 import com.caimei.modules.product.service.*;
 import com.caimei.modules.user.entity.CmPageModules;
 import com.caimei.modules.user.entity.CmUserOrganize;
+import com.caimei.modules.user.entity.SplitCode;
 import com.caimei.modules.user.service.CmUserOrganizeService;
 import com.caimei.po.ProductImage;
 import com.caimei.po.ProductLadderPrice;
@@ -294,10 +295,13 @@ public class ProductNewController extends BaseController {
         // 添加相关参数
         List<ProductParameters> productParams = productNewService.getProductParams(product.getProductID());
         product.setProductParametersList(productParams);
+        product.setSplitCode(productNewDao.findSplitCodeByProduct(product.getProductID()));
         //若供应商税率为空,初始化为与机构税率一致
         if (product.getSupplierTaxPoint() == null) {
             product.setSupplierTaxPoint(product.getTaxPoint());
         }
+        List<SplitCode> splitCodeList = productNewDao.findSplitCode(product.getShopID());
+        model.addAttribute("splitCodeList",splitCodeList);
         model.addAttribute("combinationList", combinationList);
         model.addAttribute("brandList", brandList);
         model.addAttribute("classify", classify);
@@ -802,7 +806,7 @@ public class ProductNewController extends BaseController {
             e.printStackTrace();
             logger.error(e.getMessage());
             map.put("success", false);
-            map.put("msg", "上失败");
+            map.put("msg", "上失败");
         }
         return map;
     }

+ 7 - 0
src/main/java/com/caimei/modules/user/dao/NewCmShopDao.java

@@ -2,6 +2,7 @@ package com.caimei.modules.user.dao;
 
 import com.caimei.modules.cibe.entity.ShopCert;
 import com.caimei.modules.user.entity.NewCmShop;
+import com.caimei.modules.user.entity.SplitCode;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import org.apache.ibatis.annotations.Param;
@@ -30,4 +31,10 @@ public interface NewCmShopDao extends CrudDao<NewCmShop> {
 
     // 退还可用余额
     void backAbleRebateAmount(@Param("balancePayFee") Double balancePayFee, @Param("shopID")  Integer shopID);
+
+    void deleteSplitCode(Integer shopID);
+
+    void insertSplitCode(SplitCode splitCode);
+
+    List<SplitCode> findSplitCode(Integer shopID);
 }

+ 6 - 5
src/main/java/com/caimei/modules/user/entity/NewCmShop.java

@@ -6,6 +6,7 @@ import org.hibernate.validator.constraints.Length;
 import javax.validation.constraints.NotNull;
 import java.beans.Transient;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 用户模块重构-供应商信息Entity
@@ -76,7 +77,7 @@ public class NewCmShop extends DataEntity<NewCmShop> {
     private String productionLicense;//生产许可
     private String sanitationPermit;//卫生许可
     private String taxPermit;//税务许可
-    private String commercialCode; //分账方,子商户商编
+    private List<SplitCode> splitCodes; //分账方,子商户商编
     private String socialCreditCode; //统一社会信用代码
 
     /**
@@ -989,12 +990,12 @@ public class NewCmShop extends DataEntity<NewCmShop> {
         this.source = source;
     }
 
-    public String getCommercialCode() {
-        return commercialCode;
+    public List<SplitCode> getSplitCodes() {
+        return splitCodes;
     }
 
-    public void setCommercialCode(String commercialCode) {
-        this.commercialCode = commercialCode;
+    public void setSplitCodes(List<SplitCode> splitCodes) {
+        this.splitCodes = splitCodes;
     }
 
     public String getSocialCreditCode() {

+ 33 - 0
src/main/java/com/caimei/modules/user/entity/SplitCode.java

@@ -0,0 +1,33 @@
+package com.caimei.modules.user.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+public class SplitCode extends DataEntity<SplitCode> {
+    private String splitCode;//分账商户号
+    private String codeRemark;//账户备注
+    private Integer shopId; //供应商ID
+
+    public String getSplitCode() {
+        return splitCode;
+    }
+
+    public void setSplitCode(String splitCode) {
+        this.splitCode = splitCode;
+    }
+
+    public String getCodeRemark() {
+        return codeRemark;
+    }
+
+    public void setCodeRemark(String codeRemark) {
+        this.codeRemark = codeRemark;
+    }
+
+    public Integer getShopId() {
+        return shopId;
+    }
+
+    public void setShopId(Integer shopId) {
+        this.shopId = shopId;
+    }
+}

+ 195 - 176
src/main/java/com/caimei/modules/user/service/NewCmShopService.java

@@ -2,12 +2,14 @@ package com.caimei.modules.user.service;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.modules.cibe.entity.ShopCert;
 import com.caimei.modules.common.utils.UploadUtils;
 import com.caimei.modules.sys.utils.UploadImageUtils;
 import com.caimei.modules.user.dao.CmUserDao;
+import com.caimei.modules.user.entity.SplitCode;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.utils.Encodes;
 import com.thinkgem.jeesite.common.utils.StringUtils;
@@ -24,6 +26,7 @@ import com.caimei.modules.user.dao.NewCmShopDao;
 
 /**
  * 用户模块重构-供应商信息Service
+ *
  * @author zcp
  * @version 2018-05-21
  */
@@ -31,239 +34,255 @@ import com.caimei.modules.user.dao.NewCmShopDao;
 @Transactional(readOnly = true)
 public class NewCmShopService extends CrudService<NewCmShopDao, NewCmShop> {
 
-	@Autowired
-	private NewCmShopDao newCmShopDao;
-	@Autowired
-	private CmUserDao cmUserDao;
+    @Autowired
+    private NewCmShopDao newCmShopDao;
+    @Autowired
+    private CmUserDao cmUserDao;
 
-	public NewCmShop get(String id) {
-		return super.get(id);
-	}
+    public NewCmShop get(String id) {
+        return super.get(id);
+    }
 
-	public List<NewCmShop> findList(NewCmShop newCmShop) {
-		return super.findList(newCmShop);
-	}
+    public List<NewCmShop> findList(NewCmShop newCmShop) {
+        return super.findList(newCmShop);
+    }
 
-	public Page<NewCmShop> findPage(Page<NewCmShop> page, NewCmShop newCmShop) {
-		return super.findPage(page, newCmShop);
-	}
+    public Page<NewCmShop> findPage(Page<NewCmShop> page, NewCmShop newCmShop) {
+        return super.findPage(page, newCmShop);
+    }
 
-@Transactional(readOnly = false)
-	public void updateUserAudit(String auditStatus, String auditNote, String auditTime, String manufacturerStatus, Integer userId,String validFlag){
-		cmUserDao.updateUserAudit(auditStatus,auditNote,auditTime,manufacturerStatus,userId,validFlag);
-	}
+    @Transactional(readOnly = false)
+    public void updateUserAudit(String auditStatus, String auditNote, String auditTime, String manufacturerStatus, Integer userId, String validFlag) {
+        cmUserDao.updateUserAudit(auditStatus, auditNote, auditTime, manufacturerStatus, userId, validFlag);
+    }
 
-@Transactional(readOnly = false)
-	public void updateShopStatus(String status,Integer userID){
-		cmUserDao.updateShopStatus(status,userID);
-	}
+    @Transactional(readOnly = false)
+    public void updateShopStatus(String status, Integer userID) {
+        cmUserDao.updateShopStatus(status, userID);
+    }
 
-@Transactional(readOnly = false)
-	public void updateShopAudit(String auditStatus, String auditNote, String auditTime,String name, String manufacturerStatus, Integer shopId){
-		cmUserDao.updateShopAudit(auditStatus,auditNote,auditTime,name,manufacturerStatus,shopId);
-	}
+    @Transactional(readOnly = false)
+    public void updateShopAudit(String auditStatus, String auditNote, String auditTime, String name, String manufacturerStatus, Integer shopId) {
+        cmUserDao.updateShopAudit(auditStatus, auditNote, auditTime, name, manufacturerStatus, shopId);
+    }
 
-	public NewCmShop getShopcert(NewCmShop newCmShop){
-		Integer shopId = newCmShop.getShopID();
-		// 荣誉证书
-		List<ShopCert> shopcert = newCmShopDao.getShopcert(shopId,"1");
-		if(CollectionUtils.isNotEmpty(shopcert) && shopcert.size() > 0){
-			if(shopcert.size() == 1){
-				newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
-			}
-			if(shopcert.size() == 2){
-				newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
-				newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
-			}
-			if(shopcert.size() == 3){
-				newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
-				newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
-				newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
-			}
-			if(shopcert.size() == 4){
-				newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
-				newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
-				newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
-				newCmShop.setHonorCertificate4(shopcert.get(3).getImage());
-			}
-			if(shopcert.size() >= 5){
-				newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
-				newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
-				newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
-				newCmShop.setHonorCertificate4(shopcert.get(3).getImage());
-				newCmShop.setHonorCertificate5(shopcert.get(4).getImage());
-			}
-		}
+    public NewCmShop getShopcert(NewCmShop newCmShop) {
+        Integer shopId = newCmShop.getShopID();
+        // 荣誉证书
+        List<ShopCert> shopcert = newCmShopDao.getShopcert(shopId, "1");
+        if (CollectionUtils.isNotEmpty(shopcert) && shopcert.size() > 0) {
+            if (shopcert.size() == 1) {
+                newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
+            }
+            if (shopcert.size() == 2) {
+                newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
+                newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
+            }
+            if (shopcert.size() == 3) {
+                newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
+                newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
+                newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
+            }
+            if (shopcert.size() == 4) {
+                newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
+                newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
+                newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
+                newCmShop.setHonorCertificate4(shopcert.get(3).getImage());
+            }
+            if (shopcert.size() >= 5) {
+                newCmShop.setHonorCertificate1(shopcert.get(0).getImage());
+                newCmShop.setHonorCertificate2(shopcert.get(1).getImage());
+                newCmShop.setHonorCertificate3(shopcert.get(2).getImage());
+                newCmShop.setHonorCertificate4(shopcert.get(3).getImage());
+                newCmShop.setHonorCertificate5(shopcert.get(4).getImage());
+            }
+        }
 
-		List<ShopCert> shopcert2 = newCmShopDao.getShopcert(shopId,"2");
-		if(CollectionUtils.isNotEmpty(shopcert2) && shopcert2.size() > 0){
-			newCmShop.setProductionLicense(shopcert2.get(0).getImage());
-		}
+        List<ShopCert> shopcert2 = newCmShopDao.getShopcert(shopId, "2");
+        if (CollectionUtils.isNotEmpty(shopcert2) && shopcert2.size() > 0) {
+            newCmShop.setProductionLicense(shopcert2.get(0).getImage());
+        }
 
-		List<ShopCert> shopcert3 = newCmShopDao.getShopcert(shopId,"3");
-		if(CollectionUtils.isNotEmpty(shopcert3) && shopcert3.size() > 0){
-			newCmShop.setProductCertificate(shopcert3.get(0).getImage());
-		}
+        List<ShopCert> shopcert3 = newCmShopDao.getShopcert(shopId, "3");
+        if (CollectionUtils.isNotEmpty(shopcert3) && shopcert3.size() > 0) {
+            newCmShop.setProductCertificate(shopcert3.get(0).getImage());
+        }
 
-		List<ShopCert> shopcert5 = newCmShopDao.getShopcert(shopId,"5");
-		if(CollectionUtils.isNotEmpty(shopcert5) && shopcert5.size() > 0){
-			newCmShop.setSanitationPermit(shopcert5.get(0).getImage());
-		}
+        List<ShopCert> shopcert5 = newCmShopDao.getShopcert(shopId, "5");
+        if (CollectionUtils.isNotEmpty(shopcert5) && shopcert5.size() > 0) {
+            newCmShop.setSanitationPermit(shopcert5.get(0).getImage());
+        }
 
-		List<ShopCert> shopcert6 = newCmShopDao.getShopcert(shopId,"6");
-		if(CollectionUtils.isNotEmpty(shopcert6) && shopcert6.size() > 0){
-			newCmShop.setTaxPermit(shopcert6.get(0).getImage());
-		}
-		return newCmShop;
-	}
+        List<ShopCert> shopcert6 = newCmShopDao.getShopcert(shopId, "6");
+        if (CollectionUtils.isNotEmpty(shopcert6) && shopcert6.size() > 0) {
+            newCmShop.setTaxPermit(shopcert6.get(0).getImage());
+        }
+        //分帐号查询
+        List<SplitCode> splitCodes = newCmShopDao.findSplitCode(newCmShop.getShopID());
+        if (null != splitCodes && splitCodes.size() > 0) {
+            newCmShop.setSplitCodes(splitCodes);
+        }
+        return newCmShop;
+    }
 
-	@Transactional(readOnly = false)
-	public void update(NewCmShop newCmShop){
-	    // 供应商logo
-		String logo = newCmShop.getLogo();
-		if(StringUtils.isNotEmpty(logo)){
-			logo = getImageUrl(logo);
-			newCmShop.setLogo(logo);
-		}
-		// 营业执照
+    @Transactional(readOnly = false)
+    public void update(NewCmShop newCmShop) {
+        // 供应商logo
+        String logo = newCmShop.getLogo();
+        if (StringUtils.isNotEmpty(logo)) {
+            logo = getImageUrl(logo);
+            newCmShop.setLogo(logo);
+        }
+        // 营业执照
         String businessLicenseImage = newCmShop.getBusinessLicenseImage();
         if (StringUtils.isNotEmpty(businessLicenseImage)) {
-			businessLicenseImage = getImageUrl(businessLicenseImage);
+            businessLicenseImage = getImageUrl(businessLicenseImage);
             newCmShop.setBusinessLicenseImage(businessLicenseImage);
         }
         // 供应商基础信息保存
-		newCmShopDao.update(newCmShop);
-		//清除所有供应商证书再保存
-		newCmShopDao.deleteCert(newCmShop.getShopID());
-		// 1、荣誉证书
-		String honorCertificate1 = newCmShop.getHonorCertificate1();
-		String honorCertificate2 = newCmShop.getHonorCertificate2();
-		String honorCertificate3 = newCmShop.getHonorCertificate3();
-		String honorCertificate4 = newCmShop.getHonorCertificate4();
-		String honorCertificate5 = newCmShop.getHonorCertificate5();
-		// 2、生产许可
-		String productionLicense = newCmShop.getProductionLicense();
-		// 3、产品证书
-		String productCertificate = newCmShop.getProductCertificate();
-		///5、卫生许可
-		String sanitationPermit = newCmShop.getSanitationPermit();
-		// 6、税务许可
-		String taxPermit = newCmShop.getTaxPermit();
-		if(StringUtils.isNotEmpty(honorCertificate1)){
-			honorCertificate1 = getImageUrl(honorCertificate1);
-			ShopCert shopCert = new ShopCert();
+        newCmShopDao.update(newCmShop);
+        //清除所有供应商证书再保存
+        newCmShopDao.deleteCert(newCmShop.getShopID());
+        // 1、荣誉证书
+        String honorCertificate1 = newCmShop.getHonorCertificate1();
+        String honorCertificate2 = newCmShop.getHonorCertificate2();
+        String honorCertificate3 = newCmShop.getHonorCertificate3();
+        String honorCertificate4 = newCmShop.getHonorCertificate4();
+        String honorCertificate5 = newCmShop.getHonorCertificate5();
+        // 2、生产许可
+        String productionLicense = newCmShop.getProductionLicense();
+        // 3、产品证书
+        String productCertificate = newCmShop.getProductCertificate();
+        ///5、卫生许可
+        String sanitationPermit = newCmShop.getSanitationPermit();
+        // 6、税务许可
+        String taxPermit = newCmShop.getTaxPermit();
+        if (StringUtils.isNotEmpty(honorCertificate1)) {
+            honorCertificate1 = getImageUrl(honorCertificate1);
+            ShopCert shopCert = new ShopCert();
             shopCert.setShopID(newCmShop.getShopID());
             shopCert.setShopCertTypeID("1");//
             shopCert.setName("荣誉证书");
             shopCert.setImage(honorCertificate1);
-			newCmShopDao.saveShopcert(shopCert);
-		}
-		if(StringUtils.isNotEmpty(honorCertificate2)){
-			honorCertificate2 = getImageUrl(honorCertificate2);
-			ShopCert shopCert = new ShopCert();
+            newCmShopDao.saveShopcert(shopCert);
+        }
+        if (StringUtils.isNotEmpty(honorCertificate2)) {
+            honorCertificate2 = getImageUrl(honorCertificate2);
+            ShopCert shopCert = new ShopCert();
             shopCert.setShopID(newCmShop.getShopID());
             shopCert.setShopCertTypeID("1");//
             shopCert.setName("荣誉证书");
             shopCert.setImage(honorCertificate2);
-			newCmShopDao.saveShopcert(shopCert);
-		}
-		if(StringUtils.isNotEmpty(honorCertificate3)){
-			honorCertificate3 = getImageUrl(honorCertificate3);
-			ShopCert shopCert = new ShopCert();
+            newCmShopDao.saveShopcert(shopCert);
+        }
+        if (StringUtils.isNotEmpty(honorCertificate3)) {
+            honorCertificate3 = getImageUrl(honorCertificate3);
+            ShopCert shopCert = new ShopCert();
             shopCert.setShopID(newCmShop.getShopID());
             shopCert.setShopCertTypeID("1");//
             shopCert.setName("荣誉证书");
             shopCert.setImage(honorCertificate3);
-			newCmShopDao.saveShopcert(shopCert);
-		}
-		if(StringUtils.isNotEmpty(honorCertificate4)){
-			honorCertificate4 = getImageUrl(honorCertificate4);
-			ShopCert shopCert = new ShopCert();
+            newCmShopDao.saveShopcert(shopCert);
+        }
+        if (StringUtils.isNotEmpty(honorCertificate4)) {
+            honorCertificate4 = getImageUrl(honorCertificate4);
+            ShopCert shopCert = new ShopCert();
             shopCert.setShopID(newCmShop.getShopID());
             shopCert.setShopCertTypeID("1");//
             shopCert.setName("荣誉证书");
             shopCert.setImage(honorCertificate4);
-			newCmShopDao.saveShopcert(shopCert);
-		}
-		if(StringUtils.isNotEmpty(honorCertificate5)){
-			honorCertificate5 = getImageUrl(honorCertificate5);
-			ShopCert shopCert = new ShopCert();
+            newCmShopDao.saveShopcert(shopCert);
+        }
+        if (StringUtils.isNotEmpty(honorCertificate5)) {
+            honorCertificate5 = getImageUrl(honorCertificate5);
+            ShopCert shopCert = new ShopCert();
             shopCert.setShopID(newCmShop.getShopID());
             shopCert.setShopCertTypeID("1");//
             shopCert.setName("荣誉证书");
             shopCert.setImage(honorCertificate5);
-			newCmShopDao.saveShopcert(shopCert);
-		}
-		if(StringUtils.isNotEmpty(productionLicense)){
-			productionLicense = getImageUrl(productionLicense);
-			ShopCert shopCert = new ShopCert();
+            newCmShopDao.saveShopcert(shopCert);
+        }
+        if (StringUtils.isNotEmpty(productionLicense)) {
+            productionLicense = getImageUrl(productionLicense);
+            ShopCert shopCert = new ShopCert();
             shopCert.setShopID(newCmShop.getShopID());
             shopCert.setShopCertTypeID("2");
             shopCert.setName("生产经营证书");
             shopCert.setImage(productionLicense);
-			newCmShopDao.saveShopcert(shopCert);
-		}
-		if(StringUtils.isNotEmpty(productCertificate)){
-			productCertificate = getImageUrl(productCertificate);
-			ShopCert shopCert = new ShopCert();
+            newCmShopDao.saveShopcert(shopCert);
+        }
+        if (StringUtils.isNotEmpty(productCertificate)) {
+            productCertificate = getImageUrl(productCertificate);
+            ShopCert shopCert = new ShopCert();
             shopCert.setShopID(newCmShop.getShopID());
             shopCert.setShopCertTypeID("3");
             shopCert.setName("产品证书");
             shopCert.setImage(productCertificate);
-			newCmShopDao.saveShopcert(shopCert);
-		}
-		if(StringUtils.isNotEmpty(sanitationPermit)){
-			sanitationPermit = getImageUrl(sanitationPermit);
-			ShopCert shopCert = new ShopCert();
+            newCmShopDao.saveShopcert(shopCert);
+        }
+        if (StringUtils.isNotEmpty(sanitationPermit)) {
+            sanitationPermit = getImageUrl(sanitationPermit);
+            ShopCert shopCert = new ShopCert();
             shopCert.setShopID(newCmShop.getShopID());
             shopCert.setShopCertTypeID("5");
             shopCert.setName("卫生许可");
             shopCert.setImage(sanitationPermit);
-			newCmShopDao.saveShopcert(shopCert);
-		}
-		if(StringUtils.isNotEmpty(taxPermit)){
-			taxPermit = getImageUrl(taxPermit);
-			ShopCert shopCert = new ShopCert();
+            newCmShopDao.saveShopcert(shopCert);
+        }
+        if (StringUtils.isNotEmpty(taxPermit)) {
+            taxPermit = getImageUrl(taxPermit);
+            ShopCert shopCert = new ShopCert();
             shopCert.setShopID(newCmShop.getShopID());
             shopCert.setShopCertTypeID("6");
             shopCert.setName("税务许可");
             shopCert.setImage(taxPermit);
-			newCmShopDao.saveShopcert(shopCert);
-		}
-
-	}
-
-	/**
-	 * 获取商品图片服务器全路径
-	 * @param imageUrl
-	 * @return
-	 */
-	public String getImageUrl(String imageUrl){
-		 String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
-            ImageUploadInfo saveImageSerivce = new ImageUploadInfo();
-            if(StringUtils.isNotBlank(imageUrl) && !imageUrl.startsWith("http:") && !imageUrl.startsWith("https:")){
-                imageUrl= Encodes.urlDecode(imageUrl);
-                String realPath = UploadImageUtils.getAbsolutePath(imageUrl);
-                int pointerIndex = realPath.lastIndexOf(".");
-                try {
-                    saveImageSerivce = UploadUtils.saveImageSerivce(realPath, pointerIndex,realPath);
-                    imageUrl = photoServer + saveImageSerivce.getSource();
-                } catch (Exception e) {
-                    logger.error("图片上传错误:"+e.toString(),e);
+            newCmShopDao.saveShopcert(shopCert);
+        }
+        if (null != newCmShop.getSplitCodes() && newCmShop.getSplitCodes().size() > 0) {
+            //删除旧分帐号
+            newCmShopDao.deleteSplitCode(newCmShop.getShopID());
+            for (SplitCode splitCode : newCmShop.getSplitCodes()) {
+                if(StringUtils.isNotBlank(splitCode.getSplitCode())){
+                    splitCode.setShopId(newCmShop.getShopID());
+                    //增加新分帐号
+                    newCmShopDao.insertSplitCode(splitCode);
                 }
             }
-            return imageUrl;
-	}
+        }
+    }
+
+    /**
+     * 获取商品图片服务器全路径
+     *
+     * @param imageUrl
+     * @return
+     */
+    public String getImageUrl(String imageUrl) {
+        String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
+        ImageUploadInfo saveImageSerivce = new ImageUploadInfo();
+        if (StringUtils.isNotBlank(imageUrl) && !imageUrl.startsWith("http:") && !imageUrl.startsWith("https:")) {
+            imageUrl = Encodes.urlDecode(imageUrl);
+            String realPath = UploadImageUtils.getAbsolutePath(imageUrl);
+            int pointerIndex = realPath.lastIndexOf(".");
+            try {
+                saveImageSerivce = UploadUtils.saveImageSerivce(realPath, pointerIndex, realPath);
+                imageUrl = photoServer + saveImageSerivce.getSource();
+            } catch (Exception e) {
+                logger.error("图片上传错误:" + e.toString(), e);
+            }
+        }
+        return imageUrl;
+    }
 
 
-	@Transactional(readOnly = false)
-	public void save(NewCmShop newCmShop) {
-		super.save(newCmShop);
-	}
+    @Transactional(readOnly = false)
+    public void save(NewCmShop newCmShop) {
+        super.save(newCmShop);
+    }
 
-	@Transactional(readOnly = false)
-	public void delete(NewCmShop newCmShop) {
-		super.delete(newCmShop);
-	}
+    @Transactional(readOnly = false)
+    public void delete(NewCmShop newCmShop) {
+        super.delete(newCmShop);
+    }
 
 }

+ 1 - 0
src/main/resources/mappings/modules/coupon/CmCouponClubMapper.xml

@@ -134,6 +134,7 @@
 		  AND NOW() BETWEEN cc.startDate
 		  AND cc.endDate
 		  AND cc.status != 2
+		  AND NOW()  <![CDATA[ < ]]>  DATE_ADD(ccc.createDate,INTERVAL cc.usePeriod DAY)
 		WHERE
 		  c.status IN (1, 90)
 		  <if test="clubName != null and clubName != ''">

+ 56 - 4
src/main/resources/mappings/modules/coupon/CmCouponMapper.xml

@@ -22,6 +22,9 @@
 		a.appletsBanner AS "appletsBanner",
 		a.categoryType AS "categoryType",
 		a.couponsMode AS "couponsMode",
+		a.moneyCouponPrice AS "moneyCouponPrice",
+		a.moneyCouponFlag AS "moneyCouponFlag",
+		a.moneyCouponType as "moneyCouponType",
 		a.createDate AS "createDate",
 		a.delFlag AS "delFlag"
 	</sql>
@@ -49,9 +52,12 @@
 		<include refid="cmCouponJoins"/>
 		<where>
 			AND a.delFlag = 0 AND a.vipFlag != '1'
-			<if test="couponType != null">
+			<if test="couponType != null and couponType != 5">
 				AND a.couponType = #{couponType}
 			</if>
+		    <if test="moneyCouponFlag != null and moneyCouponFlag > 0">
+				AND a.moneyCouponFlag = #{moneyCouponFlag}
+			</if>
 			<if test="name != null and name != ''">
 				AND a.name LIKE 
 					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
@@ -152,6 +158,9 @@
 			categoryType,
 			couponsMode,
 			createDate,
+			moneyCouponPrice,
+			moneyCouponFlag,
+			moneyCouponType,
 			delFlag
 		) VALUES (
 			#{name},
@@ -173,6 +182,9 @@
 			#{categoryType},
 			#{couponsMode},
 			#{createDate},
+		    #{moneyCouponPrice},
+		    #{moneyCouponFlag},
+			#{moneyCouponType},
 			#{delFlag}
 		)
 	</insert>
@@ -196,7 +208,9 @@
 			pcBanner = #{pcBanner},
 			appletsBanner = #{appletsBanner},
 			categoryType = #{categoryType},
-			couponsMode = #{couponsMode}
+			couponsMode = #{couponsMode},
+			moneyCouponPrice = #{moneyCouponPrice},
+			moneyCouponType = #{moneyCouponType}
 		WHERE id = #{id}
 	</update>
 	
@@ -440,7 +454,7 @@
 		  LEFT JOIN cm_coupon cc ON a.couponId = cc.id
 		  LEFT JOIN cm_coupon_redemption_code ccrc ON a.id = ccrc.clubCouponId
 		WHERE
-		  cc.delFlag = 0
+		  	  if(moneyCouponFlag=2,cc.delFlag = 0,cc.id>0)
 		  AND a.delFlag = 0
 		  AND a.userId = #{userId}
 		  AND a.status = 1
@@ -488,13 +502,51 @@
 		  LEFT JOIN cm_coupon_redemption_code ccrc ON a.id = ccrc.couponId
 		WHERE
 		  a.status != 2
+		  AND a.moneyCouponFlag = 2
 		  AND a.delFlag = 0
 		  AND NOW() BETWEEN a.startDate
 		  AND a.endDate
 		  AND a.couponsMode = 1
 		  AND ccrc.status = 1
 	</select>
-
+	<select id="findCouponList" resultType="com.caimei.modules.coupon.entity.CmCoupon">
+		SELECT
+			cc.`id`,
+			cc.`name`,
+			cc.`couponAmount`,
+			cc.`touchPrice`,
+			cc.`startDate`,
+			cc.`endDate`,
+			cc.`status`,
+			cc.`couponType`,
+			cc.`userId`,
+			cc.`shopId`,
+			cc.`productType`,
+			cc.`pcBanner`,
+			cc.`appletsBanner`,
+			cc.`categoryType`,
+			cc.`couponsMode`,
+			cc.`createDate`,
+		    cc.moneyCouponPrice,
+			cc.`delFlag`
+		FROM
+			cm_coupon cc
+		WHERE
+			cc.id > 0
+		  AND cc.delFlag = 0
+		  AND cc.moneyCouponFlag = #{moneyCouponFlag}
+		  AND cc.status != 2
+		  AND cc.couponsMode = 0
+		  AND (couponType IN (0,1,3)
+			OR (couponType = 2 AND userId = #{userId})
+			OR ((SELECT registerTime FROM USER WHERE userID = #{userId}) <![CDATA[ >= ]]> startDate
+				AND couponType = 4))
+		  AND NOW() <![CDATA[ < ]]> if(receiveFlag = 1,endDate,
+									   date_add(if((SELECT registerTime FROM USER WHERE userID = #{userId}) <![CDATA[ > ]]> startDate and (SELECT registerTime FROM USER WHERE userID = #{userId}) <![CDATA[ < ]]> endDate,(SELECT registerTime FROM USER WHERE userID = #{userId}),startDate),
+												interval receivePeriod day))
+		ORDER BY
+			cc.couponAmount DESC
+	</select>
 	<update id="updateClubCoupon">
 		UPDATE
 		  cm_coupon_club

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

@@ -67,9 +67,11 @@
         end) AS "userName",
         (case when crr.relationType = '1' then u_cr.name else u.name
         end) AS "name",
+        IF(crr.relationType = '6',(SELECT NAME FROM USER mu WHERE mu.userId=ccb.userId),'') AS "backname",
         cr.organizeID AS organizeID
         FROM cm_discern_receipt a
         left join cm_receipt_order_relation crr on crr.receiptID = a.id and crr.delFlag = '0'
+        LEFT JOIN cm_coupon_buyrecord ccb ON crr.couponRecordId=ccb.id
         -- 主订单
         left join cm_order cr on cr.orderID = crr.orderID
         left join user u on u.userID = cr.userID
@@ -913,9 +915,11 @@
                svipr.payTime,
                cror.orderRequestNo,
                cror.vipRecordId,
-               svipp.duration
+               svipp.duration,
+               c.name as clubName
         from cm_svip_history svipr
         left join cm_receipt_order_relation cror on svipr.id = cror.vipRecordId
+        left join club c on svipr.userId = c.clubID
         left join cm_svip_package svipp on svipp.id = svipr.packageId
         where cror.receiptID=#{receiptID}
         LIMIT 1
@@ -1000,4 +1004,14 @@
           AND cdr.payway = 1
           AND cror.orderID = #{orderID}
     </select>
+    <select id="getCouponInfo" resultType="com.caimei.modules.order.entity.ReceipCouponInfoVo">
+        SELECT c.name as clubName,cc.touchPrice,cc.couponAmount,cror.mborderId,cc.couponType,cdr.confirmDate
+        FROM cm_receipt_order_relation cror
+                 LEFT JOIN cm_discern_receipt cdr ON cror.receiptID=cdr.id
+                 LEFT JOIN cm_order co ON cror.orderId=co.orderID
+                 LEFT JOIN club c ON co.userID=c.userID
+                 LEFT JOIN cm_coupon_buyrecord ccb ON ccb.id=cror.couponRecordId
+                 LEFT JOIN cm_coupon cc ON ccb.couponId=cc.id
+        WHERE receiptID = #{receiptID}
+    </select>
 </mapper>

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

@@ -33,7 +33,7 @@
 			b.totalFee as totalFee,b.totalAddedValueTax as totalAddedValueTax,
 			b.taxRate as taxRate,b.addedValueTax as addedValueTax,c.mainImage as mainImage,
 			c.name as name,d.name as shopName,
-			c.unit as unit,d.commercialCode as commercialCode
+			c.unit as unit
 		FROM cm_returned_purchase_product a
 		left join cm_order_product b on a.orderProductID = b.orderProductID
 		left join product c on c.productID = a.productID

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

@@ -240,7 +240,6 @@
     <select id="findListByOrderID" resultType="newShopOrder">
         SELECT<include refid="shopOrderColumns"/>,
         b.name as shopName,
-        b.commercialCode as commercialCode,
         oa.id as orderArchiveId
         FROM cm_shop_order a left join shop b on a.shopID = b.shopID left join cm_order_archive oa on a.shopOrderID =
         oa.shopOrderId

+ 1 - 0
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -1608,6 +1608,7 @@
 			<if test="trainingFee != null">
 				trainingFee = #{trainingFee},
 			</if>
+				splitCode = #{splitCode}
 		</set>
 		where productID = #{productID}
 	</update>

+ 8 - 0
src/main/resources/mappings/modules/product/ProductNewMapper.xml

@@ -741,6 +741,14 @@
         ORDER BY
           addTime DESC
     </select>
+    <select id="findSplitCode" resultType="com.caimei.modules.user.entity.SplitCode">
+        select shopId,commercialCode as splitCode,codeDetail as codeRemark
+        from cm_shop_splitcode
+        where shopId=#{shopID}
+    </select>
+    <select id="findSplitCodeByProduct" resultType="java.lang.String">
+        select splitCode from product where productID = #{productID}
+    </select>
 
 </mapper>
 

+ 14 - 5
src/main/resources/mappings/modules/user/NewCmShopMapper.xml

@@ -54,7 +54,6 @@
 		a.rebateAmount AS "rebateAmount",
 		a.bankAccountName AS "bankAccountName",
 		a.bankName AS "bankName",
-		a.commercialCode AS "commercialCode",
 		a.socialCreditCode AS "socialCreditCode",
 		u.email,
 		u.source AS "source",
@@ -149,6 +148,11 @@
 			</otherwise>
 		</choose>
 	</select>
+	<select id="findSplitCode" resultType="com.caimei.modules.user.entity.SplitCode">
+		select shopId,commercialCode as splitCode,codeDetail as codeRemark
+		from cm_shop_splitcode
+		where shopId = #{shopID}
+	</select>
 
 	<insert id="saveShopcert" parameterType="com.caimei.modules.cibe.entity.ShopCert" keyProperty="shopCertID" useGeneratedKeys="true">
         INSERT INTO `shopcert` (
@@ -257,7 +261,11 @@
 			#{socialCreditCode}
 		)
 	</insert>
-
+	<insert id="insertSplitCode">
+		insert into cm_shop_splitcode
+		(shopId, commercialCode, codeDetail)
+		values (#{shopId},#{splitCode},#{codeRemark})
+	</insert>
 	<update id="update">
 		UPDATE shop
 		<set>
@@ -376,9 +384,6 @@
 			<if test="bankName != null">
 				bankName=#{bankName},
 			</if>
-			<if test="commercialCode != null">
-				commercialCode = #{commercialCode},
-			</if>
 			<if test="socialCreditCode != null">
 				socialCreditCode = #{socialCreditCode}
 			</if>
@@ -395,6 +400,10 @@
 		DELETE FROM shopcert
 		WHERE shopID = #{shopID}
 	</delete>
+	<delete id="deleteSplitCode">
+		delete from cm_shop_splitcode
+		where shopId = #{shopID}
+	</delete>
 
 	<update id="updateAbleRebateAmount" parameterType="NewCmShop">
 		update shop set ableRebateAmount = #{ableRebateAmount} where shopID = #{shopID}

+ 985 - 0
src/main/webapp/WEB-INF/views/modules/coupon/MoneyCouponForm.jsp

@@ -0,0 +1,985 @@
+<%@ page import="java.util.Date" %>
+<%@ 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() {
+            $("#inputForm").validate({
+                submitHandler: function(form){
+                    if (imageList.length > 0) {
+                        var productInfo = JSON.stringify(imageList);
+                        $('#productInfo').val(productInfo);
+                    }
+                    var couponType = $("input[name='couponType']:checked").val();
+                    var productType = $("input[name='productType']:checked").val();
+                    if (couponType == 0 && productType == 2) {
+                        var pcBanner = $('#pcBanner').val();
+                        var appletsBanner = $('#appletsBanner').val();
+                        if (pcBanner == '' || appletsBanner == '') {
+                            alertx("请上传Banner图");
+                            return false;
+                        }
+                    }
+                    var couponAmount = $("#couponAmount").val()*1;
+                    var touchPrice = $("#touchPrice").val()*1;
+                    if (couponAmount >= touchPrice) {
+                        alertx("优惠券金额必须小于优惠条件金额");
+                        return false;
+                    }
+                    var startDate = $("#startDate").val();
+                    var endDate = $("#endDate").val();
+                    if (startDate >= endDate) {
+                        alertx("结束时间不能早于开始时间");
+                        return false;
+                    }
+                    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>
+    <style>
+        .iconBox {
+            font-size: 0;
+        }
+        .conList .btn:nth-of-type(1){
+            margin-left: 25px;
+        }
+        .upload-content-image {
+            margin-top: -70px;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) {
+            width: 90px;
+            height: 100px;
+            border: 2px solid #eee;
+            background: #fff;
+            position: relative;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) > div {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            color: #666;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) span {
+            font-size: 35px;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) h5 {
+            color: #666;
+        }
+        .upload-content-image .conList ol li {
+            width: 114px;
+            min-height: 80px;
+            text-align: center;
+            background: #fff;
+            position: relative;
+            top: 120px;
+            margin-left: 2px;
+        }
+        .cancel-upload-image {
+            background: transparent;
+            border: none;
+            box-shadow: none;
+            position: relative;
+            top: -38px;
+            left: -25px;
+            cursor: pointer;
+            z-index: 100;
+        }
+        .hide-pic-image {
+            display: none !important;
+        }
+    </style>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/coupon/cmCoupon/list?moneyCouponFlag=1&&couponType=5">价值优惠券列表</a></li>
+    <li class="active"><a href="${ctx}/coupon/cmCoupon/moneyCouponForm?id=${cmCoupon.id}">${not empty cmCoupon.id?'编辑':'添加'}</a></li>
+</ul><br/>
+<form:form id="inputForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/moneyCouponSave" method="post" class="form-horizontal">
+    <form:hidden path="id"/>
+    <form:hidden path="productInfo" id="productInfo"/>
+    <sys:message content="${message}"/>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>优惠券名称:</label>
+        <div class="controls">
+            <form:input path="name" htmlEscape="false" maxlength="30" placeholder="30个汉字以内" 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="couponAmount" name="couponAmount" value="${cmCoupon.couponAmount}" min="0" required>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>优惠条件:</label>
+        <div class="controls">
+            订单商品总额满&nbsp;&nbsp;&nbsp;&nbsp;<input type="number" name="touchPrice" id="touchPrice" value="${cmCoupon.touchPrice}" min="0" required>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>购买价格:</label>
+        <div class="controls">
+            <input type="number" id="moneyCouponPrice" name="moneyCouponPrice" value="${cmCoupon.moneyCouponPrice}" min="0" required>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
+        <div class="controls">
+            <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
+                   value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd 00:00:00"/>"
+                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd 00:00:00',isShowClear:false});" onblur="dateShow()"/>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
+        <div class="controls">
+            <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
+                   value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd 23:59:59"/>"
+                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59',isShowClear:false});" onblur="dateShow()"/>
+        </div>
+    </div>
+    <div class="control-group" style="display:none;">
+        <label class="control-label"><font color="red">*</font>状态:</label>
+        <div class="controls">
+            <label id="initializeShow">
+                <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">
+                    <font color="#800080">未生效</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 1}">
+                    <font color="#00CC66">已生效</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 2}">
+                    <font color="red">已关闭</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 3}">
+                    <font color="#FF6600">已失效</font>
+                </c:if>
+            </label>
+            <label id="closeShow" style="display: none">
+                <font color="red">已关闭</font>
+            </label>
+            <input type="hidden" id="hiddenStatus" name="status" value="">
+            <input type="checkbox" id="status" name="status" value="2" ${cmCoupon.status eq "2" ? "checked" : ""}
+                   onclick="statusShow()"/>关闭
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>购买期限:</label>
+        <div class="controls">
+            <input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
+            <input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
+                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
+            <input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>使用期限:</label>
+        <div class="controls">
+            <input type="number" id="usePeriod" name="usePeriod" value="${cmCoupon.usePeriod}" min="1" required> 天
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>优惠券属性:</label>
+        <div class="controls">
+            <form:radiobutton path="moneyCouponType" value="1" label="意向券" class="required" onclick="moneyCouponShow()"/>
+            <form:radiobutton path="moneyCouponType" value="2" label="定向券" class="required" onclick="moneyCouponShow()"/>
+        </div>
+    </div>
+    <div class="control-group" id="yxq">
+        <label class="control-label"><font color="red">*</font>优惠券类型:</label>
+        <div class="controls">
+                <form:radiobutton name="hdq" path="couponType" value="0" label="活动券" class="required" onclick="couponShow()"/>
+                <form:radiobutton id="plq" path="couponType" value="1" style="display:${cmCoupon.moneyCouponType eq 2 ? 'none':''}" label="品类券" class="required" onclick="couponShow()"/>
+                <form:radiobutton id="zxq" path="couponType" value="2" style="display:${cmCoupon.moneyCouponType eq 2 ? 'none':''}" label="用户专享券" class="required" onclick="couponShow()"/>
+                <form:radiobutton id="dpq" path="couponType" value="3" style="display:${cmCoupon.moneyCouponType eq 2 ? 'none':''}" label="店铺券" class="required" onclick="couponShow()"/>
+        </div>
+    </div>
+    <div id="eventVoucher" class="yxq">
+        <div class="control-group">
+            <label class="control-label"><font color="red">*</font>优惠商品:</label>
+            <div class="controls">
+                <form:radiobutton id="qsc" path="productType" value="1" label="全商城商品" style="display: ${cmCoupon.moneyCouponType eq 2 ? 'none':''}" onclick="productShow()" checked ="${empty cmCoupon.productType ? true:false}" />
+                <form:radiobutton path="productType" value="2" label="指定商品" onclick="productShow()"/>
+            </div>
+        </div>
+    </div>
+    <div class="control-group" id="couponCategory" hidden="hidden">
+        <label class="control-label"><font color="red">*</font>优惠品类:</label>
+        <div class="controls">
+            <form:radiobutton path="categoryType" value="1" label="产品" checked ="${empty cmCoupon.categoryType ? true:false}"/>
+            <form:radiobutton path="categoryType" value="2" label="仪器"/>
+        </div>
+    </div>
+    <div class="control-group" id="couponClub" hidden="hidden">
+        <label class="control-label"><font color="red">*</font>机构:</label>
+        <div class="controls">
+            <a href="javascript:void(0);" onclick="showSelectClub()" id="chooseClub">请选择机构</a>
+            <input type="hidden" name="userId" id="userId" value="${cmCoupon.userId}">
+            <table id="contentTableClub" class="table table-striped table-bordered table-condensed" hidden="hidden">
+                <thead>
+                <tr>
+                    <th>机构名称</th>
+                    <th>机构简称</th>
+                    <th>联系人</th>
+                    <th>手机号</th>
+                    <th>操作</th>
+                </tr>
+                </thead>
+                <tbody id="hotSearchClub"></tbody>
+            </table>
+        </div>
+    </div>
+    <div class="control-group" id="couponShop" hidden="hidden">
+        <label class="control-label"><font color="red">*</font>供应商:</label>
+        <div class="controls">
+            <a href="javascript:void(0);" onclick="showSelectShop()" id="chooseShop">请选择供应商</a>
+            <form:hidden path="shopId" id="shopId"/>
+            <table id="contentTableShop" class="table table-striped table-bordered table-condensed" hidden="hidden">
+                <thead>
+                <tr>
+                    <th>机构名称</th>
+                    <th>机构简称</th>
+                    <th>联系人</th>
+                    <th>手机号</th>
+                    <th>操作</th>
+                </tr>
+                </thead>
+                <tbody id="hotSearchShop"></tbody>
+            </table>
+        </div>
+    </div>
+    <div class="productData" hidden="hidden">
+        <div class="control-group">
+            <label class="control-label"><font color="red">*</font>网站活动页banner:</label>
+            <div class="controls upload-content-image iconBox">
+                <div class="conList">
+                    <form:hidden id="pcBanner" path="pcBanner" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                    <sys:ckfinder input="pcBanner" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                    <br>
+                </div>
+            </div>
+        </div>
+        <div class="control-group">
+            <label class="control-label"><font color="red">*</font>小程序活动页banner:</label>
+            <div class="controls upload-content-image iconBox">
+                <div class="conList">
+                    <form:hidden id="appletsBanner" path="appletsBanner" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                    <sys:ckfinder input="appletsBanner" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                    <br>
+                </div>
+            </div>
+        </div>
+        <div class="control-group">
+            <input class="btn" id="del" style="width: 50px" onclick="batchDeletion()" value="删除"/>&nbsp;&nbsp;&nbsp;&nbsp;
+            <input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort()" value="一键排序"/>&nbsp;&nbsp;&nbsp;&nbsp;
+            <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct()" value="添加"/>
+            <br><br>
+            <table id="contentTable" class="table table-striped table-bordered table-condensed" hidden="hidden">
+                <thead>
+                <tr>
+                    <th style="width:20px;"><input class="check-all" type="checkbox" onclick="clickAllSelect(this)"/> 全选
+                    </th>
+                    <th>商品图片</th>
+                    <th>商品名称</th>
+                    <th>供应商</th>
+                    <th>网站状态</th>
+                    <th>小程序状态</th>
+                    <th>排序</th>
+                    <th>添加时间</th>
+                    <th>操作</th>
+                </tr>
+                </thead>
+                <tbody id="hotSearch"></tbody>
+            </table>
+        </div>
+    </div>
+    <div class="form-actions">
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+    </div>
+</form:form>
+<script>
+    //图片初始化
+    $(function () {
+        $('.upload-content-image .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+        $('.upload-content-image .conList .btn:nth-of-type(2)').after('<img class="cancel-upload-image" src="/static/images/close-btn1.png">').remove();
+        $('.upload-content-image .conList').find('.cancel-upload-image').hide();
+        var observeEleImage = document.getElementsByClassName('upload-content-image')[0];
+        var observeEleImage1 = document.getElementsByClassName('upload-content-image')[1];
+        var MutationObserverImage = window.MutationObserver || window.WebKitMutationObserver;
+        var MutationObserverConfigImage = {
+            childList: true,
+            subtree: true,
+            characterData: true
+        };
+        var observerImage = new MutationObserverImage(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-image').show();
+                    if (nextEle.hasClass('hide-pic-image')) {
+                        nextEle.removeClass('hide-pic-image');
+                    }
+                }
+            })
+        });
+        observerImage.observe(observeEleImage, MutationObserverConfigImage);
+        observerImage.observe(observeEleImage1, MutationObserverConfigImage);
+
+        $('body').on('click', '.upload-content-image li', function () {
+            var index = $(this).closest('.conList').index() + 1,
+                str = 'remarkImage' + index + 'FinderOpen';
+            eval(str + '()');
+        });
+        $('body').on('click', '.cancel-upload-image', function () {
+            var wrapper = $(this).closest('.conList');
+            wrapper.find('li').css('z-index', '-1');
+            wrapper.find('input').val('');
+            $(this).hide();
+            wrapper.removeClass("hide-pic-image");
+            wrapper.parent().append(wrapper.clone());
+            wrapper.remove();
+            $(".conList").each(function (i, ele) {
+                if ($(ele).find("input.input-xlarge").val()) {
+                    $(ele).next().removeClass("hide-pic-image")
+                }
+            })
+        });
+        $(window).on("load", function () {
+            setTimeout(function () {
+                var input = $("#pcBanner");
+                if (input.val()) {
+                    input.next().find("li").css("z-index", "99");
+                    input.parents(".conList").find(".cancel-upload-image").show();
+                    input.parents(".conList").next().removeClass("hide-pic-image")
+                }
+                input = $("#appletsBanner");
+                if (input.val()) {
+                    input.next().find("li").css("z-index", "99");
+                    input.parents(".conList").find(".cancel-upload-image").show();
+                    input.parents(".conList").next().removeClass("hide-pic-image")
+                }
+            }, 500);
+        });
+        productShow()
+    });
+
+    var productIds = '';
+    var imageList = [];
+
+    $(function () {
+        //活动券商品回显
+        <c:forEach items="${associateList}" var="associate" varStatus="index">
+        imageList.push({
+            id: "${associate.id}",
+            productId: "${empty associate.productId ? "":associate.productId}",
+            image: "${associate.image}",
+            productName: "${associate.productName}",
+            shopName: "${associate.shopName}",
+            sort: "${associate.sort}",
+            pcStatus: "${associate.pcStatus}",
+            appletsStatus: "${associate.appletsStatus}",
+            addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
+        });
+        </c:forEach>
+
+        if (imageList.length > 0) {
+            $('.productData').show();
+            $('#contentTable').show();
+            batchSaveSort();
+        }
+
+        if(${cmCoupon.moneyCouponType eq 2}){
+            document.querySelector('[for="qsc"]').style.display='none';
+            document.querySelector('[for="zxq"]').style.display='none';
+            document.querySelector('[for="plq"]').style.display='none';
+            document.querySelector('[for="dpq"]').style.display='none';
+        }
+
+        //用户专享券机构回显
+        if (${not empty cmUser}){
+            var items = {
+                "userID": "${cmUser.userID}",
+                "name": "${cmUser.name}",
+                "shortName": "${cmUser.shortName}",
+                "linkMan": "${empty cmUser.userName ? '':cmUser.userName}",
+                "contractMobile": "${empty cmUser.bindMobile ? '':cmUser.bindMobile}"
+            };
+            insertHtmlClub(items);
+        }
+
+        //店铺券供应商回显
+        if (${not empty cmCoupon.shop}) {
+            var shop = {
+                "shopId": "${cmCoupon.shop.shopID}",
+                "name": "${cmCoupon.shop.name}",
+                "sname": "${cmCoupon.shop.sname}",
+                "linkMan": "${cmCoupon.shop.linkMan}",
+                "contractMobile": "${cmCoupon.shop.contractMobile}"
+            }
+            appendShopOrderHead(shop);
+        }
+
+        couponShow();
+
+        if(${cmCoupon.receiveFlag eq 1}){
+            $("#receivePeriod").attr('readonly', true);
+            $("#receivePeriod").attr('required', false);
+        }
+    });
+
+    //点击添加商品
+    function showSelectProduct() {
+        var url = "${ctx}/coupon/cmCoupon/toAddProduct?productIds=" + productIds;
+        var title = '';
+        title = "选择商品";
+        top.$.jBox("iframe:" + url, {
+            iframeScrolling: 'yes',
+            width: $(top.document).width() - 400,
+            height: $(top.document).height() - 160,
+            persistent: true,
+            title: title,
+            buttons: {"确定": '1', "取消": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var items = $jboxFrame[0].contentWindow.getCheckedItems();
+                    console.log(items);
+                    console.log(items[0]);
+                    for (var i = 0; i < items.length; i++) {
+                        console.log(items[i]);
+                        imageList.push(items[i]);
+                        $('#contentTable').show();
+                        $("#del").removeAttr("disabled");
+                        batchSaveSort();
+                    };
+                }
+                return true;
+            }
+        });
+    }
+
+    /**
+     * 一键排序
+     */
+    function batchSaveSort() {
+        imageList.sort(sort);
+        insertHtmlProduct(imageList);
+    }
+
+    //根据sort值 从小到大排序
+    function sort(a, b) {
+        return a.sort - b.sort;
+    }
+
+    //相关图片列表数据
+    function appendProductOrderHead(data, index) {
+        var html = '<tr id ="ai' + index + '">' +
+            '<td>' +
+            '<input class="check-item" type="checkbox" name="info" value="' + index + '"/>' + (index + 1) +
+            '</td>' +
+            '<td>' +
+            '<img src="' + data.image + '" width="60px" border="none" title="启用">' +
+            '</td>' +
+            '<td>' +
+            data.productName +
+            '</td>' +
+            '<td>' +
+            data.shopName +
+            '</td>' +
+            '<td>' +
+            (data.pcStatus == 1 ? (
+                '<font color="green">已启用</font>&nbsp;&nbsp;&nbsp;' +
+                '<a href="javascript:void(0);" onclick="updatePcStatus(0,' + index + ');" >' +
+                '停用</a>'
+            ) : (
+                '<font color="red">已停用</font>&nbsp;&nbsp;&nbsp;' +
+                '<a href="javascript:void(0)" onclick="updatePcStatus(1,' + index + ');">' +
+                '启用</a>'
+            )) +
+            '</td>' +
+            '<td>' +
+            (data.appletsStatus == 1 ? (
+                '<font color="green">已启用</font>&nbsp;&nbsp;&nbsp;' +
+                '<a href="javascript:void(0);" onclick="updateAppletsStatus(0,' + index + ');" >' +
+                '停用</a>'
+            ) : (
+                '<font color="red">已停用</font>&nbsp;&nbsp;&nbsp;' +
+                '<a href="javascript:void(0)" onclick="updateAppletsStatus(1,' + index + ');">' +
+                '启用</a>'
+            )) +
+            '</td>' +
+            '<td>' +
+            '<input name="sort" style="width:50px;" value="' + data.sort + '"  onkeyup="onlynum(this)"  onchange="changeSort(' + index + ',this)"></td>' +
+            '</td>' +
+            '<td>' +
+            (data.addTime == '' ? (
+                '<fmt:formatDate value="<%=new Date()%>" pattern="yyyy-MM-dd HH:mm:ss"/>'
+            ) : (
+                data.addTime
+            )) +
+            '</td>' +
+            '<td>' +
+            '<a href="javascript:;" onclick="delect(' + index + ')">删除</a>' +
+            '</td>' +
+            '</tr>';
+        return html;
+    }
+
+    function insertHtmlProduct(list) {
+        var html = '';
+        productIds = '';
+        list.forEach(function (item, index) {
+            html += appendProductOrderHead(item, index);
+            productIds += "," + item.productId;
+        });
+        $("#hotSearch").html(html);
+    }
+
+    function changeSort(index, sortThis) {
+        var sort = sortThis.value;
+        if (sort <= 0) {
+
+        }
+        var image = imageList[index];
+        image.sort = sort;
+    }
+
+    function updatePcStatus(status, index) {
+        var image = imageList[index];
+        confirmx(status == 0 ? '确定停用吗?' : '确定启用吗?', function () {
+            image.pcStatus = status;
+            batchSaveSort();
+        })
+    }
+
+    function updateAppletsStatus(status, index) {
+        var image = imageList[index];
+        confirmx(status == 0 ? '确定停用吗?' : '确定启用吗?', function () {
+            image.appletsStatus = status;
+            batchSaveSort();
+        })
+    }
+
+    function clickAllSelect(ckb) {
+        var isChecked = ckb.checked;
+        $(".check-item").attr('checked', isChecked);
+    }
+
+    /**
+     * 删除操作
+     */
+    function delect(index) {
+        return confirmx("确定删除吗?", function () {
+            var image = imageList[index];
+            if (image.productId != '') {
+                productIds = productIds.replace(image.productId,"");
+            }
+            imageList.splice(index, 1);
+            insertHtmlProduct(imageList);
+            if (imageList.length == 0) {
+                $('#contentTable').hide();
+                $("#del").attr("disabled", "disabled");
+            }
+        });
+    }
+
+
+    /**
+     * 批量删除
+     */
+    function batchDeletion() {
+        var index = -1;
+        var i = 1;
+        return confirmx("确定删除吗?", function () {
+            $('input[name="info"]:checked').each(function () {
+                var thisIndex = $(this).val();
+                if (index >= 0 && index < thisIndex) {
+                    thisIndex = thisIndex - i;
+                    i++;
+                } else {
+                    index = thisIndex;
+                }
+                var image = imageList[thisIndex];
+                if (image.productId != '') {
+                    productIds = productIds.replace(image.productId, "");
+                }
+                imageList.splice(thisIndex, 1);
+                insertHtmlProduct(imageList);
+                if (imageList.length == 0) {
+                    $('#contentTable').hide();
+                    $("#del").attr("disabled", "disabled");
+                }
+            });
+        });
+    }
+
+    function productShow() {
+        var  productType = $("input[name='productType']:checked").val();
+        var moneyCouponType = $("input[name='moneyCouponType']:checked").val();
+        if(moneyCouponType == 2){
+            $("#productType1").attr("checked",true);
+            return;
+        }
+        if (productType == 2){
+            $(".productData").show();
+        }else {
+            $(".productData").hide();
+        }
+    }
+
+    function insertHtmlClub(data) {
+        var html = '<tr>' +
+            '<td>' +
+            data.name +
+            '</td>' +
+            '<td>' +
+            data.shortName +
+            '</td>' +
+            '<td>' +
+            data.linkMan +
+            '</td>' +
+            '<td>' +
+            data.contractMobile +
+            '</td>' +
+            '<td>' +
+            '<a href="javascript:;" onclick="deleteClub()">删除</a>' +
+            '</td>' +
+            '</tr>';
+        $("#contentTableClub").show();
+        $("#chooseClub").hide();
+        $("#hotSearchClub").html(html);
+        $("#userId").val(data.userID);
+    }
+
+    function deleteClub() {
+        $("#hotSearchClub").html("");
+        $("#contentTableClub").hide();
+        $("#chooseClub").show();
+        $("#userId").val("");
+    }
+
+    function statusShow() {
+        var status = $("input[name='status']:checked").val();
+        if (status == 2) {
+            $("#initializeShow").hide();
+            $("#closeShow").show();
+        } else {
+            $("#initializeShow").show();
+            $("#closeShow").hide();
+            $("#hiddenStatus").val(0);
+        }
+    }
+
+    function dateShow() {
+        var startDate = $("#startDate").val();
+        var startMs = new Date(startDate).getTime();
+        var endDate = $("#endDate").val();
+        var endMs = new Date(endDate).getTime();
+        var nowMs = new Date().getTime();
+        if (nowMs < startMs) {
+            $("#initializeShow").html("<font color=\"#800080\">未生效</font>");
+        } else if (nowMs > endMs) {
+            $("#initializeShow").html("<font color=\"#FF6600\">已失效</font>");
+        } else {
+            $("#initializeShow").html("<font color=\"#00CC66\">已生效</font>");
+        }
+    }
+
+    function showSelect(couponId) {
+        if (couponId == null){
+            alertx("暂未生成兑换码");
+            return false;
+        }
+        var url = "${ctx}/coupon/cmCoupon/redemptionCode?couponId=" + couponId;
+        var title = '';
+        title = "查看兑换码";
+        top.$.jBox("iframe:" + url, {
+            iframeScrolling: 'yes',
+            width: $(top.document).width() - 750,
+            height: $(top.document).height() - 300,
+            persistent: true,
+            title: title,
+            buttons: {"确定": '1'}
+        });
+    }
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字
+     */
+    function onlynum(obj) {
+        obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+    }
+
+    //点击添加机构
+    function showSelectClub() {
+        var url = "${ctx}/coupon/cmCoupon/toAddClub";
+        var title = '';
+        title = "选择机构";
+        top.$.jBox("iframe:" + url, {
+            iframeScrolling: 'yes',
+            width: $(top.document).width() - 400,
+            height: $(top.document).height() - 160,
+            persistent: true,
+            title: title,
+            buttons: {"确定": '1', "取消": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var items = $jboxFrame[0].contentWindow.getCheckedItems();
+                    console.log(items);
+                    insertHtmlClub(items);
+                }
+                return true;
+            }
+        });
+    }
+
+    function appendShopOrderHead(data) {
+        var html = '<tr>' +
+            '<td>' +
+            data.name +
+            '</td>' +
+            '<td>' +
+            data.sname +
+            '</td>' +
+            '<td>' +
+            data.linkMan +
+            '</td>' +
+            '<td>' +
+            data.contractMobile +
+            '</td>' +
+            '<td>' +
+            '<a href="javascript:;" onclick="delectShop()">删除</a>' +
+            '</td>' +
+            '</tr>';
+        $("#hotSearchShop").html(html);
+        $("#chooseShop").hide();
+        $('#contentTableShop').show();
+        $("#shopId").val(data.shopId);
+    }
+    function changeCondition(flag, name) {
+        var obj = $("#" + flag);
+        var val = obj.val();
+        if (val === '1') {
+            obj.val(0);
+            val = '0';
+        } else {
+            obj.val(1);
+            val = '1';
+        }
+        var inputObj = $("#" + name);
+        // 临时数据
+        var tempObj = $("#" + name + "Temp");
+        if (name.indexOf("Time") !== -1) {
+            //修改时间
+            if (val === '1') {
+                inputObj.attr('onclick', '');
+                inputObj.removeClass('required');
+            } else {
+                inputObj.attr('onclick', "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false})");
+                inputObj.addClass('required');
+            }
+        }else {
+            if (val === '1') {
+                inputObj.attr('readonly', true);
+                inputObj.attr('required', false);
+            } else {
+                inputObj.attr('readonly', false);
+                inputObj.attr('required', true);
+            }
+        }
+        if (val === '1') {
+            tempObj.val(inputObj.val());
+            inputObj.val('');
+        } else {
+            inputObj.val(tempObj.val());
+            tempObj.val('');
+        }
+    }
+
+    function changeCondition(flag, name) {
+        var obj = $("#" + flag);
+        var val = obj.val();
+        if (val === '1') {
+            obj.val(0);
+            val = '0';
+        } else {
+            obj.val(1);
+            val = '1';
+        }
+        var inputObj = $("#" + name);
+        // 临时数据
+        var tempObj = $("#" + name + "Temp");
+        if (name.indexOf("Time") !== -1) {
+            //修改时间
+            if (val === '1') {
+                inputObj.attr('onclick', '');
+                inputObj.removeClass('required');
+            } else {
+                inputObj.attr('onclick', "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false})");
+                inputObj.addClass('required');
+            }
+        }else {
+            if (val === '1') {
+                inputObj.attr('readonly', true);
+                inputObj.attr('required', false);
+            } else {
+                inputObj.attr('readonly', false);
+                inputObj.attr('required', true);
+            }
+        }
+        if (val === '1') {
+            tempObj.val(inputObj.val());
+            inputObj.val('');
+        } else {
+            inputObj.val(tempObj.val());
+            tempObj.val('');
+        }
+    }
+
+    //点击添加
+    function showSelectShop() {
+        var url = "${ctx}/coupon/cmCoupon/toAddShop";
+        var title = '';
+        title = "选择供应商";
+        top.$.jBox("iframe:" + url, {
+            iframeScrolling: 'yes',
+            width: $(top.document).width() - 400,
+            height: $(top.document).height() - 160,
+            persistent: true,
+            title: title,
+            buttons: {"确定": '1', "取消": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var items = $jboxFrame[0].contentWindow.getCheckedItems();
+                    console.log(items);
+                    appendShopOrderHead(items);
+                }
+                return true;
+            }
+        });
+    }
+
+    /**
+     * 删除操作
+     */
+    function delectShop() {
+        return confirmx("确定删除吗?", function () {
+            $("#chooseShop").show();
+            $('#contentTableShop').hide();
+            $("#shopId").val("");
+        });
+    }
+
+    function couponShow() {
+        var couponType = $("input[name='couponType']:checked").val();
+        var moneyCouponType = $("input[name='moneyCouponType']:checked").val();
+        if(moneyCouponType == 2){
+            $("#couponType1").attr("checked",true);
+            return;
+        }
+        if (couponType == 0) {
+            $("#eventVoucher").show();
+            $("#couponCategory").hide();
+            $("#couponClub").hide();
+            $("#couponShop").hide();
+        } else if (couponType == 1) {
+            $("#eventVoucher").hide();
+            $("#couponCategory").show();
+            $("#couponClub").hide();
+            $("#couponShop").hide();
+            $(".productData").hide();
+        } else if (couponType == 2) {
+            $("#eventVoucher").hide();
+            $("#couponCategory").hide();
+            $("#couponClub").show();
+            $("#couponShop").hide();
+            $(".productData").hide();
+        } else if (couponType == 3) {
+            $("#eventVoucher").hide();
+            $("#couponCategory").hide();
+            $("#couponClub").hide();
+            $("#couponShop").show();
+            $(".productData").hide();
+        } else {
+            $("#eventVoucher").hide();
+            $("#couponCategory").hide();
+            $("#couponClub").hide();
+            $("#couponShop").hide();
+            $(".productData").hide();
+        }
+    }
+
+    function moneyCouponShow() {
+        var couponType = $("input[name='moneyCouponType']:checked").val();
+        if (couponType == 1) {
+            $("#zxq").show();
+            $("#plq").show();
+            $("#dpq").show();
+            $("#qsc").show();
+            $("#qsc").attr("checked",true);
+            $("#couponType1").attr("checked",true);
+            $("#yxq").show();
+            $("#dxq").hide();
+            $("#couponCategory").hide();
+            $("#eventVoucher").show();
+            $(".productData").hide();
+            $("#couponClub").hide();
+            $("#couponShop").hide();
+            document.querySelector('[for="qsc"]').style.display='';
+            document.querySelector('[for="zxq"]').style.display='';
+            document.querySelector('[for="plq"]').style.display='';
+            document.querySelector('[for="dpq"]').style.display='';
+        }
+        if(couponType == 2) {
+            $("#couponType1").attr("checked",true);
+            $("#productType1").attr("checked",true);
+            $("#eventVoucher").show();
+            $(".productData").show();
+            $("#couponClub").hide();
+            $("#couponShop").hide();
+            document.querySelector('[for="qsc"]').style.display='none';
+            document.querySelector('[for="zxq"]').style.display='none';
+            document.querySelector('[for="plq"]').style.display='none';
+            document.querySelector('[for="dpq"]').style.display='none';
+            $("#qsc").hide();
+            $("#zxq").hide();
+            $("#plq").hide();
+            $("#dpq").hide();
+        }
+    }
+</script>
+</body>
+</html>

+ 33 - 15
src/main/webapp/WEB-INF/views/modules/coupon/cmCouponClubList.jsp

@@ -10,7 +10,7 @@
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
-			
+
 		});
 		function page(n,s){
 			$("#pageNo").val(n);
@@ -22,29 +22,33 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<c:if test="${cmCouponClub.couponType eq 0}">
-			<li><a href="${ctx}/coupon/cmCoupon/list?couponType=0">活动券</a></li>
+		<c:if test="${cmCouponClub.couponType eq 0 && cmCouponClub.moneyCouponFlag ne 1}">
+			<li><a href="${ctx}/coupon/cmCoupon/list?couponType=0&&moneyCouponFlag=2">活动券</a></li>
 		</c:if>
-		<c:if test="${cmCouponClub.couponType eq 1}">
-			<li><a href="${ctx}/coupon/cmCoupon/list?couponType=1">品类券</a></li>
+		<c:if test="${cmCouponClub.couponType eq 1 && cmCouponClub.moneyCouponFlag ne 1}">
+			<li><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>
 		</c:if>
-		<c:if test="${cmCouponClub.couponType eq 3}">
-			<li><a href="${ctx}/coupon/cmCoupon/list?couponType=3">店铺券</a></li>
+		<c:if test="${cmCouponClub.couponType eq 3 && cmCouponClub.moneyCouponFlag ne 1}">
+			<li><a href="${ctx}/coupon/cmCoupon/list?couponType=3&&moneyCouponFlag=2">店铺券</a></li>
 		</c:if>
-		<c:if test="${cmCouponClub.couponType eq 4}">
-			<li><a href="${ctx}/coupon/cmCoupon/list?couponType=4">新用户券</a></li>
+		<c:if test="${cmCouponClub.couponType eq 4 && cmCouponClub.moneyCouponFlag ne 1}">
+			<li><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>
 		</c:if>
-		<li class="active"><a href="${ctx}/coupon/cmCouponClub/list?couponId=${cmCouponClub.couponId}&couponType=${cmCouponClub.couponType}">领取用户列表</a></li>
+		<c:if test="${cmCouponClub.moneyCouponFlag eq 1}">
+			<li><a href="${ctx}/coupon/cmCoupon/list?moneyCouponFlag=1&&couponType=5">价值优惠券列表</a></li>
+		</c:if>
+		<li class="active"><a href="${ctx}/coupon/cmCouponClub/list?couponId=${cmCouponClub.couponId}&couponType=${cmCouponClub.couponType}&moneyCouponFlag=${cmCouponClub.moneyCouponFlag}">领取用户列表</a></li>
 	</ul>
 	<form:form id="searchForm" modelAttribute="cmCouponClub" action="${ctx}/coupon/cmCouponClub/" method="post" class="breadcrumb form-search">
 		<input type="hidden" name="couponId" value="${cmCouponClub.couponId}">
 		<input type="hidden" name="couponType" value="${cmCouponClub.couponType}">
+		<input type="hidden" name="moneyCouponFlag" value="${cmCouponClub.moneyCouponFlag}">
 		<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="clubName" htmlEscape="false" class="input-medium"/>
-			 <label>领取渠道:</label>
+			 <label>领取渠道:</label>
 				<form:select path="source" class="input-medium">
 					<form:option value="" label="全部"/>
 					<form:option value="1" label="小程序"/>
@@ -57,7 +61,14 @@
 					<form:option value="1" label="未使用"/>
 					<form:option value="2" label="已使用"/>
 				</form:select>
-			 <label>领取时间:</label>
+			 <label>
+				 <c:if test="${cmCouponClub.moneyCouponFlag ne 1}">
+					 领取时间:
+				 </c:if>
+				 <c:if test="${cmCouponClub.moneyCouponFlag eq 1}">
+					 购买时间:
+				 </c:if>
+			 </label>
 				<input name="createDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
 					value="<fmt:formatDate value="${cmCouponClub.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
 					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
@@ -76,7 +87,14 @@
 				<th>机构名称</th>
 				<th>领取渠道</th>
 				<th>使用状态</th>
-				<th>领取时间</th>
+				<th>
+					<c:if test="${cmCouponClub.moneyCouponFlag ne 1}">
+					领取时间:
+					</c:if>
+					<c:if test="${cmCouponClub.moneyCouponFlag eq 1}">
+						购买时间:
+					</c:if>
+				</th>
 				<th>使用时间</th>
 			</tr>
 		</thead>
@@ -87,14 +105,14 @@
 					${cmCouponClub.clubName}
 				</td>
 				<td>
-					${cmCouponClub.source eq "1" ? "网站": cmCouponClub.source eq "2" ? "小程序" : "订单退回"}
+					${cmCouponClub.source eq "1" ? "网站": cmCouponClub.source eq "2" ? "小程序" :cmCouponClub.source eq "3" ? "订单退回":cmCouponClub.source eq "4" ? "后台":"购买优惠券商品兑换"}
 				</td>
 				<td>
 					<c:if test="${cmCouponClub.status eq '1'}">
 						<font color="red">未使用</font>
 					</c:if>
 					<c:if test="${cmCouponClub.status eq '2'}">
-						<font color="#00CC66">已使用</font>
+						<font color="#00CC66"><a href="${ctx}/order/detail?id=${cmCouponClub.orderId}">已使用</a></font>
 					</c:if>
 				</td>
 				<td>

+ 5 - 5
src/main/webapp/WEB-INF/views/modules/coupon/cmCouponForm.jsp

@@ -111,7 +111,7 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=0">活动券</a></li>
+		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=0&&moneyCouponFlag=2">活动券</a></li>
 		<li class="active"><a href="${ctx}/coupon/cmCoupon/form?couponType=0&id=${cmCoupon.id}">${not empty cmCoupon.id?'编辑':'添加'}</a></li>
 	</ul><br/>
 	<font style="color: red;margin-left: 20px">活动券适合在某些节日或者主题活动时创建,并且适用于全部客户以及商城全部商品或指定商品(不包括二手商品)。</font><br><br>
@@ -140,7 +140,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label"><font color="red">*</font>开始时间:</label>
+			<label class="control-label"><font color="red">*</font>上架时间:</label>
 			<div class="controls">
 				<input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
 					value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd 00:00:00"/>"
@@ -148,7 +148,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label"><font color="red">*</font>结束时间:</label>
+			<label class="control-label"><font color="red">*</font>下架时间:</label>
 			<div class="controls">
 				<input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
 					value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd 23:59:59"/>"
@@ -160,7 +160,7 @@
 			<div class="controls">
 				<input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
 				<input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
-					${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同活动开始-结束时间
+					${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
 				<input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
 			</div>
 		</div>
@@ -171,7 +171,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label"><font color="red">*</font>优惠状态:</label>
+			<label class="control-label"><font color="red">*</font>状态:</label>
 			<div class="controls">
 				<label id="initializeShow">
 					<c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 26 - 16
src/main/webapp/WEB-INF/views/modules/coupon/cmCouponList.jsp

@@ -10,7 +10,7 @@
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
-			
+
 		});
 		function page(n,s){
 			$("#pageNo").val(n);
@@ -22,11 +22,11 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=0">活动券</a></li>
-		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=1">品类券</a></li>
-		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=2">用户专享券</a></li>
-		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=3">店铺券</a></li>
-		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=4">新用户券</a></li>
+		<li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=0&&moneyCouponFlag=2">活动券</a></li>
+		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>
+		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=2&&moneyCouponFlag=2">用户专享券</a></li>
+		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=3&&moneyCouponFlag=2">店铺券</a></li>
+		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>
 	</ul>
 	<form:form id="searchForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/" method="post" class="breadcrumb form-search">
 		<input type="hidden" name="couponType" value="0"/>
@@ -35,7 +35,7 @@
 		<div class="ul-form">
 			 <label>活动主题:</label>
 				<form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
-			<label>优惠状态:</label>
+			<label>状态:</label>
 			<form:select path="status" class="input-medium required">
 				<form:option value="" label="所有"/>
 				<form:option value="0" label="待上架"/>
@@ -63,9 +63,11 @@
 				<th>活动主题</th>
 				<th>优惠券金额</th>
 				<th>优惠条件</th>
-				<th>优惠状态</th>
-				<th>开始时间</th>
-				<th>结束时间</th>
+				<th>上架时间</th>
+				<th>下架时间</th>
+				<th>领取期限</th>
+				<th>使用期限</th>
+				<th>状态</th>
 				<th>添加时间</th>
 				<th>操作</th>
 			</tr>
@@ -85,6 +87,20 @@
 				<td>
 					满${cmCoupon.touchPrice}
 				</td>
+				<td>
+					<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+					<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+						<c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                        <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+				</td>
+				<td>
+					    <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                        <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+				</td>
 				<td>
 					<c:if test="${cmCoupon.status eq 0}">
 						<font color="#800080">待上架</font>
@@ -99,12 +115,6 @@
 						<font color="#FF6600">已下架</font>
 					</c:if>
 				</td>
-				<td>
-					<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-				</td>
-				<td>
-					<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-				</td>
 				<td>
 					<fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>

+ 139 - 0
src/main/webapp/WEB-INF/views/modules/coupon/cmMoneyCouponList.jsp

@@ -0,0 +1,139 @@
+<%@ 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}/coupon/cmCoupon/list?moneyCouponFlag=1&&couponType=5">价值优惠券列表</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/" method="post" class="breadcrumb form-search">
+		<input type="hidden" name="moneyCouponFlag" value="1"/>
+		<input type="hidden" name="couponType" value="5"/>
+		<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="50" class="input-medium"/>
+			<label>状态:</label>
+			<form:select path="status" class="input-medium required">
+				<form:option value="" label="所有"/>
+				<form:option value="0" label="待上架"/>
+				<form:option value="1" label="已上架"/>
+				<form:option value="3" label="已下架"/>
+				<form:option value="2" label="已关闭"/>
+			</form:select>
+<%--			 <label>优惠时间:</label>--%>
+<%--				<input name="startDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"--%>
+<%--					value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"--%>
+<%--					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> ---%>
+<%--				<input name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"--%>
+<%--					value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"--%>
+<%--					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>--%>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			<input class="btn btn-primary" style="width: 120px" onclick="window.location='${ctx}/coupon/cmCoupon/moneyCouponForm'" 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>ID</th>
+				<th>优惠券名称</th>
+				<th>优惠券金额</th>
+				<th>优惠条件</th>
+				<th>购买价格</th>
+				<th>上架时间</th>
+				<th>下架时间</th>
+				<th>购买期限</th>
+				<th>使用期限</th>
+				<th>状态</th>
+				<th>创建时间</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="cmCoupon">
+			<tr>
+				<td>
+					${cmCoupon.id}
+				</td>
+				<td>
+					${cmCoupon.name}
+				</td>
+				<td>
+					${cmCoupon.couponAmount}
+				</td>
+				<td>
+					满${cmCoupon.touchPrice}
+				</td>
+				<td>
+					${cmCoupon.moneyCouponPrice}
+				</td>
+				<td>
+					<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+					<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+						<c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                        <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+				</td>
+				<td>
+					    <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                        <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+				</td>
+				<td>
+					<c:if test="${cmCoupon.status eq 0}">
+						<font color="#800080">待上架</font>
+					</c:if>
+					<c:if test="${cmCoupon.status eq 1}">
+						<font color="#00CC66">已上架</font>
+					</c:if>
+					<c:if test="${cmCoupon.status eq 2}">
+						<font color="red">已关闭</font>
+					</c:if>
+					<c:if test="${cmCoupon.status eq 3}">
+						<font color="#FF6600">已下架</font>
+					</c:if>
+				</td>
+				<td>
+					<fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+					<a href="${ctx}/coupon/cmCoupon/moneyCouponForm?id=${cmCoupon.id}">编辑</a>
+<%--					<c:if test="${cmCoupon.status eq 2}">--%>
+<%--						<a href="${ctx}/coupon/cmCoupon/open?id=${cmCoupon.id}" onclick="return confirmx('确定开启该活动吗?', this.href)">开启</a>--%>
+<%--					</c:if>--%>
+<%--					<c:if test="${cmCoupon.status ne 2}">--%>
+<%--						<a href="${ctx}/coupon/cmCoupon/close?id=${cmCoupon.id}" onclick="return confirmx('确定关闭该活动吗?', this.href)">关闭</a>--%>
+<%--					</c:if>--%>
+					<a href="${ctx}/coupon/cmCoupon/delete?id=${cmCoupon.id}&moneyCouponFlag=1" onclick="return confirmx('确定删除该优惠券吗?', this.href)">删除</a>
+					<a href="${ctx}/coupon/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=0&moneyCouponFlag=1">购买用户</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+</body>
+</html>

+ 5 - 5
src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryForm.jsp

@@ -40,7 +40,7 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=1">品类券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>
     <li class="active"><a href="${ctx}/coupon/cmCoupon/form?couponType=1&id=${cmCoupon.id}">${not empty cmCoupon.id?'编辑':'添加'}</a></li>
 </ul><br/>
 <font style="color: red;margin-left: 20px">品类券只适合在某种品类需要优惠时创建,适用于该品类商品和全部客户。</font><br><br>
@@ -76,7 +76,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>开始时间:</label>
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
         <div class="controls">
             <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd 00:00:00"/>"
@@ -84,7 +84,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>结束时间:</label>
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
         <div class="controls">
             <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd 23:59:59"/>"
@@ -96,7 +96,7 @@
         <div class="controls">
             <input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
             <input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
-                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同活动开始-结束时间
+                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
             <input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
         </div>
     </div>
@@ -107,7 +107,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>优惠状态:</label>
+        <label class="control-label"><font color="red">*</font>状态:</label>
         <div class="controls">
             <label id="initializeShow">
                 <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 27 - 16
src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryList.jsp

@@ -22,11 +22,11 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=0">活动券</a></li>
-    <li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=1">品类券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=2">用户专享券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=3">店铺券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=4">新用户券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=0&&moneyCouponFlag=2">活动券</a></li>
+    <li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=2&&moneyCouponFlag=2">用户专享券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=3&&moneyCouponFlag=2">店铺券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>
 </ul>
 <form:form id="searchForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/" method="post" class="breadcrumb form-search">
     <input type="hidden" name="couponType" value="1"/>
@@ -35,7 +35,7 @@
     <div class="ul-form">
         <label>活动主题:</label>
         <form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
-        <label>优惠状态:</label>
+        <label>状态:</label>
         <form:select path="status" class="input-medium required">
             <form:option value="" label="所有"/>
             <form:option value="0" label="待上架"/>
@@ -63,10 +63,12 @@
         <th>活动主题</th>
         <th>优惠券金额</th>
         <th>优惠条件</th>
-        <th>优惠状态</th>
         <th>优惠品类</th>
-        <th>开始时间</th>
-        <th>结束时间</th>
+        <th>上架时间</th>
+        <th>下架时间</th>
+        <th>领取期限</th>
+        <th>使用期限</th>
+        <th>状态</th>
         <th>添加时间</th>
         <th>操作</th>
     </tr>
@@ -86,6 +88,22 @@
             <td>
                 满${cmCoupon.touchPrice}
             </td>
+
+            <td>${cmCoupon.categoryType eq 1 ? "产品":"仪器"}</td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+            </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
                     <font color="#800080">待上架</font>
@@ -100,13 +118,6 @@
                     <font color="#FF6600">已下架</font>
                 </c:if>
             </td>
-            <td>${cmCoupon.categoryType eq 1 ? "产品":"仪器"}</td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
             <td>
                 <fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>

+ 5 - 5
src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserForm.jsp

@@ -40,7 +40,7 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=4">新用户券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>
     <li class="active"><a href="${ctx}/coupon/cmCoupon/form?couponType=4&id=${cmCoupon.id}">${not empty cmCoupon.id?'编辑':'添加'}</a></li>
 </ul><br/>
 <font style="color: red;margin-left: 20px">新用户券适合新注册的机构,并且适用于商城全部商品(不包括二手商品)。</font><br><br>
@@ -63,7 +63,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>开始时间:</label>
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
         <div class="controls">
             <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd 00:00:00"/>"
@@ -71,7 +71,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>结束时间:</label>
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
         <div class="controls">
             <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd 23:59:59"/>"
@@ -83,7 +83,7 @@
         <div class="controls">
             <input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
             <input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
-                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同活动开始-结束时间
+                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
             <input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
         </div>
     </div>
@@ -94,7 +94,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>优惠状态:</label>
+        <label class="control-label"><font color="red">*</font>状态:</label>
         <div class="controls">
             <label id="initializeShow">
                 <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 25 - 15
src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserList.jsp

@@ -22,18 +22,18 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=0">活动券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=1">品类券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=2">用户专享券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=3">店铺券</a></li>
-    <li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=4">新用户券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=0&&moneyCouponFlag=2">活动券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=2&&moneyCouponFlag=2">用户专享券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=3&&moneyCouponFlag=2">店铺券</a></li>
+    <li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>
 </ul>
 <form:form id="searchForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/" method="post" class="breadcrumb form-search">
     <input type="hidden" name="couponType" value="4"/>
     <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>
+        <label>状态:</label>
         <form:select path="status" class="input-medium required">
             <form:option value="" label="所有"/>
             <form:option value="0" label="待上架"/>
@@ -60,9 +60,11 @@
         <th>ID</th>
         <th>优惠券金额</th>
         <th>优惠条件</th>
-        <th>优惠状态</th>
-        <th>开始时间</th>
-        <th>结束时间</th>
+        <th>上架时间</th>
+        <th>下架时间</th>
+        <th>领取期限</th>
+        <th>使用期限</th>
+        <th>状态</th>
         <th>添加时间</th>
         <th>操作</th>
     </tr>
@@ -79,6 +81,20 @@
             <td>
                 满${cmCoupon.touchPrice}
             </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+            </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
                     <font color="#800080">待上架</font>
@@ -93,12 +109,6 @@
                     <font color="#FF6600">已下架</font>
                 </c:if>
             </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
             <td>
                 <fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>

+ 5 - 5
src/main/webapp/WEB-INF/views/modules/coupon/couponShopForm.jsp

@@ -43,7 +43,7 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=3">店铺券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=3&&moneyCouponFlag=2">店铺券</a></li>
     <li class="active"><a
             href="${ctx}/coupon/cmCoupon/form?couponType=3&id=${cmCoupon.id}">${not empty cmCoupon.id?'编辑':'添加'}</a>
     </li>
@@ -95,7 +95,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>开始时间:</label>
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
         <div class="controls">
             <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20"
                    class="input-medium Wdate "
@@ -104,7 +104,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>结束时间:</label>
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
         <div class="controls">
             <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20"
                    class="input-medium Wdate "
@@ -117,7 +117,7 @@
         <div class="controls">
             <input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
             <input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
-                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同活动开始-结束时间
+                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
             <input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
         </div>
     </div>
@@ -128,7 +128,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>优惠状态:</label>
+        <label class="control-label"><font color="red">*</font>状态:</label>
         <div class="controls">
             <label id="initializeShow">
                 <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 25 - 15
src/main/webapp/WEB-INF/views/modules/coupon/couponShopList.jsp

@@ -22,11 +22,11 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=0">活动券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=1">品类券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=2">用户专享券</a></li>
-    <li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=3">店铺券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=4">新用户券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=0&&moneyCouponFlag=2">活动券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=2&&moneyCouponFlag=2">用户专享券</a></li>
+    <li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=3&&moneyCouponFlag=2">店铺券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>
 </ul>
 <form:form id="searchForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/" method="post" class="breadcrumb form-search">
     <input type="hidden" name="couponType" value="3"/>
@@ -37,7 +37,7 @@
         <form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
         <label>供应商名称:</label>
         <form:input path="shopName" htmlEscape="false" maxlength="50" class="input-medium"/>
-        <label>优惠状态:</label>
+        <label>状态:</label>
         <form:select path="status" class="input-medium required">
             <form:option value="" label="所有"/>
             <form:option value="0" label="待上架"/>
@@ -66,9 +66,11 @@
         <th>供应商</th>
         <th>优惠券金额</th>
         <th>优惠条件</th>
-        <th>优惠状态</th>
-        <th>开始时间</th>
-        <th>结束时间</th>
+        <th>上架时间</th>
+        <th>下架时间</th>
+        <th>领取期限</th>
+        <th>使用期限</th>
+        <th>状态</th>
         <th>添加时间</th>
         <th>操作</th>
     </tr>
@@ -91,6 +93,20 @@
             <td>
                 满${cmCoupon.touchPrice}
             </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+            </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
                     <font color="#800080">待上架</font>
@@ -105,12 +121,6 @@
                     <font color="#FF6600">已下架</font>
                 </c:if>
             </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
             <td>
                 <fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>

+ 5 - 5
src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveForm.jsp

@@ -45,7 +45,7 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=2">用户专享券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=2&&moneyCouponFlag=2">用户专享券</a></li>
     <li class="active"><a
             href="${ctx}/coupon/cmCoupon/form?couponType=2&id=${cmCoupon.id}">${not empty cmCoupon.id?'编辑':'添加'}</a>
     </li>
@@ -92,7 +92,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>开始时间:</label>
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
         <div class="controls">
             <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20"
                    class="input-medium Wdate "
@@ -101,7 +101,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>结束时间:</label>
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
         <div class="controls">
             <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20"
                    class="input-medium Wdate "
@@ -114,7 +114,7 @@
         <div class="controls">
             <input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
             <input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
-                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同活动开始-结束时间
+                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
             <input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
         </div>
     </div>
@@ -125,7 +125,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>优惠状态:</label>
+        <label class="control-label"><font color="red">*</font>状态:</label>
         <div class="controls">
             <label id="initializeShow">
                 <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 33 - 23
src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveList.jsp

@@ -22,11 +22,11 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=0">活动券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=1">品类券</a></li>
-    <li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=2">用户专享券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=3">店铺券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=4">新用户券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=0&&moneyCouponFlag=2">活动券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>
+    <li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=2&&moneyCouponFlag=2">用户专享券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=3&&moneyCouponFlag=2">店铺券</a></li>
+    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>
 </ul>
 <form:form id="searchForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/" method="post" class="breadcrumb form-search">
     <input type="hidden" name="couponType" value="2"/>
@@ -35,7 +35,7 @@
     <div class="ul-form">
         <label>机构名称:</label>
         <form:input path="clubName" htmlEscape="false" maxlength="100" class="input-medium"/>
-        <label>优惠状态:</label>
+        <label>状态:</label>
         <form:select path="status" class="input-medium required">
             <form:option value="" label="全部"/>
             <form:option value="0" label="待上架"/>
@@ -82,14 +82,16 @@
         <th>机构名称</th>
         <th>优惠券金额</th>
         <th>优惠条件</th>
-        <th>优惠状态</th>
         <th>领取状态</th>
         <th>领取渠道</th>
         <th>使用状态</th>
         <th>领取时间</th>
         <th>使用时间</th>
-        <th>开始时间</th>
-        <th>结束时间</th>
+        <th>上架时间</th>
+        <th>下架时间</th>
+        <th>领取期限</th>
+        <th>使用期限</th>
+        <th>状态</th>
         <th>添加时间</th>
         <th>操作</th>
     </tr>
@@ -109,20 +111,6 @@
             <td>
                 满${cmCoupon.touchPrice}
             </td>
-            <td>
-                <c:if test="${cmCoupon.status eq 0}">
-                    <font color="#800080">待上架</font>
-                </c:if>
-                <c:if test="${cmCoupon.status eq 1}">
-                    <font color="#00CC66">已上架</font>
-                </c:if>
-                <c:if test="${cmCoupon.status eq 2}">
-                    <font color="red">已关闭</font>
-                </c:if>
-                <c:if test="${cmCoupon.status eq 3}">
-                    <font color="#FF6600">已下架</font>
-                </c:if>
-            </td>
             <td>
                 <c:if test="${cmCoupon.claimStatus eq 1}">
                     <font color="red">未领取</font>
@@ -169,6 +157,28 @@
             <td>
                 <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>
+            <td>
+                <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.status eq 0}">
+                    <font color="#800080">待上架</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 1}">
+                    <font color="#00CC66">已上架</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 2}">
+                    <font color="red">已关闭</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 3}">
+                    <font color="#FF6600">已下架</font>
+                </c:if>
+            </td>
             <td>
                 <fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>

+ 13 - 0
src/main/webapp/WEB-INF/views/modules/coupon/productCouponDetails.jsp

@@ -63,6 +63,19 @@
             </c:forEach>
         </ul>
     </div>
+    <div class="couponList">
+        <h4>价值优惠券(${moneyCoupons.size()})</h4>
+        <ul>
+            <c:forEach items="${moneyCoupons}" var="coupon">
+                <li><span class="couponDesc">
+                    <span>${coupon.couponName}</span>
+                    <span>购买价格:${coupon.moneyCouponPrice}</span>
+                    <span>${coupon.couponDesc}</span>
+                    <span>有效期:<fmt:formatDate value="${coupon.startDate}" pattern="yyyy-MM-dd"/>-<fmt:formatDate value="${coupon.endDate}" pattern="yyyy-MM-dd"/></span>
+                </span></li>
+            </c:forEach>
+        </ul>
+    </div>
 </div>
 </body>
 </html>

+ 3 - 3
src/main/webapp/WEB-INF/views/modules/coupon/redemptionCodeCouponForm.jsp

@@ -136,7 +136,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>开始时间:</label>
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
         <div class="controls">
             <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd 00:00:00"/>"
@@ -144,7 +144,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>结束时间:</label>
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
         <div class="controls">
             <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd 23:59:59"/>"
@@ -158,7 +158,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>优惠状态:</label>
+        <label class="control-label"><font color="red">*</font>状态:</label>
         <div class="controls">
             <label id="initializeShow">
                 <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 18 - 13
src/main/webapp/WEB-INF/views/modules/coupon/redemptionCodeCouponList.jsp

@@ -30,7 +30,7 @@
     <div class="ul-form">
         <label>活动主题:</label>
         <form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
-        <label>优惠状态:</label>
+        <label>状态:</label>
         <form:select path="status" class="input-medium required">
             <form:option value="" label="所有"/>
             <form:option value="0" label="未生效"/>
@@ -58,10 +58,11 @@
         <th>活动主题</th>
         <th>优惠券金额</th>
         <th>优惠条件</th>
-        <th>优惠状态</th>
         <th>已兑换数量</th>
-        <th>开始时间</th>
-        <th>结束时间</th>
+        <th>上架时间</th>
+        <th>下架时间</th>
+        <th>使用期限</th>
+        <th>状态</th>
         <th>添加时间</th>
         <th>操作</th>
     </tr>
@@ -81,6 +82,19 @@
             <td>
                 满${cmCoupon.touchPrice}
             </td>
+            <td>
+                ${cmCoupon.codeNum}
+            </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+            </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
                     <font color="#800080">未生效</font>
@@ -95,15 +109,6 @@
                     <font color="#FF6600">已失效</font>
                 </c:if>
             </td>
-            <td>
-                ${cmCoupon.codeNum}
-            </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
             <td>
                 <fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/info/infoForm.jsp

@@ -76,7 +76,7 @@
 		<tr>
 			<th><span class="red">*</span>引导图:</th>
 			<td colspan="3">
-				<form:hidden id="nameImage" path="guidanceImage" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
+				<form:hidden id="nameImage" path="guidanceImage" htmlEscape="false" class="input-xlarge required"/>
 				<sys:ckfinder input="nameImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
 			</td>
 		</tr>

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

@@ -181,6 +181,9 @@
                         </c:if>
                         <c:if test="${vo.receiptType == 7}">
                             二手商品上架费
+                        </c:if>
+                        <c:if test="${vo.receiptType == 8}">
+                            优惠券购买费
                         </c:if>
 					</span>
             <span><label>收款类型:</label>${fns:getPayTypeStr(vo.payType)}</span>
@@ -225,7 +228,7 @@
             </div>
         </c:if>
     </div>
-    <c:if test="${vo.receiptType != 2 and vo.receiptType != 6 and vo.receiptType != 7}">
+    <c:if test="${vo.receiptType != 2 and vo.receiptType != 6 and vo.receiptType != 7 and vo.receiptType != 8}">
         <h5>关联订单</h5>
         <div class="receipt-order-form">
             <c:forEach items="${vo.orderInfos}" var="orderInfo">
@@ -403,6 +406,9 @@
         <div class="receipt-order-form">
             <div>
                 <c:if test="${not empty vo.vipInfo}">
+                    <span>机构名称:${vo.clubName}</span>
+                    <br/>
+                    <span>购买时间:${vo.receiptDate}</span>
                     <span>会员套餐:${vo.vipInfo.duration}个月</span>
                     <span>交易号:${vo.vipInfo.orderRequestNo}</span>
                 </c:if>
@@ -417,6 +423,25 @@
             </div>
         </div>
     </c:if>
+    <c:if test="${vo.receiptType == 8}">
+        <h5>优惠券信息</h5>
+        <div class="receipt-order-form">
+            <div>
+                <span>机构名称:</span>
+                <br/>
+                <span>购买时间:${vo.receiptDate}</span>
+                <span>优惠券类型:
+                    <c:if test="${vo.couponInfo.couponType eq '0'}">活动券</c:if>
+                    <c:if test="${vo.couponInfo.couponType eq '1'}">品类券</c:if>
+                    <c:if test="${vo.couponInfo.couponType eq '2'}">活动券</c:if>
+                    <c:if test="${vo.couponInfo.couponType eq '3'}">店铺券</c:if>
+                </span>
+                <span>满减金额:${vo.couponInfo.couponAmount}</span>
+                <span>购买金额:${vo.receiptAmount}</span>
+                <span>交易号:${vo.couponInfo.mbOrderId}</span>
+            </div>
+        </div>
+    </c:if>
 </div>
 <script>
     (function () {

+ 5 - 0
src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptList.jsp

@@ -226,16 +226,21 @@
                 <c:if test="${cmDiscernReceipt.receiptOrderType eq 2}">
                     <font color="red">(呵呵商城)</font>
                 </c:if>
+                <c:if test="${cmDiscernReceipt.receiptType eq 8}">
+                    ${cmDiscernReceipt.backName}
+                </c:if>
             </td>
             <td>
                 <c:if test="${cmDiscernReceipt.receiptType != 6}">${cmDiscernReceipt.orderType}</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 6}">-----</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 7}">-----</c:if>
+                <c:if test="${cmDiscernReceipt.receiptType == 8}">-----</c:if>
             </td>
             <td>
                 <c:if test="${cmDiscernReceipt.receiptType != 6}">${cmDiscernReceipt.orders}</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 6}">-----</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 7}">-----</c:if>
+                <c:if test="${cmDiscernReceipt.receiptType == 8}">-----</c:if>
             </td>
             <shiro:hasPermission name="order:cmDiscernReceipt:edit">
                 <td>

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

@@ -540,6 +540,7 @@
     <tr>
         <td>
             应收金额:<fmt:formatNumber value="${order.payableAmount}" type="currency"/>
+            <br/>
             <span style="color: red">
                 <c:if test="${order.balancePayFee gt 0}">
                     <a href="${ctx}/user/cmUserBalanceRecord/userBalanceRecord?userId=${order.userID}"

+ 9 - 0
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -443,6 +443,15 @@
                 </span>
             </td>
         </tr>
+        <tr>
+            <th><span class="red">*</span>线上分账账号:</th>
+            <td colspan="3">
+                <form:select path="splitCode" class="input-small">
+                    <form:option value="" label="采美"/>
+                    <form:options items="${splitCodeList}" itemLabel="splitCode" itemValue="splitCode" htmlEscape="false"/>
+                </form:select>
+            </td>
+        </tr>
         <tr id="taxPointDiv">
             <th><span class="red">*</span>机构税率:</th>
             <td>

+ 4 - 3
src/main/webapp/WEB-INF/views/modules/user/cmUserBalanceWithdrawalsForm.jsp

@@ -82,9 +82,10 @@
 		<div class="control-group">
 			<label class="control-label"><font color="red">*</font><b>提现金额:</b></label>
 			<p class="controls">
-				<input type="number" id="withdrawalsFee" onchange="changeMoney()" required placeholder="请输入此次提现金额" max="${empty cmUser.ableUserMoney ? 0:cmUser.ableUserMoney}">
-				<div id="ts" class="controls" style="color: red;display: none">请输入一个最大为<fmt:formatNumber value="${empty cmUser.userMoney ? 0:cmUser.userMoney}" type="currency"/>的值</div>
-			</div>
+				<form:input type="number" id="withdrawalsFee" path="withdrawalsFee" onchange="changeMoney()" placeholder="请输入此次提现金额" class="input-xlarge required"
+							max="${empty cmUser.ableUserMoney ? 0:cmUser.ableUserMoney}"/>
+				<div id="ts" class="controls" style="color: red;display: none">请输入一个最大为<fmt:formatNumber value="${empty cmUser.userMoney ? 0:cmUser.userMoney}"
+																										 type="currency"/>的值</div>
 		</div>
 		<div class="control-group">
 			<label class="control-label"><font color="red">*</font><b>提现会所账户:</b></label>

+ 56 - 7
src/main/webapp/WEB-INF/views/modules/user/newCmShopForm.jsp

@@ -46,6 +46,7 @@
 			})
 		}
 
+
 		// 初始化主营内容数据
         $(function () {
 			var html = '';
@@ -379,8 +380,6 @@ function loadProvince() {
     $.ajax({
         type:'Get',
         success:function (date) {
-
-
         }
     });
 }
@@ -675,7 +674,6 @@ function loadTown(curTown) {
 								<form:option value="0" label="未缴纳"/>
 						</form:select>
 					</td>
-
 					<td >&nbsp;&nbsp;
 						<span class="maintenanceDate1">
 							<span><b>缴纳时间:</b></span>
@@ -683,13 +681,33 @@ function loadTown(curTown) {
 							onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
 						</span>
 					</td>
-                    <td >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <span><b>线上分账商户号:</b></span>
-                    <form:input path="commercialCode" htmlEscape="false" placeholder="请输入8位商户号" maxlength="8" class="input-xlarge"/>
-                    </td>
             	</tr>
 			</table>
 		</div>
+		<div class="control-group">
+			<tr>
+				<th><b>分账商户号:</b></th>
+				<td colspan="3" class="params">
+					<div id="addParamsItems">
+							<%--相关参数层--%>
+						<input type="hidden" value="${fn:length(newCmShop.splitCodes)}"
+							   id="productParametersLength">
+						<c:forEach items="${newCmShop.splitCodes}" var="item" varStatus="varIndex">
+							<div id="paramsItem" class="paramsItem">
+								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<form:input path="splitCodes[${varIndex.index}].splitCode" id="paramsName"
+											maxlength="8" placeholder="请输入分帐商户号" class="input-small"/>
+								<form:input path="splitCodes[${varIndex.index}].codeRemark" id="paramsContent"
+											maxlength="10" placeholder="请输入账户备注"
+											class="input-small"/>
+								<span type="button" style="cursor: pointer;color: #0B61A4"
+									  onclick="deleteParams(this)">删除</span>
+							</div>
+						</c:forEach>
+					</div>
+					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class="addParams" onclick="return false">添加分帐号</button>
+				</td>
+			</tr>
+		</div>
 		<div class="control-group">
 			<b>公司基本信息</b>
 			<table style="border-collapse: separate; border-spacing: 10px; ">
@@ -1030,5 +1048,36 @@ function loadTown(curTown) {
 			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
 		</div>
 	</form:form>
+
+
+<script>
+
+	var productParametersIndex = $('#productParametersLength').val() - 1;
+	$(".addParams").click(function () {
+		var val = $("#paramsName").val();
+		// alertx("+++++"+val.length)         splitCodes[${varIndex.index}].splitCode
+		productParametersIndex++;
+		var html = '<div id="paramsItem" class="paramsItem">';
+		html += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="splitCodes[' + [productParametersIndex] + '].splitCode" id="splitCode" maxlength="8" placeholder="请输入分帐商户号" type="text" class="input-small"/>&nbsp;';
+		html += '<input name="splitCodes[' + [productParametersIndex] + '].codeRemark" id="codeRemark" maxlength="10" placeholder="请输入账户备注"  type="text"   class="input-small"/>&nbsp;';
+		html += '<span type="button" style="cursor: pointer;color: #0B61A4" onclick="deleteParams(this)"">删除</span>';
+		html += '</div>';
+		$("#addParamsItems").append(html).show();
+		var paramsItemLength = $('.paramsItem').length;
+		if (paramsItemLength === 30) {
+			$(this).hide();
+			return
+		}
+	});
+
+	//删除相关参数
+	function deleteParams(paramsThis) {
+		$(paramsThis).parent().remove();
+		var paramsItemLength = $('.paramsItem').length;
+		if (paramsItemLength < 50) {
+			$('.addParams').show();
+		}
+	}
+</script>
 </body>
 </html>

+ 14 - 2
src/main/webapp/WEB-INF/views/modules/userNew/cmAgencyForm.jsp

@@ -268,6 +268,9 @@
                         html += '<span class="new-tag up-club-tag" data-typeName="spa">spa</span>'
                     $('#clubArea').html(html);
                     $('.Main-content').show();
+                }else {
+                    $('.raw-option').hide();
+                    $('.med-option,.qualification').hide();
                 }
             });
             //初始化2
@@ -612,9 +615,18 @@
                         <div class="raw-beauty">
                             <input name="firstClubType" value="2" type="radio" ${cmClubinfo.firstClubType == "2" ? "checked" : ""}/>生美
                         </div>
+                        <div class="raw-beauty">
+                            <input name="firstClubType" value="3" type="radio" ${cmClubinfo.firstClubType == "3" ? "checked" : ""}/>项目公司
+                        </div>
+                        <div class="raw-beauty">
+                            <input name="firstClubType" value="4" type="radio" ${cmClubinfo.firstClubType == "4" ? "checked" : ""}/>个人
+                        </div>
+                        <div class="raw-beauty">
+                            <input name="firstClubType" value="5" type="radio" ${cmClubinfo.firstClubType == "5" ? "checked" : ""}/>其他
+                        </div>
                     </div>
                     <span class="err-tip"></span>
-                    <div class="med-option the-oradio" style="display: none">
+                    <div class="med-option the-oradio" style="display: none" id="ejf">
                         <div class="med-beauty"><input name="secondClubType" value="1"
                                                        type="radio"  ${cmClubinfo.secondClubType == "1" ? "checked" : ""}/>诊所
                         </div>
@@ -629,7 +641,7 @@
                         </div>
                         <span class="err-tip"></span>
                     </div>
-                    <div class="raw-option the-oradio" style="display: none">
+                    <div class="raw-option the-oradio" style="display: none" id="ej">
                         <div class="med-beauty"><input name="secondClubType" value="5"
                                                        type="radio"  ${cmClubinfo.secondClubType == "5" ? "checked" : ""}/>美容院
                         </div>