Просмотр исходного кода

使用期限同上下架时间

zhijiezhao 2 лет назад
Родитель
Сommit
96e3dd2643

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

@@ -360,8 +360,8 @@ public class CmCouponController extends BaseController {
 //        new Thread(() -> consumer(cmCoupon, clubIds)).start();
         //等于空就是添加否则是修改
         if("".equals(cmCoupon.getId())){
-        consumer(cmCoupon, clubIds);
-        RedisLearn.producer(clubIds);
+//        consumer(cmCoupon, clubIds);
+//        RedisLearn.producer(clubIds);
         MessageCenter messageCenter = new MessageCenter();
         if (cmCoupon.getUserId() != null) {
             Integer clubc = messageCenterDao.clubIdCule(cmCoupon.getUserId());

+ 4 - 5
src/main/resources/config/dev/caimei.properties

@@ -12,9 +12,9 @@
 #mysql database setting
 jdbc.type=mysql
 jdbc.driver=com.mysql.cj.jdbc.Driver
-jdbc.url=jdbc:mysql://192.168.2.100:3306/caimei?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
+jdbc.url=jdbc:mysql://120.79.25.27:3306/caimei?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
 jdbc.username=developer
-jdbc.password=05bZ/OxTB:X+yd%1
+jdbc.password=J5p3tgOVazNl4ydf
 
 #jdbc.url=jdbc:mysql://120.79.25.27:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
 #jdbc.username=developer
@@ -40,10 +40,9 @@ jdbc.pool.maxActive=20
 jdbc.testSql=SELECT 'x' FROM DUAL
 
 #redis settings
-redis.keyPrefix=caimei-manager
-redis.host=192.168.2.100
+redis.host=47.119.112.46
 redis.port=6379
-redis.pass=123456
+redis.pass=6#xsI%b4o@5c3RoE
 redis.timeout=100000
 #\u6700\u5927\u8FDE\u63A5\u6570
 redis.pool.maxActive=300

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

@@ -178,6 +178,7 @@
 			#{endDate},
 			#{receivePeriod},
 			#{receiveFlag},
+			#{useTimeFlag},
 			#{usePeriod},
 			#{status},
 			#{couponType},
@@ -468,7 +469,7 @@
 		  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() <![CDATA[ < ]]> if(cc.usePeriod is null,cc.endDate,date_add(a.createDate,interval cc.usePeriod DAY))
 		  AND cc.status != 2
 		ORDER BY
 		  a.createDate DESC

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

@@ -9,6 +9,7 @@
         $(document).ready(function () {
             $("#inputForm").validate({
                 submitHandler: function (form) {
+                    $("#receiveFlag").removeAttr('disabled');
                     if (imageList.length > 0) {
                         var productInfo = JSON.stringify(imageList);
                         $('#productInfo').val(productInfo);
@@ -1074,6 +1075,8 @@
             $("#receivePeriod").attr('readonly', true);
             $('[name="receiveFlag"]').attr('checked', true);
             $('[name="receiveFlag"]').attr('disabled', true);
+            $("#receivePeriod").removeAttr('required');
+            $('[name="receiveFlag"]').val(1);
         } else {
             $("#usePeriod").attr('readonly', false);
             $("#usePeriod").attr('required', true);
@@ -1087,6 +1090,7 @@
             }
             if (receiveTemp > 0) {
                 $("#receivePeriod").val(receiveTemp);
+                $('[name="receiveFlag"]').val(0);
             }else{
                 $('[name="receiveFlag"]').attr('checked', true);
                 $("#receivePeriod").attr('readonly', true);
@@ -1100,8 +1104,11 @@
         if (receiveFlag === '1') {
             $("#usePeriod").attr('readonly', true);
             $("#usePeriod").attr('required', false);
+            $("#receivePeriod").attr('readonly', true);
             $('[name="receiveFlag"]').attr('disabled', 'disabled');
             $('[name="receiveFlag"]').attr('checked', true);
+            $('[name="receiveFlag"]').val(1);
+            $("#receivePeriod").removeAttr('required');
         } else {
             $('[name="receiveFlag"]').attr('disabled', false);
             $("#usePeriod").attr('readonly', false);

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

@@ -10,6 +10,7 @@
 			//$("#name").focus();
 			$("#inputForm").validate({
 				submitHandler: function(form){
+					$("#receiveFlag").removeAttr('disabled');
 					if (imageList.length > 0) {
 						var productInfo = JSON.stringify(imageList);
 						$('#productInfo').val(productInfo);
@@ -653,6 +654,8 @@
 			$("#receivePeriod").attr('readonly', true);
 			$('[name="receiveFlag"]').attr('checked', true);
 			$('[name="receiveFlag"]').attr('disabled', true);
+			$("#receivePeriod").removeAttr('required');
+			$('[name="receiveFlag"]').val(1);
 		} else {
 			$("#usePeriod").attr('readonly', false);
 			$("#usePeriod").attr('required', true);
@@ -666,6 +669,7 @@
 			}
 			if (receiveTemp > 0) {
 				$("#receivePeriod").val(receiveTemp);
+				$('[name="receiveFlag"]').val(0);
 			}else{
 				$('[name="receiveFlag"]').attr('checked', true);
 				$("#receivePeriod").attr('readonly', true);
@@ -679,8 +683,11 @@
 		if (receiveFlag === '1') {
 			$("#usePeriod").attr('readonly', true);
 			$("#usePeriod").attr('required', false);
+			$("#receivePeriod").attr('readonly', true);
 			$('[name="receiveFlag"]').attr('disabled', 'disabled');
 			$('[name="receiveFlag"]').attr('checked', true);
+			$('[name="receiveFlag"]').val(1);
+			$("#receivePeriod").removeAttr('required');
 		} else {
 			$('[name="receiveFlag"]').attr('disabled', false);
 			$("#usePeriod").attr('readonly', false);

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

@@ -95,11 +95,11 @@
 				</td>
 				<td>
 						<c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
-                        <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+                        <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">同上下架时间</c:if>
 				</td>
 				<td>
 					    <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
-                        <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+                        <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">同上下架时间</c:if>
 				</td>
 				<td>
 					<c:if test="${cmCoupon.status eq 0}">

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

@@ -97,11 +97,11 @@
 				</td>
 				<td>
 						<c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
-                        <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+                        <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">同上下架时间</c:if>
 				</td>
 				<td>
 					    <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
-                        <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+                        <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">同上下架时间</c:if>
 				</td>
 				<td>
 					<c:if test="${cmCoupon.status eq 0}">

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

@@ -22,6 +22,7 @@
                         alertx("结束时间不能早于开始时间");
                         return false;
                     }
+                    $("#receiveFlag").removeAttr('disabled');
                     loading('正在提交,请稍等...');
                     form.submit();
                 },
@@ -256,6 +257,8 @@
             $("#receivePeriod").attr('readonly', true);
             $('[name="receiveFlag"]').attr('checked', true);
             $('[name="receiveFlag"]').attr('disabled', true);
+            $("#receivePeriod").removeAttr('required');
+            $('[name="receiveFlag"]').val(1);
         } else {
             $("#usePeriod").attr('readonly', false);
             $("#usePeriod").attr('required', true);
@@ -269,6 +272,7 @@
             }
             if (receiveTemp > 0) {
                 $("#receivePeriod").val(receiveTemp);
+                $('[name="receiveFlag"]').val(0);
             }else{
                 $('[name="receiveFlag"]').attr('checked', true);
                 $("#receivePeriod").attr('readonly', true);
@@ -276,14 +280,16 @@
             $("#usePeriod").val(temp);
         }
     }
-
     function initUseTimeFlag() {
         var receiveFlag = $("#useTimeFlag").val();
         if (receiveFlag === '1') {
             $("#usePeriod").attr('readonly', true);
             $("#usePeriod").attr('required', false);
+            $("#receivePeriod").attr('readonly', true);
             $('[name="receiveFlag"]').attr('disabled', 'disabled');
             $('[name="receiveFlag"]').attr('checked', true);
+            $('[name="receiveFlag"]').val(1);
+            $("#receivePeriod").removeAttr('required');
         } else {
             $('[name="receiveFlag"]').attr('disabled', false);
             $("#usePeriod").attr('readonly', false);

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

@@ -98,11 +98,11 @@
             </td>
             <td>
                 <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
-                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">同上下架时间</c:if>
             </td>
             <td>
                 <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
-                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">同上下架时间</c:if>
             </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">

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

@@ -22,6 +22,7 @@
                         alertx("结束时间不能早于开始时间");
                         return false;
                     }
+                    $("#receiveFlag").removeAttr('disabled');
                     loading('正在提交,请稍等...');
                     form.submit();
                 },
@@ -243,6 +244,8 @@
             $("#receivePeriod").attr('readonly', true);
             $('[name="receiveFlag"]').attr('checked', true);
             $('[name="receiveFlag"]').attr('disabled', true);
+            $("#receivePeriod").removeAttr('required');
+            $('[name="receiveFlag"]').val(1);
         } else {
             $("#usePeriod").attr('readonly', false);
             $("#usePeriod").attr('required', true);
@@ -256,6 +259,7 @@
             }
             if (receiveTemp > 0) {
                 $("#receivePeriod").val(receiveTemp);
+                $('[name="receiveFlag"]').val(0);
             }else{
                 $('[name="receiveFlag"]').attr('checked', true);
                 $("#receivePeriod").attr('readonly', true);
@@ -269,8 +273,11 @@
         if (receiveFlag === '1') {
             $("#usePeriod").attr('readonly', true);
             $("#usePeriod").attr('required', false);
+            $("#receivePeriod").attr('readonly', true);
             $('[name="receiveFlag"]').attr('disabled', 'disabled');
             $('[name="receiveFlag"]').attr('checked', true);
+            $('[name="receiveFlag"]').val(1);
+            $("#receivePeriod").removeAttr('required');
         } else {
             $('[name="receiveFlag"]').attr('disabled', false);
             $("#usePeriod").attr('readonly', false);

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

@@ -89,11 +89,11 @@
             </td>
             <td>
                 <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
-                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">同上下架时间</c:if>
             </td>
             <td>
                 <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
-                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">同上下架时间</c:if>
             </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">

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

@@ -25,6 +25,7 @@
                         alertx("结束时间不能早于开始时间");
                         return false;
                     }
+                    $("#receiveFlag").removeAttr('disabled');
                     loading('正在提交,请稍等...');
                     form.submit();
                 },
@@ -351,6 +352,8 @@
             $("#receivePeriod").attr('readonly', true);
             $('[name="receiveFlag"]').attr('checked', true);
             $('[name="receiveFlag"]').attr('disabled', true);
+            $("#receivePeriod").removeAttr('required');
+            $('[name="receiveFlag"]').val(1);
         } else {
             $("#usePeriod").attr('readonly', false);
             $("#usePeriod").attr('required', true);
@@ -364,6 +367,7 @@
             }
             if (receiveTemp > 0) {
                 $("#receivePeriod").val(receiveTemp);
+                $('[name="receiveFlag"]').val(0);
             }else{
                 $('[name="receiveFlag"]').attr('checked', true);
                 $("#receivePeriod").attr('readonly', true);
@@ -377,8 +381,11 @@
         if (receiveFlag === '1') {
             $("#usePeriod").attr('readonly', true);
             $("#usePeriod").attr('required', false);
+            $("#receivePeriod").attr('readonly', true);
             $('[name="receiveFlag"]').attr('disabled', 'disabled');
             $('[name="receiveFlag"]').attr('checked', true);
+            $('[name="receiveFlag"]').val(1);
+            $("#receivePeriod").removeAttr('required');
         } else {
             $('[name="receiveFlag"]').attr('disabled', false);
             $("#usePeriod").attr('readonly', false);

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

@@ -101,11 +101,11 @@
             </td>
             <td>
                 <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
-                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">同上下架时间</c:if>
             </td>
             <td>
                 <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
-                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">同上下架时间</c:if>
             </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">

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

@@ -27,6 +27,7 @@
                         alertx("请选择机构");
                         return false;
                     }
+                    $("#receiveFlag").removeAttr('disabled');
                     loading('正在提交,请稍等...');
                     form.submit();
                 },
@@ -356,6 +357,8 @@
             $("#receivePeriod").attr('readonly', true);
             $('[name="receiveFlag"]').attr('checked', true);
             $('[name="receiveFlag"]').attr('disabled', true);
+            $("#receivePeriod").removeAttr('required');
+            $('[name="receiveFlag"]').val(1);
         } else {
             $("#usePeriod").attr('readonly', false);
             $("#usePeriod").attr('required', true);
@@ -369,6 +372,7 @@
             }
             if (receiveTemp > 0) {
                 $("#receivePeriod").val(receiveTemp);
+                $('[name="receiveFlag"]').val(0);
             }else{
                 $('[name="receiveFlag"]').attr('checked', true);
                 $("#receivePeriod").attr('readonly', true);
@@ -382,8 +386,11 @@
         if (receiveFlag === '1') {
             $("#usePeriod").attr('readonly', true);
             $("#usePeriod").attr('required', false);
+            $("#receivePeriod").attr('readonly', true);
             $('[name="receiveFlag"]').attr('disabled', 'disabled');
             $('[name="receiveFlag"]').attr('checked', true);
+            $('[name="receiveFlag"]').val(1);
+            $("#receivePeriod").removeAttr('required');
         } else {
             $('[name="receiveFlag"]').attr('disabled', false);
             $("#usePeriod").attr('readonly', false);

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

@@ -159,11 +159,11 @@
             </td>
             <td>
                 <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
-                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">同上下架时间</c:if>
             </td>
             <td>
                 <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
-                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">同上下架时间</c:if>
             </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">

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

@@ -829,9 +829,9 @@
         var use = $("#usePeriod").val();
         if (val === '1') {
             $("#usePeriod").attr('readonly', true);
-            $("#usePeriod").attr('required', false);
             $("#usePeriod").val('');
             $("#usePeriodTemp").val(use);
+            $("#usePeriod").removeAttr('required');
         } else {
             $("#usePeriod").attr('readonly', false);
             $("#usePeriod").attr('required', true);

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

@@ -93,7 +93,7 @@
             </td>
             <td>
                 <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
-                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">同上下架时间</c:if>
             </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">