Aslee 3 tahun lalu
induk
melakukan
ed4a8d89c2
48 mengubah file dengan 845 tambahan dan 190 penghapusan
  1. 18 0
      src/main/java/com/caimei/modules/archive/entity/CmOrderArchive.java
  2. 1 1
      src/main/java/com/caimei/modules/archive/entity/CmProductArchiveFile.java
  3. 74 71
      src/main/java/com/caimei/modules/common/utils/PoiExcelUtil.java
  4. 46 0
      src/main/java/com/caimei/modules/coupon/entity/CmCoupon.java
  5. 13 0
      src/main/java/com/caimei/modules/coupon/service/CmCouponService.java
  6. 13 0
      src/main/java/com/caimei/modules/coupon/web/CmCouponController.java
  7. 2 0
      src/main/java/com/caimei/modules/hehe/dao/CmHeheCouponDao.java
  8. 1 1
      src/main/java/com/caimei/modules/hehe/dao/CmHeheProductDao.java
  9. 8 0
      src/main/java/com/caimei/modules/hehe/dao/HeHeNewOrderDao.java
  10. 9 0
      src/main/java/com/caimei/modules/hehe/entity/CmHeheCoupon.java
  11. 30 7
      src/main/java/com/caimei/modules/hehe/service/CmHeheCouponService.java
  12. 1 3
      src/main/java/com/caimei/modules/hehe/service/CmHeheDiscountService.java
  13. 1 0
      src/main/java/com/caimei/modules/hehe/service/CmHeheFloorProductService.java
  14. 4 4
      src/main/java/com/caimei/modules/hehe/service/CmHeheProductService.java
  15. 9 0
      src/main/java/com/caimei/modules/hehe/service/HeHeNewOrderService.java
  16. 1 1
      src/main/java/com/caimei/modules/hehe/web/CmHeheCouponController.java
  17. 23 0
      src/main/java/com/caimei/modules/order/entity/NewOrder.java
  18. 9 0
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  19. 4 2
      src/main/java/com/caimei/modules/order/web/CmDiscernReceiptController.java
  20. 4 2
      src/main/java/com/caimei/modules/order/web/NewOrderController.java
  21. 30 0
      src/main/java/com/caimei/modules/oss/utils/OSSUtils.java
  22. 13 0
      src/main/java/com/caimei/modules/product/entity/Product.java
  23. 19 27
      src/main/java/com/thinkgem/jeesite/common/utils/excel/ExportExcel.java
  24. 15 2
      src/main/resources/mappings/modules/coupon/CmCouponMapper.xml
  25. 4 4
      src/main/resources/mappings/modules/hehe/CmHeheDiscountMapper.xml
  26. 10 3
      src/main/resources/mappings/modules/hehe/CmHeheFloorProductMapper.xml
  27. 15 0
      src/main/resources/mappings/modules/hehe/HeHeNewOrderMapper.xml
  28. 2 2
      src/main/webapp/WEB-INF/views/modules/archive/addFileForm.jsp
  29. 17 3
      src/main/webapp/WEB-INF/views/modules/archive/cmOrderArchiveList.jsp
  30. 70 2
      src/main/webapp/WEB-INF/views/modules/coupon/cmCouponForm.jsp
  31. 14 9
      src/main/webapp/WEB-INF/views/modules/coupon/cmCouponList.jsp
  32. 71 0
      src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryForm.jsp
  33. 13 8
      src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryList.jsp
  34. 71 0
      src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserForm.jsp
  35. 13 8
      src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserList.jsp
  36. 68 0
      src/main/webapp/WEB-INF/views/modules/coupon/couponShopForm.jsp
  37. 13 8
      src/main/webapp/WEB-INF/views/modules/coupon/couponShopList.jsp
  38. 68 0
      src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveForm.jsp
  39. 13 8
      src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveList.jsp
  40. 1 1
      src/main/webapp/WEB-INF/views/modules/coupon/productCouponDetails.jsp
  41. 6 0
      src/main/webapp/WEB-INF/views/modules/coupon/redemptionCodeCouponForm.jsp
  42. 7 2
      src/main/webapp/WEB-INF/views/modules/coupon/redemptionCodeCouponList.jsp
  43. 8 3
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheCouponList.jsp
  44. 9 1
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheDiscountForm.jsp
  45. 0 3
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheDiscountList.jsp
  46. 2 2
      src/main/webapp/WEB-INF/views/modules/hehe/toAddCouponUser.jsp
  47. 1 1
      src/main/webapp/WEB-INF/views/modules/hehe/toAddDiscountUser.jsp
  48. 1 1
      src/main/webapp/static/modules/bulkpurchase/orderForm.js

+ 18 - 0
src/main/java/com/caimei/modules/archive/entity/CmOrderArchive.java

@@ -27,6 +27,8 @@ public class CmOrderArchive extends DataEntity<CmOrderArchive> {
 	private Date addTime;		// 添加时间
 
 	private Integer orderId;	// 主订单id
+	private Integer orderStatus;	// 主订单状态:0待确认,11待收待发,12待收部发,13待收全发,21部收待发,22部收部发,23部收全发,31已收待发,32已收部发,33已收全发,4交易完成,5订单完成,6已关闭,7交易全退
+	private Integer fileNum;		//文件数量
 
 	/**
 	 * 上传文件id,以","隔开
@@ -135,4 +137,20 @@ public class CmOrderArchive extends DataEntity<CmOrderArchive> {
 	public void setFileIds(String fileIds) {
 		this.fileIds = fileIds;
 	}
+
+	public Integer getOrderStatus() {
+		return orderStatus;
+	}
+
+	public void setOrderStatus(Integer orderStatus) {
+		this.orderStatus = orderStatus;
+	}
+
+	public Integer getFileNum() {
+		return fileNum;
+	}
+
+	public void setFileNum(Integer fileNum) {
+		this.fileNum = fileNum;
+	}
 }

+ 1 - 1
src/main/java/com/caimei/modules/archive/entity/CmProductArchiveFile.java

@@ -17,7 +17,7 @@ public class CmProductArchiveFile extends DataEntity<CmProductArchiveFile> {
 	private Integer archiveContentId;		// 资料库内容id
 	private String fileName;		// 文件名称
 	private String ossName;		// oss名称
-	private String waterOssName;		//水印文oss名称
+	private String waterOssName;		//水印文oss名称
 	private String ossUrl;		// oss链接
 	private String waterOssUrl;		//水印文件oss链接
 	private Date uploadTime;		// 上传时间

+ 74 - 71
src/main/java/com/caimei/modules/common/utils/PoiExcelUtil.java

@@ -9,6 +9,9 @@ import com.caimei.utils.MathUtil;
 import com.thinkgem.jeesite.common.utils.DateUtils;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.BorderStyle;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -51,8 +54,8 @@ public class PoiExcelUtil {
         headfont.setFontHeightInPoints((short) 22);// 字体大小
         HSSFCellStyle headstyle = workbook.createCellStyle();
         headstyle.setFont(headfont);
-        headstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        headstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        headstyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        headstyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         headstyle.setLocked(true);
         // 表头客户名 订单号 客户电话 客户地址 样式
         HSSFFont datefont = workbook.createFont();
@@ -60,35 +63,35 @@ public class PoiExcelUtil {
         datefont.setFontHeightInPoints((short) 12);// 字体大小
         HSSFCellStyle datestyle = workbook.createCellStyle();
         datestyle.setFont(datefont);
-        datestyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        datestyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        datestyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        datestyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         datestyle.setLocked(true);
         // 列名样式
         HSSFFont font = workbook.createFont();
         font.setFontName("黑体");
         font.setFontHeightInPoints((short) 12);// 字体大小
         HSSFCellStyle style = workbook.createCellStyle();
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         style.setFont(font);
-        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        style.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        style.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         style.setLocked(true);
         // 普通单元格样式(中文)
         HSSFFont font2 = workbook.createFont();
         font2.setFontName("宋体");
         font2.setFontHeightInPoints((short) 12);
         HSSFCellStyle style2 = workbook.createCellStyle();
-        style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style2.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style2.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style2.setBorderBottom(BorderStyle.THIN); //下边框
+        style2.setBorderLeft(BorderStyle.THIN);//左边框
+        style2.setBorderTop(BorderStyle.THIN);//上边框
+        style2.setBorderRight(BorderStyle.THIN);//右边框
         style2.setFont(font2);
-        style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
+        style2.setAlignment(HorizontalAlignment.CENTER);// 左右居中
         style2.setWrapText(true); // 换行
-        style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        style2.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
 
         // 应付 带颜色单元格样式
         HSSFCellStyle yfstyle = workbook.createCellStyle();
@@ -97,12 +100,12 @@ public class PoiExcelUtil {
         yffont.setFontHeightInPoints((short) 12);
         yffont.setColor(HSSFColor.RED.index);
         yfstyle.setFont(yffont);
-        yfstyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        yfstyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        yfstyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        yfstyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
-        yfstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        yfstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        yfstyle.setBorderBottom(BorderStyle.THIN); //下边框
+        yfstyle.setBorderLeft(BorderStyle.THIN);//左边框
+        yfstyle.setBorderTop(BorderStyle.THIN);//上边框
+        yfstyle.setBorderRight(BorderStyle.THIN);//右边框
+        yfstyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        yfstyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         yfstyle.setWrapText(true); // 换行
 
         // 合计 带颜色单元格样式
@@ -112,12 +115,12 @@ public class PoiExcelUtil {
         hjfont.setFontHeightInPoints((short) 12);
         hjfont.setColor(HSSFColor.BLUE.index);
         hjstyle.setFont(hjfont);
-        hjstyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        hjstyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        hjstyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        hjstyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
-        hjstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        hjstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        hjstyle.setBorderBottom(BorderStyle.THIN); //下边框
+        hjstyle.setBorderLeft(BorderStyle.THIN);//左边框
+        hjstyle.setBorderTop(BorderStyle.THIN);//上边框
+        hjstyle.setBorderRight(BorderStyle.THIN);//右边框
+        hjstyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        hjstyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         hjstyle.setWrapText(true); // 换行
 
         // 已收
@@ -127,12 +130,12 @@ public class PoiExcelUtil {
         ysfont.setFontHeightInPoints((short) 12);
         ysfont.setColor(HSSFColor.GREEN.index);
         ysstyle.setFont(ysfont);
-        ysstyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        ysstyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        ysstyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        ysstyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
-        ysstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        ysstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        ysstyle.setBorderBottom(BorderStyle.THIN); //下边框
+        ysstyle.setBorderLeft(BorderStyle.THIN);//左边框
+        ysstyle.setBorderTop(BorderStyle.THIN);//上边框
+        ysstyle.setBorderRight(BorderStyle.THIN);//右边框
+        ysstyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        ysstyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         ysstyle.setWrapText(true); // 换行
 
         //列宽度  设为自适应
@@ -500,8 +503,8 @@ public class PoiExcelUtil {
         headfont.setFontHeightInPoints((short) 22);// 字体大小
         HSSFCellStyle headstyle = workbook.createCellStyle();
         headstyle.setFont(headfont);
-        headstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        headstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        headstyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        headstyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         headstyle.setLocked(true);
         // 表头客户名 订单号 客户电话 客户地址 样式
         HSSFFont datefont = workbook.createFont();
@@ -509,35 +512,35 @@ public class PoiExcelUtil {
         datefont.setFontHeightInPoints((short) 12);// 字体大小
         HSSFCellStyle datestyle = workbook.createCellStyle();
         datestyle.setFont(datefont);
-        datestyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        datestyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        datestyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        datestyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         datestyle.setLocked(true);
         // 列名样式
         HSSFFont font = workbook.createFont();
         font.setFontName("黑体");
         font.setFontHeightInPoints((short) 12);// 字体大小
         HSSFCellStyle style = workbook.createCellStyle();
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         style.setFont(font);
-        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        style.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        style.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         style.setLocked(true);
         // 普通单元格样式(中文)
         HSSFFont font2 = workbook.createFont();
         font2.setFontName("宋体");
         font2.setFontHeightInPoints((short) 12);
         HSSFCellStyle style2 = workbook.createCellStyle();
-        style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style2.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style2.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style2.setBorderBottom(BorderStyle.THIN); //下边框
+        style2.setBorderLeft(BorderStyle.THIN);//左边框
+        style2.setBorderTop(BorderStyle.THIN);//上边框
+        style2.setBorderRight(BorderStyle.THIN);//右边框
         style2.setFont(font2);
-        style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
+        style2.setAlignment(HorizontalAlignment.CENTER);// 左右居中
         style2.setWrapText(true); // 换行
-        style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        style2.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
 
         // 应付 带颜色单元格样式
         HSSFCellStyle yfstyle = workbook.createCellStyle();
@@ -546,12 +549,12 @@ public class PoiExcelUtil {
         yffont.setFontHeightInPoints((short) 12);
         yffont.setColor(HSSFColor.RED.index);
         yfstyle.setFont(yffont);
-        yfstyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        yfstyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        yfstyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        yfstyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
-        yfstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        yfstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        yfstyle.setBorderBottom(BorderStyle.THIN); //下边框
+        yfstyle.setBorderLeft(BorderStyle.THIN);//左边框
+        yfstyle.setBorderTop(BorderStyle.THIN);//上边框
+        yfstyle.setBorderRight(BorderStyle.THIN);//右边框
+        yfstyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        yfstyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         yfstyle.setWrapText(true); // 换行
 
         // 合计 带颜色单元格样式
@@ -561,14 +564,14 @@ public class PoiExcelUtil {
         hjfont.setFontHeightInPoints((short) 12);
         hjfont.setColor(HSSFColor.BLUE.index);
         hjstyle.setFont(hjfont);
-        hjstyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        hjstyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        hjstyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        hjstyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
-        hjstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        hjstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        hjstyle.setBorderBottom(BorderStyle.THIN); //下边框
+        hjstyle.setBorderLeft(BorderStyle.THIN);//左边框
+        hjstyle.setBorderTop(BorderStyle.THIN);//上边框
+        hjstyle.setBorderRight(BorderStyle.THIN);//右边框
+        hjstyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        hjstyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         hjstyle.setWrapText(true); // 换行
-        
+
         // 已收
         HSSFCellStyle ysstyle = workbook.createCellStyle();
         HSSFFont ysfont = workbook.createFont();
@@ -576,12 +579,12 @@ public class PoiExcelUtil {
         ysfont.setFontHeightInPoints((short) 12);
         ysfont.setColor(HSSFColor.GREEN.index);
         ysstyle.setFont(ysfont);
-        ysstyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        ysstyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        ysstyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        ysstyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
-        ysstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
-        ysstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
+        ysstyle.setBorderBottom(BorderStyle.THIN); //下边框
+        ysstyle.setBorderLeft(BorderStyle.THIN);//左边框
+        ysstyle.setBorderTop(BorderStyle.THIN);//上边框
+        ysstyle.setBorderRight(BorderStyle.THIN);//右边框
+        ysstyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        ysstyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
         ysstyle.setWrapText(true); // 换行
 
         //列宽度  设为自适应
@@ -732,8 +735,8 @@ public class PoiExcelUtil {
 //                            //设置shouldPay 列属性值
 //                            CellUtil.setCellValue(cell, Double.parseDouble(getFieldValue(orderProductList.get(i), colName[j]).toString()));
 //                        }else {
-                            //设置shouldPay 列属性值
-                            CellUtil.setCellValue(cell, getFieldValue(orderProductList.get(i), colName[j]),"");
+                        //设置shouldPay 列属性值
+                        CellUtil.setCellValue(cell, getFieldValue(orderProductList.get(i), colName[j]),"");
 //                        }
                     }
                 }

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

@@ -23,6 +23,9 @@ public class CmCoupon extends DataEntity<CmCoupon> {
     private BigDecimal touchPrice;        // 优惠满减条件金额
     private Date startDate;        // 使用开始时间(有效期)
     private Date endDate;        // 使用结束时间(有效期)
+    private Integer receivePeriod;		// 领取期限(天)
+    private Integer receiveFlag;		// 领取期限同开始-结束时间
+    private Integer usePeriod;		// 使用期限(天)
     private String status;        // 状态 0未生效 1已生效 2已关闭 3已失效
     private Integer couponType;        // 劵类型 0活动券 1品类券 2用户专享券 3店铺券 4新用户券
     private Integer vipFlag;        // 超级会员专享优惠券标志:0否,1是
@@ -48,6 +51,9 @@ public class CmCoupon extends DataEntity<CmCoupon> {
     private NewCmShop shop;
     private List<Integer> productIdList;
 
+    private Date receiveDate;   // 领取时间
+    private Date useEndDate;    // 使用截止时间
+
     public CmCoupon() {
         super();
     }
@@ -294,4 +300,44 @@ public class CmCoupon extends DataEntity<CmCoupon> {
     public void setRedemptionCode(String redemptionCode) {
         this.redemptionCode = redemptionCode;
     }
+
+    public Integer getReceivePeriod() {
+        return receivePeriod;
+    }
+
+    public void setReceivePeriod(Integer receivePeriod) {
+        this.receivePeriod = receivePeriod;
+    }
+
+    public Integer getReceiveFlag() {
+        return receiveFlag;
+    }
+
+    public void setReceiveFlag(Integer receiveFlag) {
+        this.receiveFlag = receiveFlag;
+    }
+
+    public Integer getUsePeriod() {
+        return usePeriod;
+    }
+
+    public void setUsePeriod(Integer usePeriod) {
+        this.usePeriod = usePeriod;
+    }
+
+    public Date getReceiveDate() {
+        return receiveDate;
+    }
+
+    public void setReceiveDate(Date receiveDate) {
+        this.receiveDate = receiveDate;
+    }
+
+    public Date getUseEndDate() {
+        return useEndDate;
+    }
+
+    public void setUseEndDate(Date useEndDate) {
+        this.useEndDate = useEndDate;
+    }
 }

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

@@ -215,6 +215,19 @@ public class CmCouponService extends CrudService<CmCouponDao, CmCoupon> {
         cmCouponDao.update(cmCoupon);
     }
 
+    @Transactional(readOnly = false)
+    public void open(CmCoupon cmCoupon) {
+        Date date = new Date();
+        if (date.compareTo(cmCoupon.getStartDate()) < 0) {
+            cmCoupon.setStatus("0");
+        } else if (date.compareTo(cmCoupon.getEndDate()) > 0) {
+            cmCoupon.setStatus("3");
+        } else {
+            cmCoupon.setStatus("1");
+        }
+        cmCouponDao.update(cmCoupon);
+    }
+
     public Page<CmUser> findUserList(Page<CmUser> userPage, CmUser cmUser) {
         cmUser.setPage(userPage);
         List<CmUser> userList = cmCouponDao.findUserList(cmUser);

+ 13 - 0
src/main/java/com/caimei/modules/coupon/web/CmCouponController.java

@@ -160,6 +160,19 @@ public class CmCouponController extends BaseController {
         return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/list?couponType=" + cmCoupon.getCouponType();
     }
 
+    /**
+     *  开启优惠券
+     */
+    @RequestMapping("open")
+    public String open(CmCoupon cmCoupon, RedirectAttributes redirectAttributes) {
+        cmCouponService.open(cmCoupon);
+        addMessage(redirectAttributes, "开启优惠券成功");
+        if ("1".equals(cmCoupon.getCouponsMode())) {
+            return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/codeCouponList";
+        }
+        return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/list?couponType=" + cmCoupon.getCouponType();
+    }
+
     /**
      * 选择机构页面
      */

+ 2 - 0
src/main/java/com/caimei/modules/hehe/dao/CmHeheCouponDao.java

@@ -43,4 +43,6 @@ public interface CmHeheCouponDao extends CrudDao<CmHeheCoupon> {
     List<CmHeheReceiveUser> receiveUserList(CmHeheReceiveUser cmHeheReceiveUser);
 
     List<CmHeheCoupon> receiveCouponList(CmHeheCoupon cmHeheCoupon);
+
+    void deleteCoupon(String cmHeheCoupon);
 }

+ 1 - 1
src/main/java/com/caimei/modules/hehe/dao/CmHeheProductDao.java

@@ -51,5 +51,5 @@ public interface CmHeheProductDao extends CrudDao<CmHeheProduct> {
 
     void addActivityProduct(@Param("productId") Integer productId, @Param("activityId") Integer activityId);
 
-    void addFloorProduct(@Param("productId") Integer productId, @Param("floorId") String floorId);
+    void addFloorProduct(@Param("productId") String productId, @Param("floorId") String floorId);
 }

+ 8 - 0
src/main/java/com/caimei/modules/hehe/dao/HeHeNewOrderDao.java

@@ -1,5 +1,6 @@
 package com.caimei.modules.hehe.dao;
 
+import com.caimei.modules.hehe.entity.CmHeheCouponOrderRecord;
 import com.caimei.modules.order.entity.NewOrder;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
@@ -19,4 +20,11 @@ public interface HeHeNewOrderDao extends CrudDao<NewOrder> {
      * @return
      */
     String findHeUser(Integer heUserId);
+
+    /**
+     * 查询订单优惠记录
+     * @param orderID
+     * @return
+     */
+    CmHeheCouponOrderRecord findOrderCouponRecord(Integer orderID);
 }

+ 9 - 0
src/main/java/com/caimei/modules/hehe/entity/CmHeheCoupon.java

@@ -39,6 +39,7 @@ public class CmHeheCoupon extends DataEntity<CmHeheCoupon> {
 	private String orderNo;			//订单号
 	private Integer orderId;		//订单id
 	private Integer userId;			//呵呵商城用户id
+	private Integer cmUserId;		//采美用户id
 
 
 
@@ -244,4 +245,12 @@ public class CmHeheCoupon extends DataEntity<CmHeheCoupon> {
 	public void setValidFlag(Integer validFlag) {
 		this.validFlag = validFlag;
 	}
+
+	public Integer getCmUserId() {
+		return cmUserId;
+	}
+
+	public void setCmUserId(Integer cmUserId) {
+		this.cmUserId = cmUserId;
+	}
 }

+ 30 - 7
src/main/java/com/caimei/modules/hehe/service/CmHeheCouponService.java

@@ -59,6 +59,18 @@ public class CmHeheCouponService extends CrudService<CmHeheCouponDao, CmHeheCoup
 
 	@Transactional(readOnly = false)
 	public void save(CmHeheCoupon cmHeheCoupon) {
+		if (cmHeheCoupon.getIsNewRecord()) {
+			if (1 == cmHeheCoupon.getStartNowFlag()) {
+				// 新增且立即上架,需要将上架时间更改为当前时间
+				cmHeheCoupon.setStartTime(new Date());
+			}
+		} else {
+			CmHeheCoupon dbCoupon = get(cmHeheCoupon.getId());
+			if (0 == dbCoupon.getStartNowFlag() && 1 == cmHeheCoupon.getStartNowFlag() && new Date().compareTo(dbCoupon.getStartTime()) > 0) {
+				// 原来不是立即上架,修改后是,且当前时间比原上架时间晚,需要将上架时间更改为当前时间
+				cmHeheCoupon.setStartTime(new Date());
+			}
+		}
 		super.save(cmHeheCoupon);
 		Date date = new Date();
 		List<Integer> productIds = cmHeheCouponDao.findCouponProductIds(cmHeheCoupon.getId());
@@ -113,18 +125,29 @@ public class CmHeheCouponService extends CrudService<CmHeheCouponDao, CmHeheCoup
 	public void setCouponStatus(CmHeheCoupon cmHeheCoupon) {
 		Date date = new Date();
 		if (cmHeheCoupon != null) {
-			if (date.compareTo(cmHeheCoupon.getStartTime()) < 0) {
-				cmHeheCoupon.setStatus(1);
-			} else if (date.compareTo(cmHeheCoupon.getEndTime()) > 0) {
-				cmHeheCoupon.setStatus(3);
-			} else {
-				cmHeheCoupon.setStatus(2);
+			// 立即开始
+			if (1 == cmHeheCoupon.getStartNowFlag()) {
+				cmHeheCoupon.setStartTime(date);
+			}
+			// 永久有效
+			if (1 == cmHeheCoupon.getPermanentFlag()) {
+				// 只要活动已开始,那就是上架状态
+				cmHeheCoupon.setStatus(date.compareTo(cmHeheCoupon.getStartTime()) < 0 ? 1 : 2);
+			}else {
+				if (date.compareTo(cmHeheCoupon.getStartTime()) < 0) {
+					cmHeheCoupon.setStatus(1);
+				} else if (date.compareTo(cmHeheCoupon.getEndTime()) > 0) {
+					cmHeheCoupon.setStatus(3);
+				} else {
+					cmHeheCoupon.setStatus(2);
+				}
 			}
 		}
 	}
 
 	public Page<Product> findProductList(Page<Product> productPage, Product product) {
 		product.setPage(productPage);
+		product.setSearchType(1);
 		List<Product> productList = cmHeheFloorProductDao.findAllProduct(product);
 		if (productList != null && productList.size() > 0) {
 			productList.forEach(item -> {
@@ -155,7 +178,7 @@ public class CmHeheCouponService extends CrudService<CmHeheCouponDao, CmHeheCoup
 		if (userList != null && userList.size() > 0) {
 			userList.forEach(item -> {
 				item.setUserIds(user.getUserIds());
-				if (StringUtils.isNotBlank(user.getUserIds()) && user.getUserIds().contains(item.getId())) {
+				if (StringUtils.isNotBlank(user.getUserIds()) && user.getUserIds().contains(item.getUserID().toString())) {
 					item.setStoreStatus(true);
 				}
 			});

+ 1 - 3
src/main/java/com/caimei/modules/hehe/service/CmHeheDiscountService.java

@@ -111,6 +111,7 @@ public class CmHeheDiscountService extends CrudService<CmHeheDiscountDao, CmHehe
 
 	public Page<Product> findProductList(Page<Product> productPage, Product product) {
 		product.setPage(productPage);
+		product.setSearchType(1);
 		List<Product> productList = cmHeheFloorProductDao.findAllProduct(product);
 		if (productList != null && productList.size() > 0) {
 			productList.forEach(item -> {
@@ -132,9 +133,6 @@ public class CmHeheDiscountService extends CrudService<CmHeheDiscountDao, CmHehe
 		if (userList != null && userList.size() > 0) {
 			userList.forEach(item -> {
 				item.setUserIds(user.getUserIds());
-				if (StringUtils.isNotBlank(user.getUserIds()) && user.getUserIds().contains(item.getId())) {
-					item.setStoreStatus(true);
-				}
                 if (StringUtils.isNotBlank(discountUserIds)  && discountUserIds.contains(item.getUserID().toString())) {
                     item.setStoreStatus(true);
                 }

+ 1 - 0
src/main/java/com/caimei/modules/hehe/service/CmHeheFloorProductService.java

@@ -71,6 +71,7 @@ public class CmHeheFloorProductService extends CrudService<CmHeheFloorProductDao
 		List<Integer> ids = cmHeheFloorProductDao.findFloorProductId(product.getFloorId());
 		product.setIds(ids);
 		product.setPage(productPage);
+		product.setSearchType(2);
 		List<Product> productList = cmHeheFloorProductDao.findAllProduct(product);
 		String wwwServer = Global.getConfig("wwwServer");
 		productList.forEach(item -> {

+ 4 - 4
src/main/java/com/caimei/modules/hehe/service/CmHeheProductService.java

@@ -57,7 +57,9 @@ public class CmHeheProductService extends CrudService<CmHeheProductDao, CmHehePr
 
     @Transactional(readOnly = false)
     public void save(CmHeheProduct cmHeheProduct) {
-        if (cmHeheProduct.getIsNewRecord()) {
+        boolean isNewRecord = cmHeheProduct.getIsNewRecord();
+        super.save(cmHeheProduct);
+        if (isNewRecord) {
             // 添加商品时保存商品楼层和活动
             Integer newActivityId = cmHeheProduct.getActivityId();
             if (newActivityId != null) {
@@ -67,11 +69,9 @@ public class CmHeheProductService extends CrudService<CmHeheProductDao, CmHehePr
             String[] floorIdArr = newFloorIds.split(",");
             for (int i = 0; i < floorIdArr.length; i++) {
                 String floorId = floorIdArr[i];
-                cmHeheProductDao.addFloorProduct(cmHeheProduct.getProductId(), floorId);
+                cmHeheProductDao.addFloorProduct(cmHeheProduct.getId(), floorId);
             }
         }
-        super.save(cmHeheProduct);
-
     }
 
     @Transactional(readOnly = false)

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

@@ -1,6 +1,7 @@
 package com.caimei.modules.hehe.service;
 
 import com.caimei.modules.hehe.dao.HeHeNewOrderDao;
+import com.caimei.modules.hehe.entity.CmHeheCouponOrderRecord;
 import com.caimei.modules.order.dao.*;
 import com.caimei.modules.order.entity.*;
 import com.caimei.modules.order.service.CmReceiptOrderRelationService;
@@ -77,6 +78,14 @@ public class HeHeNewOrderService extends CrudService<HeHeNewOrderDao, NewOrder>
         else
             newOrder.setRebateOrder("0");
         if (null != newOrder) {
+            // 获取订单优惠记录
+            if (newOrder.getCouponAmount() != null && newOrder.getCouponAmount() > 0) {
+                CmHeheCouponOrderRecord couponRecord = heHeNewOrderDao.findOrderCouponRecord(newOrder.getOrderID());
+                if (couponRecord != null) {
+                    newOrder.setReceiveCouponId(couponRecord.getReceiveCouponId());
+                    newOrder.setHeheCouponRecord(couponRecord);
+                }
+            }
             //获取订单客户
             OrderUserInfo orderUserInfo = orderUserInfoService.findByOrderID(newOrder.getOrderID());
             if (null != orderUserInfo) {

+ 1 - 1
src/main/java/com/caimei/modules/hehe/web/CmHeheCouponController.java

@@ -82,7 +82,7 @@ public class CmHeheCouponController extends BaseController {
 	public String delete(CmHeheCoupon cmHeheCoupon, RedirectAttributes redirectAttributes) {
 		cmHeheCouponService.delete(cmHeheCoupon);
 		addMessage(redirectAttributes, "删除优惠券成功");
-		return "redirect:"+Global.getAdminPath()+"/hehe/cmHeheCoupon/?repage";
+		return "redirect:" + Global.getAdminPath() + "/hehe/cmHeheCoupon/?repage&couponType=" + cmHeheCoupon.getCouponType();
 	}
 
 	/**

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

@@ -2,6 +2,7 @@ package com.caimei.modules.order.entity;
 
 import com.caimei.modules.bulkpurchase.entity.OrderInvoice;
 import com.caimei.modules.coupon.entity.CmCouponOrderRecord;
+import com.caimei.modules.hehe.entity.CmHeheCouponOrderRecord;
 import com.caimei.modules.product.entity.CmPromotion;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
 
@@ -142,6 +143,12 @@ public class NewOrder extends DataEntity<NewOrder> {
     private CmCouponOrderRecord couponOrderRecord;    //优惠券信息
     private Double svipFullReduction;   //超级会员优惠
 
+    /**
+     * 呵呵商城优惠券
+     */
+    private Integer receiveCouponId;
+    private CmHeheCouponOrderRecord heheCouponRecord;   //优惠券信息
+
     public Integer getOrderSeen() {
         return orderSeen;
     }
@@ -1068,5 +1075,21 @@ public class NewOrder extends DataEntity<NewOrder> {
     public void setSvipFullReduction(Double svipFullReduction) {
         this.svipFullReduction = svipFullReduction;
     }
+
+    public Integer getReceiveCouponId() {
+        return receiveCouponId;
+    }
+
+    public void setReceiveCouponId(Integer receiveCouponId) {
+        this.receiveCouponId = receiveCouponId;
+    }
+
+    public CmHeheCouponOrderRecord getHeheCouponRecord() {
+        return heheCouponRecord;
+    }
+
+    public void setHeheCouponRecord(CmHeheCouponOrderRecord heheCouponRecord) {
+        this.heheCouponRecord = heheCouponRecord;
+    }
 }
 

+ 9 - 0
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -14,6 +14,8 @@ import com.caimei.modules.coupon.entity.CmCouponClub;
 import com.caimei.modules.coupon.entity.CmCouponOrderRecord;
 import com.caimei.modules.coupon.entity.CmCouponRedemptionCode;
 import com.caimei.modules.coupon.service.CmCouponService;
+import com.caimei.modules.hehe.dao.HeHeNewOrderDao;
+import com.caimei.modules.hehe.entity.CmHeheCouponOrderRecord;
 import com.caimei.modules.miniprogram.utils.UploadPicUtils;
 import com.caimei.modules.order.dao.*;
 import com.caimei.modules.order.entity.*;
@@ -120,6 +122,8 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
     private CmCouponService cmCouponService;
     @Autowired
     private CmCouponClubDao cmCouponClubDao;
+    @Autowired
+    private HeHeNewOrderDao heHeNewOrderDao;
 
     @Transactional(readOnly = false)
     public void updateClauseContent(NewOrder newOrder) {
@@ -1023,6 +1027,11 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                     newOrder.setClubCouponId(couponRecord.getClubCouponId());
                     newOrder.setCouponOrderRecord(couponRecord);
                 }
+                CmHeheCouponOrderRecord heheCouponRecord = heHeNewOrderDao.findOrderCouponRecord(newOrder.getOrderID());
+                if (heheCouponRecord != null) {
+                    newOrder.setReceiveCouponId(heheCouponRecord.getReceiveCouponId());
+                    newOrder.setHeheCouponRecord(heheCouponRecord);
+                }
             }
             //获取订单客户
             OrderUserInfo orderUserInfo = orderUserInfoService.findByOrderID(newOrder.getOrderID());

+ 4 - 2
src/main/java/com/caimei/modules/order/web/CmDiscernReceiptController.java

@@ -21,6 +21,8 @@ import com.thinkgem.jeesite.common.web.BaseController;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -1152,8 +1154,8 @@ public class CmDiscernReceiptController extends BaseController {
 
         //创建单元格,并设置值表头 设置表头居中
         HSSFCellStyle style = wb.createCellStyle();
-        style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直
-        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平
+        style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直
+        style.setAlignment(HorizontalAlignment.CENTER);//水平
         style.setFillForegroundColor(HSSFColor.ORANGE.index);
 
         HSSFCellStyle textStyle = wb.createCellStyle();

+ 4 - 2
src/main/java/com/caimei/modules/order/web/NewOrderController.java

@@ -50,6 +50,8 @@ import com.thinkgem.jeesite.common.web.BaseController;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -1642,8 +1644,8 @@ public class NewOrderController extends BaseController {
 
         //创建单元格,并设置值表头 设置表头居中
         HSSFCellStyle style = wb.createCellStyle();
-        style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直
-        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平
+        style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直
+        style.setAlignment(HorizontalAlignment.CENTER);//水平
         style.setFillForegroundColor(HSSFColor.ORANGE.index);
 
 

+ 30 - 0
src/main/java/com/caimei/modules/oss/utils/OSSUtils.java

@@ -5,11 +5,14 @@ import com.aliyun.oss.OSSClientBuilder;
 import com.aliyun.oss.model.GetObjectRequest;
 import com.aliyun.oss.model.ObjectMetadata;
 import com.aliyun.oss.model.UploadFileRequest;
+import com.caimei.modules.archive.entity.CmProductArchiveContent;
 import com.thinkgem.jeesite.common.config.Global;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.File;
 import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.UUID;
 
@@ -150,6 +153,33 @@ public class OSSUtils {
         return url;
     }
 
+    /**
+     * 生成商品资料库链接
+     * @param archiveFile
+     * @return
+     */
+    public static String generateProductArchiveUrl(CmProductArchiveContent archiveFile) {
+        OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
+        String ossName = archiveFile.getOssName();
+        // 设置URL过期时间为1个小时
+        Date expiration = new Date(System.currentTimeMillis() + 3600L * 1000);
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            Date dateOne = format.parse("2021-06-01 00:00:00");
+            Date dateTwo = format.parse("2021-09-17 18:00:00");
+            String active = "product".equals(config) ? "prod" : config;
+            if (archiveFile.getUploadTime() != null && archiveFile.getUploadTime().compareTo(dateOne) > 0 && archiveFile.getUploadTime().compareTo(dateTwo) < 0) {
+                ossName = active + "/" + ossName;
+            } else if (archiveFile.getUploadTime() != null && archiveFile.getUploadTime().compareTo(dateTwo)>0){
+                ossName = active + "/archiveFile/" + ossName;
+            }
+        } catch (ParseException e) {
+        }
+        String url = ossClient.generatePresignedUrl(privateBucket, ossName, expiration).toString();
+        ossClient.shutdown();
+        return url;
+    }
+
     /**
      * oss单个文件删除
      *

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

@@ -198,6 +198,11 @@ public class Product extends DataEntity<Product> {
      */
     private List<ProductLadderPrice> ladderPriceList;
 
+    /**
+     * 搜索类型:1采美商品,2呵呵商城商品
+     */
+    private Integer searchType;
+
     public List<ProductLadderPrice> getLadderPriceList() {
         return ladderPriceList;
     }
@@ -1829,4 +1834,12 @@ public class Product extends DataEntity<Product> {
     public void setSvipFlag(Integer svipFlag) {
         this.svipFlag = svipFlag;
     }
+
+    public Integer getSearchType() {
+        return searchType;
+    }
+
+    public void setSearchType(Integer searchType) {
+        this.searchType = searchType;
+    }
 }

+ 19 - 27
src/main/java/com/thinkgem/jeesite/common/utils/excel/ExportExcel.java

@@ -19,15 +19,7 @@ import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Comment;
-import org.apache.poi.ss.usermodel.DataFormat;
-import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.IndexedColors;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
@@ -235,58 +227,58 @@ public class ExportExcel {
 	 */
 	private Map<String, CellStyle> createStyles(Workbook wb) {
 		Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
-		
+
 		CellStyle style = wb.createCellStyle();
-		style.setAlignment(CellStyle.ALIGN_CENTER);
-		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
+		style.setVerticalAlignment(VerticalAlignment.CENTER);
 		Font titleFont = wb.createFont();
 		titleFont.setFontName("Arial");
 		titleFont.setFontHeightInPoints((short) 16);
-		titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		titleFont.setBold(true);
 		style.setFont(titleFont);
 		styles.put("title", style);
 
 		style = wb.createCellStyle();
-		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
-		style.setBorderRight(CellStyle.BORDER_THIN);
+		style.setVerticalAlignment(VerticalAlignment.CENTER);
+		style.setBorderRight(BorderStyle.THIN);
 		style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderLeft(CellStyle.BORDER_THIN);
+		style.setBorderLeft(BorderStyle.THIN);
 		style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderTop(CellStyle.BORDER_THIN);
+		style.setBorderTop(BorderStyle.THIN);
 		style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderBottom(CellStyle.BORDER_THIN);
+		style.setBorderBottom(BorderStyle.THIN);
 		style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
 		Font dataFont = wb.createFont();
 		dataFont.setFontName("Arial");
 		dataFont.setFontHeightInPoints((short) 10);
 		style.setFont(dataFont);
 		styles.put("data", style);
-		
+
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_LEFT);
+		style.setAlignment(HorizontalAlignment.LEFT);
 		styles.put("data1", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
 		styles.put("data2", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_RIGHT);
+		style.setAlignment(HorizontalAlignment.RIGHT);
 		styles.put("data3", style);
-		
+
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
 //		style.setWrapText(true);
-		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
 		style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setFillPattern(CellStyle.SOLID_FOREGROUND);
+		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
 		Font headerFont = wb.createFont();
 		headerFont.setFontName("Arial");
 		headerFont.setFontHeightInPoints((short) 10);
-		headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		headerFont.setBold(true);
 		headerFont.setColor(IndexedColors.WHITE.getIndex());
 		style.setFont(headerFont);
 		styles.put("header", style);
@@ -421,7 +413,7 @@ public class ExportExcel {
 	
 	/**
 	 * 输出到文件
-	 * @param fileName 输出文件名
+	 * @param name 输出文件名
 	 */
 	public ExportExcel writeFile(String name) throws FileNotFoundException, IOException{
 		FileOutputStream os = new FileOutputStream(name);

+ 15 - 2
src/main/resources/mappings/modules/coupon/CmCouponMapper.xml

@@ -9,6 +9,9 @@
 		a.touchPrice AS "touchPrice",
 		a.startDate AS "startDate",
 		a.endDate AS "endDate",
+		a.receivePeriod,
+		a.receiveFlag,
+		a.usePeriod,
 		a.status AS "status",
 		a.couponType AS "couponType",
 		a.vipFlag AS "vipFlag",
@@ -135,6 +138,9 @@
 			touchPrice,
 			startDate,
 			endDate,
+			receivePeriod,
+			receiveFlag,
+			usePeriod,
 			status,
 			couponType,
 			vipFlag,
@@ -153,6 +159,9 @@
 			#{touchPrice},
 			#{startDate},
 			#{endDate},
+			#{receivePeriod},
+			#{receiveFlag},
+			#{usePeriod},
 			#{status},
 			#{couponType},
 		    #{vipFlag},
@@ -175,6 +184,9 @@
 			touchPrice = #{touchPrice},
 			startDate = #{startDate},
 			endDate = #{endDate},
+			receivePeriod = #{receivePeriod},
+			receiveFlag = #{receiveFlag},
+			usePeriod = #{usePeriod},
 			status = #{status},
 			couponType = #{couponType},
 			vipFlag = #{vipFlag},
@@ -408,6 +420,8 @@
 		  cc.`touchPrice`,
 		  cc.`startDate`,
 		  cc.`endDate`,
+		  a.`createDate` as `receiveDate`,
+		  date_add(a.createDate,interval cc.usePeriod DAY) as `useEndDate`,
 		  cc.`status`,
 		  cc.`couponType`,
 		  cc.`userId`,
@@ -430,8 +444,7 @@
 		  AND a.delFlag = 0
 		  AND a.userId = #{userId}
 		  AND a.status = 1
-		  AND NOW() BETWEEN cc.startDate
-		  AND cc.endDate
+		  AND NOW() <![CDATA[ < ]]> date_add(a.createDate,interval cc.usePeriod DAY)
 		  AND cc.status != 2
 		ORDER BY
 		  a.createDate DESC

+ 4 - 4
src/main/resources/mappings/modules/hehe/CmHeheDiscountMapper.xml

@@ -78,7 +78,7 @@
 			#{discount},
 			#{status},
 			#{productType},
-			#{addTime}
+			NOW()
 		)
 	</insert>
 	
@@ -118,7 +118,7 @@
 		VALUES
 		(
 			#{discountId}, #{productId}, #{status},
-			#{sort}, NOW()
+			#{sort}, #{addTime}
 		)
 	</insert>
 	<insert id="insertDiscountUser">
@@ -162,7 +162,7 @@
 			p.mainImage AS image
 		FROM
 			cm_hehe_discount_product cca
-				left join cm_hehe_product chp on cca.productId = chp.id
+				left join cm_hehe_product chp on cca.productId = chp.productId
 				LEFT JOIN product p ON chp.productId = p.productID
 				LEFT JOIN shop s ON p.shopID = s.shopID
 		WHERE
@@ -173,7 +173,7 @@
 	<select id="findDiscountUserList" resultType="com.caimei.modules.hehe.entity.CmHeheDiscountUser">
 		select chu.id, chu.userId, chu.discountId, chu.addTime, u.nickName, u.mobile, u.userIdentity
 		from cm_hehe_discount_user chu
-				 left join cm_hehe_user u on chu.userId = u.id
+				 left join cm_hehe_user u on chu.userId = u.userId
 		where chu.discountId = #{id}
 		order by chu.addTime desc
 	</select>

+ 10 - 3
src/main/resources/mappings/modules/hehe/CmHeheFloorProductMapper.xml

@@ -88,9 +88,16 @@
 		select productId from cm_hehe_floor_product where floorId = #{floorId}
 	</select>
 	<select id="findAllProduct" resultType="com.caimei.modules.product.entity.Product">
-		select hp.id as productID,p.mainImage,p.name,s.name as shopName
-		       from cm_hehe_product hp left join product p on hp.productId = p.productID
-				left join shop s on p.shopID = s.shopID
+		select
+			<if test="searchType == 1">
+				hp.productId as productID,
+			</if>
+			<if test="searchType != 1">
+				hp.id as productID,
+			</if>
+			p.mainImage,p.name,s.name as shopName
+			from cm_hehe_product hp left join product p on hp.productId = p.productID
+			left join shop s on p.shopID = s.shopID
 		<where>
 			hp.validFlag = 1
 			<if test="productID != null" >

+ 15 - 0
src/main/resources/mappings/modules/hehe/HeHeNewOrderMapper.xml

@@ -244,4 +244,19 @@
         SELECT IFNULL(name,nickName) FROM cm_hehe_user WHERE userId = #{heUserId}
     </select>
 
+    <select id="findOrderCouponRecord" resultType="com.caimei.modules.hehe.entity.CmHeheCouponOrderRecord">
+        SELECT
+            `id`,
+            `orderId`,
+            `receiveCouponId`,
+            `couponType`,
+            `couponAmount`,
+            `touchPrice`,
+            `createDate`
+        FROM
+            cm_hehe_coupon_order_record
+        WHERE
+            orderId = #{orderID}
+    </select>
+
 </mapper>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/archive/addFileForm.jsp

@@ -186,7 +186,7 @@
         <label class="control-label"><font color="red">*</font>文件路径:</label>
         <input id="uploadFileName" type="text" style="display: inline;margin-left:20px" disabled="true" class="input-xlarge required" />
         <div class="upload">
-            <input type="file" name="file" id="archiveFile" accept=".pdf,.doc,.docx,.ppt,.pptx">选择文件
+            <input type="file" name="file" id="archiveFile" accept=".pdf,.docx,.pptx">选择文件
         </div>
         <div class="add-submit">
             <input id="addSubmit" type="button" value="上传" style="cursor: pointer"/>上传&nbsp;
@@ -195,7 +195,7 @@
             <img alt="gif" src="/static/images/upload.gif" width="32px" border="none">
         </div>
         <div style="margin:5px 0 0 180px">
-            <font color="red">支持上传pdf丶word丶ppt文件格式</font>
+            <font color="red">支持上传pdf丶docx丶pptx文件格式</font>
         </div>
     </div>
 </form:form>

+ 17 - 3
src/main/webapp/WEB-INF/views/modules/archive/cmOrderArchiveList.jsp

@@ -73,6 +73,12 @@
         <form:input path="clubName" htmlEscape="false" maxlength="55" class="input-medium"/>
         <label>商品标签:</label>
         <form:input path="tag" htmlEscape="false" class="input-medium"/>
+        <label>订单状态:</label>
+        <form:select path="orderStatus" class="select-ele input-medium required">
+            <form:option value="" label="所有"/>
+            <form:options items="${fns:getDictList('order_status')}" itemLabel="label" itemValue="value"
+                          htmlEscape="false"/>
+        </form:select>
         <label>返佣订单:</label>
         <form:select path="rebateFlag" class="input-medium">
             <form:option value="" label="请选择"/>
@@ -92,7 +98,8 @@
         <th>序号</th>
         <th>订单资料编号</th>
         <th>订单资料标题</th>
-        <th>子订单ID</th>
+        <th>子订单ID/母订单ID</th>
+        <th>母订单状态</th>
         <th>供应商名称</th>
         <th>机构名称</th>
         <th>商品标签</th>
@@ -113,9 +120,16 @@
             </td>
             <td>
                 <a href="${ctx}/order/detail?id=${cmOrderArchive.orderId}">
-                        ${cmOrderArchive.shopOrderId}
+                        ${cmOrderArchive.shopOrderId}/${cmOrderArchive.orderId}
                 </a>
             </td>
+            <td>
+                <c:if test="${cmOrderArchive.orderStatus eq 11 || cmOrderArchive.orderStatus eq 12 || cmOrderArchive.orderStatus eq 13 ||cmOrderArchive.orderStatus eq 21 ||cmOrderArchive.orderStatus eq 22 ||
+				cmOrderArchive.orderStatus eq 23 || cmOrderArchive.orderStatus eq 31 ||cmOrderArchive.orderStatus eq 32 ||cmOrderArchive.orderStatus eq 33}">
+                    交易中<br>(${fns:getDictLabel(cmOrderArchive.orderStatus,"order_detail_status","" )})
+                </c:if>
+                <c:if test="${cmOrderArchive.orderStatus eq 0 || cmOrderArchive.orderStatus eq 4 || cmOrderArchive.orderStatus eq 5 || cmOrderArchive.orderStatus eq 6 || cmOrderArchive.orderStatus eq 7}">${fns:getDictLabel(cmOrderArchive.orderStatus,"order_detail_status","" )}</c:if>
+            </td>
             <td>
                     ${cmOrderArchive.shopName}
             </td>
@@ -135,7 +149,7 @@
                 <a href="${ctx}/archive/cmOrderArchive/form?id=${cmOrderArchive.id}">编辑</a>
                 <a href="${ctx}/archive/cmOrderArchive/delete?id=${cmOrderArchive.id}"
                    onclick="return confirmx('确认要删除该数据吗?', this.href)">删除</a>
-                <a href="JavaScript:;" onclick="showArchiveList(${cmOrderArchive.id})">资料列表</a>
+                <a href="JavaScript:;" onclick="showArchiveList(${cmOrderArchive.id})">资料列表(${cmOrderArchive.fileNum})</a>
             </td>
         </tr>
     </c:forEach>

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

@@ -120,6 +120,7 @@
 		<form:hidden path="productInfo" id="productInfo"/>
 		<input type="hidden" name="couponType" value="0"/>
 		<sys:message content="${message}"/>
+		<form:hidden path="receiveFlag"/>
 		<div class="control-group">
 			<label class="control-label"><font color="red">*</font>活动主题:</label>
 			<div class="controls">
@@ -154,6 +155,21 @@
 					onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59',isShowClear:false});" onblur="dateShow()"/>
 			</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">
@@ -302,7 +318,9 @@
 				}
 			}, 500);
 		});
-		productShow()
+		productShow();
+
+		initInputDisplay();
 	});
 
 	var productIds = '';
@@ -553,7 +571,6 @@
 		}
 	}
 
-
 	/**
 	 * @param obj
 	 * jquery控制input只能输入数字
@@ -561,6 +578,57 @@
 	function onlynum(obj) {
 		obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
 	}
+
+	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 initInputDisplay() {
+		var receiveFlag = $("#receiveFlag").val();
+		if (receiveFlag === '1') {
+			$("#receivePeriod").attr('readonly', true);
+			$("#receivePeriod").attr('required', false);
+		} else {
+			$("#receivePeriod").attr('readonly', false);
+			$("#receivePeriod").attr('required', true);
+		}
+	}
 </script>
 </body>
 </html>

+ 14 - 9
src/main/webapp/WEB-INF/views/modules/coupon/cmCouponList.jsp

@@ -38,10 +38,10 @@
 			<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="0" label="待上架"/>
+				<form:option value="1" label="已上架"/>
+				<form:option value="3" label="已下架"/>
 				<form:option value="2" label="已关闭"/>
-				<form:option value="3" label="已失效"/>
 			</form:select>
 			 <label>优惠时间:</label>
 				<input name="startDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
@@ -87,16 +87,16 @@
 				</td>
 				<td>
 					<c:if test="${cmCoupon.status eq 0}">
-						<font color="#800080">未生效</font>
+						<font color="#800080">待上架</font>
 					</c:if>
 					<c:if test="${cmCoupon.status eq 1}">
-						<font color="#00CC66">已生效</font>
+						<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>
+						<font color="#FF6600">已下架</font>
 					</c:if>
 				</td>
 				<td>
@@ -109,9 +109,14 @@
 					<fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>
 				<td>
-    				<a href="${ctx}/coupon/cmCoupon/form?id=${cmCoupon.id}">编辑</a>
-					<a href="${ctx}/coupon/cmCoupon/close?id=${cmCoupon.id}" onclick="return confirmx('确定关闭该优惠券吗?', this.href)">关闭</a>
-					<a href="${ctx}/coupon/cmCoupon/delete?id=${cmCoupon.id}" onclick="return confirmx('确定删除该优惠券吗?', this.href)">删除</a>
+					<a href="${ctx}/coupon/cmCoupon/form?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}" onclick="return confirmx('确定删除该活动吗?', this.href)">删除</a>
 					<a href="${ctx}/coupon/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=0">领取用户</a>
 				</td>
 			</tr>

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

@@ -49,6 +49,7 @@
     <form:hidden path="productInfo" id="productInfo"/>
     <input type="hidden" name="couponType" value="1"/>
     <sys:message content="${message}"/>
+    <form:hidden path="receiveFlag"/>
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>活动主题:</label>
         <div class="controls">
@@ -90,6 +91,21 @@
                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59',isShowClear:false});" onblur="dateShow()"/>
         </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">
@@ -120,6 +136,10 @@
     </div>
 </form:form>
 <script>
+    $(function () {
+        initInputDisplay();
+    })
+
     function statusShow() {
         var status = $("input[name='status']:checked").val();
         if (status == 2) {
@@ -154,6 +174,57 @@
     function onlynum(obj) {
         obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
     }
+
+    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 initInputDisplay() {
+        var receiveFlag = $("#receiveFlag").val();
+        if (receiveFlag === '1') {
+            $("#receivePeriod").attr('readonly', true);
+            $("#receivePeriod").attr('required', false);
+        } else {
+            $("#receivePeriod").attr('readonly', false);
+            $("#receivePeriod").attr('required', true);
+        }
+    }
 </script>
 </body>
 </html>

+ 13 - 8
src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryList.jsp

@@ -38,10 +38,10 @@
         <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="0" label="待上架"/>
+            <form:option value="1" label="已上架"/>
+            <form:option value="3" label="已下架"/>
             <form:option value="2" label="已关闭"/>
-            <form:option value="3" label="已失效"/>
         </form:select>
         <label>优惠时间:</label>
         <input name="startDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
@@ -88,16 +88,16 @@
             </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
-                    <font color="#800080">未生效</font>
+                    <font color="#800080">待上架</font>
                 </c:if>
                 <c:if test="${cmCoupon.status eq 1}">
-                    <font color="#00CC66">已生效</font>
+                    <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>
+                    <font color="#FF6600">已下架</font>
                 </c:if>
             </td>
             <td>${cmCoupon.categoryType eq 1 ? "产品":"仪器"}</td>
@@ -112,8 +112,13 @@
             </td>
             <td>
                 <a href="${ctx}/coupon/cmCoupon/form?id=${cmCoupon.id}">编辑</a>
-                <a href="${ctx}/coupon/cmCoupon/close?id=${cmCoupon.id}" onclick="return confirmx('确定关闭该优惠券吗?', this.href)">关闭</a>
-                <a href="${ctx}/coupon/cmCoupon/delete?id=${cmCoupon.id}" onclick="return confirmx('确定删除该优惠券吗?', this.href)">删除</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}" onclick="return confirmx('确定删除该活动吗?', this.href)">删除</a>
                 <a href="${ctx}/coupon/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=1">领取用户</a>
             </td>
         </tr>

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

@@ -49,6 +49,7 @@
     <form:hidden path="productInfo" id="productInfo"/>
     <input type="hidden" name="couponType" value="4"/>
     <sys:message content="${message}"/>
+    <form:hidden path="receiveFlag"/>
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>优惠券金额:</label>
         <div class="controls">
@@ -77,6 +78,21 @@
                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59',isShowClear:false});" onblur="dateShow()"/>
         </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">
@@ -107,6 +123,10 @@
     </div>
 </form:form>
 <script>
+    $(function () {
+        initInputDisplay();
+    })
+
     function statusShow() {
         var status = $("input[name='status']:checked").val();
         if (status == 2) {
@@ -141,6 +161,57 @@
     function onlynum(obj) {
         obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
     }
+
+    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 initInputDisplay() {
+        var receiveFlag = $("#receiveFlag").val();
+        if (receiveFlag === '1') {
+            $("#receivePeriod").attr('readonly', true);
+            $("#receivePeriod").attr('required', false);
+        } else {
+            $("#receivePeriod").attr('readonly', false);
+            $("#receivePeriod").attr('required', true);
+        }
+    }
 </script>
 </body>
 </html>

+ 13 - 8
src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserList.jsp

@@ -36,10 +36,10 @@
         <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="0" label="待上架"/>
+            <form:option value="1" label="已上架"/>
+            <form:option value="3" label="已下架"/>
             <form:option value="2" label="已关闭"/>
-            <form:option value="3" label="已失效"/>
         </form:select>
         <label>优惠时间:</label>
         <input name="startDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
@@ -81,16 +81,16 @@
             </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
-                    <font color="#800080">未生效</font>
+                    <font color="#800080">待上架</font>
                 </c:if>
                 <c:if test="${cmCoupon.status eq 1}">
-                    <font color="#00CC66">已生效</font>
+                    <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>
+                    <font color="#FF6600">已下架</font>
                 </c:if>
             </td>
             <td>
@@ -104,8 +104,13 @@
             </td>
             <td>
                 <a href="${ctx}/coupon/cmCoupon/form?id=${cmCoupon.id}">编辑</a>
-                <a href="${ctx}/coupon/cmCoupon/close?id=${cmCoupon.id}" onclick="return confirmx('确定关闭该优惠券吗?', this.href)">关闭</a>
-                <a href="${ctx}/coupon/cmCoupon/delete?id=${cmCoupon.id}" onclick="return confirmx('确定删除该优惠券吗?', this.href)">删除</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}" onclick="return confirmx('确定删除该活动吗?', this.href)">删除</a>
                 <a href="${ctx}/coupon/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=4">领取用户</a>
             </td>
         </tr>

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

@@ -55,6 +55,7 @@
     <form:hidden path="shopId" id="shopId"/>
     <input type="hidden" name="couponType" value="3"/>
     <sys:message content="${message}"/>
+    <form:hidden path="receiveFlag"/>
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>活动主题:</label>
         <div class="controls">
@@ -111,6 +112,21 @@
                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59',isShowClear:false});" onblur="dateShow()"/>
         </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">
@@ -153,6 +169,7 @@
             }
             appendShopOrderHead(shop);
         }
+        initInputDisplay();
     });
 
 
@@ -252,6 +269,57 @@
     function onlynum(obj) {
         obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
     }
+
+    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 initInputDisplay() {
+        var receiveFlag = $("#receiveFlag").val();
+        if (receiveFlag === '1') {
+            $("#receivePeriod").attr('readonly', true);
+            $("#receivePeriod").attr('required', false);
+        } else {
+            $("#receivePeriod").attr('readonly', false);
+            $("#receivePeriod").attr('required', true);
+        }
+    }
 </script>
 </body>
 </html>

+ 13 - 8
src/main/webapp/WEB-INF/views/modules/coupon/couponShopList.jsp

@@ -40,10 +40,10 @@
         <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="0" label="待上架"/>
+            <form:option value="1" label="已上架"/>
+            <form:option value="3" label="已下架"/>
             <form:option value="2" label="已关闭"/>
-            <form:option value="3" label="已失效"/>
         </form:select><br><br>
         <label>优惠时间:</label>
         <input name="startDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
@@ -93,16 +93,16 @@
             </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
-                    <font color="#800080">未生效</font>
+                    <font color="#800080">待上架</font>
                 </c:if>
                 <c:if test="${cmCoupon.status eq 1}">
-                    <font color="#00CC66">已生效</font>
+                    <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>
+                    <font color="#FF6600">已下架</font>
                 </c:if>
             </td>
             <td>
@@ -116,8 +116,13 @@
             </td>
             <td>
                 <a href="${ctx}/coupon/cmCoupon/form?id=${cmCoupon.id}">编辑</a>
-                <a href="${ctx}/coupon/cmCoupon/close?id=${cmCoupon.id}" onclick="return confirmx('确定关闭该优惠券吗?', this.href)">关闭</a>
-                <a href="${ctx}/coupon/cmCoupon/delete?id=${cmCoupon.id}" onclick="return confirmx('确定删除该优惠券吗?', this.href)">删除</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}" onclick="return confirmx('确定删除该活动吗?', this.href)">删除</a>
                 <a href="${ctx}/coupon/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=3">领取用户</a>
             </td>
         </tr>

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

@@ -57,6 +57,7 @@
     <form:hidden path="productInfo" id="productInfo"/>
     <input type="hidden" name="couponType" value="2"/>
     <sys:message content="${message}"/>
+    <form:hidden path="receiveFlag"/>
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>机构:</label>
         <div class="controls">
@@ -108,6 +109,21 @@
                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59',isShowClear:false});" onblur="dateShow()"/>
         </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">
@@ -164,6 +180,7 @@
             };
             insertHtml(items);
         }
+        initInputDisplay();
     });
 
     function insertHtml(data) {
@@ -257,6 +274,57 @@
     function onlynum(obj) {
         obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
     }
+
+    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 initInputDisplay() {
+        var receiveFlag = $("#receiveFlag").val();
+        if (receiveFlag === '1') {
+            $("#receivePeriod").attr('readonly', true);
+            $("#receivePeriod").attr('required', false);
+        } else {
+            $("#receivePeriod").attr('readonly', false);
+            $("#receivePeriod").attr('required', true);
+        }
+    }
 </script>
 </body>
 </html>

+ 13 - 8
src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveList.jsp

@@ -38,10 +38,10 @@
         <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="0" label="待上架"/>
+            <form:option value="1" label="已上架"/>
+            <form:option value="3" label="已下架"/>
             <form:option value="2" label="已关闭"/>
-            <form:option value="3" label="已失效"/>
         </form:select>
         <label>领取状态:</label>
         <form:select path="claimStatus" class="input-medium required">
@@ -111,16 +111,16 @@
             </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
-                    <font color="#800080">未生效</font>
+                    <font color="#800080">待上架</font>
                 </c:if>
                 <c:if test="${cmCoupon.status eq 1}">
-                    <font color="#00CC66">已生效</font>
+                    <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>
+                    <font color="#FF6600">已下架</font>
                 </c:if>
             </td>
             <td>
@@ -174,8 +174,13 @@
             </td>
             <td>
                 <a href="${ctx}/coupon/cmCoupon/form?id=${cmCoupon.id}">编辑</a>
-                <a href="${ctx}/coupon/cmCoupon/close?id=${cmCoupon.id}" onclick="return confirmx('确定关闭该优惠券吗?', this.href)">关闭</a>
-                <a href="${ctx}/coupon/cmCoupon/delete?id=${cmCoupon.id}" onclick="return confirmx('确定删除该优惠券吗?', this.href)">删除</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}" onclick="return confirmx('确定删除该活动吗?', this.href)">删除</a>
             </td>
         </tr>
     </c:forEach>

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

@@ -43,7 +43,7 @@
                         <span>兑换码:${coupon.redemptionCode}</span>
                     </c:if>
                     <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>有效期:<fmt:formatDate value="${coupon.receiveDate}" pattern="yyyy-MM-dd"/>-<fmt:formatDate value="${coupon.useEndDate}" pattern="yyyy-MM-dd"/></span>
                 </span></li>
             </c:forEach>
         </ul>

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

@@ -151,6 +151,12 @@
                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59',isShowClear:false});" onblur="dateShow()"/>
         </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">

+ 7 - 2
src/main/webapp/WEB-INF/views/modules/coupon/redemptionCodeCouponList.jsp

@@ -109,8 +109,13 @@
             </td>
             <td>
                 <a href="${ctx}/coupon/cmCoupon/codeCouponForm?id=${cmCoupon.id}">编辑</a>
-                <a href="${ctx}/coupon/cmCoupon/close?id=${cmCoupon.id}" onclick="return confirmx('确定关闭该优惠券吗?', this.href)">关闭</a>
-                <a href="${ctx}/coupon/cmCoupon/delete?id=${cmCoupon.id}" onclick="return confirmx('确定删除该优惠券吗?', this.href)">删除</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}" onclick="return confirmx('确定删除该活动吗?', this.href)">删除</a>
                 <a href="javascript:void(0);" onclick="showSelect(${cmCoupon.id})">查看兑换码</a>
             </td>
         </tr>

+ 8 - 3
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheCouponList.jsp

@@ -10,7 +10,7 @@
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
-			
+
 		});
 		function page(n,s){
 			$("#pageNo").val(n);
@@ -79,7 +79,12 @@
 					${cmHeheCoupon.couponAmount}
 				</td>
 				<td>
-					${cmHeheCoupon.touchPrice}
+					<c:if test="${cmHeheCoupon.noThresholdFlag eq 1}">
+						无门槛
+					</c:if>
+					<c:if test="${cmHeheCoupon.noThresholdFlag ne 1}">
+						满${cmHeheCoupon.touchPrice}
+					</c:if>
 				</td>
 				<td>
 					<fmt:formatDate value="${cmHeheCoupon.startTime}" pattern="yyyy-MM-dd HH:mm"/>
@@ -107,7 +112,7 @@
 				</td>
 				<td>
     				<a href="${ctx}/hehe/cmHeheCoupon/form?id=${cmHeheCoupon.id}">编辑</a>
-					<a href="${ctx}/hehe/cmHeheCoupon/delete?id=${cmHeheCoupon.id}" onclick="return confirmx('确认要删除该优惠券吗?', this.href)">删除</a>
+					<a href="${ctx}/hehe/cmHeheCoupon/delete?id=${cmHeheCoupon.id}&couponType=${cmHeheCoupon.couponType}" onclick="return confirmx('确认要删除该优惠券吗?', this.href)">删除</a>
 					<a href="${ctx}/hehe/cmHeheCoupon/receive/user/list?couponId=${cmHeheCoupon.id}&couponType=${cmHeheCoupon.couponType}">领取用户</a>
 				</td>
 			</tr>

+ 9 - 1
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheDiscountForm.jsp

@@ -49,6 +49,14 @@
 		function onlynum(obj) {
 			obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
 		}
+
+		function changeDiscount(){
+            var discount = Number($("#discount").val()).toFixed(2);
+            if (discount > 100 || discount <= 0) {
+                $.jBox.tip("请输入0-100之间的数字", 'info');
+                $("#discount").val('');
+            }
+        }
 	</script>
 </head>
 <body>
@@ -70,7 +78,7 @@
 		<div class="control-group">
 			<label class="control-label"><font color="red">*</font>折扣率:</label>
 			<div class="controls">
-				<form:input path="discount" htmlEscape="false" onkeyup="onlynum(this)" class="input-xlarge  digits required"/> %
+				<form:input path="discount" htmlEscape="false" onkeyup="onlynum(this)" onchange="changeDiscount()" class="input-xlarge  digits required"/> %
 			</div>
 		</div>
 		<div class="control-group">

+ 0 - 3
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheDiscountList.jsp

@@ -38,9 +38,6 @@
 					<form:option value="2" label="已停用"/>
 				</form:select>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
-			<a class="btn btn-primary" href="${ctx}/hehe/cmHeheDiscount/form" style="margin-left: 15px">
-				添加内部优惠
-			</a>
 			<div class="clearfix"></div>
 		</div>
 	</form:form>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/hehe/toAddCouponUser.jsp

@@ -41,7 +41,7 @@
                 var user = JSON.parse($(this).val());
                 items.push({
                     "id": '',
-                    "userId": user.id,
+                    "userId": user.userID,
                     "nickName": user.nickName,
                     "mobile": user.mobile,
                     "userIdentity": user.userIdentity,
@@ -115,7 +115,7 @@
     <tbody>
     <c:if test="${not empty page.list}">
         <c:forEach items="${page.list}" var="item">
-            <tr id="${item.id}" class="itemtr">
+            <tr id="${item.userID}" class="itemtr">
                     <%--已过滤添加过的商品和未上架的商品--%>
                 <th>
                     <input class="check-item" ${item.storeStatus ? "disabled" : ""}  type="checkbox" name="info" value='${fns:toJson(item)}'/>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/hehe/toAddDiscountUser.jsp

@@ -41,7 +41,7 @@
                 var user = JSON.parse($(this).val());
                 items.push({
                     "id": '',
-                    "userId": user.id,
+                    "userId": user.userID,
                     "nickName": user.nickName,
                     "mobile": user.mobile,
                     "userIdentity": user.userIdentity,

+ 1 - 1
src/main/webapp/static/modules/bulkpurchase/orderForm.js

@@ -471,7 +471,7 @@ function setPageCoupon() {
         html += '            <span>' + item.couponName + '</span>';
         html += redemptionCode;
         html += '            <span>' + item.couponDesc + '</span>';
-        html += '            <span>有效期:' + item.startDate + ' - ' + item.endDate + '</span>';
+        html += '            <span>有效期:'+item.receiveDate+' - '+item.useEndDate+'</span>';
         html += '</span></label></li>';
     });
     $("#couponBox").find(".couponContent").html(html);