Browse Source

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

# Conflicts:
#	pom.xml
#	src/main/java/com/caimei/modules/archive/entity/CmProductArchiveContent.java
#	src/main/java/com/caimei/modules/archive/service/CmProductArchiveContentService.java
#	src/main/java/com/caimei/modules/archive/utils/WaterMarkUtils.java
#	src/main/java/com/caimei/modules/archive/web/CmProductArchiveContentController.java
#	src/main/java/com/caimei/modules/hehe/web/CmHeheProductController.java
#	src/main/resources/config/beta/caimei.properties
#	src/main/resources/config/dev/caimei.properties
#	src/main/resources/mappings/modules/archive/CmOrderArchiveMapper.xml
#	src/main/resources/mappings/modules/archive/CmProductArchiveContentMapper.xml
#	src/main/resources/mappings/modules/hehe/CmHeheCouponMapper.xml
#	src/main/resources/mappings/modules/order/OrderMapper.xml
#	src/main/resources/mappings/modules/user/CmUserMapper.xml
#	src/main/webapp/WEB-INF/views/modules/archive/addFileForm.jsp
#	src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveContentList.jsp
#	src/main/webapp/WEB-INF/views/modules/bulkpurchase/applyRefoundForm.jsp
#	src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderConfirmReturnRecord.jsp
#	src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderReturnRecord.jsp
#	src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderReviewReturnRecord.jsp
#	src/main/webapp/WEB-INF/views/modules/bulkpurchase/refundRecord.jsp
#	src/main/webapp/WEB-INF/views/modules/hehe/cmHeheCouponForm.jsp
#	src/main/webapp/WEB-INF/views/modules/hehe/cmHeheProductForm.jsp
#	src/main/webapp/WEB-INF/views/modules/hehe/heheNewOrderDetail.jsp
Aslee 3 năm trước cách đây
mục cha
commit
31c2e7ff56
68 tập tin đã thay đổi với 2109 bổ sung1949 xóa
  1. 0 18
      src/main/java/com/caimei/modules/archive/entity/CmOrderArchive.java
  2. 11 0
      src/main/java/com/caimei/modules/bulkpurchase/entity/PurchaseProduct.java
  3. 1 1
      src/main/java/com/caimei/modules/bulkpurchase/web/CmRefundsProductController.java
  4. 68 71
      src/main/java/com/caimei/modules/common/utils/PoiExcelUtil.java
  5. 0 48
      src/main/java/com/caimei/modules/coupon/entity/CmCoupon.java
  6. 0 13
      src/main/java/com/caimei/modules/coupon/service/CmCouponService.java
  7. 0 13
      src/main/java/com/caimei/modules/coupon/web/CmCouponController.java
  8. 0 2
      src/main/java/com/caimei/modules/hehe/dao/CmHeheCouponDao.java
  9. 0 8
      src/main/java/com/caimei/modules/hehe/dao/HeHeNewOrderDao.java
  10. 0 9
      src/main/java/com/caimei/modules/hehe/entity/CmHeheCoupon.java
  11. 8 31
      src/main/java/com/caimei/modules/hehe/service/CmHeheCouponService.java
  12. 1 2
      src/main/java/com/caimei/modules/hehe/service/CmHeheDiscountService.java
  13. 0 1
      src/main/java/com/caimei/modules/hehe/service/CmHeheFloorProductService.java
  14. 0 10
      src/main/java/com/caimei/modules/hehe/service/HeHeNewOrderService.java
  15. 1 2
      src/main/java/com/caimei/modules/hehe/web/CmHeheCouponController.java
  16. 1 1
      src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java
  17. 8 22
      src/main/java/com/caimei/modules/order/entity/NewOrder.java
  18. 9 0
      src/main/java/com/caimei/modules/order/entity/NewOrderProduct.java
  19. 2 0
      src/main/java/com/caimei/modules/order/service/CmPayShopService.java
  20. 19 0
      src/main/java/com/caimei/modules/order/service/CmReturnedPurchaseService.java
  21. 29 10
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  22. 2 4
      src/main/java/com/caimei/modules/order/web/CmDiscernReceiptController.java
  23. 2 4
      src/main/java/com/caimei/modules/order/web/NewOrderController.java
  24. 0 30
      src/main/java/com/caimei/modules/oss/utils/OSSUtils.java
  25. 2 0
      src/main/java/com/caimei/modules/product/dao/CmPromotionDao.java
  26. 25 0
      src/main/java/com/caimei/modules/product/entity/CmPromotion.java
  27. 0 13
      src/main/java/com/caimei/modules/product/entity/Product.java
  28. 50 27
      src/main/java/com/caimei/modules/product/web/CmPromotionController.java
  29. 2 0
      src/main/java/com/caimei/modules/user/dao/CmUserDao.java
  30. 3 0
      src/main/java/com/caimei/modules/user/dao/NewCmClubDao.java
  31. 2 2
      src/main/java/com/caimei/modules/user/entity/UserBeansHistory.java
  32. 24 16
      src/main/java/com/thinkgem/jeesite/common/utils/excel/ExportExcel.java
  33. BIN
      src/main/resources/export/payList.xls
  34. 2 15
      src/main/resources/mappings/modules/coupon/CmCouponMapper.xml
  35. 4 4
      src/main/resources/mappings/modules/hehe/CmHeheDiscountMapper.xml
  36. 1 8
      src/main/resources/mappings/modules/hehe/CmHeheFloorProductMapper.xml
  37. 0 14
      src/main/resources/mappings/modules/hehe/HeHeNewOrderMapper.xml
  38. 8 2
      src/main/resources/mappings/modules/order/OrderMapper.xml
  39. 171 156
      src/main/resources/mappings/modules/product/CmPromotionMapper.xml
  40. 9 1
      src/main/resources/mappings/modules/user/NewCmClubMapper.xml
  41. 2 3
      src/main/webapp/WEB-INF/views/modules/archive/addFileForm.jsp
  42. 3 17
      src/main/webapp/WEB-INF/views/modules/archive/cmOrderArchiveList.jsp
  43. 0 1
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderReviewReturnRecord.jsp
  44. 1 70
      src/main/webapp/WEB-INF/views/modules/coupon/cmCouponForm.jsp
  45. 8 13
      src/main/webapp/WEB-INF/views/modules/coupon/cmCouponList.jsp
  46. 0 71
      src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryForm.jsp
  47. 8 13
      src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryList.jsp
  48. 0 71
      src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserForm.jsp
  49. 8 13
      src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserList.jsp
  50. 0 68
      src/main/webapp/WEB-INF/views/modules/coupon/couponShopForm.jsp
  51. 8 13
      src/main/webapp/WEB-INF/views/modules/coupon/couponShopList.jsp
  52. 0 68
      src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveForm.jsp
  53. 8 13
      src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveList.jsp
  54. 1 1
      src/main/webapp/WEB-INF/views/modules/coupon/productCouponDetails.jsp
  55. 0 6
      src/main/webapp/WEB-INF/views/modules/coupon/redemptionCodeCouponForm.jsp
  56. 2 7
      src/main/webapp/WEB-INF/views/modules/coupon/redemptionCodeCouponList.jsp
  57. 3 8
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheCouponList.jsp
  58. 1 9
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheDiscountForm.jsp
  59. 3 0
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheDiscountList.jsp
  60. 2 2
      src/main/webapp/WEB-INF/views/modules/hehe/toAddCouponUser.jsp
  61. 1 1
      src/main/webapp/WEB-INF/views/modules/hehe/toAddDiscountUser.jsp
  62. 1 1
      src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptForm.jsp
  63. 524 156
      src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp
  64. 838 647
      src/main/webapp/WEB-INF/views/modules/order/orderForm.jsp
  65. 12 0
      src/main/webapp/WEB-INF/views/modules/product-new/multiPromotionForm.jsp
  66. 12 0
      src/main/webapp/WEB-INF/views/modules/product-new/shopPromotionForm.jsp
  67. 22 3
      src/main/webapp/WEB-INF/views/modules/product-new/singlePromotionForm.jsp
  68. 176 116
      src/main/webapp/static/modules/bulkpurchase/orderForm.js

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

@@ -27,8 +27,6 @@ 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,以","隔开
@@ -137,20 +135,4 @@ 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;
-	}
 }

+ 11 - 0
src/main/java/com/caimei/modules/bulkpurchase/entity/PurchaseProduct.java

@@ -16,6 +16,7 @@ import java.util.List;
 public class PurchaseProduct extends DataEntity<PurchaseProduct> {
 
     private static final long serialVersionUID = 1L;
+    private String discounts; //是否支持叠加优惠,1支持,2不支持
     private String purchaseProductName;        // 商品名称
     private String name;        // 商品名称
     private String image;//商品图片
@@ -64,6 +65,8 @@ public class PurchaseProduct extends DataEntity<PurchaseProduct> {
     private String oldProductFlag;//是否是旧商品 0否 1是
     private String commodityType; //商品属性:1产品,2仪器
     private Integer couponsLogo;    //显示优惠券查看: 1不显示 2显示
+
+
     /**
      * 超级会员优惠价格标识:0不是,1是
      */
@@ -89,6 +92,14 @@ public class PurchaseProduct extends DataEntity<PurchaseProduct> {
      */
     private Double svipTaxReduction;
 
+    public String getDiscounts() {
+        return discounts;
+    }
+
+    public void setDiscounts(String discounts) {
+        this.discounts = discounts;
+    }
+
     public Integer getLadderPriceFlag() {
         return ladderPriceFlag;
     }

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

@@ -728,7 +728,7 @@ public class CmRefundsProductController extends BaseController {
     /**
      * @return
      * @Author ye.qin
-     * @Description //TODO 审核退货退款申请
+     * @Description //审核退货退款申请
      * @Date 2019\5\29 0029 11:02
      * @Param
      */

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

@@ -9,9 +9,6 @@ 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;
@@ -54,8 +51,8 @@ public class PoiExcelUtil {
         headfont.setFontHeightInPoints((short) 22);// 字体大小
         HSSFCellStyle headstyle = workbook.createCellStyle();
         headstyle.setFont(headfont);
-        headstyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
-        headstyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
+        headstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
+        headstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
         headstyle.setLocked(true);
         // 表头客户名 订单号 客户电话 客户地址 样式
         HSSFFont datefont = workbook.createFont();
@@ -63,35 +60,35 @@ public class PoiExcelUtil {
         datefont.setFontHeightInPoints((short) 12);// 字体大小
         HSSFCellStyle datestyle = workbook.createCellStyle();
         datestyle.setFont(datefont);
-        datestyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
-        datestyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
+        datestyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
+        datestyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
         datestyle.setLocked(true);
         // 列名样式
         HSSFFont font = workbook.createFont();
         font.setFontName("黑体");
         font.setFontHeightInPoints((short) 12);// 字体大小
         HSSFCellStyle style = workbook.createCellStyle();
-        style.setBorderBottom(BorderStyle.THIN); //下边框
-        style.setBorderLeft(BorderStyle.THIN);//左边框
-        style.setBorderTop(BorderStyle.THIN);//上边框
-        style.setBorderRight(BorderStyle.THIN);//右边框
+        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
+        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
+        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
+        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
         style.setFont(font);
-        style.setAlignment(HorizontalAlignment.CENTER);// 左右居中
-        style.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
+        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
+        style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
         style.setLocked(true);
         // 普通单元格样式(中文)
         HSSFFont font2 = workbook.createFont();
         font2.setFontName("宋体");
         font2.setFontHeightInPoints((short) 12);
         HSSFCellStyle style2 = workbook.createCellStyle();
-        style2.setBorderBottom(BorderStyle.THIN); //下边框
-        style2.setBorderLeft(BorderStyle.THIN);//左边框
-        style2.setBorderTop(BorderStyle.THIN);//上边框
-        style2.setBorderRight(BorderStyle.THIN);//右边框
+        style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
+        style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
+        style2.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
+        style2.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
         style2.setFont(font2);
-        style2.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
         style2.setWrapText(true); // 换行
-        style2.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
+        style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
 
         // 应付 带颜色单元格样式
         HSSFCellStyle yfstyle = workbook.createCellStyle();
@@ -100,12 +97,12 @@ public class PoiExcelUtil {
         yffont.setFontHeightInPoints((short) 12);
         yffont.setColor(HSSFColor.RED.index);
         yfstyle.setFont(yffont);
-        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.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.setWrapText(true); // 换行
 
         // 合计 带颜色单元格样式
@@ -115,12 +112,12 @@ public class PoiExcelUtil {
         hjfont.setFontHeightInPoints((short) 12);
         hjfont.setColor(HSSFColor.BLUE.index);
         hjstyle.setFont(hjfont);
-        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.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.setWrapText(true); // 换行
 
         // 已收
@@ -130,12 +127,12 @@ public class PoiExcelUtil {
         ysfont.setFontHeightInPoints((short) 12);
         ysfont.setColor(HSSFColor.GREEN.index);
         ysstyle.setFont(ysfont);
-        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.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.setWrapText(true); // 换行
 
         //列宽度  设为自适应
@@ -503,8 +500,8 @@ public class PoiExcelUtil {
         headfont.setFontHeightInPoints((short) 22);// 字体大小
         HSSFCellStyle headstyle = workbook.createCellStyle();
         headstyle.setFont(headfont);
-        headstyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
-        headstyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
+        headstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
+        headstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
         headstyle.setLocked(true);
         // 表头客户名 订单号 客户电话 客户地址 样式
         HSSFFont datefont = workbook.createFont();
@@ -512,35 +509,35 @@ public class PoiExcelUtil {
         datefont.setFontHeightInPoints((short) 12);// 字体大小
         HSSFCellStyle datestyle = workbook.createCellStyle();
         datestyle.setFont(datefont);
-        datestyle.setAlignment(HorizontalAlignment.CENTER);// 左右居中
-        datestyle.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
+        datestyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
+        datestyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
         datestyle.setLocked(true);
         // 列名样式
         HSSFFont font = workbook.createFont();
         font.setFontName("黑体");
         font.setFontHeightInPoints((short) 12);// 字体大小
         HSSFCellStyle style = workbook.createCellStyle();
-        style.setBorderBottom(BorderStyle.THIN); //下边框
-        style.setBorderLeft(BorderStyle.THIN);//左边框
-        style.setBorderTop(BorderStyle.THIN);//上边框
-        style.setBorderRight(BorderStyle.THIN);//右边框
+        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
+        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
+        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
+        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
         style.setFont(font);
-        style.setAlignment(HorizontalAlignment.CENTER);// 左右居中
-        style.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
+        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
+        style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
         style.setLocked(true);
         // 普通单元格样式(中文)
         HSSFFont font2 = workbook.createFont();
         font2.setFontName("宋体");
         font2.setFontHeightInPoints((short) 12);
         HSSFCellStyle style2 = workbook.createCellStyle();
-        style2.setBorderBottom(BorderStyle.THIN); //下边框
-        style2.setBorderLeft(BorderStyle.THIN);//左边框
-        style2.setBorderTop(BorderStyle.THIN);//上边框
-        style2.setBorderRight(BorderStyle.THIN);//右边框
+        style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
+        style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
+        style2.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
+        style2.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
         style2.setFont(font2);
-        style2.setAlignment(HorizontalAlignment.CENTER);// 左右居中
+        style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中
         style2.setWrapText(true); // 换行
-        style2.setVerticalAlignment(VerticalAlignment.CENTER);// 上下居中
+        style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中
 
         // 应付 带颜色单元格样式
         HSSFCellStyle yfstyle = workbook.createCellStyle();
@@ -549,12 +546,12 @@ public class PoiExcelUtil {
         yffont.setFontHeightInPoints((short) 12);
         yffont.setColor(HSSFColor.RED.index);
         yfstyle.setFont(yffont);
-        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.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.setWrapText(true); // 换行
 
         // 合计 带颜色单元格样式
@@ -564,12 +561,12 @@ public class PoiExcelUtil {
         hjfont.setFontHeightInPoints((short) 12);
         hjfont.setColor(HSSFColor.BLUE.index);
         hjstyle.setFont(hjfont);
-        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.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.setWrapText(true); // 换行
         
         // 已收
@@ -579,12 +576,12 @@ public class PoiExcelUtil {
         ysfont.setFontHeightInPoints((short) 12);
         ysfont.setColor(HSSFColor.GREEN.index);
         ysstyle.setFont(ysfont);
-        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.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.setWrapText(true); // 换行
 
         //列宽度  设为自适应

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

@@ -23,9 +23,6 @@ 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是
@@ -51,9 +48,6 @@ public class CmCoupon extends DataEntity<CmCoupon> {
     private NewCmShop shop;
     private List<Integer> productIdList;
 
-    private Date receiveDate;   // 领取时间
-    private Date useEndDate;    // 使用截止时间
-
     public CmCoupon() {
         super();
     }
@@ -300,46 +294,4 @@ 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;
-    }
-
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    public Date getReceiveDate() {
-        return receiveDate;
-    }
-
-    public void setReceiveDate(Date receiveDate) {
-        this.receiveDate = receiveDate;
-    }
-
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    public Date getUseEndDate() {
-        return useEndDate;
-    }
-
-    public void setUseEndDate(Date useEndDate) {
-        this.useEndDate = useEndDate;
-    }
 }

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

@@ -215,19 +215,6 @@ 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);

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

@@ -160,19 +160,6 @@ 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();
-    }
-
     /**
      * 选择机构页面
      */

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

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

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

@@ -1,6 +1,5 @@
 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;
@@ -20,11 +19,4 @@ public interface HeHeNewOrderDao extends CrudDao<NewOrder> {
      * @return
      */
     String findHeUser(Integer heUserId);
-
-    /**
-     * 查询订单优惠记录
-     * @param orderID
-     * @return
-     */
-    CmHeheCouponOrderRecord findOrderCouponRecord(Integer orderID);
 }

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

@@ -39,7 +39,6 @@ public class CmHeheCoupon extends DataEntity<CmHeheCoupon> {
 	private String orderNo;			//订单号
 	private Integer orderId;		//订单id
 	private Integer userId;			//呵呵商城用户id
-	private Integer cmUserId;		//采美用户id
 
 
 
@@ -245,12 +244,4 @@ 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;
-	}
 }

+ 8 - 31
src/main/java/com/caimei/modules/hehe/service/CmHeheCouponService.java

@@ -59,18 +59,6 @@ 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());
@@ -118,36 +106,25 @@ public class CmHeheCouponService extends CrudService<CmHeheCouponDao, CmHeheCoup
 
 	@Transactional(readOnly = false)
 	public void delete(CmHeheCoupon cmHeheCoupon) {
-		cmHeheCouponDao.deleteCoupon(cmHeheCoupon.getId());
+		super.delete(cmHeheCoupon);
 	}
 
 
 	public void setCouponStatus(CmHeheCoupon cmHeheCoupon) {
 		Date date = new Date();
 		if (cmHeheCoupon != null) {
-			// 立即开始
-			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);
-				}
+			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 -> {
@@ -178,7 +155,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.getUserID().toString())) {
+				if (StringUtils.isNotBlank(user.getUserIds()) && user.getUserIds().contains(item.getId())) {
 					item.setStoreStatus(true);
 				}
 			});

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

@@ -111,7 +111,6 @@ 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 -> {
@@ -133,7 +132,7 @@ 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.getUserID().toString())) {
+				if (StringUtils.isNotBlank(user.getUserIds()) && user.getUserIds().contains(item.getId())) {
 					item.setStoreStatus(true);
 				}
                 if (StringUtils.isNotBlank(discountUserIds)  && discountUserIds.contains(item.getUserID().toString())) {

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

@@ -71,7 +71,6 @@ 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 -> {

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

@@ -1,8 +1,6 @@
 package com.caimei.modules.hehe.service;
 
-import com.caimei.modules.coupon.entity.CmCouponOrderRecord;
 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;
@@ -79,14 +77,6 @@ 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 - 2
src/main/java/com/caimei/modules/hehe/web/CmHeheCouponController.java

@@ -22,7 +22,6 @@ import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.caimei.modules.hehe.service.CmHeheCouponService;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 呵呵商城优惠券Controller
@@ -83,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&couponType=" + cmHeheCoupon.getCouponType();
+		return "redirect:"+Global.getAdminPath()+"/hehe/cmHeheCoupon/?repage";
 	}
 
 	/**

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

@@ -17,7 +17,7 @@ public class CmDiscernReceipt extends DataEntity<CmDiscernReceipt> {
     private static final long serialVersionUID = 1L;
     private String payWay;        // 用户付款方式:1线上,2线下
     private String payType;        // 付款类型:1建设银行7297、2广发银行0115、3中信银行7172、4中信银行0897、5中信银行0897-财付通、6中信银行0897-支付宝、7线上-支付宝、8线上-微信支付、9线上-快钱支付,10口头返佣,11广发5461
-    private String receiptType;        // 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单)
+    private String receiptType;        // 1订单款,2非订单款,3返佣款,5供应商退款,6超级会员款,7二手商品上架费
     private String receiptStatus;        // 收款状态:1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销、6待返佣、7已返佣【线上支付成功为审核通过】
     private String smsContent;        // 短信内容
     private String smsMd5Code;        // 短信内容Md5加密串(适用于二次短信匹配查询)

+ 8 - 22
src/main/java/com/caimei/modules/order/entity/NewOrder.java

@@ -2,7 +2,6 @@ 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;
 
@@ -15,6 +14,7 @@ import java.util.List;
  * @description 主订单表
  */
 public class NewOrder extends DataEntity<NewOrder> {
+    private Integer orderSeen;            //订单对机构可见度,1可见,2不可见
     private Integer orderID;             // bigint(11) not null,
     private String orderNo;             // varchar(30) comment '订单编号',
     private Integer userID;              // bigint(11), 订单归属人
@@ -142,11 +142,13 @@ public class NewOrder extends DataEntity<NewOrder> {
     private CmCouponOrderRecord couponOrderRecord;    //优惠券信息
     private Double svipFullReduction;   //超级会员优惠
 
-    /**
-     * 呵呵商城优惠券
-     */
-    private Integer receiveCouponId;
-    private CmHeheCouponOrderRecord heheCouponRecord;   //优惠券信息
+    public Integer getOrderSeen() {
+        return orderSeen;
+    }
+
+    public void setOrderSeen(Integer orderSeen) {
+        this.orderSeen = orderSeen;
+    }
 
     public Integer getClubCouponId() {
         return clubCouponId;
@@ -1066,21 +1068,5 @@ 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/entity/NewOrderProduct.java

@@ -117,6 +117,7 @@ public class NewOrderProduct extends DataEntity<NewOrderProduct> {
     private Integer couponsLogo;        //显示优惠券查看: 1不显示 2显示
     private String commodityType;//商品属性:1产品,2仪器
     private Double svipReduction;//超级会员优惠
+    private Double svipTaxReduction;//超级会员税费优惠
 
     public Integer getLadderPriceFlag() {
         return ladderPriceFlag;
@@ -998,4 +999,12 @@ public class NewOrderProduct extends DataEntity<NewOrderProduct> {
     public void setSvipReduction(Double svipReduction) {
         this.svipReduction = svipReduction;
     }
+
+    public Double getSvipTaxReduction() {
+        return svipTaxReduction;
+    }
+
+    public void setSvipTaxReduction(Double svipTaxReduction) {
+        this.svipTaxReduction = svipTaxReduction;
+    }
 }

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

@@ -67,6 +67,8 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
     public List<CmPayShop> exports(Page<CmPayShop> cmPayShopPage, CmPayShop cmPayShop) {
         Page<CmPayShop> result = super.findPage(cmPayShopPage, cmPayShop);
         List<CmPayShop> list = result.getList();
+        //线下分账出现空订单号会导出不了,如果正式有,打开这个注释
+//        list.removeIf(c->"6".equals(c.getPayType()));
         list.forEach(l -> {
             if (l.getStatus().equals("1")) {
                 //1建设银行7297, 2中信银行0897, 3中信银行7172, 4广发银行0115, 5广发银行5461, 6线上分账

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

@@ -626,6 +626,25 @@ public class CmReturnedPurchaseService extends CrudService<CmReturnedPurchaseDao
                     userBeans = userBeans - num;
                     cmUserDao.updateUserBeans(newOrder.getUserID(), userBeans);
                 }
+                //订单低于1000扣500豆子退回
+                if (newOrder.getPayTotalFee() != null && newOrder.getPayTotalFee() < 1000) {
+                    //查本单是否扣豆子,有就返回
+                    UserBeansHistory bean = newCmClubDao.findLowOrder(newOrder.getOrderID());
+                    if (bean != null) {
+                        //有扣豆子记录
+                        UserBeansHistory beanHistory = new UserBeansHistory();
+                        beanHistory.setUserId(newOrder.getUserID());
+                        beanHistory.setOrderId(newOrder.getOrderID());
+                        beanHistory.setBeansType(16);
+                        beanHistory.setType(1);
+                        beanHistory.setNum(500);
+                        beanHistory.setPushStatus(0);
+                        beanHistory.setAddTime(new Date());
+                        newCmClubDao.insertBeansHistory(beanHistory);
+                        int beans = cmUserDao.findUserBeans(newOrder.getUserID()) + 500;
+                        cmUserDao.updateUserBeans(newOrder.getUserID(), beans);
+                    }
+                }
             }
             //优惠券退回
             CmCouponOrderRecord couponOrderRecord = newOrder.getCouponOrderRecord();

+ 29 - 10
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -14,8 +14,6 @@ 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.*;
@@ -122,8 +120,6 @@ 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) {
@@ -211,6 +207,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                 o.setCostPrice(copCostPrice);
                 //o.setShopProductAmount(copCostPrice * (o.getNum() + o.getPresentNum()));//商品费  =  成本价快照
                 // 赠送数单独列出来
+                //todo 叠加满减满赠修改
                 o.setShopProductAmount(copCostPrice * o.getNum());
                 discountFee += (o.getDiscountFee() == null ? 0 : o.getDiscountFee()); //主订单统计经理折扣
                 preferential += (o.getPreferential() == null ? 0 : o.getPreferential()); //主订单统计优惠
@@ -1026,11 +1023,6 @@ 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());
@@ -1068,6 +1060,12 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                         if (6060 == orderProduct.getProductID()) {
                             newOrder.setRechargeGoods(1);
                         }
+                        // 设置超级会员税费优惠
+                        if (null != orderProduct.getSvipPriceFlag() && orderProduct.getSvipPriceFlag() == 1 && "0".equals(orderProduct.getIncludedTax()) && ("1".equals(orderProduct.getInvoiceType()) || "2".equals(orderProduct.getInvoiceType()))) {
+                            orderProduct.setSvipTaxReduction(orderProduct.getSvipReduction() - (orderProduct.getPrice() - orderProduct.getDiscountPrice()));
+                        } else {
+                            orderProduct.setSvipTaxReduction(0d);
+                        }
                     });
                     list.addAll(pList);
                     shopOrder.setNewOrderProducts(pList);
@@ -1344,6 +1342,26 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             int userBeans = user.getUserBeans() + order.getUserBeans();
             cmUserDao.updateUserBeans(order.getUserID(), userBeans);
         }
+
+        if (order.getPayTotalFee() != null && order.getPayTotalFee() < 1000) {
+            //查本单是否扣豆子,有就返回
+            UserBeansHistory bean = newCmClubDao.findLowOrder(order.getOrderID());
+            if (bean != null) {
+                //有扣豆子记录
+                UserBeansHistory beansHistory = new UserBeansHistory();
+                beansHistory.setUserId(order.getUserID());
+                beansHistory.setOrderId(order.getOrderID());
+                beansHistory.setBeansType(16);
+                beansHistory.setType(1);
+                beansHistory.setNum(500);
+                beansHistory.setPushStatus(0);
+                beansHistory.setAddTime(new Date());
+                newCmClubDao.insertBeansHistory(beansHistory);
+                int beans = cmUserDao.findUserBeans(order.getUserID()) + 500;
+                cmUserDao.updateUserBeans(order.getUserID(), beans);
+            }
+        }
+
         //取消订单短信推送(取消订单推送)
         /*try {
             if (user != null && StringUtils.isNotBlank(user.getBindMobile()) && "0".equals(order.getRebateFlag())) {
@@ -1809,7 +1827,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         for (NewOrder order : results) {
             Double ableUserMoney = 0d;
             CmUser user = cmUserDao.get(order.getUserID().toString());
-            if (null != user && null != user.getAbleUserMoney()){
+            if (null != user && null != user.getAbleUserMoney()) {
                 ableUserMoney = user.getAbleUserMoney();
             }
             order.setAbleUserMoney(ableUserMoney);
@@ -1911,6 +1929,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         }
         return pageResult;
     }
+
     /**
      * 判断是否是游客
      *

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

@@ -21,8 +21,6 @@ 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;
@@ -1154,8 +1152,8 @@ public class CmDiscernReceiptController extends BaseController {
 
         //创建单元格,并设置值表头 设置表头居中
         HSSFCellStyle style = wb.createCellStyle();
-        style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直
-        style.setAlignment(HorizontalAlignment.CENTER);//水平
+        style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直
+        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平
         style.setFillForegroundColor(HSSFColor.ORANGE.index);
 
         HSSFCellStyle textStyle = wb.createCellStyle();

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

@@ -50,8 +50,6 @@ 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;
@@ -1644,8 +1642,8 @@ public class NewOrderController extends BaseController {
 
         //创建单元格,并设置值表头 设置表头居中
         HSSFCellStyle style = wb.createCellStyle();
-        style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直
-        style.setAlignment(HorizontalAlignment.CENTER);//水平
+        style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直
+        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平
         style.setFillForegroundColor(HSSFColor.ORANGE.index);
 
 

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

@@ -5,14 +5,11 @@ 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;
 
@@ -153,33 +150,6 @@ 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单个文件删除
      *

+ 2 - 0
src/main/java/com/caimei/modules/product/dao/CmPromotionDao.java

@@ -95,4 +95,6 @@ public interface CmPromotionDao extends CrudDao<CmPromotion> {
     CmPromotion findPromotionsByProductId(@Param("productId") Integer productId);
 
     Double getPresentPriceById(@Param("productId") Integer productId);
+    List<Integer> findProductIdByPromotion(String promotionsId);
+    List<Integer> findProductIdsByPromotion(String promotionsId);
 }

+ 25 - 0
src/main/java/com/caimei/modules/product/entity/CmPromotion.java

@@ -11,6 +11,15 @@ import java.util.List;
 
 public class CmPromotion extends DataEntity<CmPromotion> {
     private static final long serialVersionUID = 1L;
+
+    /**
+     * 是否支持叠加优惠,1支持,2不支持
+     */
+    private String discount;
+    /**
+     * 活动可见度, 1所有人,2仅对机构
+     */
+    private String seen;
     /**
      *  促销名称
      */
@@ -145,6 +154,22 @@ public class CmPromotion extends DataEntity<CmPromotion> {
         super(id);
     }
 
+    public String getDiscount() {
+        return discount;
+    }
+
+    public void setDiscount(String discount) {
+        this.discount = discount;
+    }
+
+    public String getSeen() {
+        return seen;
+    }
+
+    public void setSeen(String seen) {
+        this.seen = seen;
+    }
+
     public Integer getOrderId() {
         return orderId;
     }

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

@@ -198,11 +198,6 @@ public class Product extends DataEntity<Product> {
      */
     private List<ProductLadderPrice> ladderPriceList;
 
-    /**
-     * 搜索类型:1采美商品,2呵呵商城商品
-     */
-    private Integer searchType;
-
     public List<ProductLadderPrice> getLadderPriceList() {
         return ladderPriceList;
     }
@@ -1834,12 +1829,4 @@ 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;
-    }
 }

+ 50 - 27
src/main/java/com/caimei/modules/product/web/CmPromotionController.java

@@ -2,7 +2,9 @@ package com.caimei.modules.product.web;
 
 import com.caimei.modules.bulkpurchase.entity.PurchaseProduct;
 import com.caimei.modules.cibe.entity.Shop;
+import com.caimei.modules.opensearch.CoreServiceUitls;
 import com.caimei.modules.opensearch.GenerateUtils;
+import com.caimei.modules.product.dao.CmPromotionDao;
 import com.caimei.modules.product.entity.CmPromotion;
 import com.caimei.modules.product.entity.Product;
 import com.caimei.modules.product.service.CmPromotionService;
@@ -45,6 +47,11 @@ public class CmPromotionController extends BaseController {
     private RedisService redisService;
     @Resource
     private GenerateUtils generateUtils;
+    @Autowired
+    private CoreServiceUitls coreServiceUitls;
+    @Autowired
+    private CmPromotionDao cmPromotionDao;
+
     @ModelAttribute
     public CmPromotion get(@RequestParam(required = false) String id) {
         CmPromotion entity = null;
@@ -55,7 +62,7 @@ public class CmPromotionController extends BaseController {
                 if ("0".equals(entity.getDelFlag1())) {
                     if ("1".equals(entity.getStatus())) {
                         entity.setDelFlag1("2");
-                    }else {
+                    } else {
                         Date now = new Date();
                         if (null != entity.getBeginTime() && null != entity.getEndTime()) {
                             boolean effectiveDate = DateUtils.isEffectiveDate(now, entity.getBeginTime(), entity.getEndTime());
@@ -66,11 +73,11 @@ public class CmPromotionController extends BaseController {
                             } else {
                                 entity.setDelFlag1("3");
                             }
-                        }else {
+                        } else {
                             entity.setDelFlag1("0");
                         }
                     }
-                }else {
+                } else {
                     //关闭或删除
                     entity.setDelFlag1("0");
                 }
@@ -78,7 +85,7 @@ public class CmPromotionController extends BaseController {
                     entity.setTouchPrice1(entity.getTouchPrice());
                 } else if ("2".equals(entity.getMode())) {
                     entity.setTouchPrice2(entity.getTouchPrice());
-                }else if ("3".equals(entity.getMode())) {
+                } else if ("3".equals(entity.getMode())) {
                     entity.setTouchPrice3(entity.getTouchPrice());
                 }
             }
@@ -136,7 +143,7 @@ public class CmPromotionController extends BaseController {
                             //未开始
                             cmPromotion.setDelFlag1("1");
                         }
-                    }else {
+                    } else {
                         cmPromotion.setDelFlag1("0");
                     }
                 }
@@ -154,7 +161,7 @@ public class CmPromotionController extends BaseController {
                             promotionProducts.add(product);
                         }
                     }
-                }else {
+                } else {
                     Product product = productService.get(cmPromotion.getProductIds());
                     promotionProducts.add(product);
                 }
@@ -168,7 +175,7 @@ public class CmPromotionController extends BaseController {
                             giftProducts.add(product);
                         }
                     }
-                }else {
+                } else {
                     Product product = productService.get(cmPromotion.getGiftIds());
                     giftProducts.add(product);
                 }
@@ -182,7 +189,7 @@ public class CmPromotionController extends BaseController {
                             promotionShops.add(shop);
                         }
                     }
-                }else {
+                } else {
                     Shop shop = cmPromotionService.findShop(cmPromotion.getShopIds());
                     promotionShops.add(shop);
                 }
@@ -195,14 +202,14 @@ public class CmPromotionController extends BaseController {
                 //非店铺促销下添加促销商品
                 if (!"3".equals(cmPromotion.getType())) {
                     //单品促销时,若添加了新商品或者删除了商品,则不需要从数据库中查询促销商品
-                    if (!"0".equals(cmPromotion.getSearchDbFlag())){
+                    if (!"0".equals(cmPromotion.getSearchDbFlag())) {
                         if (StringUtil.isNotBlank(delProductIds)) {
                             List<Product> promotionProduct = cmPromotionService.findPromotionProduct(cmPromotion);
                             List<String> delProductIdList = new ArrayList<>();
                             if (delProductIds.contains(",")) {
                                 String[] split = delProductIds.split(",");
                                 delProductIdList = Arrays.asList(split);
-                            }else {
+                            } else {
                                 delProductIdList.add(delProductIds);
                             }
                             ListIterator<Product> productListIterator = promotionProduct.listIterator();
@@ -219,19 +226,19 @@ public class CmPromotionController extends BaseController {
                     } else if (StringUtils.isBlank(cmPromotion.getDelProductIds())) {
                         //将原有的促销商品id加入delProductIds,使得添加促销商品时能够找到
                         List<Product> promotionProduct = cmPromotionService.findPromotionProduct(cmPromotion);
-                        cmPromotion.setDelProductIds(promotionProduct.size()>0?promotionProduct.get(0).getProductID().toString():"");
+                        cmPromotion.setDelProductIds(promotionProduct.size() > 0 ? promotionProduct.get(0).getProductID().toString() : "");
                     }
                     //店铺促销
-                }else if ("3".equals(cmPromotion.getType())){
+                } else if ("3".equals(cmPromotion.getType())) {
                     //店铺促销时,若添加了新店铺或者删除了店铺,则不需要从数据库中查询促销店铺
-                    if (!"0".equals(cmPromotion.getSearchDbFlag())){
+                    if (!"0".equals(cmPromotion.getSearchDbFlag())) {
                         if (StringUtil.isNotBlank(delShopIds)) {
                             List<Shop> promotionShop = cmPromotionService.findPromotionShops(cmPromotion);
                             List<String> delShopIdList = new ArrayList<>();
                             if (delShopIds.contains(",")) {
                                 String[] split = delShopIds.split(",");
                                 delShopIdList = Arrays.asList(split);
-                            }else {
+                            } else {
                                 delShopIdList.add(delShopIds);
                             }
                             ListIterator<Shop> shopListIterator = promotionShop.listIterator();
@@ -248,7 +255,7 @@ public class CmPromotionController extends BaseController {
                     } else if (StringUtils.isBlank(cmPromotion.getDelShopIds())) {
                         //将原有的促销店铺id加入delProductIds,使得添加促销店铺时能够找到
                         List<Shop> promotionShop = cmPromotionService.findPromotionShops(cmPromotion);
-                        cmPromotion.setDelShopIds(promotionShop.size()>0?promotionShop.get(0).getShopID().toString():"");
+                        cmPromotion.setDelShopIds(promotionShop.size() > 0 ? promotionShop.get(0).getShopID().toString() : "");
                     }
 
                 }
@@ -259,7 +266,7 @@ public class CmPromotionController extends BaseController {
                         if (delGiftIds.contains(",")) {
                             String[] split = delGiftIds.split(",");
                             delGiftIdList = Arrays.asList(split);
-                        }else {
+                        } else {
                             delGiftIdList.add(delGiftIds);
                         }
                         ListIterator<Product> giftListIterator = giftProduct.listIterator();
@@ -300,7 +307,7 @@ public class CmPromotionController extends BaseController {
                 return "modules/product-new/singlePromotionForm";
             } else if ("2".equals(cmPromotion.getType())) {
                 return "modules/product-new/multiPromotionForm";
-            }else {
+            } else {
                 return "modules/product-new/shopPromotionForm";
             }
         } else {
@@ -315,7 +322,7 @@ public class CmPromotionController extends BaseController {
     @RequiresPermissions("product:product:view")
     @RequestMapping(value = "updateStatus")
     @ResponseBody
-    public Map<String, Object> updateStatus( String id,String flag, RedirectAttributes redirectAttributes) {
+    public Map<String, Object> updateStatus(String id, String flag, RedirectAttributes redirectAttributes) {
         Map<String, Object> map = new HashMap<>();
         if (StringUtils.isNotBlank(id)) {
             CmPromotion cmPromotion = cmPromotionService.get(id);
@@ -329,7 +336,7 @@ public class CmPromotionController extends BaseController {
                 //关闭活动
                 map.put("msg", "关闭成功");
                 cmPromotion.setDelFlag1("1");
-            } else if("open".equals(flag)){
+            } else if ("open".equals(flag)) {
                 //开启活动
                 map.put("msg", "开启成功");
                 if ("1".equals(cmPromotion.getStatus())) {
@@ -337,19 +344,20 @@ public class CmPromotionController extends BaseController {
                 } else {
                     if (cmPromotion.getBeginTime() != null && cmPromotion.getEndTime() != null) {
                         cmPromotion.setDelFlag1("0");
-                    }else {
+                    } else {
                         map.put("success", false);
                         map.put("msg", "促销活动开始时间和结束时间不能为空,请编辑该活动");
                         return map;
                     }
                 }
-            }else if ("delete".equals(flag)){
+            } else if ("delete".equals(flag)) {
                 //删除活动
                 map.put("msg", "删除成功");
                 cmPromotion.setDelFlag1("2");
             }
             cmPromotion.setUpdateTime(new Date());
             cmPromotionService.update(cmPromotion);
+            updateIndex(cmPromotion);
             map.put("success", true);
         } else {
             map.put("success", false);
@@ -358,6 +366,19 @@ public class CmPromotionController extends BaseController {
         cleanRedisCache();
         return map;
     }
+    //更新促销索引
+    private void updateIndex(CmPromotion cmPromotion) {
+        List<Integer> productIdsByPromotion = new ArrayList<>();
+        List<Integer> productIdByPromotion = new ArrayList<>();
+        if (cmPromotion.getType().equals("3")) {
+            productIdsByPromotion = cmPromotionDao.findProductIdsByPromotion(cmPromotion.getId());
+        } else {
+            productIdByPromotion = cmPromotionDao.findProductIdByPromotion(cmPromotion.getId());
+        }
+        // 更新索引
+        productIdsByPromotion.forEach(p->coreServiceUitls.updateProductIndex(p));
+        productIdByPromotion.forEach(p->coreServiceUitls.updateProductIndex(p));
+    }
 
     /**
      * 添加商品/赠品数据
@@ -372,7 +393,7 @@ public class CmPromotionController extends BaseController {
         model.addAttribute("delProductIds", product.getDelProductIds());
         if ("1".equals(product.getPromotionType())) {
             return "modules/product-new/promotionSelectSingleProduct";
-        }else {
+        } else {
             return "modules/product-new/promotionSelectProducts";
         }
     }
@@ -398,14 +419,15 @@ public class CmPromotionController extends BaseController {
     public String save(CmPromotion cmPromotion, Model model, RedirectAttributes redirectAttributes) {
         if ("1".equals(cmPromotion.getMode())) {
             cmPromotion.setTouchPrice(cmPromotion.getTouchPrice1());
-        }else if ("2".equals(cmPromotion.getMode())) {
+            cmPromotion.setDiscount("1");
+        } else if ("2".equals(cmPromotion.getMode())) {
             cmPromotion.setTouchPrice(cmPromotion.getTouchPrice2());
-        }else if ("3".equals(cmPromotion.getMode())) {
+        } else if ("3".equals(cmPromotion.getMode())) {
             cmPromotion.setTouchPrice(cmPromotion.getTouchPrice3());
         }
         if ("close".equals(cmPromotion.getDelFlag1())) {
             cmPromotion.setDelFlag1("1");
-        }else if (cmPromotion.getDelFlag1() == null || "undefined".equals(cmPromotion.getDelFlag1())){
+        } else if (cmPromotion.getDelFlag1() == null || "undefined".equals(cmPromotion.getDelFlag1())) {
             if ("1".equals(cmPromotion.getStatus())) {
                 //永久开启
                 cmPromotion.setDelFlag1("0");
@@ -413,7 +435,7 @@ public class CmPromotionController extends BaseController {
                 //区间有效判断起止时间是否为空
                 if (null != cmPromotion.getBeginTime() && null != cmPromotion.getEndTime()) {
                     cmPromotion.setDelFlag1("0");
-                }else {
+                } else {
                     cmPromotion.setDelFlag1("1");
                 }
             }
@@ -424,9 +446,10 @@ public class CmPromotionController extends BaseController {
             return form(cmPromotion, model);
         }
         cmPromotionService.save(cmPromotion);
+        updateIndex(cmPromotion);
         addMessage(redirectAttributes, "保存促销列表成功");
         cleanRedisCache();
-        return "redirect:" + Global.getAdminPath() + "/product/cmPromotions/?type="+cmPromotion.getType();
+        return "redirect:" + Global.getAdminPath() + "/product/cmPromotions/?type=" + cmPromotion.getType();
     }
 
     /**

+ 2 - 0
src/main/java/com/caimei/modules/user/dao/CmUserDao.java

@@ -80,4 +80,6 @@ public interface CmUserDao extends CrudDao<CmUser> {
     void updateByClubStatus(@Param("clubStatus") int clubStatus, @Param("confirmUserId") Integer confirmUserId);
 
     Date findByConfirmTime(Integer userId);
+
+    Integer findUserBeans(Integer userId);
 }

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

@@ -34,4 +34,7 @@ public interface NewCmClubDao extends CrudDao<NewCmClub> {
     List<String> getRemarksImageList(Integer remarksId);
 
     List<RemarksFileVo> getRemarksFileList(Integer remarksId);
+
+    UserBeansHistory findLowOrder(Integer orderID);
+
 }

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

@@ -21,8 +21,8 @@ public class UserBeansHistory extends DataEntity<UserBeansHistory> {
     private Integer type;
 
     /**
-     * 采美豆类型:1注册机构,2升级会员机构,3普通机构完善资料,4会员机构完善资料,5下单,
-     * 6线上支付订单,7确认收货,8系统发放,9抵用退回,10抵用运费,11退款回收
+     * 1注册机构,2升级会员机构,3普通机构完善资料,4会员机构完善资料,5下单,6线上支付订单,7确认收货,8系统发放,9抵用退回,10抵用运费,
+     * 11退款回收,12登录奖励,13查看商品资料抵扣,14购买超级会员,15系统扣除,16系统退回
      */
     private Integer beansType;
 

+ 24 - 16
src/main/java/com/thinkgem/jeesite/common/utils/excel/ExportExcel.java

@@ -19,7 +19,15 @@ import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.usermodel.*;
+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.util.CellRangeAddress;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
@@ -227,26 +235,26 @@ public class ExportExcel {
 	 */
 	private Map<String, CellStyle> createStyles(Workbook wb) {
 		Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
-
+		
 		CellStyle style = wb.createCellStyle();
-		style.setAlignment(HorizontalAlignment.CENTER);
-		style.setVerticalAlignment(VerticalAlignment.CENTER);
+		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
 		Font titleFont = wb.createFont();
 		titleFont.setFontName("Arial");
 		titleFont.setFontHeightInPoints((short) 16);
-		titleFont.setBold(true);
+		titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
 		style.setFont(titleFont);
 		styles.put("title", style);
 
 		style = wb.createCellStyle();
-		style.setVerticalAlignment(VerticalAlignment.CENTER);
-		style.setBorderRight(BorderStyle.THIN);
+		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+		style.setBorderRight(CellStyle.BORDER_THIN);
 		style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderLeft(BorderStyle.THIN);
+		style.setBorderLeft(CellStyle.BORDER_THIN);
 		style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderTop(BorderStyle.THIN);
+		style.setBorderTop(CellStyle.BORDER_THIN);
 		style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderBottom(BorderStyle.THIN);
+		style.setBorderBottom(CellStyle.BORDER_THIN);
 		style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
 		Font dataFont = wb.createFont();
 		dataFont.setFontName("Arial");
@@ -256,29 +264,29 @@ public class ExportExcel {
 		
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(HorizontalAlignment.LEFT);
+		style.setAlignment(CellStyle.ALIGN_LEFT);
 		styles.put("data1", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(HorizontalAlignment.CENTER);
+		style.setAlignment(CellStyle.ALIGN_CENTER);
 		styles.put("data2", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(HorizontalAlignment.RIGHT);
+		style.setAlignment(CellStyle.ALIGN_RIGHT);
 		styles.put("data3", style);
 		
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
 //		style.setWrapText(true);
-		style.setAlignment(HorizontalAlignment.CENTER);
+		style.setAlignment(CellStyle.ALIGN_CENTER);
 		style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+		style.setFillPattern(CellStyle.SOLID_FOREGROUND);
 		Font headerFont = wb.createFont();
 		headerFont.setFontName("Arial");
 		headerFont.setFontHeightInPoints((short) 10);
-		headerFont.setBold(true);
+		headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
 		headerFont.setColor(IndexedColors.WHITE.getIndex());
 		style.setFont(headerFont);
 		styles.put("header", style);

BIN
src/main/resources/export/payList.xls


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

@@ -9,9 +9,6 @@
 		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",
@@ -138,9 +135,6 @@
 			touchPrice,
 			startDate,
 			endDate,
-			receivePeriod,
-		    receiveFlag,
-			usePeriod,
 			status,
 			couponType,
 			vipFlag,
@@ -159,9 +153,6 @@
 			#{touchPrice},
 			#{startDate},
 			#{endDate},
-			#{receivePeriod},
-			#{receiveFlag},
-			#{usePeriod},
 			#{status},
 			#{couponType},
 		    #{vipFlag},
@@ -184,9 +175,6 @@
 			touchPrice = #{touchPrice},
 			startDate = #{startDate},
 			endDate = #{endDate},
-			receivePeriod = #{receivePeriod},
-			receiveFlag = #{receiveFlag},
-			usePeriod = #{usePeriod},
 			status = #{status},
 			couponType = #{couponType},
 			vipFlag = #{vipFlag},
@@ -420,8 +408,6 @@
 		  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`,
@@ -444,7 +430,8 @@
 		  AND a.delFlag = 0
 		  AND a.userId = #{userId}
 		  AND a.status = 1
-		  AND NOW() <![CDATA[ < ]]> date_add(a.createDate,interval cc.usePeriod DAY)
+		  AND NOW() BETWEEN cc.startDate
+		  AND cc.endDate
 		  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},
-			NOW()
+			#{addTime}
 		)
 	</insert>
 	
@@ -118,7 +118,7 @@
 		VALUES
 		(
 			#{discountId}, #{productId}, #{status},
-			#{sort}, #{addTime}
+			#{sort}, NOW()
 		)
 	</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.productId
+				left join cm_hehe_product chp on cca.productId = chp.id
 				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.userId
+				 left join cm_hehe_user u on chu.userId = u.id
 		where chu.discountId = #{id}
 		order by chu.addTime desc
 	</select>

+ 1 - 8
src/main/resources/mappings/modules/hehe/CmHeheFloorProductMapper.xml

@@ -88,14 +88,7 @@
 		select productId from cm_hehe_floor_product where floorId = #{floorId}
 	</select>
 	<select id="findAllProduct" resultType="com.caimei.modules.product.entity.Product">
-		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
+		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
 		<where>

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

@@ -243,19 +243,5 @@
     <select id="findHeUser" resultType="string">
         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>

+ 8 - 2
src/main/resources/mappings/modules/order/OrderMapper.xml

@@ -2,7 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.order.dao.NewOrderDao">
 
-	<sql id="columns">
+    <sql id="columns">
+        a.orderSeen AS orderSeen,
 		a.orderID AS orderID,
 		a.orderNo AS orderNo,
 		a.organizeID AS organizeID,
@@ -319,6 +320,7 @@
 
     <insert id="insert" parameterType="NewOrder" keyProperty="orderID" useGeneratedKeys="true">
 		INSERT INTO cm_order(
+            orderSeen,
 			orderNo,
 			userID,
 			buyUserID,
@@ -367,6 +369,7 @@
 			couponAmount,
 			svipFullReduction
 		) VALUES (
+            #{orderSeen},
 			#{orderNo},
 			#{userID},
 			#{buyUserID},
@@ -419,7 +422,10 @@
 
 	<update id="update">
 		update cm_order
-		<set >
+		<set>
+            <if test="orderSeen != null">
+                orderSeen = #{orderSeen},
+            </if>
 			<if test="orderNo != null" >
 				orderNo = #{orderNo,jdbcType=VARCHAR},
 			</if>

+ 171 - 156
src/main/resources/mappings/modules/product/CmPromotionMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.caimei.modules.product.dao.CmPromotionDao">
 
     <sql id="cmPromotionColumns">
-		cp.id AS "id",
+        cp.id AS "id",
 		cp.name AS "name",
 		cp.description AS "description",
 		cp.type AS "type",
@@ -15,8 +15,10 @@
 		cp.addTime AS "addTime",
 		cp.updateTime AS "updateTime",
 		cp.status AS "status",
-		cp.delFlag AS "delFlag1"
-	</sql>
+		cp.delFlag AS "delFlag1",
+        cp.seen AS "seen",
+        cp.discount AS "discount"
+    </sql>
 
     <select id="get" resultType="CmPromotion">
         SELECT
@@ -94,58 +96,58 @@
     </select>
 
     <select id="findPromotionProduct" resultType="com.caimei.modules.product.entity.Product">
-        SELECT
-        p.*,
-        cp.reducedPrice AS "reducedPrice",
-        s.name AS "shopName"
-        FROM
-        cm_promotions cp
-        LEFT JOIN cm_promotions_product cpp ON cp.id = cpp.promotionsId
-        LEFT JOIN product p ON cpp.productId = p.productID
-        LEFT JOIN shop s ON s.shopID = p.shopID
-        WHERE
-            cp.id = #{id}
-        and p.productCategory = 1
+        SELECT p.*,
+               cp.reducedPrice AS "reducedPrice",
+               s.name          AS "shopName"
+        FROM cm_promotions cp
+                 LEFT JOIN cm_promotions_product cpp ON cp.id = cpp.promotionsId
+                 LEFT JOIN product p ON cpp.productId = p.productID
+                 LEFT JOIN shop s ON s.shopID = p.shopID
+        WHERE cp.id = #{id}
+          and p.productCategory = 1
     </select>
 
     <select id="findGiftProduct" resultType="com.caimei.modules.product.entity.Product">
-           SELECT
-             p.*,
-             s.name AS "shopName",
-             cpg.number AS "giftNumber"
-           FROM
-             cm_promotions cp
-             LEFT JOIN cm_promotions_gift cpg ON cp.id = cpg.promotionsId
-             LEFT JOIN product p ON cpg.productId = p.productID
-             LEFT JOIN shop s ON s.shopID = p.shopID
-           WHERE
-             cp.id = #{id}
-             and p.productCategory = 1
+        SELECT p.*,
+               s.name     AS "shopName",
+               cpg.number AS "giftNumber"
+        FROM cm_promotions cp
+                 LEFT JOIN cm_promotions_gift cpg ON cp.id = cpg.promotionsId
+                 LEFT JOIN product p ON cpg.productId = p.productID
+                 LEFT JOIN shop s ON s.shopID = p.shopID
+        WHERE cp.id = #{id}
+          and p.productCategory = 1
     </select>
 
     <select id="findGiftPurchaseProduct" resultType="com.caimei.modules.bulkpurchase.entity.PurchaseProduct">
-		SELECT p.name name,s.name shopName ,s.`shopID` shopId,p.name purchaseProductName,
-		p.`price1` price,p.`productID` productId,p.productCode productNo,p.mainImage image
-		,p.costCheckFlag costCheckFlag,p.costPrice costPrice,p.costProportional costProportional, p.price0 AS normalPrice,
-        cpg.number AS num
-           FROM
-             cm_promotions cp
-             LEFT JOIN cm_promotions_gift cpg ON cp.id = cpg.promotionsId
-             LEFT JOIN product p ON cpg.productId = p.productID
-             LEFT JOIN shop s ON s.shopID = p.shopID
-           WHERE
-             cp.id = #{id}
-             and p.productCategory = 1
+        SELECT p.name             name,
+               s.name             shopName,
+               s.`shopID`         shopId,
+               p.name             purchaseProductName,
+               p.`price1`         price,
+               p.`productID`      productId,
+               p.productCode      productNo,
+               p.mainImage        image
+                ,
+               p.costCheckFlag    costCheckFlag,
+               p.costPrice        costPrice,
+               p.costProportional costProportional,
+               p.price0    AS     normalPrice,
+               cpg.number  AS     num,
+               cp.discount as     discounts
+        FROM cm_promotions cp
+                 LEFT JOIN cm_promotions_gift cpg ON cp.id = cpg.promotionsId
+                 LEFT JOIN product p ON cpg.productId = p.productID
+                 LEFT JOIN shop s ON s.shopID = p.shopID
+        WHERE cp.id = #{id}
+          and p.productCategory = 1
     </select>
 
     <select id="findPromotionShops" resultType="com.caimei.modules.cibe.entity.Shop">
-        SELECT
-        s.*
-        FROM
-        cm_promotions_product cpp
-        LEFT JOIN shop s ON cpp.supplierId = s.shopID
-        WHERE
-            cpp.promotionsId = #{id}
+        SELECT s.*
+        FROM cm_promotions_product cpp
+                 LEFT JOIN shop s ON cpp.supplierId = s.shopID
+        WHERE cpp.promotionsId = #{id}
     </select>
 
     <select id="findAllProduct" resultType="com.caimei.modules.product.entity.Product">
@@ -239,150 +241,151 @@
     </select>
 
     <delete id="deleteAllPromotionProductsAndShops">
-		DELETE FROM cm_promotions_product
-		WHERE promotionsId = #{id}
-	</delete>
+        DELETE
+        FROM cm_promotions_product
+        WHERE promotionsId = #{id}
+    </delete>
 
     <delete id="deleteAllPromotionGifts">
-		DELETE FROM cm_promotions_gift
-		WHERE promotionsId = #{id}
-	</delete>
+        DELETE
+        FROM cm_promotions_gift
+        WHERE promotionsId = #{id}
+    </delete>
 
     <insert id="insertPromotionProduct">
-		INSERT INTO cm_promotions_product(
-			promotionsId,
-            productId,
-            addTime
-		) VALUES (
-			#{promotionId},
-			#{productId},
-			now()
-		)
-	</insert>
+        INSERT INTO cm_promotions_product(promotionsId,
+                                          productId,
+                                          addTime)
+        VALUES (#{promotionId},
+                #{productId},
+                now())
+    </insert>
 
     <insert id="insertGiftProduct">
-		INSERT INTO cm_promotions_gift(
-			promotionsId,
-            productId,
-            number,
-            addTime
-		) VALUES (
-			#{promotionId},
-			#{giftId},
-			#{number},
-			now()
-		)
-	</insert>
+        INSERT INTO cm_promotions_gift(promotionsId,
+                                       productId,
+                                       number,
+                                       addTime)
+        VALUES (#{promotionId},
+                #{giftId},
+                #{number},
+                now())
+    </insert>
 
     <insert id="insertPromotionShop">
-		INSERT INTO cm_promotions_product(
-			promotionsId,
-            supplierId,
-            productId,
-            addTime
-		) VALUES (
-			#{promotionId},
-			#{shopId},
-			0,
-			now()
-		)
-	</insert>
+        INSERT INTO cm_promotions_product(promotionsId,
+                                          supplierId,
+                                          productId,
+                                          addTime)
+        VALUES (#{promotionId},
+                #{shopId},
+                0,
+                now())
+    </insert>
 
     <insert id="insert" parameterType="CmPromotion" keyProperty="id" useGeneratedKeys="true">
-        INSERT INTO cm_promotions(
-            name,
-            description,
-            type,
-            mode,
-            touchPrice,
-            reducedPrice,
-            beginTime,
-            endTime,
-            addTime,
-            updateTime,
-            status,
-            delFlag
-        ) VALUES (
-            #{name},
-            #{description},
-            #{type},
-            #{mode},
-            #{touchPrice},
-            #{reducedPrice},
-            #{beginTime},
-            #{endTime},
-            #{addTime},
-            #{updateTime},
-            #{status},
-            #{delFlag1}
-        )
+        INSERT INTO cm_promotions(name,
+                                  description,
+                                  type,
+                                  mode,
+                                  touchPrice,
+                                  reducedPrice,
+                                  beginTime,
+                                  endTime,
+                                  addTime,
+                                  updateTime,
+                                  status,
+                                  delFlag,
+                                  discount,
+                                  seen)
+        VALUES (#{name},
+                #{description},
+                #{type},
+                #{mode},
+                #{touchPrice},
+                #{reducedPrice},
+                #{beginTime},
+                #{endTime},
+                #{addTime},
+                #{updateTime},
+                #{status},
+                #{delFlag1},
+                #{discount},
+                #{seen})
     </insert>
 
 
     <update id="update">
         UPDATE cm_promotions
-        SET name = #{name},
-        description = #{description},
-        type = #{type},
-        mode = #{mode},
-        touchPrice = #{touchPrice},
-        reducedPrice = #{reducedPrice},
-        beginTime = #{beginTime},
-        endTime = #{endTime},
-        updateTime = #{updateTime},
-        status = #{status},
-        delFlag = #{delFlag1}
+        SET name         = #{name},
+            description  = #{description},
+            type         = #{type},
+            mode         = #{mode},
+            touchPrice   = #{touchPrice},
+            reducedPrice = #{reducedPrice},
+            beginTime    = #{beginTime},
+            endTime      = #{endTime},
+            updateTime   = #{updateTime},
+            status       = #{status},
+            delFlag      = #{delFlag1},
+            discount     = #{discount},
+            seen         = #{seen}
         WHERE id = #{id}
     </update>
 
     <select id="findShop" resultType="com.caimei.modules.cibe.entity.Shop">
-        SELECT * from shop where shopID = #{id}
+        SELECT *
+        from shop
+        where shopID = #{id}
     </select>
 
     <select id="findProductPromotion" resultType="com.caimei.modules.product.entity.CmPromotion">
-        select  pr.id,
-                pr.name,
-                pr.type,
-                pr.mode,
-                pr.touchPrice,
-                pr.reducedPrice,
-                pr.beginTime,
-                pr.endTime,
-                pr.status,
-                prp.productId,
-                prp.supplierId
+        select pr.id,
+               pr.name,
+               pr.type,
+               pr.mode,
+               pr.touchPrice,
+               pr.reducedPrice,
+               pr.beginTime,
+               pr.endTime,
+               pr.status,
+               prp.productId,
+               prp.supplierId,
+               pr.discount
         from cm_promotions pr
-        left join cm_promotions_product prp on pr.id = prp.promotionsId
+                 left join cm_promotions_product prp on pr.id = prp.promotionsId
         where (prp.productId = #{productId}
-        or prp.supplierId = #{shopId})
-        and (pr.status = 1 or ( pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
-        and pr.delFlag not in ('1','2')
+            or prp.supplierId = #{shopId})
+          and (pr.status = 1 or (pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
+          and pr.delFlag not in ('1', '2')
         order by pr.type desc
         limit 1
     </select>
 
     <select id="findProductPromotionsGift" resultType="com.caimei.modules.product.entity.CmPromotion">
-        SELECT DISTINCT  pr.id,
-        pr.name,
-        pr.type,
-        pr.mode,
-        pr.touchPrice,
-        pr.reducedPrice,
-        pr.beginTime,
-        pr.endTime,
-        pr.status
+        SELECT DISTINCT pr.id,
+                        pr.name,
+                        pr.type,
+                        pr.mode,
+                        pr.touchPrice,
+                        pr.reducedPrice,
+                        pr.beginTime,
+                        pr.endTime,
+                        pr.status
         FROM cm_promotions_gift cpg
-        LEFT JOIN cm_promotions pr ON pr.id = cpg.promotionsId
+                 LEFT JOIN cm_promotions pr ON pr.id = cpg.promotionsId
         WHERE cpg.productId = #{productId}
-        AND (pr.status = 1 OR ( pr.status = 2 AND (NOW() BETWEEN pr.beginTime AND pr.endTime)))
-        AND pr.mode = 3
-        AND pr.delFlag not in ('1','2')
+          AND (pr.status = 1 OR (pr.status = 2 AND (NOW() BETWEEN pr.beginTime AND pr.endTime)))
+          AND pr.mode = 3
+          AND pr.delFlag not in ('1', '2')
         ORDER BY pr.type DESC
         LIMIT 1
     </select>
 
     <select id="findOrderPromotions" resultType="com.caimei.modules.product.entity.CmPromotion">
-        SELECT * FROM cm_promotions_order WHERE id = #{orderPromotionsId}
+        SELECT *
+        FROM cm_promotions_order
+        WHERE id = #{orderPromotionsId}
     </select>
 
     <select id="findPromotionsByProductId" resultType="com.caimei.modules.product.entity.CmPromotion">
@@ -404,11 +407,23 @@
                prp.supplierId = (select p.shopID from product p where p.productID = #{productId})
             )
           and (pr.status = 1 or (pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
-          and pr.delFlag not in (1,2)
+          and pr.delFlag not in (1, 2)
         order by pr.type desc
         limit 1
     </select>
     <select id="getPresentPriceById" resultType="java.lang.Double">
-        select price1 from product where productID=#{productId}
+        select price1
+        from product
+        where productID = #{productId}
+    </select>
+    <select id="findProductIdByPromotion" resultType="java.lang.Integer">
+        select productId
+        from cm_promotions_product
+        where promotionsId = #{promotionsId}
+    </select>
+    <select id="findProductIdsByPromotion" resultType="java.lang.Integer">
+        select productID
+        from product
+        where shopID in (select supplierId from cm_promotions_product where promotionsId = #{promotionsId})
     </select>
 </mapper>

+ 9 - 1
src/main/resources/mappings/modules/user/NewCmClubMapper.xml

@@ -414,7 +414,7 @@
 		  and fileType = 2
 	</select>
 
-	<insert id="insertBeansHistory">
+    <insert id="insertBeansHistory">
         INSERT INTO `user_beans_history` (
           `userId`, `type`, `beansType`, `orderId`,
           `num`, `pushStatus`, `addTime`, delFlag
@@ -430,4 +430,12 @@
 		UPDATE club SET status = #{clubStatus} WHERE userID = #{confirmUserId}
 	</update>
 
+	<select id="findLowOrder" resultType="com.caimei.modules.user.entity.UserBeansHistory">
+		select userId, type, beansType, orderId, num, addTime
+		from user_beans_history
+		where orderId = #{orderId}
+		  and delFlag = 0
+		  and type = 2
+		  and num = 500
+	</select>
 </mapper>

+ 2 - 3
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,.docx,.pptx">选择文件
+            <input type="file" name="file" id="archiveFile" accept=".pdf,.doc,.docx,.ppt,.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丶docx丶pptx文件格式</font>
+            <font color="red">支持上传pdf丶word丶ppt文件格式</font>
         </div>
     </div>
 </form:form>
@@ -237,7 +237,6 @@
             data.append('fileName', fileName);
             $('.upload-loading').css("display", "inline");
             $.ajax({
-                <%--url: "${ctx}/archive/cmProductArchiveContent/addWaterMark",--%>
                 url: "${ctx}/archive/cmProductArchiveContent/upload",
                 data: data,
                 type: "POST",

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

@@ -73,12 +73,6 @@
         <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="请选择"/>
@@ -98,8 +92,7 @@
         <th>序号</th>
         <th>订单资料编号</th>
         <th>订单资料标题</th>
-        <th>子订单ID/母订单ID</th>
-        <th>母订单状态</th>
+        <th>子订单ID</th>
         <th>供应商名称</th>
         <th>机构名称</th>
         <th>商品标签</th>
@@ -120,16 +113,9 @@
             </td>
             <td>
                 <a href="${ctx}/order/detail?id=${cmOrderArchive.orderId}">
-                        ${cmOrderArchive.shopOrderId}/${cmOrderArchive.orderId}
+                        ${cmOrderArchive.shopOrderId}
                 </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>
@@ -149,7 +135,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})">资料列表(${cmOrderArchive.fileNum})</a>
+                <a href="JavaScript:;" onclick="showArchiveList(${cmOrderArchive.id})">资料列表</a>
             </td>
         </tr>
     </c:forEach>

+ 0 - 1
src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderReviewReturnRecord.jsp

@@ -764,7 +764,6 @@
     };
 
     function setNum(a,b,c) {
-        debugger
         var numberA = Number($("#"+a).html());
         var numberB = Number($("#cmReturnedPurchaseProductList"+c+"\\."+b).val());
         if (numberA < numberB){

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

@@ -120,7 +120,6 @@
 		<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">
@@ -155,21 +154,6 @@
 					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">
@@ -318,9 +302,7 @@
 				}
 			}, 500);
 		});
-		productShow();
-
-		initInputDisplay();
+		productShow()
 	});
 
 	var productIds = '';
@@ -579,57 +561,6 @@
 	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>

+ 8 - 13
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="3" label="已下架"/>
+				<form:option value="0" label="未生效"/>
+				<form:option value="1" 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>
@@ -110,13 +110,8 @@
 				</td>
 				<td>
     				<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/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/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=0">领取用户</a>
 				</td>
 			</tr>

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

@@ -49,7 +49,6 @@
     <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">
@@ -91,21 +90,6 @@
                    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">
@@ -136,10 +120,6 @@
     </div>
 </form:form>
 <script>
-    $(function () {
-        initInputDisplay();
-    })
-
     function statusShow() {
         var status = $("input[name='status']:checked").val();
         if (status == 2) {
@@ -174,57 +154,6 @@
     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>

+ 8 - 13
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="3" label="已下架"/>
+            <form:option value="0" label="未生效"/>
+            <form:option value="1" 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,13 +112,8 @@
             </td>
             <td>
                 <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/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/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=1">领取用户</a>
             </td>
         </tr>

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

@@ -49,7 +49,6 @@
     <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">
@@ -78,21 +77,6 @@
                    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">
@@ -123,10 +107,6 @@
     </div>
 </form:form>
 <script>
-    $(function () {
-        initInputDisplay();
-    })
-
     function statusShow() {
         var status = $("input[name='status']:checked").val();
         if (status == 2) {
@@ -161,57 +141,6 @@
     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>

+ 8 - 13
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="3" label="已下架"/>
+            <form:option value="0" label="未生效"/>
+            <form:option value="1" 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,13 +104,8 @@
             </td>
             <td>
                 <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/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/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=4">领取用户</a>
             </td>
         </tr>

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

@@ -55,7 +55,6 @@
     <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">
@@ -112,21 +111,6 @@
                    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">
@@ -169,7 +153,6 @@
             }
             appendShopOrderHead(shop);
         }
-        initInputDisplay();
     });
 
 
@@ -269,57 +252,6 @@
     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>

+ 8 - 13
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="3" label="已下架"/>
+            <form:option value="0" label="未生效"/>
+            <form:option value="1" 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,13 +116,8 @@
             </td>
             <td>
                 <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/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/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=3">领取用户</a>
             </td>
         </tr>

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

@@ -57,7 +57,6 @@
     <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">
@@ -109,21 +108,6 @@
                    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">
@@ -180,7 +164,6 @@
             };
             insertHtml(items);
         }
-        initInputDisplay();
     });
 
     function insertHtml(data) {
@@ -274,57 +257,6 @@
     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>

+ 8 - 13
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="3" label="已下架"/>
+            <form:option value="0" label="未生效"/>
+            <form:option value="1" 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,13 +174,8 @@
             </td>
             <td>
                 <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/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>
             </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.receiveDate}" pattern="yyyy-MM-dd"/>-<fmt:formatDate value="${coupon.useEndDate}" pattern="yyyy-MM-dd"/></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>

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

@@ -151,12 +151,6 @@
                    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">

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

@@ -109,13 +109,8 @@
             </td>
             <td>
                 <a href="${ctx}/coupon/cmCoupon/codeCouponForm?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/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="javascript:void(0);" onclick="showSelect(${cmCoupon.id})">查看兑换码</a>
             </td>
         </tr>

+ 3 - 8
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,12 +79,7 @@
 					${cmHeheCoupon.couponAmount}
 				</td>
 				<td>
-					<c:if test="${cmHeheCoupon.noThresholdFlag eq 1}">
-						无门槛
-					</c:if>
-					<c:if test="${cmHeheCoupon.noThresholdFlag ne 1}">
-						满${cmHeheCoupon.touchPrice}
-					</c:if>
+					${cmHeheCoupon.touchPrice}
 				</td>
 				<td>
 					<fmt:formatDate value="${cmHeheCoupon.startTime}" pattern="yyyy-MM-dd HH:mm"/>
@@ -112,7 +107,7 @@
 				</td>
 				<td>
     				<a href="${ctx}/hehe/cmHeheCoupon/form?id=${cmHeheCoupon.id}">编辑</a>
-					<a href="${ctx}/hehe/cmHeheCoupon/delete?id=${cmHeheCoupon.id}&couponType=${cmHeheCoupon.couponType}" onclick="return confirmx('确认要删除该优惠券吗?', this.href)">删除</a>
+					<a href="${ctx}/hehe/cmHeheCoupon/delete?id=${cmHeheCoupon.id}" onclick="return confirmx('确认要删除该优惠券吗?', this.href)">删除</a>
 					<a href="${ctx}/hehe/cmHeheCoupon/receive/user/list?couponId=${cmHeheCoupon.id}&couponType=${cmHeheCoupon.couponType}">领取用户</a>
 				</td>
 			</tr>

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

@@ -49,14 +49,6 @@
 		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>
@@ -78,7 +70,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)" onchange="changeDiscount()" class="input-xlarge  digits required"/> %
+				<form:input path="discount" htmlEscape="false" onkeyup="onlynum(this)" class="input-xlarge  digits required"/> %
 			</div>
 		</div>
 		<div class="control-group">

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

@@ -38,6 +38,9 @@
 					<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.userID,
+                    "userId": user.id,
                     "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.userID}" class="itemtr">
+            <tr id="${item.id}" 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.userID,
+                    "userId": user.id,
                     "nickName": user.nickName,
                     "mobile": user.mobile,
                     "userIdentity": user.userIdentity,

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

@@ -179,7 +179,7 @@
                         <c:if test="${vo.receiptType == 6}">
                             超级会员款
                         </c:if>
-                        <c:if test="${vo.receiptType == 6}">
+                        <c:if test="${vo.receiptType == 7}">
                             二手商品上架费
                         </c:if>
 					</span>

+ 524 - 156
src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp

@@ -5,69 +5,377 @@
     <title>订单列表</title>
     <meta name="decorator" content="default"/>
     <style type="text/css">
-        *{margin:0;padding:0}
-        a{list-style:none;text-decoration:none}
-        body{background-color:rgb(255,255,255)}
-        h3{line-height:20px;padding:20px 0 20px 15px;border-bottom:1px solid #CCCCCC}
-        .now-status p{padding:20px}
-        .now-status span{display:inline-block;width:160px;line-height:35px;margin-right:15px;cursor:pointer;border:1px solid #CCCCCC;text-align:center;border-radius:5px}
-        .buyInfo p{padding:15px 5px 0}
-        .buyInfo p label{width:60px;display:inline-block}
-        .buyInfo p span{padding-left:10px}
-        .table th{background-color:#CCCCCC}
-        .table th,.table td{font-weight:normal;border:1px solid #CCCCCC;height:35px;text-align:center}
-        .table td .div-img{box-sizing:border-box}
-        .table td .div-img img{width:100px;height:100px;vertical-align:middle}
-        .table td .div-img span{}
-        .div-order span{width:260px;display:inline-block;margin-right:50px}
-        .text-result p{padding-top:15px}
-        .text-cost p{padding:20px 0}
-        .moeny-cost p{padding:10px 0 0 0;text-align:left}
-        .moeny-cost p label{display:inline-block}
-        .Staging table{width:100%;border-collapse:collapse;margin-top:20px}
-        .Staging table th,.Staging table td{font-weight:normal;border:1px solid #000;height:35px;text-align:center;width:10%}
-        .change-info{position:fixed;top:0%;left:50%;transform:translateX(-50%);z-index:999;width:800px;background-color:#fff;box-shadow:0px 0px 15px #ccc}
-        .item-div label{width:260px;text-align:right;display:inline-block;margin-right:50px}
-        .item-div input{width:300px;line-height:35px;height:35px;box-sizing:border-box;border:1px solid #CCCCCC;display:inline-block}
-        .item-div select{width:90px;height:35px;margin-right:10px}
-        .item-div textarea{border:1px solid #CCCCCC;margin-top:20px;width:300px;height:80px;resize:none;display:block}
-        .layer-status span{display:inline-block;width:80px;line-height:35px;background-color:#00A6C7;text-align:center;color:#fff;cursor:pointer}
-        .layer-status span:nth-of-type(1){}
-        .layer-status span:nth-of-type(2){margin-left:72px}
-        .same-style{position:fixed;top:20%;left:50%;transform:translateX(-50%);width:500px;background-color:#fff;z-index:999;box-shadow:0 0 15px #666}
-        .reason-cancel label{margin-right:20px}
-        .reason-cancel textarea{width:270px;height:80px;resize:none;vertical-align:text-top;border:1px solid #CCCCCC}
-        .order-details-heading{background:#eee}
-        .order-details-heading td{white-space:nowrap;padding:0 10px}
-        .order-rows,.order-details-heading{width:100%;border-bottom:1px solid #ccc;border-left:1px solid #ccc;border-right:1px solid #ccc;color:#666;padding:10px;line-height:30px}
-        .order-details-heading{border-top:1px solid #ccc}
-        .order-details-heading span,.order-rows span{margin-right:80px}
-        .order-details-heading span{width:230px;margin-right:0px;display:inline-block}
-        .order-details-heading span label,.order-rows span label{font-weight:bold}
-        .order-rows .supplier-img{width:100px}
-        .operation-wrapper{position:relative}
-        .operation-btn{cursor:pointer}
-        .operation-block{background:#fff;width:125px;position:absolute;left:35px;top:30px;padding:10px;border:1px solid #666;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;z-index:100001;display:none}
-        .operation-block a{display:block;padding:3px 0}
-        .print-wrapper{display:inline-block}
-        .supplier-product-name,.supplier-product-alias{width:200px;line-height:20px}
-        .supplier-product-info{width:50%;display:inline-block;position:relative;top:50%;transform:translateY(30%)}
-        .supplier-product-promotionInfo{width:20%;display:inline-block;position:relative;top:50%;transform:translateY(30%)}
-        .supplier-product-item{margin-bottom:10px}
-        .supplier-product-alias{display:inline-block;margin-top:5px}
-        .supplier-name{display:inline-block;vertical-align:middle;margin:0 10px}
-        #auditBox{padding:20px;line-height:30px}
-        #auditBox p{font-size:16px;margin:0 0 0 0}
-        #auditBox .note-div{font-size:16px}
-        .downSpan{display:block;margin-left:5px;margin-bottom:-8px}
-        .upSpan{display:block;margin-left:5px;margin-top:-8px}
-        .promotionsName{margin:2px}
-        .ladderPrice>span{text-decoration:underline;color:red}
-        .ladderPrice .list{display:none;position:absolute;z-index:999;background:#FFF;white-space:nowrap;border:1px solid #EEE;padding:10px 0;color:#333}
-        .ladderPrice:hover .list{display:block}
-        .ladderPrice .list span{margin:0 20px;width:60px;text-align:center;display:inline-block}
-        .ladderPrice .list span.price{color:red}
-        .weishaIcon {background:darkorange;color:white;margin:0 0px;padding:0 3px;font-style:normal;font-size: 12px; display:inline-block;border-radius:2px}
+        * {
+            margin: 0;
+            padding: 0
+        }
+
+        a {
+            list-style: none;
+            text-decoration: none
+        }
+
+        body {
+            background-color: rgb(255, 255, 255)
+        }
+
+        h3 {
+            line-height: 20px;
+            padding: 20px 0 20px 15px;
+            border-bottom: 1px solid #CCCCCC
+        }
+
+        .now-status p {
+            padding: 20px
+        }
+
+        .now-status span {
+            display: inline-block;
+            width: 160px;
+            line-height: 35px;
+            margin-right: 15px;
+            cursor: pointer;
+            border: 1px solid #CCCCCC;
+            text-align: center;
+            border-radius: 5px
+        }
+
+        .buyInfo p {
+            padding: 15px 5px 0
+        }
+
+        .buyInfo p label {
+            width: 60px;
+            display: inline-block
+        }
+
+        .buyInfo p span {
+            padding-left: 10px
+        }
+
+        .table th {
+            background-color: #CCCCCC
+        }
+
+        .table th, .table td {
+            font-weight: normal;
+            border: 1px solid #CCCCCC;
+            height: 35px;
+            text-align: center
+        }
+
+        .table td .div-img {
+            box-sizing: border-box
+        }
+
+        .table td .div-img img {
+            width: 100px;
+            height: 100px;
+            vertical-align: middle
+        }
+
+        .table td .div-img span {
+        }
+
+        .div-order span {
+            width: 260px;
+            display: inline-block;
+            margin-right: 50px
+        }
+
+        .text-result p {
+            padding-top: 15px
+        }
+
+        .text-cost p {
+            padding: 20px 0
+        }
+
+        .moeny-cost p {
+            padding: 10px 0 0 0;
+            text-align: left
+        }
+
+        .moeny-cost p label {
+            display: inline-block
+        }
+
+        .Staging table {
+            width: 100%;
+            border-collapse: collapse;
+            margin-top: 20px
+        }
+
+        .Staging table th, .Staging table td {
+            font-weight: normal;
+            border: 1px solid #000;
+            height: 35px;
+            text-align: center;
+            width: 10%
+        }
+
+        .change-info {
+            position: fixed;
+            top: 0%;
+            left: 50%;
+            transform: translateX(-50%);
+            z-index: 999;
+            width: 800px;
+            background-color: #fff;
+            box-shadow: 0px 0px 15px #ccc
+        }
+
+        .item-div label {
+            width: 260px;
+            text-align: right;
+            display: inline-block;
+            margin-right: 50px
+        }
+
+        .item-div input {
+            width: 300px;
+            line-height: 35px;
+            height: 35px;
+            box-sizing: border-box;
+            border: 1px solid #CCCCCC;
+            display: inline-block
+        }
+
+        .item-div select {
+            width: 90px;
+            height: 35px;
+            margin-right: 10px
+        }
+
+        .item-div textarea {
+            border: 1px solid #CCCCCC;
+            margin-top: 20px;
+            width: 300px;
+            height: 80px;
+            resize: none;
+            display: block
+        }
+
+        .layer-status span {
+            display: inline-block;
+            width: 80px;
+            line-height: 35px;
+            background-color: #00A6C7;
+            text-align: center;
+            color: #fff;
+            cursor: pointer
+        }
+
+        .layer-status span:nth-of-type(1) {
+        }
+
+        .layer-status span:nth-of-type(2) {
+            margin-left: 72px
+        }
+
+        .same-style {
+            position: fixed;
+            top: 20%;
+            left: 50%;
+            transform: translateX(-50%);
+            width: 500px;
+            background-color: #fff;
+            z-index: 999;
+            box-shadow: 0 0 15px #666
+        }
+
+        .reason-cancel label {
+            margin-right: 20px
+        }
+
+        .reason-cancel textarea {
+            width: 270px;
+            height: 80px;
+            resize: none;
+            vertical-align: text-top;
+            border: 1px solid #CCCCCC
+        }
+
+        .order-details-heading {
+            background: #eee
+        }
+
+        .order-details-heading td {
+            white-space: nowrap;
+            padding: 0 10px
+        }
+
+        .order-rows, .order-details-heading {
+            width: 100%;
+            border-bottom: 1px solid #ccc;
+            border-left: 1px solid #ccc;
+            border-right: 1px solid #ccc;
+            color: #666;
+            padding: 10px;
+            line-height: 30px
+        }
+
+        .order-details-heading {
+            border-top: 1px solid #ccc
+        }
+
+        .order-details-heading span, .order-rows span {
+            margin-right: 80px
+        }
+
+        .order-details-heading span {
+            width: 230px;
+            margin-right: 0px;
+            display: inline-block
+        }
+
+        .order-details-heading span label, .order-rows span label {
+            font-weight: bold
+        }
+
+        .order-rows .supplier-img {
+            width: 100px
+        }
+
+        .operation-wrapper {
+            position: relative
+        }
+
+        .operation-btn {
+            cursor: pointer
+        }
+
+        .operation-block {
+            background: #fff;
+            width: 125px;
+            position: absolute;
+            left: 35px;
+            top: 30px;
+            padding: 10px;
+            border: 1px solid #666;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            z-index: 100001;
+            display: none
+        }
+
+        .operation-block a {
+            display: block;
+            padding: 3px 0
+        }
+
+        .print-wrapper {
+            display: inline-block
+        }
+
+        .supplier-product-name, .supplier-product-alias {
+            width: 200px;
+            line-height: 20px
+        }
+
+        .supplier-product-info {
+            width: 50%;
+            display: inline-block;
+            position: relative;
+            top: 50%;
+            transform: translateY(30%)
+        }
+
+        .supplier-product-promotionInfo {
+            width: 20%;
+            display: inline-block;
+            position: relative;
+            top: 50%;
+            transform: translateY(30%)
+        }
+
+        .supplier-product-item {
+            margin-bottom: 10px
+        }
+
+        .supplier-product-alias {
+            display: inline-block;
+            margin-top: 5px
+        }
+
+        .supplier-name {
+            display: inline-block;
+            vertical-align: middle;
+            margin: 0 10px
+        }
+
+        #auditBox {
+            padding: 20px;
+            line-height: 30px
+        }
+
+        #auditBox p {
+            font-size: 16px;
+            margin: 0 0 0 0
+        }
+
+        #auditBox .note-div {
+            font-size: 16px
+        }
+
+        .downSpan {
+            display: block;
+            margin-left: 5px;
+            margin-bottom: -8px
+        }
+
+        .upSpan {
+            display: block;
+            margin-left: 5px;
+            margin-top: -8px
+        }
+
+        .promotionsName {
+            margin: 2px
+        }
+
+        .ladderPrice > span {
+            text-decoration: underline;
+            color: red
+        }
+
+        .ladderPrice .list {
+            display: none;
+            position: absolute;
+            z-index: 999;
+            background: #FFF;
+            white-space: nowrap;
+            border: 1px solid #EEE;
+            padding: 10px 0;
+            color: #333
+        }
+
+        .ladderPrice:hover .list {
+            display: block
+        }
+
+        .ladderPrice .list span {
+            margin: 0 20px;
+            width: 60px;
+            text-align: center;
+            display: inline-block
+        }
+
+        .ladderPrice .list span.price {
+            color: red
+        }
+
+        .weishaIcon {
+            background: darkorange;
+            color: white;
+            margin: 0 0px;
+            padding: 0 3px;
+            font-style: normal;
+            font-size: 12px;
+            display: inline-block;
+            border-radius: 2px
+        }
     </style>
     <script type="text/javascript" src="${ctxStatic}/QRCode/jquery.qrcode.min.js"></script>
     <script type="text/javascript" src="static/common/clipboard.min.js"></script>
@@ -117,38 +425,44 @@
                 <c:if test="${order.receiptStatus == 3}">
                     <font color="green">已收款</font>
                 </c:if>
-                <%--抹平明细--%>
-                    <c:if test="${order.confirmType eq 1}">
-                        <c:if test="${order.receiptOrderFlag}">
-                            <font color="red">(一款多单:少收抹平金额未知)</font>
-                        </c:if>
-                        <c:if test="${!order.receiptOrderFlag}">
-                            <font color="red">(少收抹平:
-                                ¥<fmt:formatNumber value="${order.payableAmount - (empty order.orderReceivedAmount ? 0 : order.orderReceivedAmount)}" pattern="#0.00"/>)
-                            </font>
-                        </c:if>
+                    <%--抹平明细--%>
+                <c:if test="${order.confirmType eq 1}">
+                    <c:if test="${order.receiptOrderFlag}">
+                        <font color="red">(一款多单:少收抹平金额未知)</font>
                     </c:if>
-                    <c:if test="${order.confirmType eq 2}">
-                        <c:if test="${order.receiptOrderFlag}">
-                            <font color="red">(一款多单:多收抹平金额未知)</font>
-                        </c:if>
-                        <c:if test="${!order.receiptOrderFlag}">
-                            <font color="red">(多收抹平:
-                                ¥<fmt:formatNumber value="${(empty order.orderReceivedAmount ? 0 : order.orderReceivedAmount) - order.payableAmount}" pattern="#0.00"/>)
-                            </font>
-                        </c:if>
+                    <c:if test="${!order.receiptOrderFlag}">
+                        <font color="red">(少收抹平:
+                            ¥<fmt:formatNumber
+                                    value="${order.payableAmount - (empty order.orderReceivedAmount ? 0 : order.orderReceivedAmount)}"
+                                    pattern="#0.00"/>)
+                        </font>
                     </c:if>
-                    <c:if test="${order.confirmType eq 3}">
-                        <c:if test="${order.receiptOrderFlag}">
-                             <font color="red">(一款多单:多收退余额)</font>
-                        </c:if>
-                        <c:if test="${!order.receiptOrderFlag}">
-                            <font color="red">(多收退余额&nbsp;&nbsp;${order.associationType eq 2 ? "(自动)" : ""}:
-                                ¥<fmt:formatNumber value="${(empty order.returnBalanceAmount ? 0 : order.returnBalanceAmount)}" pattern="#0.00"/>)
-                            </font>
-                        </c:if>
+                </c:if>
+                <c:if test="${order.confirmType eq 2}">
+                    <c:if test="${order.receiptOrderFlag}">
+                        <font color="red">(一款多单:多收抹平金额未知)</font>
+                    </c:if>
+                    <c:if test="${!order.receiptOrderFlag}">
+                        <font color="red">(多收抹平:
+                            ¥<fmt:formatNumber
+                                    value="${(empty order.orderReceivedAmount ? 0 : order.orderReceivedAmount) - order.payableAmount}"
+                                    pattern="#0.00"/>)
+                        </font>
+                    </c:if>
+                </c:if>
+                <c:if test="${order.confirmType eq 3}">
+                    <c:if test="${order.receiptOrderFlag}">
+                        <font color="red">(一款多单:多收退余额)</font>
                     </c:if>
-                </td>
+                    <c:if test="${!order.receiptOrderFlag}">
+                        <font color="red">(多收退余额&nbsp;&nbsp;${order.associationType eq 2 ? "(自动)" : ""}:
+                            ¥<fmt:formatNumber
+                                    value="${(empty order.returnBalanceAmount ? 0 : order.returnBalanceAmount)}"
+                                    pattern="#0.00"/>)
+                        </font>
+                    </c:if>
+                </c:if>
+            </td>
             <td>发货状态:
                 <c:if test="${order.sendOutStatus == 1}">
                     <font color="red">待发货</font>
@@ -187,8 +501,10 @@
                 </c:if>
             </td>
         </c:if>
-        <td>机构:${order.buyer}<font id="svipFlagLabel" style="margin-left:10px" color="red">${order.bpOrderUserinfo.svipFlag eq 1?'(超级会员)':''}</font>
-            <c:if test="${order.organizeID >= 3}"><label style="margin-left: 20px">门店:${order.organizeStoreName}</label> </c:if></td>
+        <td>机构:${order.buyer}<font id="svipFlagLabel" style="margin-left:10px"
+                                   color="red">${order.bpOrderUserinfo.svipFlag eq 1?'(超级会员)':''}</font>
+            <c:if test="${order.organizeID >= 3}"><label
+                    style="margin-left: 20px">门店:${order.organizeStoreName}</label> </c:if></td>
         <td>收货人: ${order.bpOrderUserinfo.shouHuoRen}</td>
     </tr>
     <tr>
@@ -200,19 +516,23 @@
             订单金额:<fmt:formatNumber value="${order.payTotalFee}" type="currency"/>&nbsp;
             <c:if test="${not empty order.couponOrderRecord}">
                 <c:if test="${order.couponOrderRecord.couponType eq 0}">
-                    <a href="${ctx}/coupon/cmCouponClub/couponDetails?userId=${order.userID}"><font color="red">(活动券抵扣¥${order.couponOrderRecord.couponAmount},满${order.couponOrderRecord.touchPrice}减${order.couponOrderRecord.couponAmount})</font></a>
+                    <a href="${ctx}/coupon/cmCouponClub/couponDetails?userId=${order.userID}"><font
+                            color="red">(活动券抵扣¥${order.couponOrderRecord.couponAmount},满${order.couponOrderRecord.touchPrice}减${order.couponOrderRecord.couponAmount})</font></a>
                 </c:if>
                 <c:if test="${order.couponOrderRecord.couponType eq 1}">
-                    <a href="${ctx}/coupon/cmCouponClub/couponDetails?userId=${order.userID}"><font color="red">(品类券抵扣¥${order.couponOrderRecord.couponAmount},满${order.couponOrderRecord.touchPrice}减${order.couponOrderRecord.couponAmount})</font></a>
+                    <a href="${ctx}/coupon/cmCouponClub/couponDetails?userId=${order.userID}"><font
+                            color="red">(品类券抵扣¥${order.couponOrderRecord.couponAmount},满${order.couponOrderRecord.touchPrice}减${order.couponOrderRecord.couponAmount})</font></a>
                 </c:if>
                 <c:if test="${order.couponOrderRecord.couponType eq 2}">
                     <a href="${ctx}/coupon/cmCouponClub/couponDetails?userId=${order.userID}"><font color="red">(用户专享券抵扣¥${order.couponOrderRecord.couponAmount},满${order.couponOrderRecord.touchPrice}减${order.couponOrderRecord.couponAmount})</font></a>
                 </c:if>
                 <c:if test="${order.couponOrderRecord.couponType eq 3}">
-                    <a href="${ctx}/coupon/cmCouponClub/couponDetails?userId=${order.userID}"><font color="red">(店铺券抵扣¥${order.couponOrderRecord.couponAmount},满${order.couponOrderRecord.touchPrice}减${order.couponOrderRecord.couponAmount})</font></a>
+                    <a href="${ctx}/coupon/cmCouponClub/couponDetails?userId=${order.userID}"><font
+                            color="red">(店铺券抵扣¥${order.couponOrderRecord.couponAmount},满${order.couponOrderRecord.touchPrice}减${order.couponOrderRecord.couponAmount})</font></a>
                 </c:if>
                 <c:if test="${order.couponOrderRecord.couponType eq 4}">
-                    <a href="${ctx}/coupon/cmCouponClub/couponDetails?userId=${order.userID}"><font color="red">(新用户券抵扣¥${order.couponOrderRecord.couponAmount},满${order.couponOrderRecord.touchPrice}减${order.couponOrderRecord.couponAmount})</font></a>
+                    <a href="${ctx}/coupon/cmCouponClub/couponDetails?userId=${order.userID}"><font
+                            color="red">(新用户券抵扣¥${order.couponOrderRecord.couponAmount},满${order.couponOrderRecord.touchPrice}减${order.couponOrderRecord.couponAmount})</font></a>
                 </c:if>
             </c:if>
         </td>
@@ -222,12 +542,13 @@
             应收金额:<fmt:formatNumber value="${order.payableAmount}" type="currency"/>
             <span style="color: red">
                 <c:if test="${order.balancePayFee gt 0}">
-                    <a href="${ctx}/user/cmUserBalanceRecord/userBalanceRecord?userId=${order.userID}" style="color: red;text-decoration: underline">
+                    <a href="${ctx}/user/cmUserBalanceRecord/userBalanceRecord?userId=${order.userID}"
+                       style="color: red;text-decoration: underline">
                         (账户余额抵扣: <fmt:formatNumber value="${order.balancePayFee}" type="currency"/>)
                     </a>
                 </c:if>
                 <c:if test="${order.balancePayFee le 0}">
-                        (账户余额抵扣: <fmt:formatNumber value="${order.balancePayFee}" type="currency"/>)
+                    (账户余额抵扣: <fmt:formatNumber value="${order.balancePayFee}" type="currency"/>)
                 </c:if>
 
 
@@ -242,7 +563,7 @@
                 <fmt:formatNumber value="${receiptAmount}" type="currency"/>
             </c:if>
             <c:if test="${order.receiptStatus == 3 && order.confirmType != null && order.confirmType != ''}">
-<%--                <span style='color:#FF0000'>(已抹平收款)</span>--%>
+                <%--                <span style='color:#FF0000'>(已抹平收款)</span>--%>
             </c:if>
         </td>
         <td>
@@ -316,17 +637,17 @@
                             <a href="${ctx}/order/cancelOrder?orderID=${order.orderID}"
                                onclick="return confirmx('是否取消订单?', this.href)">取消订单</a>
                         </c:if>
-                    <c:if test="${order.status eq 11 || order.status eq 12 || order.status eq 13 ||order.status eq 21 ||order.status eq 22 ||
+                        <c:if test="${order.status eq 11 || order.status eq 12 || order.status eq 13 ||order.status eq 21 ||order.status eq 22 ||
 				            order.status eq 23 || order.status eq 0}">
-                        <c:if test="${empty order.rechargeGoods && (order.ableUserMoney > 0 || order.status eq 0)}">
-                            <c:if test="${order.postageOrderFlag == 0 && order.secondHandOrderFlag != 1}">
-                                <a href="${ctx}/order/form?id=${order.orderID}">修改订单</a>
-                            </c:if>
-                            <c:if test="${order.postageOrderFlag == 0 && order.secondHandOrderFlag == 1}">
-                                <a href="${ctx}/order/secondeProductOrderForm?id=${order.orderID}">修改订单</a>
+                            <c:if test="${empty order.rechargeGoods && (order.ableUserMoney > 0 || order.status eq 0)}">
+                                <c:if test="${order.postageOrderFlag == 0 && order.secondHandOrderFlag != 1}">
+                                    <a href="${ctx}/order/form?id=${order.orderID}">修改订单</a>
+                                </c:if>
+                                <c:if test="${order.postageOrderFlag == 0 && order.secondHandOrderFlag == 1}">
+                                    <a href="${ctx}/order/secondeProductOrderForm?id=${order.orderID}">修改订单</a>
+                                </c:if>
                             </c:if>
                         </c:if>
-                    </c:if>
                         <c:if test="${order.status == 0}">
                             <c:if test="${order.postageOrderFlag == 1}">
                                 <a href="${ctx}/order/postageOrderForm?id=${order.orderID}">修改邮费订单</a>
@@ -338,7 +659,8 @@
                            onclick="modelShow('${order.orderID}')">编辑经理折扣</a>
                     </c:if>
                     <c:if test="${order.rebateFlag eq 0 && order.receiptStatus eq 1 && order.payStatus eq 1}">
-                        <a href="${ctx}/order/modifyRebate?orderId=${order.orderID}" onclick="return confirmx('确定将订单转为返佣订单吗?', this.href)">转为返佣订单</a>
+                        <a href="${ctx}/order/modifyRebate?orderId=${order.orderID}"
+                           onclick="return confirmx('确定将订单转为返佣订单吗?', this.href)">转为返佣订单</a>
                     </c:if>
                 </shiro:hasPermission>
                 <shiro:hasPermission name="order:order:applyrefound">
@@ -485,25 +807,32 @@
         <span><label>供应商:</label>${shopOrder.shopName}</span>
         <c:if test="${shopOrder.shopPromotion ne null && shopOrder.shopPromotion.type eq 3}">
             <c:if test="${shopOrder.shopPromotion.mode eq 2}">
-                <span><label style="background-color: #F60;color: white">${shopOrder.shopPromotion.name}</label> 满<fmt:formatNumber value="${shopOrder.shopPromotion.touchPrice}" pattern="#,##0.00" maxFractionDigits="2"/>,减<fmt:formatNumber value="${shopOrder.shopPromotion.reducedPrice}" pattern="#,##0.00" maxFractionDigits="2"/></span>
+                <span><label
+                        style="background-color: #F60;color: white">${shopOrder.shopPromotion.name}</label> 满<fmt:formatNumber
+                        value="${shopOrder.shopPromotion.touchPrice}" pattern="#,##0.00"
+                        maxFractionDigits="2"/>,减<fmt:formatNumber value="${shopOrder.shopPromotion.reducedPrice}"
+                                                                   pattern="#,##0.00" maxFractionDigits="2"/></span>
             </c:if>
             <c:if test="${shopOrder.shopPromotion.mode eq 3}">
-                <span><label style="background-color: purple;color: white">${shopOrder.shopPromotion.name}</label> 满<fmt:formatNumber value="${shopOrder.shopPromotion.touchPrice}" pattern="#,##0.00" maxFractionDigits="2"/>,赠送商品</span>
+                <span><label
+                        style="background-color: purple;color: white">${shopOrder.shopPromotion.name}</label> 满<fmt:formatNumber
+                        value="${shopOrder.shopPromotion.touchPrice}" pattern="#,##0.00"
+                        maxFractionDigits="2"/>,赠送商品</span>
             </c:if>
         </c:if>
         <div>
-            <c:forEach items="${shopOrder.newOrderProducts}" var="op"  varStatus="varIndex">
+            <c:forEach items="${shopOrder.newOrderProducts}" var="op" varStatus="varIndex">
                 <div class="supplier-product-item" style="z-index:${100000 - varIndex.index};position:relative;">
-                    <%--二手订单详情--%>
+                        <%--二手订单详情--%>
                     <c:if test="${order.secondHandOrderFlag eq 1}">
                         <a href="${fns:getConfig('wwwServer')}product-${op.productID}.html" target="_blank">
-                        <img class="supplier-img" src="${op.image}"/>
+                            <img class="supplier-img" src="${op.image}"/>
                         </a>
                     </c:if>
-                    <%--正常订单详情--%>
+                        <%--正常订单详情--%>
                     <c:if test="${order.secondHandOrderFlag ne 1}">
                         <a href="${fns:getConfig('wwwServer')}product-${op.productID}.html" target="_blank">
-                         <img class="supplier-img" src="${op.image}"/>
+                            <img class="supplier-img" src="${op.image}"/>
                         </a>
                     </c:if>
                     <div class="supplier-name">
@@ -533,44 +862,49 @@
                         </c:if>
                     </div>
                     <c:if test="${op.productID ne 999}">
-                        <div class="supplier-product-info" >
+                        <div class="supplier-product-info">
                             <span>单价:
                                 <c:if test="${op.svipPriceFlag eq 1 or op.productPromotion.mode eq 1}">
-                                    <label style="text-decoration: line-through"><fmt:formatNumber value="${op.price}" type="currency"/></label>
+                                    <label style="text-decoration: line-through"><fmt:formatNumber value="${op.price}"
+                                                                                                   type="currency"/></label>
                                 </c:if>
                                 <c:if test="${op.svipPriceFlag ne 1 and op.productPromotion.mode ne 1}">
                                     <fmt:formatNumber value="${op.price}" type="currency"/>
                                 </c:if>
                                 <c:if test="${op.svipPriceFlag eq 1}">
-                                    <label style="margin-left:5px"><fmt:formatNumber value="${op.discountPrice}" type="currency"/></label>
+                                    <label style="margin-left:5px"><fmt:formatNumber value="${op.discountPrice}"
+                                                                                     type="currency"/></label>
                                     <font color="red">(超级会员价)</font></span>
-                                </c:if>
-                                <c:if test="${op.ladderPriceFlag eq 1 || op.isActProduct eq 2}">
-                                    <a href="javascript:;" class="ladderPrice"><span> (阶梯价格)</span>
-                                        <c:if test="${not empty op.orderProductLadderPriceList}">
-                                            <div class="list">
-                                                <p><span>起订量</span><span>价格</span></p>
-                                                <c:forEach items="${op.orderProductLadderPriceList}" var="ladderPrice">
-                                                    <p data-num="${ladderPrice.buyNum}"><span>${ladderPrice.buyNumRangeShow}</span><span class="price">${ladderPrice.buyPrice}</span></p>
-                                                </c:forEach>
-                                            </div>
-                                        </c:if>
-                                    </a>
-                                </c:if>
+                            </c:if>
+                            <c:if test="${op.ladderPriceFlag eq 1 || op.isActProduct eq 2}">
+                                <a href="javascript:;" class="ladderPrice"><span> (阶梯价格)</span>
+                                    <c:if test="${not empty op.orderProductLadderPriceList}">
+                                        <div class="list">
+                                            <p><span>起订量</span><span>价格</span></p>
+                                            <c:forEach items="${op.orderProductLadderPriceList}" var="ladderPrice">
+                                                <p data-num="${ladderPrice.buyNum}">
+                                                    <span>${ladderPrice.buyNumRangeShow}</span><span
+                                                        class="price">${ladderPrice.buyPrice}</span></p>
+                                            </c:forEach>
+                                        </div>
+                                    </c:if>
+                                </a>
+                            </c:if>
                             </span>
                             <span>折扣: ${op.discount}%</span>
                             <span>折后单价:
                                 <c:if test="${op.productPromotion.mode eq 1}">
-                                    <label style="text-decoration: line-through"><fmt:formatNumber value="${op.discountPrice}" type="currency"/></label></span>
-                                </c:if>
-                                <c:if test="${op.productPromotion.mode ne 1}">
-                                    <fmt:formatNumber value="${op.discountPrice}" type="currency"/></span>
-                                </c:if>
+                                    <label style="text-decoration: line-through"><fmt:formatNumber
+                                            value="${op.discountPrice}" type="currency"/></label></span>
+                            </c:if>
+                            <c:if test="${op.productPromotion.mode ne 1}">
+                                <fmt:formatNumber value="${op.discountPrice}" type="currency"/></span>
+                            </c:if>
                             <span>数量:  x${op.num}</span>
 
                             <br>
                             <span>税率:  ${(op.includedTax != '' and op.includedTax eq 0 and op.invoiceType eq 3)?'---': op.taxRate ne null?op.taxRate:0.0}%</span>
-                            <span>税费:  ${(op.includedTax eq 1 or (op.includedTax != '' and op.includedTax eq 0 and op.invoiceType eq 3))?'---': empty op.totalAddedValueTax ?0.00:(op.totalAddedValueTax)}</span>
+                            <span>税费: ${(op.includedTax eq 1 or (op.includedTax != '' and op.includedTax eq 0 and op.invoiceType eq 3))?'---': empty op.totalAddedValueTax ?0.00:(op.totalAddedValueTax)}</span>
                             <span>总额:  <fmt:formatNumber value="${op.totalFee}" type="currency"/></span>
                             <c:if test="${order.sendOutStatus == 2 || order.sendOutStatus == 3}">
                                 <span>已发/已收  ${(op.num == null ? 0 : op.num)+ (op.presentNum == null ? 0 : op.presentNum)- (op.notOutStore == null ? 0 : op.notOutStore)}/${op.receivedNum}</span>
@@ -583,22 +917,30 @@
                             <c:if test="${op.productPromotion.type eq 2}">
                                 <div class="supplier-product-promotionInfo">
                                     <table>
-                                        <tr >
+                                        <tr>
                                             <td rowspan="2">
                                                 <c:if test="${op.productPromotion.mode eq 2}">
-                                                    <label style="background-color: #F60;color: white"><label class="promotionsName">${op.productPromotion.name}</label></label>
+                                                    <label style="background-color: #F60;color: white"><label
+                                                            class="promotionsName">${op.productPromotion.name}</label></label>
                                                 </c:if>
                                                 <c:if test="${op.productPromotion.mode eq 3}">
-                                                    <label style="background-color: purple;color: white"><label class="promotionsName">${op.productPromotion.name}</label></label>
+                                                    <label style="background-color: purple;color: white"><label
+                                                            class="promotionsName">${op.productPromotion.name}</label></label>
                                                 </c:if>
                                             </td>
                                             <td>
                                                 <span class="downSpan">${op.productPromotion.description}</span>
                                                 <c:if test="${op.productPromotion.mode eq 2}">
-                                                    <span class="upSpan"> 满<fmt:formatNumber value="${op.productPromotion.touchPrice}" pattern="#,##0.00" maxFractionDigits="2"/>,减<fmt:formatNumber value="${op.productPromotion.reducedPrice}" pattern="#,##0.00" maxFractionDigits="2"/></span>
+                                                    <span class="upSpan"> 满<fmt:formatNumber
+                                                            value="${op.productPromotion.touchPrice}" pattern="#,##0.00"
+                                                            maxFractionDigits="2"/>,减<fmt:formatNumber
+                                                            value="${op.productPromotion.reducedPrice}"
+                                                            pattern="#,##0.00" maxFractionDigits="2"/></span>
                                                 </c:if>
                                                 <c:if test="${op.productPromotion.mode eq 3}">
-                                                    <span class="upSpan"> 满<fmt:formatNumber value="${op.productPromotion.touchPrice}" pattern="#,##0.00" maxFractionDigits="2"/>,赠送商品</span>
+                                                    <span class="upSpan"> 满<fmt:formatNumber
+                                                            value="${op.productPromotion.touchPrice}" pattern="#,##0.00"
+                                                            maxFractionDigits="2"/>,赠送商品</span>
                                                 </c:if>
                                             </td>
                                         </tr>
@@ -610,16 +952,30 @@
                                     <table>
                                         <tr>
                                             <c:if test="${op.productPromotion.mode eq 1}">
-                                                <td><label style="background-color: green;color: white"><label class="promotionsName">${op.productPromotion.name}</label></label></td>
-                                                <td> 优惠价: <label style="color: red"><fmt:formatNumber value="${op.productPromotion.touchPrice}" pattern="#,##0.00" maxFractionDigits="2"/></label></td>
+                                                <td><label style="background-color: green;color: white"><label
+                                                        class="promotionsName">${op.productPromotion.name}</label></label>
+                                                </td>
+                                                <td> 优惠价: <label style="color: red"><fmt:formatNumber
+                                                        value="${op.productPromotion.touchPrice}" pattern="#,##0.00"
+                                                        maxFractionDigits="2"/></label></td>
                                             </c:if>
                                             <c:if test="${op.productPromotion.mode eq 2}">
-                                                <td><label style="background-color: #F60;color: white"><label class="promotionsName">${op.productPromotion.name}</label></label></td>
-                                                <td> 满<fmt:formatNumber value="${op.productPromotion.touchPrice}" pattern="#,##0.00" maxFractionDigits="2"/>,减<fmt:formatNumber value="${op.productPromotion.reducedPrice}" pattern="#,##0.00" maxFractionDigits="2"/></td>
+                                                <td><label style="background-color: #F60;color: white"><label
+                                                        class="promotionsName">${op.productPromotion.name}</label></label>
+                                                </td>
+                                                <td> 满<fmt:formatNumber value="${op.productPromotion.touchPrice}"
+                                                                        pattern="#,##0.00"
+                                                                        maxFractionDigits="2"/>,减<fmt:formatNumber
+                                                        value="${op.productPromotion.reducedPrice}" pattern="#,##0.00"
+                                                        maxFractionDigits="2"/></td>
                                             </c:if>
                                             <c:if test="${op.productPromotion.mode eq 3}">
-                                                <td><label style="background-color: purple;color: white"><label class="promotionsName">${op.productPromotion.name}</label></label></td>
-                                                <td> 满<fmt:formatNumber value="${op.productPromotion.touchPrice}" pattern="#,##0.00" maxFractionDigits="2"/>,赠送商品</td>
+                                                <td><label style="background-color: purple;color: white"><label
+                                                        class="promotionsName">${op.productPromotion.name}</label></label>
+                                                </td>
+                                                <td> 满<fmt:formatNumber value="${op.productPromotion.touchPrice}"
+                                                                        pattern="#,##0.00" maxFractionDigits="2"/>,赠送商品
+                                                </td>
                                             </c:if>
                                         </tr>
                                     </table>
@@ -639,22 +995,34 @@
 </c:forEach>
 <%--组织订单暂时不显示发票和条款信息--%>
 <c:if test="${order.organizeID == 0}">
+    <div class="order-rows">
+        <label>订单对机构是否可见:</label>
+        <c:if test="${order.orderSeen eq 1}">
+            <label>可见</label>
+        </c:if>
+        <c:if test="${order.orderSeen eq 2}">
+            <label>不可见</label>
+        </c:if>
+        <c:if test="${order.orderSeen ne 1 and order.orderSeen ne 2}">
+            <label>未定义</label>
+        </c:if>
+    </div>
     <div class="order-rows">
         <label>发票信息:</label>
         <c:if test="${order.orderInvoice.type eq 0}">
-            <input name="invoice" type="radio" checked="checked">
+            <%--            <input name="invoice" type="radio" checked="checked">--%>
             <label>不需要发票</label>
         </c:if>
         <c:if test="${order.orderInvoice.type eq 1}">
-            <input name="invoice" type="radio" checked="checked">
+            <%--            <input name="invoice" type="radio" checked="checked">--%>
             <label>增值税普通发票</label>
         </c:if>
         <c:if test="${order.orderInvoice.type eq 2}">
-            <input name="invoice" type="radio" checked="checked">
+            <%--            <input name="invoice" type="radio" checked="checked">--%>
             <label>增值税专用发票</label>
         </c:if>
         <c:if test="${order.orderInvoice.type eq null}">
-            <input name="invoice" type="radio" checked="checked">
+            <%--            <input name="invoice" type="radio" checked="checked">--%>
             <label>不需要发票</label>
         </c:if>
         <c:if test="${order.orderInvoice.type == 1}">
@@ -880,7 +1248,7 @@
         $.jBox.tip(msg, 'info', {timeout: 1000});
         setTimeout(function () {
             window.location.href = "${ctx}/order/detail?id=${order.orderID}"
-        },1000)
+        }, 1000)
     }
 </script>
  
@@ -971,7 +1339,7 @@
                                 'orderID': orderId,
                                 'balanceAccountsRemark': content
                             });
-                            window.location.href = "${ctx}/order/detail?id="+orderId;
+                            window.location.href = "${ctx}/order/detail?id=" + orderId;
                         }
                     }
                 });

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 838 - 647
src/main/webapp/WEB-INF/views/modules/order/orderForm.jsp


+ 12 - 0
src/main/webapp/WEB-INF/views/modules/product-new/multiPromotionForm.jsp

@@ -398,6 +398,18 @@
                onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
     </div>
 
+    <div class="control-group" id="discount">
+        <label>叠加优惠:</label>
+        <input type="radio" name="discount" value="1" ${cmPromotion.discount == null ? "checked" : cmPromotion.discount == "1"?"checked":""} />支持
+        <input type="radio" name="discount" value="2" ${cmPromotion.discount == "2" ? "checked" : ""} />不支持
+    </div>
+
+    <div class="control-group">
+        <label>活动可见度:</label>
+        <input type="radio" name="seen" value="1" ${cmPromotion.seen == null ? "checked" : cmPromotion.seen == "1"?"checked":""}/>对所有人可见(含协销)
+        <input type="radio" name="seen" value="2" ${cmPromotion.seen == "2" ? "checked" : ""}/>仅对机构可见(不含协销)
+    </div>
+
     <div class="control-group">
         <label style="display: inline">促销状态:</label>
         <label style="display: inline;color: ${cmPromotion.delFlag1 == null || cmPromotion.delFlag1 == '' ?"green":cmPromotion.delFlag1 == "0"?"red":cmPromotion.delFlag1 == "1"?"purple":cmPromotion.delFlag1 == "2"?"green":"orange"}" id="promotionStatus">${cmPromotion.delFlag1 == null?"进行中": cmPromotion.delFlag1 == "0"?"已关闭":cmPromotion.delFlag1 == "1"?"未开始":cmPromotion.delFlag1 == "2"?"进行中":"已结束"}</label>

+ 12 - 0
src/main/webapp/WEB-INF/views/modules/product-new/shopPromotionForm.jsp

@@ -395,6 +395,18 @@
                onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
     </div>
 
+    <div class="control-group" id="discount">
+        <label>叠加优惠:</label>
+        <input type="radio" name="discount" value="1" ${cmPromotion.discount == null ? "checked" : cmPromotion.discount == "1"?"checked":""} />支持
+        <input type="radio" name="discount" value="2" ${cmPromotion.discount == "2" ? "checked" : ""} />不支持
+    </div>
+
+    <div class="control-group">
+        <label>活动可见度:</label>
+        <input type="radio" name="seen" value="1" ${cmPromotion.seen == null ? "checked" : cmPromotion.seen == "1"?"checked":""}/>对所有人可见(含协销)
+        <input type="radio" name="seen" value="2" ${cmPromotion.seen == "2" ? "checked" : ""}/>仅对机构可见(不含协销)
+    </div>
+
     <div class="control-group">
         <label style="display: inline">促销状态:</label>
         <label style="display: inline;color: ${cmPromotion.delFlag1 == null || cmPromotion.delFlag1 == '' ?"green":cmPromotion.delFlag1 == "0"?"red":cmPromotion.delFlag1 == "1"?"purple":cmPromotion.delFlag1 == "2"?"green":"orange"}" id="promotionStatus">${cmPromotion.delFlag1 == null?"进行中":cmPromotion.delFlag1 == "0"?"已关闭":cmPromotion.delFlag1 == "1"?"未开始":cmPromotion.delFlag1 == "2"?"进行中":"已结束"}</label>

+ 22 - 3
src/main/webapp/WEB-INF/views/modules/product-new/singlePromotionForm.jsp

@@ -299,6 +299,13 @@
             return items;
         }
 
+        function checkModes(){
+            $("#discount").show();
+        }
+
+        function checkMode(){
+            $("#discount").hide();
+        }
     </script>
 </head>
 <body>
@@ -353,9 +360,9 @@
 
     <div class="control-group" id="promotionType">
         <label>促销方式:</label>
-        <input type="radio"  id="promotionType1" name="mode" value="1" ${cmPromotion.mode == null ? "checked" : cmPromotion.mode == "1"?"checked":""} />优惠价
-        <input type="radio"  id="promotionType2" name="mode" value="2" ${cmPromotion.mode == "2" ? "checked" : ""} />满减
-        <input type="radio" id="promotionType3"  name="mode" value="3" ${cmPromotion.mode == "3" ? "checked" : ""} />满赠
+        <input type="radio"  id="promotionType1" onclick="checkMode()" name="mode" value="1" ${cmPromotion.mode == null ? "checked" : cmPromotion.mode == "1"?"checked":""} />优惠价
+        <input type="radio"  id="promotionType2" onclick="checkModes()" name="mode" value="2" ${cmPromotion.mode == "2" ? "checked" : ""} />满减
+        <input type="radio" id="promotionType3"  onclick="checkModes()" name="mode" value="3" ${cmPromotion.mode == "3" ? "checked" : ""} />满赠
     </div>
 
     <div class="control-group">
@@ -432,6 +439,18 @@
                onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
     </div>
 
+    <div class="control-group" id="discount" style="display: ${cmPromotion.mode == null ? "none" : cmPromotion.mode == "1"?"none":""}">
+        <label>叠加优惠:</label>
+        <input type="radio" name="discount" value="1" ${cmPromotion.discount == null ? "checked" : cmPromotion.discount == "1"?"checked":""} />支持
+        <input type="radio" name="discount" value="2" ${cmPromotion.discount == "2" ? "checked" : ""} />不支持
+    </div>
+
+    <div class="control-group">
+        <label>活动可见度:</label>
+        <input type="radio" name="seen" value="1" ${cmPromotion.seen == null ? "checked" : cmPromotion.seen == "1"?"checked":""}/>对所有人可见(含协销)
+        <input type="radio" name="seen" value="2" ${cmPromotion.seen == "2" ? "checked" : ""}/>仅对机构可见(不含协销)
+    </div>
+
     <div class="control-group">
         <label style="display: inline" id="testStatus">促销状态:</label>
         <label style="display: inline;color: ${cmPromotion.delFlag1 == null || cmPromotion.delFlag1 == '' ?"green":cmPromotion.delFlag1 == "0"?"red":cmPromotion.delFlag1 == "1"?"purple":cmPromotion.delFlag1 == "2"?"green":"orange"}" id="promotionStatus" >${cmPromotion.delFlag1 == null || cmPromotion.delFlag1 == '' ?"进行中":cmPromotion.delFlag1 == "0"?"已关闭":cmPromotion.delFlag1 == "1"?"未开始":cmPromotion.delFlag1 == "2"?"进行中":"已结束"}</label>

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

@@ -17,7 +17,7 @@ var couponPrice = 0;
 var initFlag = true;
 var orderStatus = 0;
 
-$(function() {
+$(function () {
     /**  发票信息 start * */
         // var invoiceTitle=$("#orderInvoice\\.invoiceTitle").val();
         // if(invoiceTitle !='' && invoiceTitle !=null && invoiceTitle !='null'){
@@ -64,11 +64,11 @@ $(function() {
     }
 
     //单存在输入时候默认为个人发票类型
-    $("#orderInvoice\\.invoiceTitle").on('change', function() {
+    $("#orderInvoice\\.invoiceTitle").on('change', function () {
         $("#orderInvoice\\.type").val("1"); //优化发票修改
     });
 
-    $(":radio[name='normalTitle_r']").click(function() {
+    $(":radio[name='normalTitle_r']").click(function () {
         var index = $(":radio[name='normalTitle_r']").index($(this));
         $("#orderInvoice\\.corporationTaxNum").attr('value', '');
         $("#orderInvoice\\.corporationTaxNum").attr('name', '');
@@ -96,7 +96,7 @@ $(function() {
         }
     });
 
-    $(":radio[name='invoice']").click(function() {
+    $(":radio[name='invoice']").click(function () {
         var index = $(":radio[name='invoice']").index($(this));
         if (index == 1) { //选中第2个时,div显示
             $("#invoiceTable").hide();
@@ -125,7 +125,7 @@ $(function() {
     });
     /**  发票信息 end * */
 
-    $("body").on('change', '.shopNote', function() {
+    $("body").on('change', '.shopNote', function () {
         var self = $(this);
         var shopID = self.attr('data-shopid');
         var val = self.val();
@@ -133,8 +133,8 @@ $(function() {
     });
 
     /** 修改订单初始化 */
-    var orderId = $("#orderID").val()*1;
-    orderStatus = $("#orderStatus").val()*1;
+    var orderId = $("#orderID").val() * 1;
+    orderStatus = $("#orderStatus").val() * 1;
     if (orderId && orderId > 0) {
         var userId = $("#inputForm").find("[name*='bpOrderUserinfo.userId']").val();
         // 获取用户总优惠券
@@ -143,7 +143,7 @@ $(function() {
         $('#product_index').val(0);
         product_index = 0;
         var productList = [];
-        $('.productTable tbody tr:not(.gift)').each(function(index, element) {
+        $('.productTable tbody tr:not(.gift)').each(function (index, element) {
             var data = JSON.parse($(this).attr("data-value"));
             data.shopId = data.shopID ? data.shopID : data.shopId;
             data.productId = data.productID ? data.productID : data.productId;
@@ -169,7 +169,7 @@ $(function() {
                 data.shopId = data.shopID;
                 var tempId = data.productPromotion.promotionsId;
                 if (promotionsIds.indexOf(tempId) >= 0) {
-                    totalPromotions.forEach(function(item) {
+                    totalPromotions.forEach(function (item) {
                         if (item.id * 1 === tempId) {
                             for (var i = 0; i < item.promotionProducts.length; i++) {
                                 if (item.promotionProducts[i].productId == data.productId) {
@@ -199,24 +199,24 @@ $(function() {
             data.productPromotion = null;
             productList.push(data);
         });
-        $('.productTable tbody tr.gift').each(function(index, element) {
+        $('.productTable tbody tr.gift').each(function (index, element) {
             var present = JSON.parse($(this).attr("data-value"));
             present.shopId = present.shopID ? present.shopID : present.shopId;
             present.productId = present.productID ? present.productID : present.productId;
             if (present.productType == 1) {
-                productList.forEach(function(data) {
+                productList.forEach(function (data) {
                     if (present.productId == data.productId) {
                         data.presentNum = present.num;
                     }
                 });
             }
         });
-        $('.productTable').each(function(index, element) {
+        $('.productTable').each(function (index, element) {
             $(this).prev('.order-rows').remove();
             $(this).remove();
         });
         initFlag = false;
-        productList.forEach(function(data) {
+        productList.forEach(function (data) {
             setProductList(data);
         });
         setOrderFee(); //设置底部订单金额
@@ -242,7 +242,7 @@ function showClubSelect(iframe) {
             "确定": '1',
             "关闭": '-1'
         },
-        submit: function(v, h, f) {
+        submit: function (v, h, f) {
             //确定
             var $jboxFrame = top.$('#jbox-iframe');
             var $mainFrame = top.$('#mainFrame');
@@ -289,9 +289,9 @@ function setSingleSelect(items) {
     $("#inputForm").find("[name*='bpOrderUserinfo.city']").select2("val", info.city);
     $("#inputForm").find("[name*='bpOrderUserinfo.town']").select2("val", info.town);
     $("#inputForm").find("[name*='bpOrderUserinfo.name']").val(info.name);
-    $("#inputForm").find("[name*='bpOrderUserinfo.shouHuoRen']").val(info.linkMan1?info.linkMan1:info.linkMan);
-    $("#inputForm").find("[name*='bpOrderUserinfo.phonee']").val(info.contractPhone1?info.contractPhone1:info.contractPhone);
-    $("#inputForm").find("[name*='bpOrderUserinfo.mobile']").val(info.contractMobile1?info.contractMobile1:info.contractMobile);
+    $("#inputForm").find("[name*='bpOrderUserinfo.shouHuoRen']").val(info.linkMan1 ? info.linkMan1 : info.linkMan);
+    $("#inputForm").find("[name*='bpOrderUserinfo.phonee']").val(info.contractPhone1 ? info.contractPhone1 : info.contractPhone);
+    $("#inputForm").find("[name*='bpOrderUserinfo.mobile']").val(info.contractMobile1 ? info.contractMobile1 : info.contractMobile);
     $("#svipFlagLabel").text(1 == info.svipFlag ? '(超级会员)' : '');
     $("#availableBalance").html(info.ableUserMoney);
 
@@ -308,7 +308,7 @@ function setSingleSelect(items) {
 
 function getUserCoupons(userId) {
     totalCoupons = [];
-    $.get($("#ctx").val() + "/order/clubCouponList?userId="+userId, function(data) {
+    $.get($("#ctx").val() + "/order/clubCouponList?userId=" + userId, function (data) {
         if (data.code * 1 === 0) {
             totalCoupons = data.couponList;
             // 展示可选优惠券列表
@@ -316,24 +316,28 @@ function getUserCoupons(userId) {
         }
     })
 }
+
 /************************添加会所 end**********************************************************/
 
 // 兑换优惠券
-$("#redeemCoupons").on("click",  function(){
+$("#redeemCoupons").on("click", function () {
     var userId = $("#inputForm").find("[name*='bpOrderUserinfo.userId']").val();
-    if (userId && userId*1 > 0) {
+    if (userId && userId * 1 > 0) {
         var html = '<div style="text-align:center;padding-top:12px;"><input id="couponsCode" name="couponsCode" type="text" maxlength="16" placeholder="请输入16位兑换码"></div>';
         var submit = function (v, h, f) {
             if (f.couponsCode == '' || isNaN(f.couponsCode)) {
-                $.jBox.tip("请输入兑换码!", 'error', { focusId: "couponsCode" });
+                $.jBox.tip("请输入兑换码!", 'error', {focusId: "couponsCode"});
             }
             var bool = new RegExp("^[A-Za-z0-9]{16}$").test(f.couponsCode);
             if (!bool) {
                 // 16位数字和字母
-                $.jBox.tip("请输入正确的兑换码!", 'error', { focusId: "couponsCode" });
-            }else{
-                $.post($("#ctx").val() + "/coupon/cmCouponClub/redeem", {'redemptionCode': f.couponsCode, 'userId': userId}, function (data) {
-                    if (0 === data.code*1) {
+                $.jBox.tip("请输入正确的兑换码!", 'error', {focusId: "couponsCode"});
+            } else {
+                $.post($("#ctx").val() + "/coupon/cmCouponClub/redeem", {
+                    'redemptionCode': f.couponsCode,
+                    'userId': userId
+                }, function (data) {
+                    if (0 === data.code * 1) {
                         $.jBox.tip(data.msg, 'info');
                         // 获取用户总优惠券
                         getUserCoupons(userId);
@@ -343,7 +347,7 @@ $("#redeemCoupons").on("click",  function(){
                 }, "JSON");
             }
         };
-        $.jBox(html, { title: "兑换优惠券", buttons: { '立即兑换': true }, submit: submit });
+        $.jBox(html, {title: "兑换优惠券", buttons: {'立即兑换': true}, submit: submit});
     } else {
         alertx('请您先选择会所!');
     }
@@ -380,7 +384,7 @@ function editShop(obj) {
             },
             //                    buttons:{"关闭":true},
             bottomText: "设置商品",
-            submit: function(v, h, f) {
+            submit: function (v, h, f) {
                 if (v == "ok") {
                     var $jboxFrame = $('#jbox-iframe');
                     var items = $jboxFrame[0].contentWindow.getCheckedItems();
@@ -395,34 +399,34 @@ function editShop(obj) {
                     return true;
                 }
             },
-            loaded: function(h) {
+            loaded: function (h) {
                 //$(".jbox-content", top.document).css("overflow-y","hidden");
             }
         });
 }
 
 // 展示可选优惠券列表
-function getShownCouponList(){
+function getShownCouponList() {
     selectCoupons = [];
     var couponProductIds = [];
     var couponProductList = [];
-    $('.productTable tbody tr:not(.gift)').each(function(index, element) {
+    $('.productTable tbody tr:not(.gift)').each(function (index, element) {
         var data = JSON.parse($(this).attr("data-value"));
         couponProductList.push(data);
         couponProductIds.push(data.productId);
     });
-    totalCoupons.forEach(function(coupon){
+    totalCoupons.forEach(function (coupon) {
         var totalAmount = 0;
-        var couponType = coupon.couponType*1;
-        couponProductList.forEach(function(item){
+        var couponType = coupon.couponType * 1;
+        couponProductList.forEach(function (item) {
             var productPrice = item.totalFee * 1;
             if (couponType === 0) {
-                if (coupon.productType*1 === 1) {
+                if (coupon.productType * 1 === 1) {
                     //活动券-全商城商品
                     totalAmount += productPrice;
-                } else if (coupon.productType*1 === 2) {
+                } else if (coupon.productType * 1 === 2) {
                     //活动券-指定商品
-                    if (coupon.productIdList.length > 0 && coupon.productIdList.indexOf(item.productId*1) >= 0) {
+                    if (coupon.productIdList.length > 0 && coupon.productIdList.indexOf(item.productId * 1) >= 0) {
                         totalAmount += productPrice;
                     }
                 }
@@ -450,24 +454,24 @@ function getShownCouponList(){
 
 // 设置页面显示
 function setPageCoupon() {
-    var clubCouponId = $("#clubCouponId").val()*1;
-    var html = '<li><label><input type="radio" name="clubCouponId" value="0"><span class="couponDesc none">不使用优惠券</span></label></li>';
-    selectCoupons.forEach(function(item){
+    var clubCouponId = $("#clubCouponId").val() * 1;
+    var html = '<li><label><input type="radio" name="clubCouponId" id="bsy" value="0"><span class="couponDesc none">不使用优惠券</span></label></li>';
+    selectCoupons.forEach(function (item) {
         var checked = '';
         var redemptionCode = '';
         if (clubCouponId === item.clubCouponId) {
             checked = 'checked="checked"';
         }
         if (!isNaN(item.redemptionCode)) {
-            redemptionCode = '<span>兑换码:'+item.redemptionCode+'</span>';
+            redemptionCode = '<span>兑换码:' + item.redemptionCode + '</span>';
         }
         html += '<li><label>';
-        html += '       <input type="radio" name="clubCouponId" value="'+item.clubCouponId +'" '+checked+'>';
+        html += '       <input type="radio" name="clubCouponId" value="' + item.clubCouponId + '" ' + checked + '>';
         html += '       <span class="couponDesc">';
-        html += '            <span>'+item.couponName+'</span>';
+        html += '            <span>' + item.couponName + '</span>';
         html += redemptionCode;
-        html += '            <span>'+item.couponDesc+'</span>';
-        html += '            <span>有效期:'+item.receiveDate+' - '+item.useEndDate+'</span>';
+        html += '            <span>' + item.couponDesc + '</span>';
+        html += '            <span>有效期:' + item.startDate + ' - ' + item.endDate + '</span>';
         html += '</span></label></li>';
     });
     $("#couponBox").find(".couponContent").html(html);
@@ -477,11 +481,11 @@ function setPageCoupon() {
 }
 
 // 勾选优惠券重新计算总价
-$("#couponBox").on("change", "input[name=clubCouponId]", function(){
+$("#couponBox").on("change", "input[name=clubCouponId]", function () {
     couponPrice = 0;
-    var clubCouponId = $(this).val()*1;
-    selectCoupons.forEach(function(item){
-        if(item.clubCouponId*1 === clubCouponId) {
+    var clubCouponId = $(this).val() * 1;
+    selectCoupons.forEach(function (item) {
+        if (item.clubCouponId * 1 === clubCouponId) {
             couponPrice = item.couponAmount;
             $("#clubCouponId").val(clubCouponId);
             $("#couponAmount").val(couponPrice);
@@ -511,7 +515,7 @@ function orderSecondHandEditShop(obj) {
                 "关闭": true
             },
             bottomText: "设置商品",
-            submit: function(v, h, f) {
+            submit: function (v, h, f) {
                 if (v == "ok") {
                     var $jboxFrame = $('#jbox-iframe');
                     var items = $jboxFrame[0].contentWindow.getCheckedItems();
@@ -525,20 +529,21 @@ function orderSecondHandEditShop(obj) {
                     return true;
                 }
             },
-            loaded: function(h) {}
+            loaded: function (h) {
+            }
         });
 }
 
 // 修改商品的时候统计下面的订单商品金额
 function setShopOrderFee(shopId) {
     var totalFee = 0;
-    $($('#pTable_' + shopId)).find('.totalFee').each(function(index, element) {
+    $($('#pTable_' + shopId)).find('.totalFee').each(function (index, element) {
         totalFee += Number($(this).html());
     });
-    totalPromotions.forEach(function(item) {
+    totalPromotions.forEach(function (item) {
         if (item.shopId == shopId && item.type == 3 && item.mode == 2) {
             var touchPrice = 0;
-            item.promotionProducts.forEach(function(product) { //计算促销包含税费
+            item.promotionProducts.forEach(function (product) { //计算促销包含税费
                 touchPrice += (product.number * product.price + product.totalTax * 1);
             });
             if (touchPrice >= item.touchPrice) {
@@ -556,24 +561,24 @@ function deleteShop(obj) {
     var $table = $tr.parents('table');
     // 协销赠品
     var productId = $tr.attr("id").split("_")[1];
-    $('.productTable tbody tr.gift_' + productId).each(function(index, element) {
+    $('.productTable tbody tr.gift_' + productId).each(function (index, element) {
         $(this).remove();
     });
     // 促销
     var promotionsId = $tr.find('.tag').attr("data-id");
     var thisTouchPrice = 0;
-    totalPromotions.forEach(function(item) {
+    totalPromotions.forEach(function (item) {
         if (item.id == promotionsId) {
             for (var i = 0; i < item.promotionProducts.length; i++) {
                 if (item.promotionProducts[i].productId == productId) {
                     item.promotionProducts.splice(i--, 1);
                 }
             }
-            item.promotionProducts.forEach(function(p) {
+            item.promotionProducts.forEach(function (p) {
                 thisTouchPrice += p.number * p.price;
             });
             if (thisTouchPrice < item.touchPrice) {
-                $('.productTable tbody tr.promotion_' + promotionsId).each(function(index, element) {
+                $('.productTable tbody tr.promotion_' + promotionsId).each(function (index, element) {
                     $(this).remove();
                 });
             }
@@ -597,12 +602,12 @@ function resetProductList(setData) {
     var productList = [];
     var productIdList = [];
     //var if (promotionsIds.indexOf(tempId)>=0) {
-    $('.productTable tbody tr:not(.gift)').each(function(index, element) {
+    $('.productTable tbody tr:not(.gift)').each(function (index, element) {
         var data = JSON.parse($(this).attr("data-value"));
         productList.push(data);
         productIdList.push(data.productId);
     });
-    $('.productTable').each(function(index, element) {
+    $('.productTable').each(function (index, element) {
         $(this).prev('.order-rows').remove();
         $(this).remove();
     });
@@ -610,13 +615,13 @@ function resetProductList(setData) {
     totalPromotions = [];
     giftPromotionsIds = [];
     if (!setData) { //删除
-        productList.forEach(function(data) {
+        productList.forEach(function (data) {
             setProductList(data, false);
         });
     } else {
         if (productIdList.indexOf(setData.productId) >= 0) {
             //设置
-            productList.forEach(function(data) {
+            productList.forEach(function (data) {
                 if (setData.productId == data.productId) {
                     setProductList(setData, false);
                 } else {
@@ -625,7 +630,7 @@ function resetProductList(setData) {
             });
         } else {
             //新增
-            productList.forEach(function(data) {
+            productList.forEach(function (data) {
                 setProductList(data, false);
             });
             setProductList(setData, false);
@@ -684,7 +689,7 @@ function editShopProduct(obj) {
                 "关闭": true
             },
             bottomText: "设置商品",
-            submit: function(v, h, f) {
+            submit: function (v, h, f) {
                 if (v == "ok") {
                     var $jboxFrame = $('#jbox-iframe');
                     var items = $jboxFrame[0].contentWindow.getCheckedItems();
@@ -697,7 +702,8 @@ function editShopProduct(obj) {
                     return true;
                 }
             },
-            loaded: function(h) {}
+            loaded: function (h) {
+            }
         });
 }
 
@@ -716,7 +722,7 @@ function showShopSelect(iframe) {
             "确定": '1',
             "关闭": '-1'
         },
-        submit: function(v, h, f) {
+        submit: function (v, h, f) {
             //确定
             var $jboxFrame = top.$('#jbox-iframe');
             var $mainFrame = top.$('#mainFrame');
@@ -736,6 +742,7 @@ function showShopSelect(iframe) {
         },
     });
 }
+
 // 展示优惠券详情
 function showCouponDetail(userId, productId) {
     var url = ctx + "/coupon/cmCoupon/productDetails?userId=" + userId + "&productId=" + productId;
@@ -767,7 +774,7 @@ function showSencondHandSelect(iframe) {
             "确定": '1',
             "关闭": '-1'
         },
-        submit: function(v, h, f) {
+        submit: function (v, h, f) {
             //确定
             var $jboxFrame = top.$('#jbox-iframe');
             var $mainFrame = top.$('#mainFrame');
@@ -799,7 +806,7 @@ function showSencondHandSelect(iframe) {
 function setProductList(data) {
     console.log("设置" + JSON.stringify(data));
     var userId = $("#inputForm").find("[name*='bpOrderUserinfo.userId']").val();
-    var orderStatus = $("#orderStatus").val() ? $("#orderStatus").val()*1 : 0;
+    var orderStatus = $("#orderStatus").val() ? $("#orderStatus").val() * 1 : 0;
     data.productType = 0;
     var shopFee = data.shopFee;
     var cmPromotion = '';
@@ -818,7 +825,7 @@ function setProductList(data) {
                 totalTax: data.totalAddedValueTax
             };
             if (promotionsIds.indexOf(tempId) >= 0) {
-                totalPromotions.forEach(function(item) {
+                totalPromotions.forEach(function (item) {
                     if (item.id * 1 === tempId) {
                         for (var i = 0; i < item.promotionProducts.length; i++) {
                             if (item.promotionProducts[i].productId == data.productId) {
@@ -873,8 +880,8 @@ function setProductList(data) {
     }
 
     var cmCouponBtn = '---';
-    if (data.couponsLogo*1 === 2) {
-        cmCouponBtn = '<a href="javascript:;" onclick="showCouponDetail('+ userId +','+ data.productId +')">查看</a>';
+    if (data.couponsLogo * 1 === 2) {
+        cmCouponBtn = '<a href="javascript:;" onclick="showCouponDetail(' + userId + ',' + data.productId + ')">查看</a>';
     }
     var str =
         "<tr id='product_" + data.productId + "' data-value='" + JSON.stringify(data) + "' data-index='" +
@@ -886,17 +893,17 @@ function setProductList(data) {
         "<td class='fix-width'>" + data.name + "</td><td hidden></td>" +
         (data.productCategory == 2 ? "" : ("<td>" + data.shopName + "</td>")) +
         "<td>" + data.num + (data.presentNum > 0 ? "(" + data.presentNum + ")" : "") + "</td>" +
-        (data.svipPriceFlag == 1?"<td>"+data.discountPrice:
-        (data.discount * 1 === 100 && data.cmPromotion && data.cmPromotion.mode == 1 ? ("<td><del>" + data.price +
-            "</del>") : ("<td>" + data.price))) +
-        ((data.svipPriceFlag == 1 || (data.includedTax != null && data.includedTax != '' && data.includedTax != 2))?"<label style='color: red'>(":"")+
-        (data.svipPriceFlag == 1?"超级会员价":"")+
-        ((data.svipPriceFlag == 1 && (data.includedTax != null && data.includedTax != '' && data.includedTax != 2))?",":"")+
+        (data.svipPriceFlag == 1 ? "<td>" + data.discountPrice :
+            (data.discount * 1 === 100 && data.cmPromotion && data.cmPromotion.mode == 1 ? ("<td><del>" + data.price +
+                "</del>") : ("<td>" + data.price))) +
+        ((data.svipPriceFlag == 1 || (data.includedTax != null && data.includedTax != '' && data.includedTax != 2)) ? "<label style='color: red'>(" : "") +
+        (data.svipPriceFlag == 1 ? "超级会员价" : "") +
+        ((data.svipPriceFlag == 1 && (data.includedTax != null && data.includedTax != '' && data.includedTax != 2)) ? "," : "") +
         (data.includedTax == 1 ? "含税" : data.includedTax == 0 && (data
             .invoiceType == 1 || data.invoiceType == 2) ? "不含税-能开票" : data
             .includedTax != '' && data.includedTax == 0 && data.invoiceType == 3 ?
             "不含税-不能开票" : "") +
-        ((data.svipPriceFlag == 1 || (data.includedTax != null && data.includedTax != '' && data.includedTax != 2))?")</label>":"")+
+        ((data.svipPriceFlag == 1 || (data.includedTax != null && data.includedTax != '' && data.includedTax != 2)) ? ")</label>" : "") +
         "</td>" +
         "<td>" + data.discount + "</td>" +
         (data.discount * 1 === 100 && data.cmPromotion && data.cmPromotion.mode == 1 ? ("<td><del>" + data
@@ -915,8 +922,8 @@ function setProductList(data) {
         ((data.productCategory == 2) ? "" : "<td>" + cmPromotion + "</td>") +
         ((data.productCategory == 2) ? "" : "<td>" + cmCouponBtn + "</td>") +
         "<td>" + (orderStatus != 0 ? "" : (data.productCategory == 2) ?
-            "<a href='javascript:void(0);' onclick='orderSecondHandEditShop($(this))'>设置</a>&nbsp;&nbsp;<a href='javascript:void(0);' onclick='deleteShopProduct($(this))'>删除商品</a>" :
-            "<a href='javascript:void(0);' onclick='editShopProduct($(this))'>设置</a>&nbsp;&nbsp;<a href='javascript:void(0);' onclick='deleteShopProduct($(this))'>删除商品</a>"
+                "<a href='javascript:void(0);' onclick='orderSecondHandEditShop($(this))'>设置</a>&nbsp;&nbsp;<a href='javascript:void(0);' onclick='deleteShopProduct($(this))'>删除商品</a>" :
+                "<a href='javascript:void(0);' onclick='editShopProduct($(this))'>设置</a>&nbsp;&nbsp;<a href='javascript:void(0);' onclick='deleteShopProduct($(this))'>删除商品</a>"
         ) +
         "</td>" +
         "</tr>";
@@ -927,7 +934,7 @@ function appendProductList(str, data, cmPromotion) {
     //把表中存在的删除
     var removeBeforeSoon = false; //是这一次移除
     var removeEle;
-    $('.productTable tbody tr:not(.gift)').each(function(index, element) {
+    $('.productTable tbody tr:not(.gift)').each(function (index, element) {
         if ($(this).find("td:nth-child(1)").html() == data.productId) {
             removeEle = $(this).parent();
             $(this).remove();
@@ -999,7 +1006,7 @@ function setGiftHtmlList(data, cmPromotion) {
     console.log("设置赠品" + JSON.stringify(data));
     if (data.presentNum > 0) {
         // 已经添加的,重新添加
-        $('.productTable tbody tr.gift_' + data.productId).each(function(index, element) {
+        $('.productTable tbody tr.gift_' + data.productId).each(function (index, element) {
             $(this).remove();
         });
         var present = JSON.parse(JSON.stringify(data));
@@ -1035,17 +1042,18 @@ function setGiftHtmlList(data, cmPromotion) {
     }
     if (data.cmPromotion && data.cmPromotion.mode == 3) {
         var thisTouchPrice = 0;
-        totalPromotions.forEach(function(item) {
+        totalPromotions.forEach(function (item) {
             if (data.cmPromotion.id == item.id) {
-                item.promotionProducts.forEach(function(p) {
+                item.promotionProducts.forEach(function (p) {
                     thisTouchPrice += (p.number * p.price + p.totalTax * 1);
                 });
             }
         });
+        //本单总价>=满赠条件金额
         if (thisTouchPrice >= data.cmPromotion.touchPrice) {
             if (giftPromotionsIds.indexOf(data.cmPromotion.id) < 0) {
                 // 已经添加的,重新添加
-                $('.productTable tbody tr.promotion_' + cmPromotion.id).each(function(index, element) {
+                $('.productTable tbody tr.promotion_' + cmPromotion.id).each(function (index, element) {
                     $(this).remove();
                 });
                 // 记录赠品促销
@@ -1054,9 +1062,9 @@ function setGiftHtmlList(data, cmPromotion) {
                 var getGiftPath = $('#ctx').val() + '/product/cmPromotions/getGifts';
                 $.getJSON(getGiftPath, {
                     id: data.cmPromotion.id
-                }, function(res) {
+                }, function (res) {
                     if (res && res.length > 0) {
-                        res.forEach(function(gift) {
+                        res.forEach(function (gift) {
                             gift.productType = 2;
                             gift.price = 0;
                             gift.discountPrice = 0;
@@ -1066,9 +1074,20 @@ function setGiftHtmlList(data, cmPromotion) {
                             if ($("#product_promotion_" + gift.productId).length > 0) {
                                 var pageGift = JSON.parse($("#product_promotion_" + gift.productId)
                                     .attr("data-value"));
-                                gift.num = gift.num * 1 + pageGift.num * 1;
+                                if (gift.discounts * 1 === 1) {
+                                    var b = Math.floor(thisTouchPrice / data.cmPromotion.touchPrice);
+                                    gift.num = gift.num * 1 * b + pageGift.num * 1;
+                                } else {
+                                    gift.num = gift.num * 1 + pageGift.num * 1;
+                                }
                                 $("#product_promotion_" + gift.productId).remove();
                             }
+                            if (gift.discounts * 1 === 1) {
+                                var b = Math.floor(thisTouchPrice / data.cmPromotion.touchPrice);
+                                gift.num = gift.num * 1 * b;
+                            } else {
+                                gift.num = gift.num * 1;
+                            }
                             var giftStr = "<tr id='product_promotion_" + gift.productId +
                                 "' class='gift promotions promotion_" + data.cmPromotion.id +
                                 "' data-value='" + JSON.stringify(gift) + "' gift-index='" +
@@ -1078,8 +1097,8 @@ function setGiftHtmlList(data, cmPromotion) {
                                 "].enabledStatus' id='orderProduct" + product_index +
                                 ".enabledStatus' value='" + JSON.stringify(gift) + "'/>" + gift.shopId +
                                 "</td>" +
-                                "<td hidden>" + gift.shopName + "</td>" +
                                 "<td class='fix-width'><i class='red'>促销赠品:</i>" + gift.name +
+                                "<td>" + gift.shopName + "</td>" +
                                 "</td><td hidden></td>" +
                                 "<td>" + gift.num + "</td>" +
                                 "<td>0</td>" +
@@ -1117,6 +1136,7 @@ function appendGiftsList(gift, giftStr, cmPromotion) {
     // 重新设置底部订单金额
     setOrderFee();
 }
+
 /**
  * 设置商品列表(二手商品)
  * @param items
@@ -1128,7 +1148,7 @@ function setSeondHandProductList(data) {
     //把表中存在的删除
     var removeBeforeSoon = false; //是这一次移除
     var removeEle;
-    $('.productTable tbody tr').each(function(index, element) {
+    $('.productTable tbody tr').each(function (index, element) {
         if ($(this).find("td:nth-child(1)").html() == productID) {
             removeEle = $(this).parent();
             $(this).remove();
@@ -1217,7 +1237,6 @@ function setSeondHandProductList(data) {
 }
 
 
-
 //设置订单金额信息
 function setOrderFee() { //不考虑经理折扣、运费,此时 商品总金额=订单总额=应付总额
     var productTotalFee = 0, //商品总金额
@@ -1227,9 +1246,9 @@ function setOrderFee() { //不考虑经理折扣、运费,此时 商品总金
         orderTotalFee = 0, //订单总额
         reducedPrice = 0, //促销满减
         payTotalFee = 0, //应付总额
-        svipFullReduction=0;   //超级会员优惠
-    var couponPrice = $("#couponAmount").val() ? $("#couponAmount").val()*1 : 0;
-    $('.productTable tbody tr:not(.gift)').each(function(index, element) {
+        svipFullReduction = 0;   //超级会员优惠
+    var couponPrice = $("#couponAmount").val() ? $("#couponAmount").val() * 1 : 0;
+    $('.productTable tbody tr:not(.gift)').each(function (index, element) {
         var obj = JSON.parse($(this).attr("data-value"));
         productTotalFee = ((Number(productTotalFee) * 100 + Number(obj.num * obj.price) * 100 + Number(obj
             .totalAddedValueTax) * 100) / 100 + Number(obj.svipTaxReduction)).toFixed(2);
@@ -1239,20 +1258,27 @@ function setOrderFee() { //不考虑经理折扣、运费,此时 商品总金
         payTotalFee = ((Number(payTotalFee) * 100 + Number(obj.totalFee) * 100) / 100).toFixed(2);
         svipFullReduction = ((Number(svipFullReduction) * 100 + Number(obj.svipReduction) * obj.num * 100) / 100).toFixed(2);
     });
-    $('.productTable tbody tr.promotions').each(function(index, element) {
+    $('.productTable tbody tr.promotions').each(function (index, element) {
         var obj = JSON.parse($(this).attr("data-value"));
         giftCount = Number(giftCount) + Number(obj.num);
     });
     // 计算促销折扣
-    totalPromotions.forEach(function(item) {
+    totalPromotions.forEach(function (item) {
+        console.log(totalPromotions);
         if (item.mode == 2) {
             var touchPrice = 0;
-            item.promotionProducts.forEach(function(product) {
+            item.promotionProducts.forEach(function (product) {
                 touchPrice += (product.number * product.price + product.totalTax * 1);
             });
             if (touchPrice >= item.touchPrice) {
-                reducedPrice += item.reducedPrice;
-                payTotalFee -= item.reducedPrice;
+                if (item.discount * 1 === 1) {
+                    var b = Math.floor(touchPrice/item.touchPrice);
+                    reducedPrice += (b * item.reducedPrice);
+                    payTotalFee -= reducedPrice;
+                } else {
+                    reducedPrice += item.reducedPrice;
+                    payTotalFee -= item.reducedPrice;
+                }
             }
         }
     });
@@ -1262,8 +1288,8 @@ function setOrderFee() { //不考虑经理折扣、运费,此时 商品总金
         payTotalFee -= couponPrice;
     }
     $(".productTotalFee").text((productTotalFee * 1).toFixed(2));
-    $(".promotionFullReduction").text((reducedPrice*1).toFixed(2));
-    $(".couponPrice").text((couponPrice*1).toFixed(2));
+    $(".promotionFullReduction").text((reducedPrice * 1).toFixed(2));
+    $(".couponPrice").text((couponPrice * 1).toFixed(2));
     $(".productCount").text(productCount);
     $(".presentCount").text(presentCount + giftCount);
     $(".presentCount1").text(presentCount + giftCount);
@@ -1274,12 +1300,10 @@ function setOrderFee() { //不考虑经理折扣、运费,此时 商品总金
     $(".svipFullReduction").text(svipFullReduction);
     $("#svipFullReduction").val(svipFullReduction);
     $("#discount").val('0.00');
-
     setProductTotalFee(); //重新设置经理折扣
 }
 
 
-
 // 修改数量
 function changenum(index) {
     var $num = $("#num" + index);
@@ -1287,7 +1311,7 @@ function changenum(index) {
     var $checkItem = $("#check-item" + index);
     var orderProductStr = $($checkItem).val();
     var obj = JSON.parse(orderProductStr);
-    if (numVal != null && numVal != "" && typeof(numVal) != "undefined") {
+    if (numVal != null && numVal != "" && typeof (numVal) != "undefined") {
         if (parseInt(numVal) + "" != numVal || parseInt(numVal) < 1) {
             alertx("数量必须大于0,并且是一个整数");
             $num.val(obj["num"]);
@@ -1304,11 +1328,12 @@ function changenum(index) {
         alertx("您输入的数量有误,请重新输入");
     }
 }
+
 //加减数量
 function presentNum(index, type) {
     var $num = $("#num" + index);
     var numVal = $num.val();
-    if (numVal != null && numVal != "" && typeof(numVal) != "undefined") {
+    if (numVal != null && numVal != "" && typeof (numVal) != "undefined") {
         if (type == 'del') {
             numVal = parseInt(numVal) - 1;
         } else if (type == 'add') {
@@ -1458,7 +1483,7 @@ function taxRateVal(index) {
     var totalNumVal = numVal * 1 + presentNum * 1; //统计赠品和购买商品数量
     var discountPrice = $("#discountPrice" + index).val(); //折后单价
     var $checkItem = eval('(' + $("#check-item" + index).val() + ')');
-    if ($checkItem["name"] == '' || $checkItem["name"] == null || $checkItem["name"] == 'null' || typeof($checkItem[
+    if ($checkItem["name"] == '' || $checkItem["name"] == null || $checkItem["name"] == 'null' || typeof ($checkItem[
         "name"]) == "undefined") {
         $checkItem["name"] = $checkItem.purchaseProductName + "";
     }
@@ -1568,7 +1593,7 @@ function taxRateVal(index) {
         $checkItem["costPrice"] = costPrice + ""; //重新设置成本
         $checkItem["svipReduction"] = svipReduction + ""; //重新设置超级会员优惠
         $("#svipReduction0").val(svipReduction);
-        $checkItem["svipTaxReduction"] = svipTaxReduction +""; //重新设置超级会员税费优惠
+        $checkItem["svipTaxReduction"] = svipTaxReduction + ""; //重新设置超级会员税费优惠
         $("#svipTaxReduction").val(svipTaxReduction);
         // console.log("data" + index + ":" + JSON.stringify($checkItem));
         $("#check-item" + index).val(JSON.stringify($checkItem));
@@ -1673,7 +1698,7 @@ function taxRateVal(index) {
             }
             $checkItem["svipReduction"] = svipReduction + ""; //重新设置超级会员优惠
             $("#svipReduction0").val(svipReduction);
-            $checkItem["svipTaxReduction"] = svipTaxReduction +""; //重新设置超级会员税费优惠
+            $checkItem["svipTaxReduction"] = svipTaxReduction + ""; //重新设置超级会员税费优惠
             $("#svipTaxReduction").val(svipTaxReduction);
             // console.log("data" + index + ":" + JSON.stringify($checkItem));
             $("#check-item" + index).val(JSON.stringify($checkItem));
@@ -1786,7 +1811,7 @@ function taxRateVal(index) {
                 }
                 $checkItem["svipReduction"] = svipReduction + ""; //重新设置超级会员优惠
                 $("#svipReduction0").val(svipReduction);
-                $checkItem["svipTaxReduction"] = svipTaxReduction +""; //重新设置超级会员税费优惠
+                $checkItem["svipTaxReduction"] = svipTaxReduction + ""; //重新设置超级会员税费优惠
                 $("#svipTaxReduction").val(svipTaxReduction);
 
                 $("#addedValueTax" + index).val(addedValueTax);
@@ -1934,6 +1959,7 @@ function buyAgain(i) {
     }
 
 }
+
 // 添加第三方应付商金额
 function otherFee(i) {
     var $otherFee = $("#otherFee1" + i).val();
@@ -1949,6 +1975,7 @@ function otherFee(i) {
         $("#otherFee1" + i).val($checkItem.otherFee1);
     }
 }
+
 // 添加采美应付金额
 function cmFee(i) {
     var discountPrice = $("#discountPrice" + i).val(); //折后单价
@@ -1983,7 +2010,7 @@ function setProductTotalFee() {
     if (isNaN(discount)) {
         discount = Number($("#discountFee").val());
     }
-    if ($('.productTable').length == 0){
+    if ($('.productTable').length == 0) {
         // 非添加订单页面
         $("#discount").val('0.00');
         $(".payableAmount").text(0);
@@ -2020,15 +2047,21 @@ function setProductTotalFee() {
     }
     payTotalFee = (Number(payTotalFee) + freight).toFixed(2);
     // 计算促销折扣
-    totalPromotions.forEach(function(item) {
+    totalPromotions.forEach(function (item) {
         if (item.mode == 2) {
             var touchPrice = 0;
-            item.promotionProducts.forEach(function(product) {
+            item.promotionProducts.forEach(function (product) {
                 touchPrice += (product.number * product.price + product.totalTax * 1);
             });
             if (touchPrice >= item.touchPrice) {
-                reducedPrice += item.reducedPrice;
-                payTotalFee -= item.reducedPrice;
+                if (item.discount * 1 === 1) {
+                    var b = Math.floor(touchPrice/item.touchPrice);
+                    reducedPrice += (b * item.reducedPrice);
+                    payTotalFee -= reducedPrice;
+                } else {
+                    reducedPrice += item.reducedPrice;
+                    payTotalFee -= item.reducedPrice;
+                }
             }
         }
     });
@@ -2058,7 +2091,7 @@ function setProductTotalFee() {
         balancePayFee = 0.00;
     }
 
-    trs.each(function(index, element) {
+    trs.each(function (index, element) {
         var obj = JSON.parse($(this).attr("data-value"));
 
         var _taxRate = Number(obj.taxRate); //税率
@@ -2103,7 +2136,7 @@ function setProductTotalFee() {
         obj["cmFee"] = _cmFee + "";
         obj["shouldPayFee"] = _payTotalFee + "";
         obj["presentNum"] = obj.presentNum + "";
-        if (obj["name"] == '' || obj["name"] == null || obj["name"] == 'null' || typeof(obj["name"]) ==
+        if (obj["name"] == '' || obj["name"] == null || obj["name"] == 'null' || typeof (obj["name"]) ==
             "undefined") {
             obj["name"] = obj.purchaseProductName + "";
         }
@@ -2152,7 +2185,7 @@ function showPromotionDetail(iframe, title) {
         buttons: {
             "关闭": '-1'
         },
-        submit: function(v, h, f) {
+        submit: function (v, h, f) {
             //确定
             var $jboxFrame = top.$('#jbox-iframe');
             var $mainFrame = top.$('#mainFrame');
@@ -2183,8 +2216,35 @@ function updateRebateFlag() {
     var rebateFlag = $("#rebateCheckBox").is(':checked');
     if (rebateFlag) {
         $("#rebateFlag").val(1);
+        //选中返佣订单后不可用优惠券
+        // $("#couponBox").find("input[name=clubCouponId]").prop('checked', 'checked');
+        $("#couponBox").find("input[name=clubCouponId]").prop('checked', '');
+        $("#couponBox").find("input[name=clubCouponId]").attr("disabled", true);
+        $("#couponBox").find("#bsy").prop('checked', 'checked');
+        $("#freePostFlag").attr("value", "-1");
+        $("#freeDesc").find(".select2-chosen").text("到付");
+        $("#useBalancePayFee").prop('checked', '');
+        setFreight();
+        $("#freePostFlag").attr("disabled", true);
+        $("#useBalancePayFee").attr("disabled", true);
+        $("#couponAmount").val(0);
+        $("#seen").find("#orderSeen2").prop('checked', 'checked');
+        setOrderFee();
     } else {
         $("#rebateFlag").val(0);
+        // $("#couponBox").find("input[name=clubCouponId]").prop('checked', '');
+        $("#couponBox").find("input[name=clubCouponId]").prop('checked', '');
+        $("#couponBox").find("input[name=clubCouponId]").attr("disabled", false);
+        $("#freePostFlag").attr("value", "0");
+        $("#freeDesc").find(".select2-chosen").text("包邮");
+        $("#useBalancePayFee").prop('checked', '');
+        setFreight();
+        $("#freePostFlag").attr("disabled", false);
+        $("#useBalancePayFee").attr("disabled", false);
+        $("#couponAmount").val(0);
+        $("#seen").find("#orderSeen1").prop('checked', 'checked');
+        // 重新计算总价
+        setOrderFee();
     }
 }
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác