Selaa lähdekoodia

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

huangzhiguo 1 vuosi sitten
vanhempi
commit
73d991de8b

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

@@ -183,6 +183,7 @@ public class CmCouponController extends BaseController {
      */
     @RequestMapping(value = "toAddProduct")
     public String toAddProduct(Product product, Model model, HttpServletRequest request, HttpServletResponse response) {
+        //todo 当前版本限制死为仅选取综合供应商的商品
         Page<Product> page = cmCouponService.findProductList(new Page<Product>(request, response), product);
         model.addAttribute("page", page);
         model.addAttribute("productIds", product.getProductIds());

+ 7 - 1
src/main/java/com/caimei/modules/product/service/CmPromotionService.java

@@ -49,7 +49,7 @@ public class CmPromotionService extends CrudService<CmPromotionDao, CmPromotion>
         List<Shop> promotionShops = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(promotionList)) {
             for (CmPromotion promotion : promotionList) {
-                if("1".equals(promotion.getMode())){
+                if ("1".equals(promotion.getMode())) {
                     promotion.setSkus(productDao.findSkuByPromotion(promotion.getId()));
                 }
                 if (StringUtils.isNotBlank(cmPromotion.getProductName())) {
@@ -192,6 +192,12 @@ public class CmPromotionService extends CrudService<CmPromotionDao, CmPromotion>
      * 查询促销可用商品
      */
     public Page findProductPage(Page<Product> productPage, Product product) {
+        if (!"1".equals(product.getPromotionType())) {
+            // 非单品锁死综合供应商,店铺满赠选择店铺shopid
+            if (!"3".equals(product.getPromotionType())) {
+                product.setShopID(1161);
+            }
+        }
         product.setPage(productPage);
         List<Integer> list = new ArrayList<>();
         //已添加的商品id不能被查询到

+ 1 - 0
src/main/java/com/caimei/modules/product/web/CmPromotionController.java

@@ -425,6 +425,7 @@ public class CmPromotionController extends BaseController {
     @RequiresPermissions("product:product:view")
     @RequestMapping(value = "findProductPage")
     public String findProductPage(Product product, Model model, HttpServletRequest request, HttpServletResponse response) {
+        //todo 非单品促销的时候当前版本限制死仅可选择综合供应商
         Page page = cmPromotionService.findProductPage(new Page<Product>(request, response), product);
         model.addAttribute("page", page);
         model.addAttribute("promotionType", product.getPromotionType());

+ 3 - 0
src/main/resources/mappings/modules/product/CmPromotionMapper.xml

@@ -187,6 +187,9 @@
             <if test="shopName != null and shopName != ''">
                 AND s.name LIKE concat('%',#{shopName},'%')
             </if>
+            <if test="shopID !=null and shopID != ''">
+                AND s.shopID = #{shopID}
+            </if>
             <if test="ids != null and ids.size > 0">
                 AND p.productID NOT IN
                 <foreach collection="ids" open="(" close=")" item="id" separator=",">

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

@@ -247,10 +247,10 @@
         <div class="controls">
             <form:radiobutton name="hdq" path="couponType" value="0" label="活动券" class="required"
                               onclick="couponShow()"/>
-            <form:radiobutton id="plq" path="couponType" value="1"
+            <form:radiobutton id="plq" path="couponType" value="1" disabled="true"
                               style="display:${cmCoupon.moneyCouponType eq 2 ? 'none':''}" label="品类券" class="required"
                               onclick="couponShow()"/>
-            <form:radiobutton id="zxq" path="couponType" value="2"
+            <form:radiobutton id="zxq" path="couponType" value="2" disabled="true"
                               style="display:${cmCoupon.moneyCouponType eq 2 ? 'none':''}" label="用户专享券"
                               class="required" onclick="couponShow()"/>
             <form:radiobutton id="dpq" path="couponType" value="3"
@@ -262,9 +262,9 @@
         <div class="control-group">
             <label class="control-label"><font color="red">*</font>优惠商品:</label>
             <div class="controls">
-                <form:radiobutton id="qsc" path="productType" value="1" label="全商城商品"
-                                  style="display: ${cmCoupon.moneyCouponType eq 2 ? 'none':''}" onclick="productShow()"
-                                  checked="${empty cmCoupon.productType ? true:false}"/>
+<%--                <form:radiobutton id="qsc" path="productType" value="1" label="全商城商品"--%>
+<%--                                  style="display: ${cmCoupon.moneyCouponType eq 2 ? 'none':''}" onclick="productShow()"--%>
+<%--                                  checked="${empty cmCoupon.productType ? true:false}"/>--%>
                 <form:radiobutton path="productType" value="2" label="指定商品" onclick="productShow()"/>
             </div>
         </div>

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

@@ -194,7 +194,7 @@
 		<div class="control-group">
 			<label class="control-label"><font color="red">*</font>优惠商品:</label>
 			<div class="controls">
-				<form:radiobutton path="productType" value="1" label="全商城商品" onclick="productShow()" checked ="${empty cmCoupon.productType ? true:false}"/>
+<%--				<form:radiobutton path="productType" value="1" label="全商城商品" onclick="productShow()" checked ="${empty cmCoupon.productType ? true:false}"/>--%>
 				<form:radiobutton path="productType" value="2" label="指定商品" onclick="productShow()"/>
 			</div>
 		</div>

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

@@ -23,10 +23,10 @@
 <body>
 	<ul class="nav nav-tabs">
 		<li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=0&&moneyCouponFlag=2">活动券</a></li>
-		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>
-		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=2&&moneyCouponFlag=2">用户专享券</a></li>
+<%--		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>--%>
+<%--		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=2&&moneyCouponFlag=2">用户专享券</a></li>--%>
 		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=3&&moneyCouponFlag=2">店铺券</a></li>
-		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>
+<%--		<li><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>--%>
 	</ul>
 	<form:form id="searchForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/" method="post" class="breadcrumb form-search">
 		<input type="hidden" name="couponType" value="0"/>

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

@@ -23,10 +23,10 @@
 <body>
 <ul class="nav nav-tabs">
     <li><a href="${ctx}/coupon/cmCoupon/list?couponType=0&&moneyCouponFlag=2">活动券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=2&&moneyCouponFlag=2">用户专享券</a></li>
+<%--    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=1&&moneyCouponFlag=2">品类券</a></li>--%>
+<%--    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=2&&moneyCouponFlag=2">用户专享券</a></li>--%>
     <li class="active"><a href="${ctx}/coupon/cmCoupon/list?couponType=3&&moneyCouponFlag=2">店铺券</a></li>
-    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>
+<%--    <li><a href="${ctx}/coupon/cmCoupon/list?couponType=4&&moneyCouponFlag=2">新用户券</a></li>--%>
 </ul>
 <form:form id="searchForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/" method="post" class="breadcrumb form-search">
     <input type="hidden" name="couponType" value="3"/>

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

@@ -185,17 +185,17 @@
         <label class="control-label"><font color="red">*</font>优惠券类型:</label>
         <div class="controls">
             <form:radiobutton path="couponType" value="0" label="活动券" class="required" onclick="couponShow()"/>
-            <form:radiobutton path="couponType" value="1" label="品类券" class="required" onclick="couponShow()"/>
-            <form:radiobutton path="couponType" value="2" label="用户专享券" class="required" onclick="couponShow()"/>
+            <form:radiobutton disabled="true" path="couponType" value="1" label="品类券" class="required" onclick="couponShow()"/>
+            <form:radiobutton disabled="true" path="couponType" value="2" label="用户专享券" class="required" onclick="couponShow()"/>
             <form:radiobutton path="couponType" value="3" label="店铺券" class="required" onclick="couponShow()"/>
-            <form:radiobutton path="couponType" value="4" label="新用户券" class="required" onclick="couponShow()"/>
+            <form:radiobutton disabled="true" path="couponType" value="4" label="新用户券" class="required" onclick="couponShow()"/>
         </div>
     </div>
     <div id="eventVoucher" hidden="hidden">
         <div class="control-group">
             <label class="control-label"><font color="red">*</font>优惠商品:</label>
             <div class="controls">
-                <form:radiobutton path="productType" value="1" label="全商城商品" onclick="productShow()" checked ="${empty cmCoupon.productType ? true:false}"/>
+<%--                <form:radiobutton path="productType" value="1" label="全商城商品" onclick="productShow()" checked ="${empty cmCoupon.productType ? true:false}"/>--%>
                 <form:radiobutton path="productType" value="2" label="指定商品" onclick="productShow()"/>
             </div>
         </div>

+ 13 - 7
src/main/webapp/WEB-INF/views/modules/product-new/shopPromotionForm.jsp

@@ -138,13 +138,19 @@
                 url = "${ctx}/product/cmPromotions/findSupplierPage?shopIds=" + showSelectProductID + "&delShopIds=" +delShopIds;
                 title = '选择促销店铺';
             } else if (type == 2){
-                $('#contentTbody1 tr').each(function (index, item) {
-                    var $this = $(this);
-                    var $itemProductID = $this.find('input[name="gift"]').val();
-                    showSelectProductID += $itemProductID + ',';
-                });
-                url = "${ctx}/product/cmPromotions/findProductPage?productIds=" + showSelectProductID;
-                title = '选择促销赠品';
+                var shopId = $("#productCheckItem").val();
+                if(shopId){
+                    $('#contentTbody1 tr').each(function (index, item) {
+                        var $this = $(this);
+                        var $itemProductID = $this.find('input[name="gift"]').val();
+                        showSelectProductID += $itemProductID + ',';
+                    });
+                    url = "${ctx}/product/cmPromotions/findProductPage?promotionType=3&productIds=" + showSelectProductID+"&shopID="+shopId;
+                    title = '选择促销赠品';
+                }else{
+                    top.$.jBox.tip("请先勾选供应商...");
+                    return false;
+                }
             }
             showSelectProductID = showSelectProductID.slice(0, -1);
             console.log(showSelectProductID);